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: 13092423 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; }