Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1001687pxb; Wed, 6 Apr 2022 06:27:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZvGqrG7d6oCZ/qAvas1nD+V4u04D+Tx4T5Ii0qBFUyIG7lEAsYLhC2k2HDB9CYSgL14z0 X-Received: by 2002:a65:62d0:0:b0:381:d38:c7b0 with SMTP id m16-20020a6562d0000000b003810d38c7b0mr7145191pgv.186.1649251645943; Wed, 06 Apr 2022 06:27:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251645; cv=none; d=google.com; s=arc-20160816; b=0CsB3HuVn0DQ9bkanAUA9dpwwu51BCK6cGku56Kxjn/Y8P4fsREZLKHtitLhK3v5Tt G9zYTkIfP7p9RbBCEoVBF7U6GpboO68NwiVNtSOkAxPIavObPAFK192wCQ6qW32R6lBD WjOl3AYZYds/KaQiOh0BBkvigZ/95oXehnknMXtqbbgkR0F/MbK096+cqDl9+5fC444v L72+6NvSeRZGJ09HXzhE+2lBrcdyVSMTZaf6/p1swxftaFZAMA77NlWkU/nEQdDEE/+c MH+SAM1MP8/o/MHQhMJ3fbHjX5ISu5//UnOYCMlzmOBWSByQo/K3Tj78woR5wjIJ8RMm CAlw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=07EnqziDU0QM29P+f/mj/SQQJxcaCkVN/N+0q6Hfems=; b=LLhjtkX99kT1eI2M6Zz31t+3AK6N7Xy1+NHm5T385quL/1lN36thA6dHc/oSbMqRkb eAy7iRHH/nlSE6hAk9kP+q8ByG1e6w2nV3JCuBFsA4jSZOkwZFSqSfzfn3MkOTOFqDeI m+4AQt7DqqXu9Hjsw/aGD4IJ7LSpk+JDwSI1ScE1vt+oseDd5aqc6mKZxSXw6mf1yvH8 OzHluVDL5AbgZMyDbxyhkZWVZDu7qpyypnhXyRzkGztsmzAJW56s3TO7shSQP6KbOsng NN2EXNqq9McfWub2iZHtDEUnyk44g0xWaVmK2HLeKnZdSXu8QUAzbf0drq5pW7kUF/IO WJvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qWvBPLEr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z8-20020aa791c8000000b004faa27b19b2si13600693pfa.311.2022.04.06.06.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:27:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qWvBPLEr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B4DA5BED00; Wed, 6 Apr 2022 04:04:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388306AbiDEVxz (ORCPT + 99 others); Tue, 5 Apr 2022 17:53:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349074AbiDEJtE (ORCPT ); Tue, 5 Apr 2022 05:49:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65A9BA94FE; Tue, 5 Apr 2022 02:39:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 01867615E5; Tue, 5 Apr 2022 09:39:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07B2AC385A2; Tue, 5 Apr 2022 09:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151598; bh=2aBsx4exa43Wfh0i3cu1nT18YIPOEryKz0qoslDOwf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qWvBPLEr70Ytc/oVNUftSbzM1vgNFyfpN/7tbqa9FU04AN+YyLtccWofL40GHQQrz Ej2eOsvvlADSWyQTyrDNujptvPj6rtxRQhhv3Mvf3bGdCPfDn1/bxDUvAAHVb3lujz mL+32BGAK2CWwi0RgshSiCIPIY/cSlhU+pk3DEV0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Baryshkov , Abhinav Kumar , Sasha Levin Subject: [PATCH 5.15 473/913] drm/msm/dsi/phy: fix 7nm v4.0 settings for C-PHY mode Date: Tue, 5 Apr 2022 09:25:35 +0200 Message-Id: <20220405070354.033419960@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Dmitry Baryshkov [ Upstream commit bb07af2ed2a47dc6c4d0681f275bb27d4f845465 ] The dsi_7nm_phy_enable() disagrees with downstream for glbl_str_swi_cal_sel_ctrl and glbl_hstx_str_ctrl_0 values. Update programmed settings to match downstream driver. To remove the possibility for such errors in future drop less_than_1500_mhz assignment and specify settings explicitly. Fixes: 5ac178381d26 ("drm/msm/dsi: support CPHY mode for 7nm pll/phy") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20220217000837.435340-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c index 9f7c408325ba..8cc1ef8199ac 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c @@ -866,20 +866,26 @@ static int dsi_7nm_phy_enable(struct msm_dsi_phy *phy, /* Alter PHY configurations if data rate less than 1.5GHZ*/ less_than_1500_mhz = (clk_req->bitclk_rate <= 1500000000); - /* For C-PHY, no low power settings for lower clk rate */ - if (phy->cphy_mode) - less_than_1500_mhz = false; - if (phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V4_1) { vreg_ctrl_0 = less_than_1500_mhz ? 0x53 : 0x52; - glbl_rescode_top_ctrl = less_than_1500_mhz ? 0x3d : 0x00; - glbl_rescode_bot_ctrl = less_than_1500_mhz ? 0x39 : 0x3c; + if (phy->cphy_mode) { + glbl_rescode_top_ctrl = 0x00; + glbl_rescode_bot_ctrl = 0x3c; + } else { + glbl_rescode_top_ctrl = less_than_1500_mhz ? 0x3d : 0x00; + glbl_rescode_bot_ctrl = less_than_1500_mhz ? 0x39 : 0x3c; + } glbl_str_swi_cal_sel_ctrl = 0x00; glbl_hstx_str_ctrl_0 = 0x88; } else { vreg_ctrl_0 = less_than_1500_mhz ? 0x5B : 0x59; - glbl_str_swi_cal_sel_ctrl = less_than_1500_mhz ? 0x03 : 0x00; - glbl_hstx_str_ctrl_0 = less_than_1500_mhz ? 0x66 : 0x88; + if (phy->cphy_mode) { + glbl_str_swi_cal_sel_ctrl = 0x03; + glbl_hstx_str_ctrl_0 = 0x66; + } else { + glbl_str_swi_cal_sel_ctrl = less_than_1500_mhz ? 0x03 : 0x00; + glbl_hstx_str_ctrl_0 = less_than_1500_mhz ? 0x66 : 0x88; + } glbl_rescode_top_ctrl = 0x03; glbl_rescode_bot_ctrl = 0x3c; } -- 2.34.1