All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] i2c: imx_lpi2c: add ipg clk
@ 2019-07-24  8:54 Peng Fan
  2019-07-29 19:37 ` Anatolij Gustschin
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Fan @ 2019-07-24  8:54 UTC (permalink / raw)
  To: u-boot

The controller needs two clk, per clk and ipg clk,
so let's add ipg clk.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/i2c/imx_lpi2c.c | 11 +++++++++++
 include/imx_lpi2c.h     |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c
index 4586d4331f..2de99d019e 100644
--- a/drivers/i2c/imx_lpi2c.c
+++ b/drivers/i2c/imx_lpi2c.c
@@ -471,6 +471,17 @@ static int imx_lpi2c_probe(struct udevice *bus)
 			dev_err(bus, "Failed to enable per clk\n");
 			return ret;
 		}
+
+		ret = clk_get_by_name(bus, "ipg", &i2c_bus->ipg_clk);
+		if (ret) {
+			dev_err(bus, "Failed to get ipg clk\n");
+			return ret;
+		}
+		ret = clk_enable(&i2c_bus->ipg_clk);
+		if (ret) {
+			dev_err(bus, "Failed to enable ipg clk\n");
+			return ret;
+		}
 	} else {
 		/* To i.MX7ULP, only i2c4-7 can be handled by A7 core */
 		ret = enable_i2c_clk(1, bus->seq);
diff --git a/include/imx_lpi2c.h b/include/imx_lpi2c.h
index 2700e5f876..3ce9edaf10 100644
--- a/include/imx_lpi2c.h
+++ b/include/imx_lpi2c.h
@@ -18,6 +18,7 @@ struct imx_lpi2c_bus {
 	struct i2c_pads_info *pads_info;
 	struct udevice *bus;
 	struct clk per_clk;
+	struct clk ipg_clk;
 };
 
 struct imx_lpi2c_reg {
-- 
2.16.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] i2c: imx_lpi2c: add ipg clk
  2019-07-24  8:54 [U-Boot] [PATCH] i2c: imx_lpi2c: add ipg clk Peng Fan
@ 2019-07-29 19:37 ` Anatolij Gustschin
  2019-07-30  0:45   ` Peng Fan
  0 siblings, 1 reply; 5+ messages in thread
From: Anatolij Gustschin @ 2019-07-29 19:37 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On Wed, 24 Jul 2019 08:54:16 +0000
Peng Fan peng.fan at nxp.com wrote:
...
> +++ b/drivers/i2c/imx_lpi2c.c
> @@ -471,6 +471,17 @@ static int imx_lpi2c_probe(struct udevice *bus)
>  			dev_err(bus, "Failed to enable per clk\n");
>  			return ret;
>  		}
> +
> +		ret = clk_get_by_name(bus, "ipg", &i2c_bus->ipg_clk);
> +		if (ret) {
> +			dev_err(bus, "Failed to get ipg clk\n");
> +			return ret;
> +		}

imx8dx/imx8qxp device trees do not have ipg clock in I2C nodes, here
probing will fail. Should we add I2C ipg clock to imx8x dts files?
Or is it required only for imx8qm?

--
Anatolij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] i2c: imx_lpi2c: add ipg clk
  2019-07-29 19:37 ` Anatolij Gustschin
@ 2019-07-30  0:45   ` Peng Fan
  2019-07-30  7:17     ` Anatolij Gustschin
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Fan @ 2019-07-30  0:45 UTC (permalink / raw)
  To: u-boot

> Subject: Re: [PATCH] i2c: imx_lpi2c: add ipg clk
> 
> Hi Peng,
> 
> On Wed, 24 Jul 2019 08:54:16 +0000
> Peng Fan peng.fan at nxp.com wrote:
> ...
> > +++ b/drivers/i2c/imx_lpi2c.c
> > @@ -471,6 +471,17 @@ static int imx_lpi2c_probe(struct udevice *bus)
> >  			dev_err(bus, "Failed to enable per clk\n");
> >  			return ret;
> >  		}
> > +
> > +		ret = clk_get_by_name(bus, "ipg", &i2c_bus->ipg_clk);
> > +		if (ret) {
> > +			dev_err(bus, "Failed to get ipg clk\n");
> > +			return ret;
> > +		}
> 
> imx8dx/imx8qxp device trees do not have ipg clock in I2C nodes, here probing
> will fail. Should we add I2C ipg clock to imx8x dts files?

The dts should be fixed. Seems upstream Linux also not have ipg clk, downstream has
it. Let's fix Linux first.

Thanks,
Peng.

> Or is it required only for imx8qm?
> 
> --
> Anatolij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] i2c: imx_lpi2c: add ipg clk
  2019-07-30  0:45   ` Peng Fan
@ 2019-07-30  7:17     ` Anatolij Gustschin
  0 siblings, 0 replies; 5+ messages in thread
From: Anatolij Gustschin @ 2019-07-30  7:17 UTC (permalink / raw)
  To: u-boot

On Tue, 30 Jul 2019 00:45:52 +0000
Peng Fan peng.fan at nxp.com wrote:
...
> The dts should be fixed. Seems upstream Linux also not have ipg clk, downstream has
> it. Let's fix Linux first.

OK, thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot]  [PATCH] i2c: imx_lpi2c: add ipg clk
@ 2019-10-14 12:40 sbabic at denx.de
  0 siblings, 0 replies; 5+ messages in thread
From: sbabic at denx.de @ 2019-10-14 12:40 UTC (permalink / raw)
  To: u-boot

> The controller needs two clk, per clk and ipg clk,
> so let's add ipg clk.
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-14 12:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24  8:54 [U-Boot] [PATCH] i2c: imx_lpi2c: add ipg clk Peng Fan
2019-07-29 19:37 ` Anatolij Gustschin
2019-07-30  0:45   ` Peng Fan
2019-07-30  7:17     ` Anatolij Gustschin
2019-10-14 12:40 sbabic at denx.de

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.