Re: [PATCH v2 1/3] ARM: omap: clk: add clk_prepare and clk_unprepare

2012-07-02 Thread Rajendra Nayak

On Saturday 30 June 2012 01:49 AM, Paul Walmsley wrote:

Hi

On Wed, 27 Jun 2012, Rajendra Nayak wrote:


As part of Common Clk Framework (CCF) the clk_enable() operation
was split into a clk_prepare() which could sleep, and a clk_enable()
which should never sleep. Similarly the clk_disable() was
split into clk_disable() and clk_unprepare(). This was
needed to handle complex cases where in a clk gate/ungate
would require a slow and a fast part to be implemented.
None of the clocks below seem to be in the 'complex' clocks
category and are just simple clocks which are enabled/disabled
through simple register writes.
Most of the instances also seem to be called in non-atomic
context which means its safe to move all of those from
using a clk_enable() to clk_prepare_enable() and clk_disable() to
clk_disable_unprepare().
For a few others where there is a possibility they get called from
an interrupt or atomic context, there is an additonal clk_prepare()
done before a clk_enable() and a clk_unprepare()
after a clk_disable().
This is in preparation of OMAP moving to CCF.

Based on initial changes from Mike turquette.

Signed-off-by: Rajendra Nayakrna...@ti.com


This patch generates quite a few checkpatch warnings:

WARNING: please, no space before tabs
#294: FILE: arch/arm/mach-omap2/clock3xxx_data.c:3479:
+^ICLK(NULL, ^Imcbsp4_ick,^Imcbsp2_ick,^ICK_3XXX),$

etc.

Please fix these.

The 80 column warnings from checkpatch on the CLK(... lines can be
ignored.


Sorry, I seemed to have overlooked these thinking all to be 80 column
warnings. Will fix all the non 80 column warnings and repost.

regards,
Rajendra




- Paul


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] ARM: omap: clk: add clk_prepare and clk_unprepare

2012-06-29 Thread Paul Walmsley
Hi

On Wed, 27 Jun 2012, Rajendra Nayak wrote:

 As part of Common Clk Framework (CCF) the clk_enable() operation
 was split into a clk_prepare() which could sleep, and a clk_enable()
 which should never sleep. Similarly the clk_disable() was
 split into clk_disable() and clk_unprepare(). This was
 needed to handle complex cases where in a clk gate/ungate
 would require a slow and a fast part to be implemented.
 None of the clocks below seem to be in the 'complex' clocks
 category and are just simple clocks which are enabled/disabled
 through simple register writes.
 Most of the instances also seem to be called in non-atomic
 context which means its safe to move all of those from
 using a clk_enable() to clk_prepare_enable() and clk_disable() to
 clk_disable_unprepare().
 For a few others where there is a possibility they get called from
 an interrupt or atomic context, there is an additonal clk_prepare()
 done before a clk_enable() and a clk_unprepare()
 after a clk_disable().
 This is in preparation of OMAP moving to CCF.
 
 Based on initial changes from Mike turquette.
 
 Signed-off-by: Rajendra Nayak rna...@ti.com

This patch generates quite a few checkpatch warnings:

WARNING: please, no space before tabs
#294: FILE: arch/arm/mach-omap2/clock3xxx_data.c:3479:
+^ICLK(NULL, ^Imcbsp4_ick,^Imcbsp2_ick,^ICK_3XXX),$

etc.  

Please fix these.

The 80 column warnings from checkpatch on the CLK(... lines can be 
ignored.


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] ARM: omap: clk: add clk_prepare and clk_unprepare

2012-06-29 Thread Paul Walmsley
Hi

On Fri, 29 Jun 2012, Paul Walmsley wrote:

 This patch generates quite a few checkpatch warnings:
 
 WARNING: please, no space before tabs
 #294: FILE: arch/arm/mach-omap2/clock3xxx_data.c:3479:
 +^ICLK(NULL, ^Imcbsp4_ick,^Imcbsp2_ick,^ICK_3XXX),$
 
 etc.  
 
 Please fix these.
 
 The 80 column warnings from checkpatch on the CLK(... lines can be 
 ignored.

These warnings were actually generated by patch 2/3, not this one.  Sorry 
about the confusion.


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/3] ARM: omap: clk: add clk_prepare and clk_unprepare

