linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@linaro.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com,
	sboyd@kernel.org, shawnguo@kernel.org, kernel@pengutronix.de,
	linux-imx@nxp.com, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Fabio Estevam <festevam@denx.de>
Subject: Re: [PATCH RESEND v4] clk: imx: imx6sx: Allow a different LCDIF1 clock parent
Date: Wed, 4 Oct 2023 15:41:48 +0300	[thread overview]
Message-ID: <ZR1djK5ODzQ9IpD0@linaro.org> (raw)
In-Reply-To: <20231004123458.2251635-1-festevam@gmail.com>

On 23-10-04 09:34:58, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> It is not a good idea to hardcode the LCDIF1 parent inside the
> clock driver because some users may want to use a different clock
> parent for LCDIF1. One of the reasons could be related to EMI tests.
> 
> Remove the harcoded LCDIF1 parent when the LCDIF1 parent is described
> via devicetree.
> 
> Old dtb's that do not describe the LCDIF1 parent via devicetree will
> use the same PLL5 clock as parent to keep the original behavior.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> Reviewed-by: Abel Vesa <abel.vesa@linaro.org>

I applied already the first v4 you sent.

https://lore.kernel.org/all/169642294508.713950.12324349089481800725.b4-ty@linaro.org/

Thanks.

> ---
> Changes since v3:
> - Check for the presence of 'assigned-clock-parents'. (Stephen)
> 
>  drivers/clk/imx/clk-imx6sx.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
> index 3f1502933e59..69f8f6f9ca49 100644
> --- a/drivers/clk/imx/clk-imx6sx.c
> +++ b/drivers/clk/imx/clk-imx6sx.c
> @@ -121,6 +121,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
>  {
>  	struct device_node *np;
>  	void __iomem *base;
> +	bool lcdif1_assigned_clk;
>  
>  	clk_hw_data = kzalloc(struct_size(clk_hw_data, hws,
>  					  IMX6SX_CLK_CLK_END), GFP_KERNEL);
> @@ -498,9 +499,16 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
>  	clk_set_parent(hws[IMX6SX_CLK_EIM_SLOW_SEL]->clk, hws[IMX6SX_CLK_PLL2_PFD2]->clk);
>  	clk_set_rate(hws[IMX6SX_CLK_EIM_SLOW]->clk, 132000000);
>  
> -	/* set parent clock for LCDIF1 pixel clock */
> -	clk_set_parent(hws[IMX6SX_CLK_LCDIF1_PRE_SEL]->clk, hws[IMX6SX_CLK_PLL5_VIDEO_DIV]->clk);
> -	clk_set_parent(hws[IMX6SX_CLK_LCDIF1_SEL]->clk, hws[IMX6SX_CLK_LCDIF1_PODF]->clk);
> +	np = of_find_node_by_path("/soc/bus@2200000/spba-bus@2240000/lcdif@2220000");
> +	lcdif1_assigned_clk = of_find_property(np, "assigned-clock-parents", NULL);
> +
> +	/* Set parent clock for LCDIF1 pixel clock if not done via devicetree */
> +	if (!lcdif1_assigned_clk) {
> +		clk_set_parent(hws[IMX6SX_CLK_LCDIF1_PRE_SEL]->clk,
> +			       hws[IMX6SX_CLK_PLL5_VIDEO_DIV]->clk);
> +		clk_set_parent(hws[IMX6SX_CLK_LCDIF1_SEL]->clk,
> +			       hws[IMX6SX_CLK_LCDIF1_PODF]->clk);
> +	}
>  
>  	/* Set the parent clks of PCIe lvds1 and pcie_axi to be pcie ref, axi */
>  	if (clk_set_parent(hws[IMX6SX_CLK_LVDS1_SEL]->clk, hws[IMX6SX_CLK_PCIE_REF_125M]->clk))
> -- 
> 2.34.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2023-10-04 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 12:34 [PATCH RESEND v4] clk: imx: imx6sx: Allow a different LCDIF1 clock parent Fabio Estevam
2023-10-04 12:41 ` Abel Vesa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZR1djK5ODzQ9IpD0@linaro.org \
    --to=abel.vesa@linaro.org \
    --cc=abelvesa@kernel.org \
    --cc=festevam@denx.de \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=mturquette@baylibre.com \
    --cc=peng.fan@nxp.com \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).