Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp605316rwn; Thu, 15 Sep 2022 03:56:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41ddAdfwg/AmN2BXs/K0HpzvRQuKSyiiLP2ObQX9C49REFL9a07//e0ryT+mgZ7M65QLbB X-Received: by 2002:a17:90b:1b10:b0:200:934b:741f with SMTP id nu16-20020a17090b1b1000b00200934b741fmr10210690pjb.212.1663239384294; Thu, 15 Sep 2022 03:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663239384; cv=none; d=google.com; s=arc-20160816; b=sR1StGOFBMaV7QO8GRqrKiX9/lJcFJWR00wIUh5W8CEojjLUbjX2OXpLJEVraX1ZKo N54wIGtLUuByuAC2UInH7D/Y3cCcvw3P4VUd96HOVGjMFBTtp4oRYVQ0Qm9ydJJ7XVka N+guv0BLpd7XcYZmMyRNIGNfCHktLvrGB3skAoQXulg2FL3mdJp4O4EijB0Qjmj3Yilc YjuLhlEel/QA1+oE77P5n9wAiZdeX67dThmSXSqp3AssoD8qnwfO6JUUV3vgBJIPxeye nIM3ZUTWtuj5uPI/FJ2VlqGreNh4c9lypP2E+rb37juCRgrRFHAvOKOajkL4otKs8Adj vMYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=y4XRiTWvqgw8E7sxid7nxz5JdJQpRcJN2TxmeR9LcxI=; b=mASE7DV2o2AkBCS/Ww3ShKmfGxhz+8j/43nMpy4CSWovbZLGz8x7niAU+23EHtm7f5 CYzKG8Hi42r9JV4kbQy+8rqz2YfynEhEUobahYu6zZKKkvyjFW8PGLjc5IJVo+ZlkMx7 cWFulCXICFuAdsPDU2D+weY6d87KATDHLHSKcb4GTLD96KKGtI80UDYMDgTeVtEK0PhF pR1Qgu560pJxgeFJ2uhNtfiQojiYOlqchC/VSPJ2mg0Tp/HyWNYTtJTK87e6sPROULSO 2luW4Q4jf8eBp4Y9sfRzJwwycZEYfHC6TuWMGFMOcG0suHfy1IsXWTkKjP0Nr22gW+WN anWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UskMr1TV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a31-20020a631a1f000000b0042b52f42418si17860461pga.227.2022.09.15.03.56.12; Thu, 15 Sep 2022 03:56:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UskMr1TV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbiIOK3g (ORCPT + 99 others); Thu, 15 Sep 2022 06:29:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiIOK3c (ORCPT ); Thu, 15 Sep 2022 06:29:32 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BABC43 for ; Thu, 15 Sep 2022 03:29:30 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id v185-20020a1cacc2000000b003b42e4f278cso14398033wme.5 for ; Thu, 15 Sep 2022 03:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=y4XRiTWvqgw8E7sxid7nxz5JdJQpRcJN2TxmeR9LcxI=; b=UskMr1TVUJPvARbAHGUNzn4UiwFMUZlB0Pg8EpP5zSDSP1fl6GzS2MqlHLQYjG71Kk mJ7i9ugJFQlFbTlIT1tX0Rt6B+7F40RcaExLSC/fxFBjFwn5XjtonqDUNtxECzOC0g5H RWAZzm+5cAbLo5v63fZaTyVBwskAbGpAkmbiVQWL6kfJviigzbCmsHG8RLsLUZG3kOsf 76TwZdJcnKsnEeVHvYnhPkVRV8AQLOpLP0C3cIIm8ATYtVaXEEdw5NmleWJD2HVcU7JY exEcoPpIJvFE3ilh07DDzOBJIpL4bnpiUoZr+b6SwT0RL3IIGIOruY7XSCK3NMzguzB+ qVNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=y4XRiTWvqgw8E7sxid7nxz5JdJQpRcJN2TxmeR9LcxI=; b=CrkCBNumbl38xh2EUBM7RZFROA/ZZGBSI5k8IJ0Mx6duI5gOlVykj3YVmgInYsvOW1 h6nZWjoSITDttrjwDM1Fh+Ao+RM1+GrF2BtvPiFScl3PuGmvTqVgfiW2O1i9h1qZ3MLA e48DYz7B2V1FCitLYdmKAlnTzGatzGteBw194mvQPpbi1LBQv/WYqGwoWPAQVRLPMoGD zkaLiN4FIETl2Ce6hryLci9d17Kauq7OM0YQelkLesf8W5wRdRLQ76xWv5tgapktNROC GVsWMQO/p8aWMMlCTZLwm4teKsvGj5EKt9w5IkdzSIJFX2MrUK83dHA/NnxbUcOeBuee 6OIQ== X-Gm-Message-State: ACgBeo3jUNY93TB6CiB78DRAdnoqdFOHHqaASJB7Vst526kOwFfYRzDX Z8v3DO3rR8DVELs/dcWgZCPsNQ== X-Received: by 2002:a05:600c:268f:b0:3b4:acef:34ab with SMTP id 15-20020a05600c268f00b003b4acef34abmr1427464wmt.176.1663237769154; Thu, 15 Sep 2022 03:29:29 -0700 (PDT) Received: from prec5560.. (freifunk-gw.bsa1-cpe1.syseleven.net. [176.74.57.43]) by smtp.gmail.com with ESMTPSA id q17-20020adff951000000b00228dff8d975sm2098257wrr.109.2022.09.15.03.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 03:29:28 -0700 (PDT) From: Robert Foss To: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, dianders@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chris Morgan , devicetree@vger.kernel.org Subject: [PATCH v1 1/2] Revert "Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP"" Date: Thu, 15 Sep 2022 12:29:23 +0200 Message-Id: <20220915102924.370090-2-robert.foss@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220915102924.370090-1-robert.foss@linaro.org> References: <20220915102924.370090-1-robert.foss@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit was accidentally reverted instead of another commit, and therefore needs to be reinstated. This reverts commit 8c9c40ec83445b188fb6b59e119bf5c2de81b02d. Signed-off-by: Robert Foss --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 6e053e2af229..3c3561942eb6 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,7 @@ #define BPP_18_RGB BIT(0) #define SN_HPD_DISABLE_REG 0x5C #define HPD_DISABLE BIT(0) +#define HPD_DEBOUNCED_STATE BIT(4) #define SN_GPIO_IO_REG 0x5E #define SN_GPIO_INPUT_SHIFT 4 #define SN_GPIO_OUTPUT_SHIFT 0 @@ -1158,10 +1160,33 @@ static void ti_sn_bridge_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(pdata->dev); } +static enum drm_connector_status ti_sn_bridge_detect(struct drm_bridge *bridge) +{ + struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); + int val = 0; + + pm_runtime_get_sync(pdata->dev); + regmap_read(pdata->regmap, SN_HPD_DISABLE_REG, &val); + pm_runtime_put_autosuspend(pdata->dev); + + return val & HPD_DEBOUNCED_STATE ? connector_status_connected + : connector_status_disconnected; +} + +static struct edid *ti_sn_bridge_get_edid(struct drm_bridge *bridge, + struct drm_connector *connector) +{ + struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); + + return drm_get_edid(connector, &pdata->aux.ddc); +} + static const struct drm_bridge_funcs ti_sn_bridge_funcs = { .attach = ti_sn_bridge_attach, .detach = ti_sn_bridge_detach, .mode_valid = ti_sn_bridge_mode_valid, + .get_edid = ti_sn_bridge_get_edid, + .detect = ti_sn_bridge_detect, .atomic_pre_enable = ti_sn_bridge_atomic_pre_enable, .atomic_enable = ti_sn_bridge_atomic_enable, .atomic_disable = ti_sn_bridge_atomic_disable, @@ -1257,6 +1282,9 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev, pdata->bridge.type = pdata->next_bridge->type == DRM_MODE_CONNECTOR_DisplayPort ? DRM_MODE_CONNECTOR_DisplayPort : DRM_MODE_CONNECTOR_eDP; + if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort) + pdata->bridge.ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT; + drm_bridge_add(&pdata->bridge); ret = ti_sn_attach_host(pdata); -- 2.34.1