2012-06-27 Thread Rajendra Nayak
As part of Common Clk Framework (CCF) the clk_enable() operation
was split into a clk_prepare() which could sleep, and a clk_enable()
which should never sleep. Similarly the clk_disable() was
split into clk_disable() and clk_unprepare(). This was
needed to handle complex cases where in a clk gate/ungate
would require a slow and a fast part to be implemented.
None of the clocks below seem to be in the 'complex' clocks
category and are just simple clocks which are enabled/disabled
through simple register writes.
Most of the instances also seem to be called in non-atomic
context which means its safe to move all of those from
using a clk_enable() to clk_prepare_enable() and clk_disable() to
clk_disable_unprepare().
For a few others where there is a possibility they get called from
an interrupt or atomic context, there is an additonal clk_prepare()
done before a clk_enable() and a clk_unprepare()
after a clk_disable().
This is in preparation of OMAP moving to CCF.

Based on initial changes from Mike turquette.

Signed-off-by: Rajendra Nayak rna...@ti.com
---
 arch/arm/mach-omap2/board-apollon.c|4 ++--
 arch/arm/mach-omap2/board-h4.c |6 +++---
 arch/arm/mach-omap2/board-omap4panda.c |2 +-
 arch/arm/mach-omap2/clock3xxx.c|8 
 arch/arm/mach-omap2/display.c  |4 ++--
 arch/arm/mach-omap2/gpmc.c |2 +-
 arch/arm/mach-omap2/omap_hwmod.c   |3 +++
 arch/arm/mach-omap2/pm24xx.c   |2 ++
 arch/arm/mach-omap2/usb-fs.c   |4 ++--
 9 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/board-apollon.c 
b/arch/arm/mach-omap2/board-apollon.c
index 502c31e..1d8c693 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -205,7 +205,7 @@ static inline void __init apollon_init_smc91x(void)
return;
}
 
-   clk_enable(gpmc_fck);
+   clk_prepare_enable(gpmc_fck);
rate = clk_get_rate(gpmc_fck);
 
eth_cs = APOLLON_ETH_CS;
@@ -249,7 +249,7 @@ static inline void __init apollon_init_smc91x(void)
gpmc_cs_free(APOLLON_ETH_CS);
}
 out:
-   clk_disable(gpmc_fck);
+   clk_disable_unprepare(gpmc_fck);
clk_put(gpmc_fck);
 }
 
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 876becf..a273af0 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -267,9 +267,9 @@ static inline void __init h4_init_debug(void)
return;
}
 
-   clk_enable(gpmc_fck);
+   clk_prepare_enable(gpmc_fck);
rate = clk_get_rate(gpmc_fck);
-   clk_disable(gpmc_fck);
+   clk_disable_unprepare(gpmc_fck);
clk_put(gpmc_fck);
 
if (is_gpmc_muxed())
@@ -313,7 +313,7 @@ static inline void __init h4_init_debug(void)
gpmc_cs_free(eth_cs);
 
 out:
-   clk_disable(gpmc_fck);
+   clk_disable_unprepare(gpmc_fck);
clk_put(gpmc_fck);
 }
 
diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index 982fb26..f0ea558 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -172,7 +172,7 @@ static void __init omap4_ehci_init(void)
return;
}
clk_set_rate(phy_ref_clk, 1920);
-   clk_enable(phy_ref_clk);
+   clk_prepare_enable(phy_ref_clk);
 
/* disable the power to the usb hub prior to init and reset phy+hub */
ret = gpio_request_array(panda_ehci_gpios,
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index 794d827..4c1591a 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -64,15 +64,15 @@ void __init omap3_clk_lock_dpll5(void)
 
dpll5_clk = clk_get(NULL, dpll5_ck);
clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
-   clk_enable(dpll5_clk);
+   clk_prepare_enable(dpll5_clk);
 
/* Program dpll5_m2_clk divider for no division */
dpll5_m2_clk = clk_get(NULL, dpll5_m2_ck);
-   clk_enable(dpll5_m2_clk);
+   clk_prepare_enable(dpll5_m2_clk);
clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST);
 
-   clk_disable(dpll5_m2_clk);
-   clk_disable(dpll5_clk);
+   clk_disable_unprepare(dpll5_m2_clk);
+   clk_disable_unprepare(dpll5_clk);
return;
 }
 
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5fb47a1..e5f8e48 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -471,7 +471,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
 
for (i = oh-opt_clks_cnt, oc = oh-opt_clks; i  0; i--, oc++)
if (oc-_clk)
-   clk_enable(oc-_clk);
+   clk_prepare_enable(oc-_clk);
 
dispc_disable_outputs();
 
@@ -498,7 +498,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
 
for (i = oh-opt_clks_cnt, oc =