linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first
@ 2012-05-14  5:04 Richard Zhao
  2012-05-14  7:29 ` Buddhi
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Zhao @ 2012-05-14  5:04 UTC (permalink / raw)
  To: linux-arm-kernel

This also makes any clk be possible init on.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
---
 arch/arm/mach-imx/clk-imx6q.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 1d83d03..f7eb965 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -122,10 +122,6 @@ static const char *cko1_sels[]	= { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5
 				    "dummy", "axi", "enfc", "ipu1_di0", "ipu1_di1", "ipu2_di0",
 				    "ipu2_di1", "ahb", "ipg", "ipg_per", "ckil", "pll4_audio", };
 
-static const char * const clks_init_on[] __initconst = {
-	"mmdc_ch0_axi", "mmdc_ch1_axi", "usboh3",
-};
-
 enum mx6q_clks {
 	dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m,
 	pll3_pfd0_720m, pll3_pfd1_540m, pll3_pfd2_508m, pll3_pfd3_454m,
@@ -160,11 +156,14 @@ enum mx6q_clks {
 
 static struct clk *clk[clk_max];
 
+static enum mx6q_clks const clks_init_on[] __initconst = {
+	mmdc_ch0_axi, mmdc_ch1_axi, usboh3,
+};
+
 int __init mx6q_clocks_init(void)
 {
 	struct device_node *np;
 	void __iomem *base;
-	struct clk *c;
 	int i, irq;
 
 	clk[dummy] = imx_clk_fixed("dummy", 0);
@@ -424,15 +423,8 @@ int __init mx6q_clocks_init(void)
 	clk_register_clkdev(clk[dummy], NULL, "20bc000.wdog");
 	clk_register_clkdev(clk[dummy], NULL, "20c0000.wdog");
 
-	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) {
-		c = clk_get_sys(clks_init_on[i], NULL);
-		if (IS_ERR(c)) {
-			pr_err("%s: failed to get clk %s", __func__,
-			       clks_init_on[i]);
-			return PTR_ERR(c);
-		}
-		clk_prepare_enable(c);
-	}
+	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
+		clk_prepare_enable(clk[clks_init_on[i]]);
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt");
 	base = of_iomap(np, 0);
-- 
1.7.5.4

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

* [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first
  2012-05-14  5:04 [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first Richard Zhao
@ 2012-05-14  7:29 ` Buddhi
  2012-05-14  7:55   ` Richard Zhao
  2012-05-14  8:18   ` Shawn Guo
  0 siblings, 2 replies; 5+ messages in thread
From: Buddhi @ 2012-05-14  7:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2012 at 01:04:47PM +0800, Richard Zhao wrote:
> This also makes any clk be possible init on.
> 
> Signed-off-by: Richard Zhao <richard.zhao@freescale.com>

This is something I forgot to fix, thanks for doing this.

>  
> +static enum mx6q_clks const clks_init_on[] __initconst = {
> +	mmdc_ch0_axi, mmdc_ch1_axi, usboh3,
> +};

BTW, why usboh3? Do we need this? Right now we do not have USB support
on i.MX6. Once we have it the clock should be turned on in the USB
driver, right?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first
  2012-05-14  7:29 ` Buddhi
@ 2012-05-14  7:55   ` Richard Zhao
  2012-05-14  8:18   ` Shawn Guo
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Zhao @ 2012-05-14  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2012 at 09:29:34AM +0200, Buddhi wrote:
> On Mon, May 14, 2012 at 01:04:47PM +0800, Richard Zhao wrote:
> > This also makes any clk be possible init on.
> > 
> > Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
> 
> This is something I forgot to fix, thanks for doing this.
> 
> >  
> > +static enum mx6q_clks const clks_init_on[] __initconst = {
> > +	mmdc_ch0_axi, mmdc_ch1_axi, usboh3,
> > +};
> 
> BTW, why usboh3? Do we need this? Right now we do not have USB support
> on i.MX6. Once we have it the clock should be turned on in the USB
> driver, right?
I don't know why either. I just convert it.

Thanks
Richard
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

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

* [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first
  2012-05-14  8:18   ` Shawn Guo
@ 2012-05-14  8:14     ` Buddhi
  0 siblings, 0 replies; 5+ messages in thread
From: Buddhi @ 2012-05-14  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2012 at 04:18:26PM +0800, Shawn Guo wrote:
> Sascha,
> 
> On Mon, May 14, 2012 at 09:29:34AM +0200, Buddhi wrote:
> > > +static enum mx6q_clks const clks_init_on[] __initconst = {
> > > +	mmdc_ch0_axi, mmdc_ch1_axi, usboh3,
> > > +};
> > 
> > BTW, why usboh3? Do we need this? Right now we do not have USB support
> > on i.MX6. Once we have it the clock should be turned on in the USB
> > driver, right?
> > 
> I remember that I have no usboh3 in clks_init_on when I handed the patch
> over to you.

Oops, then this probably leaked in because we have USB support hacked
into an internal branch. I'll prepare a patch to remove it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first
  2012-05-14  7:29 ` Buddhi
  2012-05-14  7:55   ` Richard Zhao
@ 2012-05-14  8:18   ` Shawn Guo
  2012-05-14  8:14     ` Buddhi
  1 sibling, 1 reply; 5+ messages in thread
From: Shawn Guo @ 2012-05-14  8:18 UTC (permalink / raw)
  To: linux-arm-kernel

Sascha,

On Mon, May 14, 2012 at 09:29:34AM +0200, Buddhi wrote:
> > +static enum mx6q_clks const clks_init_on[] __initconst = {
> > +	mmdc_ch0_axi, mmdc_ch1_axi, usboh3,
> > +};
> 
> BTW, why usboh3? Do we need this? Right now we do not have USB support
> on i.MX6. Once we have it the clock should be turned on in the USB
> driver, right?
> 
I remember that I have no usboh3 in clks_init_on when I handed the patch
over to you.

-- 
Regards,
Shawn

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

end of thread, other threads:[~2012-05-14  8:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14  5:04 [PATCH 1/1] ARM: imx6q: prepare and enable init on clks directly instead of clk_get first Richard Zhao
2012-05-14  7:29 ` Buddhi
2012-05-14  7:55   ` Richard Zhao
2012-05-14  8:18   ` Shawn Guo
2012-05-14  8:14     ` Buddhi

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).