Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3544891yba; Mon, 8 Apr 2019 22:53:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfWC5hHQmA+qvThtxIRyb3Q9LSV6wtxD/W+Oo+CdPJLHhwSNAQHXre/+cvrx/QB2PgdLz3 X-Received: by 2002:a17:902:da4:: with SMTP id 33mr3511247plv.20.1554789228293; Mon, 08 Apr 2019 22:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554789228; cv=none; d=google.com; s=arc-20160816; b=bbdZjhQ15N+BdvBq3ZPuzSg/pd5wK+EDPlzVEKSZrTkfuqrhpMI4+1m311OhukPG02 ZRl7Zw7/6RkvpBJvsTDae1pPCKZbLT8Xdyrkb3IGlr6FPiqNyEg+HsrFVMUy03JkgAFs VJ+YTeVhbL8oX4vJ2R/17OlVM29QrYzF+A03iSAhrAgarbgNAskVvLoutFe3txY3B8Ew ouBvMaVrIgOAWHG2AOJ9oBh/ME0ulK98D/dHU1OvzjrQ+Qu8no3jxRMtne6Q/ZVkNx/W wRiKWxt3NvoORhO3xDO2c8FW7IgJK0YRx+ullPVt/xYqFzxycvqJKxGXg1E5rX7VGOd1 iqRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=YDzO6xZ1aC+lh3Uf/feXj3M//QiaagnRx5buJqDbPbU=; b=yBAbRdMEfK60VTJQpPd4vszbbY3KaM8104S06rwQ7v4aihgej+5xTBoSARKeg65zBr RWyzofKklC0tPs99giq4iBjtbLySV+dlHVE+b+JwfToEDJz6oMH9vQXi5hsrAMNHIrcn 1CEQZr3F3mJ24GhYZBlqgISvmN//F7p7PG9hH/5cVgsVJFJlqV9LXUhPl32j7ZqIDRnn ZOpfSdKVvT7gdJj3i3KCxEIBrcbrA7TvWZWVPGF66TkN4p4Q4zvcX5MSu8czuliEn4GK P8gRQ719xvAzQAmUBHN2+m+rO9F8+UfiCnDvi8UXtRz0iiKNiqSiDN9EZqnmVG1Qr79+ UH2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si27754531pgh.8.2019.04.08.22.53.32; Mon, 08 Apr 2019 22:53:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbfDIFlp (ORCPT + 99 others); Tue, 9 Apr 2019 01:41:45 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:19610 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725781AbfDIFlo (ORCPT ); Tue, 9 Apr 2019 01:41:44 -0400 X-UUID: d37b884778ca4d0ca185b9f76d26faa3-20190409 X-UUID: d37b884778ca4d0ca185b9f76d26faa3-20190409 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 920611034; Tue, 09 Apr 2019 13:41:39 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Apr 2019 13:41:37 +0800 Received: from [172.21.77.4] (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 9 Apr 2019 13:41:37 +0800 Message-ID: <1554788497.336.7.camel@mtksdaap41> Subject: Re: [PATCH V9 5/5] drm/mediatek: no change parent rate in round_rate() for mt2701 hdmi phy From: CK Hu To: wangyan wang CC: Michael Turquette , Stephen Boyd , Matthias Brugger , "Philipp Zabel" , David Airlie , "Daniel Vetter" , chunhui dai , "Colin Ian King" , Sean Wang , "Ryder Lee" , , , , , , Date: Tue, 9 Apr 2019 13:41:37 +0800 In-Reply-To: <20190409030756.69496-6-wangyan.wang@mediatek.com> References: <20190409030756.69496-1-wangyan.wang@mediatek.com> <20190409030756.69496-6-wangyan.wang@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: 2147B7953C383C8E6D9064EB6680BD3204C4B7325DC07302098908BAF81AC83E2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Wangyan: On Tue, 2019-04-09 at 11:07 +0800, wangyan wang wrote: > From: Wangyan Wang > > This is the third step to make MT2701 HDMI stable. > We should not change the rate of parent for hdmi phy when > doing round_rate for this clock. The parent clock of hdmi > phy must be the same as it. We change it when doing set_rate > only. > > Signed-off-by: Wangyan Wang > --- > drivers/gpu/drm/mediatek/mtk_hdmi_phy.c | 14 -------------- > drivers/gpu/drm/mediatek/mtk_hdmi_phy.h | 2 -- > drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c | 6 ++++++ > drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c | 14 ++++++++++++++ > 4 files changed, 20 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c b/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c > index 9e153e080739..e3a6b50e0cf2 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c > @@ -15,20 +15,6 @@ static const struct phy_ops mtk_hdmi_phy_dev_ops = { > .owner = THIS_MODULE, > }; > > -long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, > - unsigned long *parent_rate) > -{ > - struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw); > - > - hdmi_phy->pll_rate = rate; > - if (rate <= 74250000) > - *parent_rate = rate; > - else > - *parent_rate = rate / 2; > - > - return rate; > -} > - > void mtk_hdmi_phy_clear_bits(struct mtk_hdmi_phy *hdmi_phy, u32 offset, > u32 bits) > { > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_phy.h b/drivers/gpu/drm/mediatek/mtk_hdmi_phy.h > index d28b8d5ed2b4..2d8b3182470d 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi_phy.h > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_phy.h > @@ -49,8 +49,6 @@ void mtk_hdmi_phy_set_bits(struct mtk_hdmi_phy *hdmi_phy, u32 offset, > void mtk_hdmi_phy_mask(struct mtk_hdmi_phy *hdmi_phy, u32 offset, > u32 val, u32 mask); > struct mtk_hdmi_phy *to_mtk_hdmi_phy(struct clk_hw *hw); > -long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, > - unsigned long *parent_rate); > > extern struct platform_driver mtk_hdmi_phy_driver; > extern struct mtk_hdmi_phy_conf mtk_hdmi_phy_8173_conf; > diff --git a/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c b/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c > index b24ea6651db4..e3f05ad89b1e 100644 > --- a/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c > +++ b/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c > @@ -106,6 +106,12 @@ static void mtk_hdmi_pll_unprepare(struct clk_hw *hw) > usleep_range(80, 100); > } > > +static long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, > + unsigned long *parent_rate) I think you've tried to align, but the result looks not aligned. Make sure your editor have equal size for each character and the 'tab' length is 8 character. Regards, CK > + > +{ > + return rate; > +} > + > static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, > unsigned long parent_rate) > { > diff --git a/drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c b/drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c > index 625739b4e938..78c638c29102 100644 > --- a/drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c > +++ b/drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c > @@ -199,6 +199,20 @@ static void mtk_hdmi_pll_unprepare(struct clk_hw *hw) > usleep_range(100, 150); > } > > +long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, > + unsigned long *parent_rate) > + > +{ > + struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw); > + > + hdmi_phy->pll_rate = rate; > + if (rate <= 74250000) > + *parent_rate = rate; > + else > + *parent_rate = rate / 2; > + > + return rate; > +} > + > static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, > unsigned long parent_rate) > {