Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp109085yba; Mon, 1 Apr 2019 02:49:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3ku9QaoT948B2htCZXBmkdWzzq5sCjqAwZM6r5Xiwv+mmYnieNqYpocHlNbZZYoXxiffG X-Received: by 2002:a63:1064:: with SMTP id 36mr32342689pgq.155.1554112149644; Mon, 01 Apr 2019 02:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554112149; cv=none; d=google.com; s=arc-20160816; b=Sv313uKCFKOoiHoeU3QM045EAggfOLfZEEWlnbtp+Lnf+PxCOqKgU5MKkRopPo+3rH 6YEPkdcJQ0/aCS7otRCrCkAtHsYTDpX0QIAnJIXmR2bfPNYj3ZJJ3DcxxQe8duCcC4LT WpHPfhBDrt2RS4llnOazYkn8kJ+IlGlTWRoXC3/bkFJcWFFbp7QiGGG/bBSHVYNHKJlO qGxnZGiGwLoaDwlTFOUIJ0HoiT1lJ5FJHNmKwVoC129+1lrzr7Akr7km/juSjHNNgZrU 0KKG3NO/ufRs8L1AuCX5eePZJw7YEj4R2x9b7l2wQMzdGpfhK+Y6rX6zrj7bUT2JZR7p xDZA== 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=0daImR/oZJzOOo+LvVUyNd8hijJHQj/bnFF22UM8Jyg=; b=MdRIf2jL3SG9IcHzb0XiQ6Ep2sAdgoCEXwkfdAMMuIiKfa0ay0VNbs23eHoYQcODcw o8nFRegdcFYWeWGN07uQFb+B6cp5xebNYSVHj0K3y2XD35UsTxl9beGpEWIUnt7m7Jmw x5wd0JaA5OqXkkZX5okZNT2nPzapoomMtukHPG+6a3M8H9/uB48zwQu7Vmpxuo5psnjw ebY4wVJaQq0Y7XqtWsEQH6kyvhw7iRYdQfwRouwOuQfZxgOuHUzoR8hhgW2CyZBGiFxG SzOScUDu1X/M1MsANL3rXnrm7aA95Lu/x9J2UqWzvWMNFojkjee2Z7x7foQGx8NssCbs 0/eQ== 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 n11si8182835pgv.491.2019.04.01.02.48.53; Mon, 01 Apr 2019 02:49:09 -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 S1726415AbfDAJrg (ORCPT + 99 others); Mon, 1 Apr 2019 05:47:36 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:53332 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725820AbfDAJrg (ORCPT ); Mon, 1 Apr 2019 05:47:36 -0400 X-UUID: 27493e00a4a5422ca3d5a35998cd6d66-20190401 X-UUID: 27493e00a4a5422ca3d5a35998cd6d66-20190401 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 30432239; Mon, 01 Apr 2019 17:47:27 +0800 Received: from MTKMBS01DR.mediatek.inc (172.21.101.111) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 1 Apr 2019 17:47:27 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01dr.mediatek.inc (172.21.101.111) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 1 Apr 2019 17:47:20 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 1 Apr 2019 17:47:20 +0800 Message-ID: <1554112040.2011.25.camel@mtksdaap41> Subject: Re: [PATCH V7 6/6] drm/mediatek: fix the rate of parent for hdmi phy in MT2701 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: Mon, 1 Apr 2019 17:47:20 +0800 In-Reply-To: <20190327091929.73162-7-wangyan.wang@mediatek.com> References: <20190327091929.73162-1-wangyan.wang@mediatek.com> <20190327091929.73162-7-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-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Wangyan: I would like the title to more clear about what this patch do. For example: drm/mediatek: no change parent rate in round_rate() for MT2701 HDMI phy On Wed, 2019-03-27 at 17:19 +0800, wangyan wang wrote: > From: chunhui dai > > 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: chunhui dai > Signed-off-by: wangyan wang > --- > drivers/gpu/drm/mediatek/mtk_hdmi_phy.c | 19 ------------------- > drivers/gpu/drm/mediatek/mtk_hdmi_phy.h | 4 ---- > drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c | 7 +++++++ > drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c | 14 ++++++++++++++ > 4 files changed, 21 insertions(+), 23 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c b/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c > index 370309d684ec..f753ee72971e 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_phy.c > @@ -15,25 +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; > -} > - > -u32 mtk_hdmi_phy_read(struct mtk_hdmi_phy *hdmi_phy, u32 offset) > -{ > - return readl(hdmi_phy->regs + offset); > -} I think this function should already be removed by the patch "drm/mediatek: recalculate hdmi phy clock of MT2701 by querying hardware" Regards, CK > - > 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 446e2acd1926..4d4de4de8977 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi_phy.h > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_phy.h > @@ -42,7 +42,6 @@ struct mtk_hdmi_phy { > unsigned int ibias_up; > }; > > -u32 mtk_hdmi_phy_read(struct mtk_hdmi_phy *hdmi_phy, u32 offset); > void mtk_hdmi_phy_clear_bits(struct mtk_hdmi_phy *hdmi_phy, u32 offset, > u32 bits); > void mtk_hdmi_phy_set_bits(struct mtk_hdmi_phy *hdmi_phy, u32 offset, > @@ -50,9 +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; > extern struct mtk_hdmi_phy_conf mtk_hdmi_phy_2701_conf; > diff --git a/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c b/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c > index cb0c68c94013..6fb4ca943463 100644 > --- a/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c > +++ b/drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c > @@ -152,6 +152,13 @@ static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, > RG_HDMITX_DRV_IBIAS_MASK); > return 0; > } > + > +static long mtk_hdmi_pll_round_rate(struct clk_hw *hw, unsigned long rate, > + unsigned long *parent_rate) > +{ > + return rate; > +} > + > static unsigned long mtk_hdmi_pll_recalc_rate(struct clk_hw *hw, > 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 63dde42521b8..3a339f516613 100644 > --- a/drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c > +++ b/drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c > @@ -285,6 +285,20 @@ static int mtk_hdmi_pll_set_rate(struct clk_hw *hw, unsigned long rate, > return 0; > } > > +static 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 unsigned long mtk_hdmi_pll_recalc_rate(struct clk_hw *hw, > unsigned long parent_rate) > {