devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	aisheng.dong@nxp.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de
Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, xiaoning.wang@nxp.com,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 6/6] i2c: imx-lpi2c: handle IPG clock
Date: Fri, 12 Aug 2022 13:13:10 +0300	[thread overview]
Message-ID: <c2991370-b55f-c782-d62c-f9c667e40389@linaro.org> (raw)
In-Reply-To: <20220812043424.4078034-7-peng.fan@oss.nxp.com>

On 12/08/2022 07:34, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The LPI2C controller needs both PER and IPG clock to work, but current
> driver only supports PER clock. This patch add IPG clock.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/i2c/busses/i2c-imx-lpi2c.c | 41 ++++++++++++++++++++++--------
>  1 file changed, 31 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
> index 8b9ba055c418..f43ad1ae8627 100644
> --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> @@ -94,7 +94,8 @@ enum lpi2c_imx_pincfg {
>  
>  struct lpi2c_imx_struct {
>  	struct i2c_adapter	adapter;
> -	struct clk		*clk;
> +	struct clk		*clk_per;
> +	struct clk		*clk_ipg;
>  	void __iomem		*base;
>  	__u8			*rx_buf;
>  	__u8			*tx_buf;
> @@ -207,7 +208,7 @@ static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx)
>  
>  	lpi2c_imx_set_mode(lpi2c_imx);
>  
> -	clk_rate = clk_get_rate(lpi2c_imx->clk);
> +	clk_rate = clk_get_rate(lpi2c_imx->clk_per);
>  	if (lpi2c_imx->mode == HS || lpi2c_imx->mode == ULTRA_FAST)
>  		filt = 0;
>  	else
> @@ -561,10 +562,16 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
>  	strlcpy(lpi2c_imx->adapter.name, pdev->name,
>  		sizeof(lpi2c_imx->adapter.name));
>  
> -	lpi2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(lpi2c_imx->clk)) {
> +	lpi2c_imx->clk_per = devm_clk_get(&pdev->dev, "per");
> +	if (IS_ERR(lpi2c_imx->clk_per)) {
>  		dev_err(&pdev->dev, "can't get I2C peripheral clock\n");
> -		return PTR_ERR(lpi2c_imx->clk);
> +		return PTR_ERR(lpi2c_imx->clk_per);
> +	}
> +
> +	lpi2c_imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
> +	if (IS_ERR(lpi2c_imx->clk_ipg)) {
> +		dev_err(&pdev->dev, "can't get I2C ipg clock\n");
> +		return PTR_ERR(lpi2c_imx->clk_ipg);
>  	}

You just broke all DTS...

Best regards,
Krzysztof

  reply	other threads:[~2022-08-12 10:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12  4:34 [PATCH 0/6] i2c-imx-lpi2c: add IPG clock Peng Fan (OSS)
2022-08-12  4:34 ` [PATCH 1/6] dt-bindings: i2c: i2c-imx-lpi2c: add ipg clk Peng Fan (OSS)
2022-08-12 10:11   ` Krzysztof Kozlowski
2022-08-12 15:13   ` Rob Herring
2022-08-12  4:34 ` [PATCH 2/6] dt-bindings: i2c: i2c-imx-lpi2c: add dmas property Peng Fan (OSS)
2022-08-12 10:11   ` Krzysztof Kozlowski
2022-08-12  4:34 ` [PATCH 3/6] dt-bindings: i2c: i2c-imx-lpi2c: add i.MX93 Peng Fan (OSS)
2022-08-12 10:11   ` Krzysztof Kozlowski
2022-08-12  4:34 ` [PATCH 4/6] arm64: dts: imx8-ss-dma: add IPG clock for i2c Peng Fan (OSS)
2022-08-12  4:34 ` [PATCH 5/6] ARM: dts: imx7ulp: Add PER clock for lpi2c Peng Fan (OSS)
2022-08-12  4:34 ` [PATCH 6/6] i2c: imx-lpi2c: handle IPG clock Peng Fan (OSS)
2022-08-12 10:13   ` Krzysztof Kozlowski [this message]
2022-08-12 18:58     ` Krzysztof Kozlowski
2022-08-12 10:14 ` [PATCH 0/6] i2c-imx-lpi2c: add " Krzysztof Kozlowski
2022-08-15  0:52   ` Peng Fan
2022-08-16  6:01     ` Krzysztof Kozlowski
2022-08-16  6:31       ` Peng Fan
2022-08-16  8:43       ` Peng Fan
2022-08-16  9:44         ` Krzysztof Kozlowski
2022-08-16  9:47           ` Peng Fan

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=c2991370-b55f-c782-d62c-f9c667e40389@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=aisheng.dong@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=xiaoning.wang@nxp.com \
    /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).