Re: [PATCH v3 3/3] ARM: omap: clk: Remove all direct dereferencing of struct clk
On Tuesday 31 July 2012 12:26 AM, Paul Walmsley wrote: On Mon, 30 Jul 2012, Rajendra Nayak wrote: Are you sure you are using the v3 of this patch? You already mentioned about these in the v2 [1] and I fixed all these in v3. I went back and looked at the v3 of this patch, and it does not complain me about any of these warnings or errors. Yep that's probably what happened. Here's the updated patch, starting from your v3. Thanks Paul, looks good to me. - Paul From: Rajendra Nayakrna...@ti.com Date: Mon, 30 Jul 2012 12:52:55 -0600 Subject: [PATCH] ARM: OMAP2+: clock: Remove all direct dereferencing of struct clk While we move to Common Clk Framework (CCF), direct deferencing of struct clk wouldn't be possible anymore. Hence get rid of all such instances in the current clock code and use macros/helpers similar to the ones that are provided by CCF. While here also concatenate some strings split across multiple lines which seem to be needed anyway. Signed-off-by: Rajendra Nayakrna...@ti.com [p...@pwsan.com: simplified some compound expressions; reformatted some messages] Signed-off-by: Paul Walmsleyp...@pwsan.com Cc: Mike Turquettemturque...@linaro.org --- arch/arm/mach-omap2/clkt2xxx_apll.c |2 +- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 10 ++- arch/arm/mach-omap2/clkt34xx_dpll3m2.c | 20 +++--- arch/arm/mach-omap2/clkt_clksel.c| 91 -- arch/arm/mach-omap2/clkt_dpll.c | 26 arch/arm/mach-omap2/clock.c | 11 ++-- arch/arm/mach-omap2/dpll3xxx.c | 48 -- arch/arm/mach-omap2/omap_hwmod.c |6 +- arch/arm/mach-omap2/pm.c |2 +- arch/arm/plat-omap/include/plat/clock.h |5 ++ 10 files changed, 135 insertions(+), 86 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c index b19a1f7..c2d15212 100644 --- a/arch/arm/mach-omap2/clkt2xxx_apll.c +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c @@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); omap2_cm_wait_idlest(cm_idlest_pll, status_mask, -OMAP24XX_CM_IDLEST_VAL, clk-name); +OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk)); /* * REVISIT: Should we return an error code if omap2_wait_clock_ready() diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 3d9d746..da03fa4 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -68,14 +68,15 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk) long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) { const struct prcm_config *ptr; - long highest_rate; + long highest_rate, sys_clk_rate; highest_rate = -EINVAL; + sys_clk_rate = __clk_get_rate(sclk); for (ptr = rate_table; ptr-mpu_speed; ptr++) { if (!(ptr-flags cpu_mask)) continue; - if (ptr-xtal_speed != sclk-rate) + if (ptr-xtal_speed != sys_clk_rate) continue; highest_rate = ptr-mpu_speed; @@ -94,12 +95,15 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) const struct prcm_config *prcm; unsigned long found_speed = 0; unsigned long flags; + long sys_clk_rate; + + sys_clk_rate = __clk_get_rate(sclk); for (prcm = rate_table; prcm-mpu_speed; prcm++) { if (!(prcm-flags cpu_mask)) continue; - if (prcm-xtal_speed != sclk-rate) + if (prcm-xtal_speed != sys_clk_rate) continue; if (prcm-mpu_speed= rate) { diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c index d6e34dd..0fd8b70 100644 --- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c +++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c @@ -56,6 +56,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) struct omap_sdrc_params *sdrc_cs0; struct omap_sdrc_params *sdrc_cs1; int ret; + unsigned long clkrate; if (!clk || !rate) return -EINVAL; @@ -64,11 +65,12 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) if (validrate != rate) return -EINVAL; - sdrcrate = sdrc_ick_p-rate; - if (rate clk-rate) - sdrcrate= ((rate / clk-rate) 1); + sdrcrate = __clk_get_rate(sdrc_ick_p); + clkrate = __clk_get_rate(clk); + if (rate clkrate) + sdrcrate= ((rate / clkrate) 1); else - sdrcrate= ((clk-rate / rate) 1); + sdrcrate=
Re: [PATCH v3 3/3] ARM: omap: clk: Remove all direct dereferencing of struct clk
Hi Rajendra On Mon, 2 Jul 2012, Rajendra Nayak wrote: While we move to Common Clk Framework (CCF), direct deferencing of struct clk wouldn't be possible anymore. Hence get rid of all such instances in the current clock code and use macros/helpers similar to the ones that are provided by CCF. While here also concatenate some strings split across multiple lines which seem to be needed anyway. Signed-off-by: Rajendra Nayak rna...@ti.com This one has some checkpatch warnings: WARNING: quoted string split across lines #482: FILE: arch/arm/mach-omap2/clock.c:109: pr_debug(clock: could not associate clk %s to +clkdm %s\n, clk_name, clk-clkdm_name); ERROR: Macros with complex values should be enclosed in parenthesis #709: FILE: arch/arm/plat-omap/include/plat/clock.h:22: +#define __clk_get_name(clk) clk-name ERROR: Macros with complex values should be enclosed in parenthesis #710: FILE: arch/arm/plat-omap/include/plat/clock.h:23: +#define __clk_get_parent(clk) clk-parent ... etc. These have been fixed in the version below, and a few other minor changes made. The patch below has been queued for 3.7. Please don't forget to make sure a patch doesn't cause checkpatch.pl warnings before posting. - Paul From: Rajendra Nayak rna...@ti.com Date: Wed, 27 Jun 2012 14:18:35 +0530 Subject: [PATCH] ARM: OMAP2+: clk: Remove all direct dereferencing of struct clk While we move to Common Clk Framework (CCF), direct deferencing of struct clk wouldn't be possible anymore. Hence get rid of all such instances in the current clock code and use macros/helpers similar to the ones that are provided by CCF. Signed-off-by: Rajendra Nayak rna...@ti.com [p...@pwsan.com: simplified some compound expressions; resolved checkpatch warnings; reformatted some messages] Signed-off-by: Paul Walmsley p...@pwsan.com Cc: Mike Turquette mturque...@linaro.org --- arch/arm/mach-omap2/clkt2xxx_apll.c |2 +- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 10 ++- arch/arm/mach-omap2/clkt34xx_dpll3m2.c | 18 +++--- arch/arm/mach-omap2/clkt_clksel.c| 90 -- arch/arm/mach-omap2/clkt_dpll.c | 24 --- arch/arm/mach-omap2/clock.c | 11 ++-- arch/arm/mach-omap2/dpll3xxx.c | 48 -- arch/arm/mach-omap2/omap_hwmod.c |6 +- arch/arm/mach-omap2/pm.c |2 +- arch/arm/plat-omap/include/plat/clock.h |5 ++ 10 files changed, 133 insertions(+), 83 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c index b19a1f7..c2d15212 100644 --- a/arch/arm/mach-omap2/clkt2xxx_apll.c +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c @@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); omap2_cm_wait_idlest(cm_idlest_pll, status_mask, -OMAP24XX_CM_IDLEST_VAL, clk-name); +OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk)); /* * REVISIT: Should we return an error code if omap2_wait_clock_ready() diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 3d9d746..da03fa4 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -68,14 +68,15 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk) long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) { const struct prcm_config *ptr; - long highest_rate; + long highest_rate, sys_clk_rate; highest_rate = -EINVAL; + sys_clk_rate = __clk_get_rate(sclk); for (ptr = rate_table; ptr-mpu_speed; ptr++) { if (!(ptr-flags cpu_mask)) continue; - if (ptr-xtal_speed != sclk-rate) + if (ptr-xtal_speed != sys_clk_rate) continue; highest_rate = ptr-mpu_speed; @@ -94,12 +95,15 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) const struct prcm_config *prcm; unsigned long found_speed = 0; unsigned long flags; + long sys_clk_rate; + + sys_clk_rate = __clk_get_rate(sclk); for (prcm = rate_table; prcm-mpu_speed; prcm++) { if (!(prcm-flags cpu_mask)) continue; - if (prcm-xtal_speed != sclk-rate) + if (prcm-xtal_speed != sys_clk_rate) continue; if (prcm-mpu_speed = rate) { diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c index d6e34dd..51601db 100644 --- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c +++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c @@ -56,6 +56,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long
Re: [PATCH v3 3/3] ARM: omap: clk: Remove all direct dereferencing of struct clk
Hi Paul, On Monday 30 July 2012 12:42 PM, Paul Walmsley wrote: Hi Rajendra On Mon, 2 Jul 2012, Rajendra Nayak wrote: While we move to Common Clk Framework (CCF), direct deferencing of struct clk wouldn't be possible anymore. Hence get rid of all such instances in the current clock code and use macros/helpers similar to the ones that are provided by CCF. While here also concatenate some strings split across multiple lines which seem to be needed anyway. Signed-off-by: Rajendra Nayakrna...@ti.com This one has some checkpatch warnings: WARNING: quoted string split across lines #482: FILE: arch/arm/mach-omap2/clock.c:109: pr_debug(clock: could not associate clk %s to + clkdm %s\n, clk_name, clk-clkdm_name); Are you sure you are using the v3 of this patch? You already mentioned about these in the v2 [1] and I fixed all these in v3. I went back and looked at the v3 of this patch, and it does not complain me about any of these warnings or errors. regards, Rajendra [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2012-July/107103.html ERROR: Macros with complex values should be enclosed in parenthesis #709: FILE: arch/arm/plat-omap/include/plat/clock.h:22: +#define __clk_get_name(clk) clk-name ERROR: Macros with complex values should be enclosed in parenthesis #710: FILE: arch/arm/plat-omap/include/plat/clock.h:23: +#define __clk_get_parent(clk) clk-parent ... etc. These have been fixed in the version below, and a few other minor changes made. The patch below has been queued for 3.7. Please don't forget to make sure a patch doesn't cause checkpatch.pl warnings before posting. - Paul From: Rajendra Nayakrna...@ti.com Date: Wed, 27 Jun 2012 14:18:35 +0530 Subject: [PATCH] ARM: OMAP2+: clk: Remove all direct dereferencing of struct clk While we move to Common Clk Framework (CCF), direct deferencing of struct clk wouldn't be possible anymore. Hence get rid of all such instances in the current clock code and use macros/helpers similar to the ones that are provided by CCF. Signed-off-by: Rajendra Nayakrna...@ti.com [p...@pwsan.com: simplified some compound expressions; resolved checkpatch warnings; reformatted some messages] Signed-off-by: Paul Walmsleyp...@pwsan.com Cc: Mike Turquettemturque...@linaro.org --- arch/arm/mach-omap2/clkt2xxx_apll.c |2 +- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 10 ++- arch/arm/mach-omap2/clkt34xx_dpll3m2.c | 18 +++--- arch/arm/mach-omap2/clkt_clksel.c| 90 -- arch/arm/mach-omap2/clkt_dpll.c | 24 --- arch/arm/mach-omap2/clock.c | 11 ++-- arch/arm/mach-omap2/dpll3xxx.c | 48 -- arch/arm/mach-omap2/omap_hwmod.c |6 +- arch/arm/mach-omap2/pm.c |2 +- arch/arm/plat-omap/include/plat/clock.h |5 ++ 10 files changed, 133 insertions(+), 83 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c index b19a1f7..c2d15212 100644 --- a/arch/arm/mach-omap2/clkt2xxx_apll.c +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c @@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); omap2_cm_wait_idlest(cm_idlest_pll, status_mask, - OMAP24XX_CM_IDLEST_VAL, clk-name); + OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk)); /* * REVISIT: Should we return an error code if omap2_wait_clock_ready() diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 3d9d746..da03fa4 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -68,14 +68,15 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk) long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) { const struct prcm_config *ptr; -long highest_rate; +long highest_rate, sys_clk_rate; highest_rate = -EINVAL; + sys_clk_rate = __clk_get_rate(sclk); for (ptr = rate_table; ptr-mpu_speed; ptr++) { if (!(ptr-flags cpu_mask)) continue; - if (ptr-xtal_speed != sclk-rate) + if (ptr-xtal_speed != sys_clk_rate) continue; highest_rate = ptr-mpu_speed; @@ -94,12 +95,15 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) const struct prcm_config *prcm; unsigned long found_speed = 0; unsigned long flags; + long sys_clk_rate; + + sys_clk_rate = __clk_get_rate(sclk); for (prcm = rate_table; prcm-mpu_speed; prcm++) { if (!(prcm-flags cpu_mask)) continue; - if (prcm-xtal_speed != sclk-rate) + if (prcm-xtal_speed != sys_clk_rate) continue; if (prcm-mpu_speed= rate) { diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c index d6e34dd..51601db 100644 --- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c +++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c @@ -56,6 +56,7 @@ int
Re: [PATCH v3 3/3] ARM: omap: clk: Remove all direct dereferencing of struct clk
On Mon, 30 Jul 2012, Rajendra Nayak wrote: Are you sure you are using the v3 of this patch? You already mentioned about these in the v2 [1] and I fixed all these in v3. I went back and looked at the v3 of this patch, and it does not complain me about any of these warnings or errors. Yep that's probably what happened. Here's the updated patch, starting from your v3. - Paul From: Rajendra Nayak rna...@ti.com Date: Mon, 30 Jul 2012 12:52:55 -0600 Subject: [PATCH] ARM: OMAP2+: clock: Remove all direct dereferencing of struct clk While we move to Common Clk Framework (CCF), direct deferencing of struct clk wouldn't be possible anymore. Hence get rid of all such instances in the current clock code and use macros/helpers similar to the ones that are provided by CCF. While here also concatenate some strings split across multiple lines which seem to be needed anyway. Signed-off-by: Rajendra Nayak rna...@ti.com [p...@pwsan.com: simplified some compound expressions; reformatted some messages] Signed-off-by: Paul Walmsley p...@pwsan.com Cc: Mike Turquette mturque...@linaro.org --- arch/arm/mach-omap2/clkt2xxx_apll.c |2 +- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 10 ++- arch/arm/mach-omap2/clkt34xx_dpll3m2.c | 20 +++--- arch/arm/mach-omap2/clkt_clksel.c| 91 -- arch/arm/mach-omap2/clkt_dpll.c | 26 arch/arm/mach-omap2/clock.c | 11 ++-- arch/arm/mach-omap2/dpll3xxx.c | 48 -- arch/arm/mach-omap2/omap_hwmod.c |6 +- arch/arm/mach-omap2/pm.c |2 +- arch/arm/plat-omap/include/plat/clock.h |5 ++ 10 files changed, 135 insertions(+), 86 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c index b19a1f7..c2d15212 100644 --- a/arch/arm/mach-omap2/clkt2xxx_apll.c +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c @@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); omap2_cm_wait_idlest(cm_idlest_pll, status_mask, -OMAP24XX_CM_IDLEST_VAL, clk-name); +OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk)); /* * REVISIT: Should we return an error code if omap2_wait_clock_ready() diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 3d9d746..da03fa4 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -68,14 +68,15 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk) long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) { const struct prcm_config *ptr; - long highest_rate; + long highest_rate, sys_clk_rate; highest_rate = -EINVAL; + sys_clk_rate = __clk_get_rate(sclk); for (ptr = rate_table; ptr-mpu_speed; ptr++) { if (!(ptr-flags cpu_mask)) continue; - if (ptr-xtal_speed != sclk-rate) + if (ptr-xtal_speed != sys_clk_rate) continue; highest_rate = ptr-mpu_speed; @@ -94,12 +95,15 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) const struct prcm_config *prcm; unsigned long found_speed = 0; unsigned long flags; + long sys_clk_rate; + + sys_clk_rate = __clk_get_rate(sclk); for (prcm = rate_table; prcm-mpu_speed; prcm++) { if (!(prcm-flags cpu_mask)) continue; - if (prcm-xtal_speed != sclk-rate) + if (prcm-xtal_speed != sys_clk_rate) continue; if (prcm-mpu_speed = rate) { diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c index d6e34dd..0fd8b70 100644 --- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c +++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c @@ -56,6 +56,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) struct omap_sdrc_params *sdrc_cs0; struct omap_sdrc_params *sdrc_cs1; int ret; + unsigned long clkrate; if (!clk || !rate) return -EINVAL; @@ -64,11 +65,12 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) if (validrate != rate) return -EINVAL; - sdrcrate = sdrc_ick_p-rate; - if (rate clk-rate) - sdrcrate = ((rate / clk-rate) 1); + sdrcrate = __clk_get_rate(sdrc_ick_p); + clkrate = __clk_get_rate(clk); + if (rate clkrate) + sdrcrate = ((rate / clkrate) 1); else - sdrcrate = ((clk-rate / rate) 1); + sdrcrate = ((clkrate / rate) 1); ret = omap2_sdrc_get_params(sdrcrate, sdrc_cs0, sdrc_cs1);
[PATCH v3 3/3] ARM: omap: clk: Remove all direct dereferencing of struct clk
While we move to Common Clk Framework (CCF), direct deferencing of struct clk wouldn't be possible anymore. Hence get rid of all such instances in the current clock code and use macros/helpers similar to the ones that are provided by CCF. While here also concatenate some strings split across multiple lines which seem to be needed anyway. Signed-off-by: Rajendra Nayak rna...@ti.com --- arch/arm/mach-omap2/clkt2xxx_apll.c |2 +- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c |4 +- arch/arm/mach-omap2/clkt34xx_dpll3m2.c | 20 +++--- arch/arm/mach-omap2/clkt_clksel.c| 89 - arch/arm/mach-omap2/clkt_dpll.c | 26 --- arch/arm/mach-omap2/clock.c | 11 ++- arch/arm/mach-omap2/dpll3xxx.c | 45 -- arch/arm/mach-omap2/omap_hwmod.c |6 +- arch/arm/mach-omap2/pm.c |2 +- arch/arm/plat-omap/include/plat/clock.h |4 + 10 files changed, 127 insertions(+), 82 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c index b19a1f7..c2d1521 100644 --- a/arch/arm/mach-omap2/clkt2xxx_apll.c +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c @@ -59,7 +59,7 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); omap2_cm_wait_idlest(cm_idlest_pll, status_mask, -OMAP24XX_CM_IDLEST_VAL, clk-name); +OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk)); /* * REVISIT: Should we return an error code if omap2_wait_clock_ready() diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 3d9d746..3a27426 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -75,7 +75,7 @@ long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) for (ptr = rate_table; ptr-mpu_speed; ptr++) { if (!(ptr-flags cpu_mask)) continue; - if (ptr-xtal_speed != sclk-rate) + if (ptr-xtal_speed != __clk_get_rate(sclk)) continue; highest_rate = ptr-mpu_speed; @@ -99,7 +99,7 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) if (!(prcm-flags cpu_mask)) continue; - if (prcm-xtal_speed != sclk-rate) + if (prcm-xtal_speed != __clk_get_rate(sclk)) continue; if (prcm-mpu_speed = rate) { diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c index d6e34dd..0fd8b70 100644 --- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c +++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c @@ -56,6 +56,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) struct omap_sdrc_params *sdrc_cs0; struct omap_sdrc_params *sdrc_cs1; int ret; + unsigned long clkrate; if (!clk || !rate) return -EINVAL; @@ -64,11 +65,12 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) if (validrate != rate) return -EINVAL; - sdrcrate = sdrc_ick_p-rate; - if (rate clk-rate) - sdrcrate = ((rate / clk-rate) 1); + sdrcrate = __clk_get_rate(sdrc_ick_p); + clkrate = __clk_get_rate(clk); + if (rate clkrate) + sdrcrate = ((rate / clkrate) 1); else - sdrcrate = ((clk-rate / rate) 1); + sdrcrate = ((clkrate / rate) 1); ret = omap2_sdrc_get_params(sdrcrate, sdrc_cs0, sdrc_cs1); if (ret) @@ -82,7 +84,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) /* * XXX This only needs to be done when the CPU frequency changes */ - _mpurate = arm_fck_p-rate / CYCLES_PER_MHZ; + _mpurate = __clk_get_rate(arm_fck_p) / CYCLES_PER_MHZ; c = (_mpurate SDRC_MPURATE_SCALE) SDRC_MPURATE_BASE_SHIFT; c += 1; /* for safety */ c *= SDRC_MPURATE_LOOPS; @@ -90,8 +92,8 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) if (c == 0) c = 1; - pr_debug(clock: changing CORE DPLL rate from %lu to %lu\n, clk-rate, -validrate); + pr_debug(clock: changing CORE DPLL rate from %lu to %lu\n, +clkrate, validrate); pr_debug(clock: SDRC CS0 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n, sdrc_cs0-rfr_ctrl, sdrc_cs0-actim_ctrla, @@ -104,14 +106,14 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) if (sdrc_cs1) omap3_configure_core_dpll( - new_div, unlock_dll, c, rate