From patchwork Sun Jan 8 07:25:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 640395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84392C54EBE for ; Sun, 8 Jan 2023 07:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232110AbjAHH0D (ORCPT ); Sun, 8 Jan 2023 02:26:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbjAHH0B (ORCPT ); Sun, 8 Jan 2023 02:26:01 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F057C1D0F8 for ; Sat, 7 Jan 2023 23:25:58 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id bq39so8370773lfb.0 for ; Sat, 07 Jan 2023 23:25:58 -0800 (PST) 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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bMcMgMN2h9pQ0++woqWQkTwB0DopoRxUXMW3C3/QKYc=; b=Ux2ciHFIvGWO6NT3TSZYAB6S//IPXOwYcprwgpxHswK6KaMc8BZXeunVEogXWh2UVX cJ7vCxBy+A263PXJ70ZbtZjgAmyvLdwt7weFf/UVBBNjX4smHNzB/59XIYJVLQ3XIoP7 7GSNKGdW6PADsCLBuyKlFAp43Bq3ExEYz5msECLnIZ32SAOdnbntxtFuqGIHHs0Np1qq REWz9nqb/8tFhPn5GtWhYlo0C4IozI23vnHITkNfoQJgwE9uLbQQHHrspZ3mVMcsvtQ3 cncr9HpO6q2LVNT9YUsBWYX85zkBURmWzpQ3uZnbZ/c63qqjwwWkEEw1sFsbODfNY0wI TpJg== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bMcMgMN2h9pQ0++woqWQkTwB0DopoRxUXMW3C3/QKYc=; b=WrpMjLSWENh2LYtAQUscqFLX31cflRWTUcw/WX18ZQOocShqfm9+md0rJ38dDgG5Mg CPfT3dDlA7VgJvqESQDXNriZnMS5glToQD43unT1Le+IFTokXfeGmRrXboOv9ZicQiEu zYd0xe6rzqVhZIvoZU8JpsDpS+jJswNuvyYRk3YQT+XfHRKIRFvY7AXNwy/VYLuq4WMM PLNrl+ueIkDRlWdgrsItkBNAdkCEZePVcBn6T8oSRzIgKY8jf/6lG9Lk43kCMr6J9THl s3OOOJyXk33A5FSrI4G43/IOQdfMteJmQ4iCuSuRgUoUn8LyJGtTw95+1d192gUXC3mo 6/UA== X-Gm-Message-State: AFqh2kqIYCQF/8FvY8U7pDtaaLuZhGOcRO77Kq/DlerU6JGcRug2n7UX xTvJOcqLyRXlTu1q0egh9h0Nuw== X-Google-Smtp-Source: AMrXdXuAxN4yqXdIZptsyDsJjG5Jcnv7P/pNVbSR10r89IK21J1NzuWq9lidrKNOTS4PfUYs3gfuUA== X-Received: by 2002:ac2:5975:0:b0:4b5:8f03:a2bc with SMTP id h21-20020ac25975000000b004b58f03a2bcmr15713088lfp.9.1673162757318; Sat, 07 Jan 2023 23:25:57 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x2-20020a056512130200b004a8f824466bsm927414lfu.188.2023.01.07.23.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 23:25:56 -0800 (PST) From: Dmitry Baryshkov To: Vinod Koul , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 01/12] drm/bridge: lt9611: fix sleep mode setup Date: Sun, 8 Jan 2023 09:25:44 +0200 Message-Id: <20230108072555.2905260-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> References: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On atomic_post_disable the bridge goes to the low power state. However the code disables too much of the chip, so the HPD event is not being detected and delivered to the host. Reduce the power saving in order to get the HPD event. Fixes: 23278bf54afe ("drm/bridge: Introduce LT9611 DSI to HDMI bridge") Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/lontium-lt9611.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 7c0a99173b39..2714184cc53f 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -448,12 +448,11 @@ static void lt9611_sleep_setup(struct lt9611 *lt9611) { 0x8023, 0x01 }, { 0x8157, 0x03 }, /* set addr pin as output */ { 0x8149, 0x0b }, - { 0x8151, 0x30 }, /* disable IRQ */ + { 0x8102, 0x48 }, /* MIPI Rx power down */ { 0x8123, 0x80 }, { 0x8130, 0x00 }, - { 0x8100, 0x01 }, /* bandgap power down */ - { 0x8101, 0x00 }, /* system clk power down */ + { 0x8011, 0x0a }, }; regmap_multi_reg_write(lt9611->regmap, From patchwork Sun Jan 8 07:25:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 640394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC8D9C54EBC for ; Sun, 8 Jan 2023 07:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232419AbjAHH0E (ORCPT ); Sun, 8 Jan 2023 02:26:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232147AbjAHH0B (ORCPT ); Sun, 8 Jan 2023 02:26:01 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 667601D0FB for ; Sat, 7 Jan 2023 23:26:00 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id bq39so8370812lfb.0 for ; Sat, 07 Jan 2023 23:26:00 -0800 (PST) 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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mZbpMMJayX1Y27MwQ3eHOLuGX6M4NgpDUpVAQPdHpwg=; b=R2WINXEkAmqc1F+yT6f+c4Nfkv1d8jkC9Ma/KTvMQZauhWNfaMLsOKVE+pHlUeoc4f 5C+d7kFjYlblzzjqqihOM3obvTaB7aTTSUSVTgbN7/lZsw8keQTvsF1OolTzdjNY6f/Y DZyf3cJ5b1U2UICzTE54FuTgWjbdzEpUfoGfsqz9/5ufnij3BmdycQ1l0vvxgIfTIk0V Yhr227dRtX+ilBRE9kKsHoauaJgLbocm4UfvosgyC/f8I6xqQQcLzOcyCYAxSIzV2Lmw G0k89rxP63Rl2EjCJ5Dg2HCVLL8zM9xeA8YnjAj/h9pPZDzk6ZQERTuikQcA66ZqSJLb LIjw== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mZbpMMJayX1Y27MwQ3eHOLuGX6M4NgpDUpVAQPdHpwg=; b=gI/jZSiXrIsW2AkugABEdvw33eTEB64p1/HgVNCUhiIC/bW3+58yU49CBfkqrfBNg0 I18vp4xkZ+M/ra0dXDd36CCwlhKYtdt4BlwlhfHfwAJmTNHOmiZFMRHB8isBOoHimrHP G9w34QBv50rrEYTqdY5nEgr8bSGy+K2jeFcfk7RATATSXJvwKkGp7jprC40IrO/lnulf v31QKfbF3HnQRffVnd3HprQIxulVgMrWSR6c3r5dKhUaBBINWeNmjwiO+Qzg7KAfY3tX eILiCJ8tEvDOUtjP9URoKVCpnb3exL/2CXyRTfXdwZ+YUKbeOL+SnwXY1XNh+EdEyuDd xfsw== X-Gm-Message-State: AFqh2kqa4Eg07aqMTbd77d1l4mSIW6MCua1AcMy0QbXj71kvdPc20Fg5 sOeWnp0sHLNVpW9ojMN4kYF8Ug== X-Google-Smtp-Source: AMrXdXtgGtsm2oDkn0j02HpZsV2wpEeIudu6QlL4kgQ2P9mZz0VJz1PqJhAaJhl+6guXztCXuxnYUQ== X-Received: by 2002:a05:6512:104e:b0:4cb:43db:30fe with SMTP id c14-20020a056512104e00b004cb43db30femr5838626lfb.11.1673162758734; Sat, 07 Jan 2023 23:25:58 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x2-20020a056512130200b004a8f824466bsm927414lfu.188.2023.01.07.23.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 23:25:58 -0800 (PST) From: Dmitry Baryshkov To: Vinod Koul , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 03/12] drm/bridge: lt9611: fix polarity programming Date: Sun, 8 Jan 2023 09:25:46 +0200 Message-Id: <20230108072555.2905260-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> References: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Fix programming of hsync and vsync polarities Fixes: 23278bf54afe ("drm/bridge: Introduce LT9611 DSI to HDMI bridge") Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/lontium-lt9611.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 58f39b279217..deb503ca956a 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -207,7 +207,6 @@ static void lt9611_pcr_setup(struct lt9611 *lt9611, const struct drm_display_mod /* stage 2 */ { 0x834a, 0x40 }, - { 0x831d, 0x10 }, /* MK limit */ { 0x832d, 0x38 }, @@ -222,11 +221,19 @@ static void lt9611_pcr_setup(struct lt9611 *lt9611, const struct drm_display_mod { 0x8325, 0x00 }, { 0x832a, 0x01 }, { 0x834a, 0x10 }, - { 0x831d, 0x10 }, - { 0x8326, 0x37 }, }; + u8 pol = 0x10; - regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); + if (mode->flags & DRM_MODE_FLAG_NHSYNC) + pol |= 0x2; + if (mode->flags & DRM_MODE_FLAG_NVSYNC) + pol |= 0x1; + regmap_write(lt9611->regmap, 0x831d, pol); + + if (mode->hdisplay == 3840) + regmap_multi_reg_write(lt9611->regmap, reg_cfg2, ARRAY_SIZE(reg_cfg2)); + else + regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); switch (mode->hdisplay) { case 640: @@ -236,7 +243,7 @@ static void lt9611_pcr_setup(struct lt9611 *lt9611, const struct drm_display_mod regmap_write(lt9611->regmap, 0x8326, 0x37); break; case 3840: - regmap_multi_reg_write(lt9611->regmap, reg_cfg2, ARRAY_SIZE(reg_cfg2)); + regmap_write(lt9611->regmap, 0x8326, 0x37); break; } From patchwork Sun Jan 8 07:25:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 640393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51976C61DB3 for ; Sun, 8 Jan 2023 07:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232555AbjAHH0G (ORCPT ); Sun, 8 Jan 2023 02:26:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232417AbjAHH0D (ORCPT ); Sun, 8 Jan 2023 02:26:03 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 690CD1D0F8 for ; Sat, 7 Jan 2023 23:26:02 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id bt23so8287576lfb.5 for ; Sat, 07 Jan 2023 23:26:02 -0800 (PST) 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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C5ihh3g6iNgJiC7zRiEmt/AFsjwhqCmHhXCZopRf9qg=; b=ZQe4KJDz4ptondq++o4ifOMaqWPCx8dqCv/EBBlz1pUl/CXtvA4TVX8b58inFkMQiV xEZ9J7W59nw4Bu2UyLe2zLEi2I4z9P8ZPbDPxZRkK2GYhlvAHEyMN3Pu5KQzvVU3BPij uEj0Ly0EsuBhuZTNgn3t4mpN0wjiOF7FFXcSPIWYCZg/7ulPBpURZQ3E9yeI3VCl00mN c9gXxbbphvs1VvE5wKr9/I5/4EAsXNN/jOCphCbCz7LMk2Lsje2QV3J90eYRoalzIiYZ m/O2Ep73ZXqCpT8hpsHniyWPnxydCYam29Oaptph5/qHOAyovtY6VZv4ErIFIuy73qWI Kibw== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C5ihh3g6iNgJiC7zRiEmt/AFsjwhqCmHhXCZopRf9qg=; b=lLjyX4m5rP/mm0Q0mMipNxq6HKFikJQVoH43+GvHS4iWOpOfxglwdZYR7P/8GyUoUS H4Z5P5tKZWmO0+jkcKBnv3irKMe2TAhy1Bm7BP53cJYyvzAnNBUkLRSasymBiksUvMUE avYA10ACaROnoBd3r6FGoFF31W7Ld7qDMqCwacf3QagAJxXfh7PHn0BfgIJRuAj3zi18 LTbpeO8yvHEncQ2GSMPRytfr94PIqhIg2AOas3t1/6/xEUcvolSasNKXp/RybdUga4y7 9A0ohsFLIHpX2eTetzwSnFcBJCyx12APznKrO9RTcrGCKrdiuOCI/29XpR5695ewVUnJ YPng== X-Gm-Message-State: AFqh2koFOFloLnIljaM1OX5DhdyBpBQo+K4derIdHNtZC/Win1CJHLIU LkPH7LU3Wz8NYZpfCGAw/3y0cw== X-Google-Smtp-Source: AMrXdXvFBev112O5sYS91DrRbcayDdq+LFoKfun7pxSfD9QGpC6eQaXo2u/E+mSxzuZpeSXR1YNORg== X-Received: by 2002:ac2:446b:0:b0:4a4:68b9:66cf with SMTP id y11-20020ac2446b000000b004a468b966cfmr15491687lfl.26.1673162760795; Sat, 07 Jan 2023 23:26:00 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x2-20020a056512130200b004a8f824466bsm927414lfu.188.2023.01.07.23.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 23:26:00 -0800 (PST) From: Dmitry Baryshkov To: Vinod Koul , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 06/12] drm/bridge: lt9611: pass a pointer to the of node Date: Sun, 8 Jan 2023 09:25:49 +0200 Message-Id: <20230108072555.2905260-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> References: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Pass a pointer to the OF node while registering lt9611 MIPI device. Fixes: 23278bf54afe ("drm/bridge: Introduce LT9611 DSI to HDMI bridge") Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/lontium-lt9611.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index e2799a0df8f8..3b77238ca4af 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -769,7 +769,7 @@ static const struct drm_connector_funcs lt9611_bridge_connector_funcs = { static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611, struct device_node *dsi_node) { - const struct mipi_dsi_device_info info = { "lt9611", 0, NULL }; + const struct mipi_dsi_device_info info = { "lt9611", 0, lt9611->dev->of_node}; struct mipi_dsi_device *dsi; struct mipi_dsi_host *host; struct device *dev = lt9611->dev; From patchwork Sun Jan 8 07:25:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 640392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56383C53210 for ; Sun, 8 Jan 2023 07:26:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232242AbjAHH0I (ORCPT ); Sun, 8 Jan 2023 02:26:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232463AbjAHH0F (ORCPT ); Sun, 8 Jan 2023 02:26:05 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B80431D0FA for ; Sat, 7 Jan 2023 23:26:03 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id bf43so8321999lfb.6 for ; Sat, 07 Jan 2023 23:26:03 -0800 (PST) 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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U/cju9fotz0lov5duz5S4oQdny3N24g+NVMg5SEoeSQ=; b=rLU1K5uipb0gy24t+IepL6qVyNnwvhMzLn0RyNiqYk/gW24yFOaLJFYWI8HRMtzB00 MkECToLk/8l+PP7XU7IVOJLFytHIENcsEweM6srbVhtYmRuQArOJ9v+hNEfqG79HEhPa 8xjf6FBkW+eH8G/c6GQyitugECkrd8gqjCLQF8HrXBndZXDP5k+3+IsNvfjy4Uzr7v+6 0xpxtqb9/tABUpH/RbiapfrX0sVCrV5ccY3JzIYfOFJvEZ1PUb3Rz+nq97P1oqLA9QBi +PwJJHC5AdGyR7nnsD9BpmFwW3M+6xZhWiKtI0Ai2cbhA6YDFMl1GcWXqxNbykYs6nEY MKng== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U/cju9fotz0lov5duz5S4oQdny3N24g+NVMg5SEoeSQ=; b=ZmJm4zjoQjpafW0Xmc1ziG/q5VVrPz9ZrU1OT3plpu9RpHb2UCfieyaK3OlB6vOD2I PqnAwAmUb7ssOtKFeueLKkUiC17zHlXZSMLW6QjtbpSzCRjlUxoOMiyUXoplgKnfP0H/ mj78uuOnTkYaClGulK33NMLvKHQebqhAqswE2AN/7a8Pq9FtiATWm7R0FmQtUrU21zMg fPdrsZCItIrnOozpaiMdONuqGkEaiHkAmCVBjgiIuaJHz9fqAfIoomyZF/zuULx8M+jT kZbMw11YDK+uPh3/oM5p+bvoT/huJE3oWbJkL3jFvFexwPpLRhj4tlYezbgtmFIIC6xz 9bfA== X-Gm-Message-State: AFqh2krwubTBAA3DsQ39WaKnjEITfNuPF77YzLAVNvA5pkv3ZehWl0QU 8LN7EN0MXOuFxVkZ2GE999hIQA== X-Google-Smtp-Source: AMrXdXskec8bUaQHl367R6JZpMP1qlkjjBNCz6mTmI7rHJpfquyB5B3zGsboE1R6eRZDWvm4INLH6g== X-Received: by 2002:a19:7008:0:b0:4b5:7d49:4a05 with SMTP id h8-20020a197008000000b004b57d494a05mr15425094lfc.0.1673162762122; Sat, 07 Jan 2023 23:26:02 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x2-20020a056512130200b004a8f824466bsm927414lfu.188.2023.01.07.23.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 23:26:01 -0800 (PST) From: Dmitry Baryshkov To: Vinod Koul , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 08/12] drm/bridge: lt9611: attach to the next bridge Date: Sun, 8 Jan 2023 09:25:51 +0200 Message-Id: <20230108072555.2905260-9-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> References: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The bindings require that there is a next bridge after the lt9611. If nothing else it can be the hdmi-connector (as used on the RB3 platform, see sdm845-db845c.dts). Bring in the next bridge into the drm bridges chain and attach to it. Since lt9611 is not anymore the last bridge in the chain, this also allows us to drop all the !DRM_BRIDGE_ATTACH_NO_CONNECTOR functionality. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/lontium-lt9611.c | 99 ++----------------------- 1 file changed, 7 insertions(+), 92 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 1b65a573be27..773d7a56f86f 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -33,7 +34,7 @@ struct lt9611 { struct device *dev; struct drm_bridge bridge; - struct drm_connector connector; + struct drm_bridge *next_bridge; struct regmap *regmap; @@ -107,11 +108,6 @@ static struct lt9611 *bridge_to_lt9611(struct drm_bridge *bridge) return container_of(bridge, struct lt9611, bridge); } -static struct lt9611 *connector_to_lt9611(struct drm_connector *connector) -{ - return container_of(connector, struct lt9611, connector); -} - static int lt9611_mipi_input_analog(struct lt9611 *lt9611) { const struct reg_sequence reg_cfg[] = { @@ -581,9 +577,9 @@ static struct lt9611_mode *lt9611_find_mode(const struct drm_display_mode *mode) return NULL; } -/* connector funcs */ -static enum drm_connector_status __lt9611_detect(struct lt9611 *lt9611) +static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge) { + struct lt9611 *lt9611 = bridge_to_lt9611(bridge); unsigned int reg_val = 0; int connected = 0; @@ -596,12 +592,6 @@ static enum drm_connector_status __lt9611_detect(struct lt9611 *lt9611) return lt9611->status; } -static enum drm_connector_status -lt9611_connector_detect(struct drm_connector *connector, bool force) -{ - return __lt9611_detect(connector_to_lt9611(connector)); -} - static int lt9611_read_edid(struct lt9611 *lt9611) { unsigned int temp; @@ -683,30 +673,6 @@ lt9611_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len) return 0; } -static int lt9611_connector_get_modes(struct drm_connector *connector) -{ - struct lt9611 *lt9611 = connector_to_lt9611(connector); - unsigned int count; - struct edid *edid; - - lt9611_power_on(lt9611); - edid = drm_do_get_edid(connector, lt9611_get_edid_block, lt9611); - drm_connector_update_edid_property(connector, edid); - count = drm_add_edid_modes(connector, edid); - kfree(edid); - - return count; -} - -static enum drm_mode_status -lt9611_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) -{ - struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode); - - return lt9611_mode ? MODE_OK : MODE_BAD; -} - /* bridge funcs */ static void lt9611_bridge_atomic_enable(struct drm_bridge *bridge, @@ -784,21 +750,6 @@ lt9611_bridge_atomic_disable(struct drm_bridge *bridge, } } -static struct -drm_connector_helper_funcs lt9611_bridge_connector_helper_funcs = { - .get_modes = lt9611_connector_get_modes, - .mode_valid = lt9611_connector_mode_valid, -}; - -static const struct drm_connector_funcs lt9611_bridge_connector_funcs = { - .fill_modes = drm_helper_probe_single_connector_modes, - .detect = lt9611_connector_detect, - .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, -}; - static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611, struct device_node *dsi_node) { @@ -834,44 +785,13 @@ static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611, return dsi; } -static int lt9611_connector_init(struct drm_bridge *bridge, struct lt9611 *lt9611) -{ - int ret; - - ret = drm_connector_init(bridge->dev, <9611->connector, - <9611_bridge_connector_funcs, - DRM_MODE_CONNECTOR_HDMIA); - if (ret) { - DRM_ERROR("Failed to initialize connector with drm\n"); - return ret; - } - - drm_connector_helper_add(<9611->connector, - <9611_bridge_connector_helper_funcs); - - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - - drm_connector_attach_encoder(<9611->connector, bridge->encoder); - - return 0; -} - static int lt9611_bridge_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { struct lt9611 *lt9611 = bridge_to_lt9611(bridge); - int ret; - - if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { - ret = lt9611_connector_init(bridge, lt9611); - if (ret < 0) - return ret; - } - return 0; + return drm_bridge_attach(bridge->encoder, lt9611->next_bridge, + bridge, flags); } static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge, @@ -918,11 +838,6 @@ lt9611_bridge_atomic_post_disable(struct drm_bridge *bridge, lt9611_sleep_setup(lt9611); } -static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge) -{ - return __lt9611_detect(bridge_to_lt9611(bridge)); -} - static struct edid *lt9611_bridge_get_edid(struct drm_bridge *bridge, struct drm_connector *connector) { @@ -995,7 +910,7 @@ static int lt9611_parse_dt(struct device *dev, lt9611->ac_mode = of_property_read_bool(dev->of_node, "lt,ac-mode"); - return 0; + return drm_of_find_panel_or_bridge(dev->of_node, 2, -1, NULL, <9611->next_bridge); } static int lt9611_gpio_init(struct lt9611 *lt9611) From patchwork Sun Jan 8 07:25:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 640391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF33CC61DB3 for ; Sun, 8 Jan 2023 07:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232448AbjAHH0J (ORCPT ); Sun, 8 Jan 2023 02:26:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232543AbjAHH0F (ORCPT ); Sun, 8 Jan 2023 02:26:05 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B07F1D0FB for ; Sat, 7 Jan 2023 23:26:04 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id bp15so8293302lfb.13 for ; Sat, 07 Jan 2023 23:26:04 -0800 (PST) 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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NkbWmLh0SyTbaJmj6lwX2gXRB2ciA0Sqr8sImuCDU5U=; b=he1aWLotN+iW77KHwK4Rtlyik8EGAi9EnsMyk+IPatRKhawmoSzURhlyWYIDbX1RNH WWNNOoUdHyjaT+UvX0B9HpGvqoEPOWsm5jYZv3e0d5SqEfE+hHmXVU7Dn5wCl8HtRV5r 1DWRz1Hy6PWM4xnys56MdLtXrQL4MZpunB7WMoZSyZ43isKyDb4Wz0hGvfv+LTXAgdes /57Mp8fnWceayVLtksep8UK4NAdwLoWLGK1JFuuN5vFB5jAGEo1ZxY+Jy8nvfCRi2IiO 2LdCzqazJ5Dufr2Zx37hvp7sj1Z+EXXmySGh/WWQVf2rUgd8G4AjomkO46723OPGTNzF l2LA== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NkbWmLh0SyTbaJmj6lwX2gXRB2ciA0Sqr8sImuCDU5U=; b=PAw0Fg7hL8TPMaylV6BFtDeCRvBbMWPsctp+oGyqRPxE4MBJov8EO0lwmYA/M5dELG S3LO3uTCF5Wf68GSgMqWPMM3AmPvU+IZw2DaUBQhoZZtlG0aDpmLQIyr5RTK7g5RCd4c WQpUar2DVr9NwQX0ol4shM2J4XHijX4ybIpz/aVGT+O4NZDBDY1VNb2sFwwTg8Sj+mV3 AkQGeKHJxX9/mZdbqRUbwejAKtBKhiuCj3N/dqxRMY7YZDLMe2coLm2DDoKkeTb0X0fT 2uW4vIIf8rgMyhoRe/1K7wtZflHGn9aaFUKTVFykcSmmB+hQiz4ga7FKsJn2/ooq5F8l gUjg== X-Gm-Message-State: AFqh2kpfb9eVXvBZkmH2pJwDKJZ4ws9XswUv+H2UdZyJNq833VH9Qe5Z 7aM1iGwuv1b4gnFBHMT3lIDYDQ== X-Google-Smtp-Source: AMrXdXt5nxnM2xIx7UKnBwUOSyzdExF/lv+pH17sqgK7aZ/NgB9awrp9/vdQ5JqpwXL7lpkRNwF/LA== X-Received: by 2002:a05:6512:260a:b0:4cb:427:745c with SMTP id bt10-20020a056512260a00b004cb0427745cmr19366133lfb.33.1673162764130; Sat, 07 Jan 2023 23:26:04 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x2-20020a056512130200b004a8f824466bsm927414lfu.188.2023.01.07.23.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 23:26:03 -0800 (PST) From: Dmitry Baryshkov To: Vinod Koul , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 11/12] drm/bridge: lt9611: rework infoframes handling Date: Sun, 8 Jan 2023 09:25:54 +0200 Message-Id: <20230108072555.2905260-12-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> References: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Rework handling infoframes: - Write full HDMI AVI infoframe instead of just fixing the VIC value - Also send the HDMI Vendor Specific infoframe, as recommended by the HDMI spec. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/lontium-lt9611.c | 57 +++++++++++++++++++------ 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 1396ab081f61..82af1f954cc6 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -59,7 +59,6 @@ struct lt9611 { enum drm_connector_status status; u8 edid_buf[EDID_SEG_SIZE]; - u32 vic; }; #define LT9611_PAGE_CONTROL 0xff @@ -352,12 +351,51 @@ static int lt9611_video_check(struct lt9611 *lt9611) return temp; } -static void lt9611_hdmi_tx_digital(struct lt9611 *lt9611, bool is_hdmi) +static void lt9611_hdmi_set_infoframes(struct lt9611 *lt9611, + struct drm_connector *connector, + struct drm_display_mode *mode) { - regmap_write(lt9611->regmap, 0x8443, 0x46 - lt9611->vic); - regmap_write(lt9611->regmap, 0x8447, lt9611->vic); - regmap_write(lt9611->regmap, 0x843d, 0x0a); /* UD1 infoframe */ + union hdmi_infoframe infoframe; + ssize_t len; + u8 iframes = 0x0a; /* UD1 infoframe */ + u8 buf[32]; + int ret; + int i; + + ret = drm_hdmi_avi_infoframe_from_display_mode(&infoframe.avi, + connector, + mode); + if (ret < 0) + goto out; + + len = hdmi_infoframe_pack(&infoframe, buf, sizeof(buf)); + if (len < 0) + goto out; + + for (i = 0; i < len; i++) + regmap_write(lt9611->regmap, 0x8440 + i, buf[i]); + + ret = drm_hdmi_vendor_infoframe_from_display_mode(&infoframe.vendor.hdmi, + connector, + mode); + if (ret < 0) + goto out; + + len = hdmi_infoframe_pack(&infoframe, buf, sizeof(buf)); + if (len < 0) + goto out; + for (i = 0; i < len; i++) + regmap_write(lt9611->regmap, 0x8474 + i, buf[i]); + + iframes |= 0x20; + +out: + regmap_write(lt9611->regmap, 0x843d, iframes); /* UD1 infoframe */ +} + +static void lt9611_hdmi_tx_digital(struct lt9611 *lt9611, bool is_hdmi) +{ if (is_hdmi) regmap_write(lt9611->regmap, 0x82d6, 0x8c); else @@ -687,9 +725,7 @@ lt9611_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_connector_state *conn_state; struct drm_crtc_state *crtc_state; struct drm_display_mode *mode; - struct hdmi_avi_infoframe avi_frame; unsigned int postdiv; - int ret; connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder); if (WARN_ON(!connector)) @@ -710,18 +746,13 @@ lt9611_bridge_atomic_enable(struct drm_bridge *bridge, lt9611_mipi_video_setup(lt9611, mode); lt9611_pcr_setup(lt9611, mode, postdiv); - ret = drm_hdmi_avi_infoframe_from_display_mode(&avi_frame, - connector, - mode); - if (!ret) - lt9611->vic = avi_frame.video_code; - if (lt9611_power_on(lt9611)) { dev_err(lt9611->dev, "power on failed\n"); return; } lt9611_mipi_input_analog(lt9611); + lt9611_hdmi_set_infoframes(lt9611, connector, mode); lt9611_hdmi_tx_digital(lt9611, connector->display_info.is_hdmi); lt9611_hdmi_tx_phy(lt9611); From patchwork Sun Jan 8 07:25:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 640390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EF55C54EBE for ; Sun, 8 Jan 2023 07:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbjAHH0L (ORCPT ); Sun, 8 Jan 2023 02:26:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232564AbjAHH0H (ORCPT ); Sun, 8 Jan 2023 02:26:07 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701FE1D0FD for ; Sat, 7 Jan 2023 23:26:06 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id cf42so8343700lfb.1 for ; Sat, 07 Jan 2023 23:26:06 -0800 (PST) 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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UqXevD+zn0cGW9m9k0kXGrlQ8TzoQsHyNoh291zM7dc=; b=sUnuEPXHH6fUG1s9exm7c9Pc0/RHn7HCRH9+vByolQJongJmtjaY0OKDvVdIOJ3AaE f80Y2XaALUaZ8zU8gmeXKfpPlRHMAHTDuRaYqDAtOICUbXm/0eltJDMuzxCmH4+12sLx Ml55dKG8sI5tpUYMphFKnCQMsEFpSe3G1Q8fS97iOgjSFKrcbNszx9V5W8V7VxoyXDAO abdIU29c5igez7JAcHKHvvOR/I8Y+T1dMvdBC1zzPV0dXN/pmUa+A/88y72JwnwaTlyS mKmlaJVtGBZVjdJ146spWlzO68xq880u/BX42kt22f2IDOXpc/UO5lGYckE7fM6jtc8F CcQw== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UqXevD+zn0cGW9m9k0kXGrlQ8TzoQsHyNoh291zM7dc=; b=Ge5oKXqK2LKteAZAc6OtjKNwmvYfeYWn9iWrZ6DZqw816oVqYUaKPTQJTLyKHka9Ih ewWsEp6FYHIjny2vrFuXfLA/o/UP2Z9PjXg9JIUfRcRCbRaml+QodoYJD0az17Czw/4N 7tmicOW8qo8+CbtnyPF3DSK8cyAaIWeA+Mg2PUGw2UTMGLGxSgKd8D+FLyU/Vr6mwhKL AvmHNAHYq3ebi1U4gJLHO/apoiFuOOk3reph4QdU75ppiG5QcVolICLG7A86cHBuavSo oZO9TezJlVs75WS/cpmzT03+dba8eKrHymkMcrRlDxO8iARQFU3xe6I7RVgddfP2MJVi H9qA== X-Gm-Message-State: AFqh2kphXLBOGJ6eT9RH0ZefMHJzIrfBQusWXhtf5hLzWSsoOm5ImQis 12RdHDkbBr8F9OO8/ZWr+35xZA== X-Google-Smtp-Source: AMrXdXvU9lFIeEcTQXT7xd+gdplEDWKgKjlA32HvtX6wcC3eFNBqxngXu52ZKNxAwgDKo4DEFXwH3w== X-Received: by 2002:a05:6512:3901:b0:4a4:68b7:e71c with SMTP id a1-20020a056512390100b004a468b7e71cmr16493081lfu.6.1673162764842; Sat, 07 Jan 2023 23:26:04 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x2-20020a056512130200b004a8f824466bsm927414lfu.188.2023.01.07.23.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 23:26:04 -0800 (PST) From: Dmitry Baryshkov To: Vinod Koul , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 12/12] drm/bridge: lt9611: stop filtering modes via the table Date: Sun, 8 Jan 2023 09:25:55 +0200 Message-Id: <20230108072555.2905260-13-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> References: <20230108072555.2905260-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The lt9611 bridge can support different modes, it makes no sense to list them in the table. Drop the table and check the number of interfaces using the fixed value. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/lontium-lt9611.c | 41 +++---------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 82af1f954cc6..5acee43f1547 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -84,24 +84,6 @@ static const struct regmap_config lt9611_regmap_config = { .num_ranges = ARRAY_SIZE(lt9611_ranges), }; -struct lt9611_mode { - u16 hdisplay; - u16 vdisplay; - u8 vrefresh; - u8 lanes; - u8 intfs; -}; - -static struct lt9611_mode lt9611_modes[] = { - { 3840, 2160, 30, 4, 2 }, /* 3840x2160 24bit 30Hz 4Lane 2ports */ - { 1920, 1080, 60, 4, 1 }, /* 1080P 24bit 60Hz 4lane 1port */ - { 1920, 1080, 30, 3, 1 }, /* 1080P 24bit 30Hz 3lane 1port */ - { 1920, 1080, 24, 3, 1 }, - { 720, 480, 60, 4, 1 }, - { 720, 576, 50, 2, 1 }, - { 640, 480, 60, 2, 1 }, -}; - static struct lt9611 *bridge_to_lt9611(struct drm_bridge *bridge) { return container_of(bridge, struct lt9611, bridge); @@ -603,21 +585,6 @@ static int lt9611_regulator_enable(struct lt9611 *lt9611) return 0; } -static struct lt9611_mode *lt9611_find_mode(const struct drm_display_mode *mode) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(lt9611_modes); i++) { - if (lt9611_modes[i].hdisplay == mode->hdisplay && - lt9611_modes[i].vdisplay == mode->vdisplay && - lt9611_modes[i].vrefresh == drm_mode_vrefresh(mode)) { - return <9611_modes[i]; - } - } - - return NULL; -} - static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge) { struct lt9611 *lt9611 = bridge_to_lt9611(bridge); @@ -832,12 +799,12 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_info *info, const struct drm_display_mode *mode) { - struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode); struct lt9611 *lt9611 = bridge_to_lt9611(bridge); - if (!lt9611_mode) - return MODE_BAD; - else if (lt9611_mode->intfs > 1 && !lt9611->dsi1) + if (mode->hdisplay >= 3840 && drm_mode_vrefresh(mode) >= 31) + return MODE_CLOCK_HIGH; + + if (mode->hdisplay > 2000 && !lt9611->dsi1) return MODE_PANEL; else return MODE_OK;