From patchwork Tue Sep 21 07:54:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5LqR6b6Z?= X-Patchwork-Id: 12507365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79205C433F5 for ; Tue, 21 Sep 2021 07:55:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0FFB60F70 for ; Tue, 21 Sep 2021 07:55:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F0FFB60F70 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1D1F6E901; Tue, 21 Sep 2021 07:55:02 +0000 (UTC) X-Greylist: delayed 74879 seconds by postgrey-1.36 at gabe; Tue, 21 Sep 2021 07:55:00 UTC Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id E18AF6E901 for ; Tue, 21 Sep 2021 07:55:00 +0000 (UTC) X-QQ-mid: bizesmtp33t1632210879tgmad6s8 Received: from localhost.localdomain (unknown [124.126.19.250]) by esmtp6.qq.com (ESMTP) with id ; Tue, 21 Sep 2021 15:54:37 +0800 (CST) X-QQ-SSF: 0140000000200060D000B00A0000000 X-QQ-FEAT: CXxUt5OpftzVMh31mxXhmiR+KGWj1x2i2uSpmwLFoT5oA+7H2r1Wdu5L4qGO5 zFEY2Gn4/KBss8YXYBpzMghhT/BFH/Q+Km/Qi0Rxy1nYVjt9AMtDKtQhQkMHxnZejI29m82 GJB0VdQwIT30zBZDGYD3N0OVd3sejLutR3nD+ldl2OG9eAtNMonSO0vMV/RAWo3eAKL8hEF NgJGhpMN30AU/2Z1wu4IauUuruLRINn/0InBo8FLjgYzsG0wJ0rvUJEM+Ew18pERVY961UO kJiUnl1rmvJvov6Zb6mO8mh8a3zbhTTf58VijGLg1PJIBJKAFtLdbY9yl3hTayP1bJmzYY/ WBO9sWvzHRJMdW/a20= X-QQ-GoodBg: 2 From: Yunlongli To: ple@baylibre.com, narmstrong@baylibre.com, a.hajda@samsung.com, robert.foss@linaro.org, airlied@linux.ie, daniel@ffwll.ch Cc: Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, liyunlonga@uniontech.com Subject: [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment Date: Tue, 21 Sep 2021 15:54:01 +0800 Message-Id: <20210921075401.24926-1-liyunlonga@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In the actual tests, the IT66121 chip sometimes misjudged whether it had an external screen, so, reference the it66121_user_guid.pdf about Audio/Video data is stable or not A typical initialization of HDMI link should be based on interrupt signal and appropriate register probing. Recommended flow is detailed in IT66121 Programming Guide. Simply put, the microcontroller should monitor the HPD status first. Upon valid HPD event, move on to check RxSENDetect register to see if the receiver chip is ready for further handshaking. When RxSENDetect is asserted, start reading EDID data through DDC channels and carry on the rest of the handshaking subsequently.If the micro-controller makes no use of the interrupt signal as well as the above-mentioned status registers, the link establishment might fail. Please do follow the suggested initialization flow recommended in IT66121 Programming Guide. So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection. Signed-off-by: Yunlongli --- drivers/gpu/drm/bridge/ite-it66121.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c index 2f2a09adb4bc..9ed4fa298d11 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx) if (regmap_read(ctx->regmap, IT66121_SYS_STATUS_REG, &val)) return false; - return val & IT66121_SYS_STATUS_HPDETECT; + return ((val & IT66121_SYS_STATUS_HPDETECT) && (val & IT66121_SYS_STATUS_SENDECTECT)); } static int it66121_bridge_attach(struct drm_bridge *bridge,