* [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC @ 2009-06-25 23:55 sawsd wang 2009-06-26 14:57 ` Kevin Hilman 2009-09-30 18:57 ` Kevin Hilman 0 siblings, 2 replies; 13+ messages in thread From: sawsd wang @ 2009-06-25 23:55 UTC (permalink / raw) To: linux-omap >From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 00:00:00 2001 From: Chunqiu Wang <cqwang@motorola.com> Date: Wed, 24 Jun 2009 06:48:52 +0800 Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC Current OMAP SmartReflex driver only supports TI Triton Power IC, add a callback to make it possible to use different PowerIC and use different settings to configure OMAP3 Voltage Controller for DVFS Board file can setup a new function to have different settings on SR to configure their Power IC for voltage scaling Signed-off-by: Chunqiu Wang <cqwang@motorola.com> --- arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ arch/arm/mach-omap2/smartreflex.h | 4 ++++ arch/arm/plat-omap/Kconfig | 2 +- 3 files changed, 18 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 9d462e3..bacf602 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -52,6 +52,8 @@ struct omap_sr { #define SR_REGADDR(offs) (sr->srbase_addr + offset) +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; + static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) { __raw_writel(value, SR_REGADDR(offset)); @@ -767,6 +769,11 @@ void disable_smartreflex(int srid) } } +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun) +{ + omap3_volscale_vcbypass_fun = fun; +} + /* Voltage Scaling using SR VCBYPASS */ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, u8 target_vsel, u8 current_vsel) @@ -779,6 +786,10 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, u32 t2_smps_steps = 0; u32 t2_smps_delay = 0; + if (omap3_volscale_vcbypass_fun) + return omap3_volscale_vcbypass_fun(target_opp, current_opp, + target_vsel, current_vsel); + vdd = get_vdd(target_opp); target_opp_no = get_opp_no(target_opp); current_opp_no = get_opp_no(current_opp); @@ -940,6 +951,7 @@ static int __init omap3_sr_init(void) return -ENODEV; } +#ifdef CONFIG_TWL4030_CORE /* Enable SR on T2 */ ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg, R_DCDC_GLOBAL_CFG); @@ -947,6 +959,7 @@ static int __init omap3_sr_init(void) RdReg |= DCDC_GLOBAL_CFG_ENABLE_SRFLX; ret |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, RdReg, R_DCDC_GLOBAL_CFG); +#endif if (cpu_is_omap34xx()) { sr1.clk = clk_get(NULL, "sr1_fck"); diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h index 2a0e823..c4aca9d 100644 --- a/arch/arm/mach-omap2/smartreflex.h +++ b/arch/arm/mach-omap2/smartreflex.h @@ -248,9 +248,13 @@ void disable_smartreflex(int srid); int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 c_vsel); void sr_start_vddautocomap(int srid, u32 target_opp_no); int sr_stop_vddautocomap(int srid); +typedef int (*omap3_voltagescale_vcbypass_t)(u32 t_opp, u32 c_opp, + u8 t_vsel, u8 c_vsel); +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun); #else static inline void enable_smartreflex(int srid) {} static inline void disable_smartreflex(int srid) {} +#define omap3_voltagescale_vcbypass_setup(fun) do {} while (0); #endif #endif diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index c8ba1e2..8d2c607 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -68,7 +68,7 @@ config OMAP_DEBUG_CLOCKDOMAIN config OMAP_SMARTREFLEX bool "SmartReflex support" - depends on ARCH_OMAP34XX && TWL4030_CORE && PM + depends on ARCH_OMAP34XX && PM help Say Y if you want to enable SmartReflex. -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-25 23:55 [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC sawsd wang @ 2009-06-26 14:57 ` Kevin Hilman 2009-09-30 18:57 ` Kevin Hilman 1 sibling, 0 replies; 13+ messages in thread From: Kevin Hilman @ 2009-06-26 14:57 UTC (permalink / raw) To: sawsd wang; +Cc: linux-omap, Chunqiu Wang sawsd wang <sawsdwang@gmail.com> writes: > From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 00:00:00 2001 > From: Chunqiu Wang <cqwang@motorola.com> > Date: Wed, 24 Jun 2009 06:48:52 +0800 > Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC > > Current OMAP SmartReflex driver only supports TI Triton > Power IC, add a callback to make it possible to use > different PowerIC and use different settings to > configure OMAP3 Voltage Controller for DVFS > > Board file can setup a new function to have different settings > on SR to configure their Power IC for voltage scaling > > Signed-off-by: Chunqiu Wang <cqwang@motorola.com> Patch is still line-wrapped in at least one place, and patch 2/2 is wrapped in several. Based on format and the headers, it doesn't look to me like you're using git-send-email. Really, git-send-email will make your life much simpler. Feel free to send me some test patches off-list so we can figure out your mailer problems. Kevin > --- > arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ > arch/arm/mach-omap2/smartreflex.h | 4 ++++ > arch/arm/plat-omap/Kconfig | 2 +- > 3 files changed, 18 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/mach-omap2/smartreflex.c > b/arch/arm/mach-omap2/smartreflex.c > index 9d462e3..bacf602 100644 > --- a/arch/arm/mach-omap2/smartreflex.c > +++ b/arch/arm/mach-omap2/smartreflex.c > @@ -52,6 +52,8 @@ struct omap_sr { > > #define SR_REGADDR(offs) (sr->srbase_addr + offset) > > +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; > + > static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) > { > __raw_writel(value, SR_REGADDR(offset)); > @@ -767,6 +769,11 @@ void disable_smartreflex(int srid) > } > } > > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun) > +{ > + omap3_volscale_vcbypass_fun = fun; > +} > + > /* Voltage Scaling using SR VCBYPASS */ > int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, > u8 target_vsel, u8 current_vsel) > @@ -779,6 +786,10 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 > current_opp, > u32 t2_smps_steps = 0; > u32 t2_smps_delay = 0; > > + if (omap3_volscale_vcbypass_fun) > + return omap3_volscale_vcbypass_fun(target_opp, current_opp, > + target_vsel, current_vsel); > + > vdd = get_vdd(target_opp); > target_opp_no = get_opp_no(target_opp); > current_opp_no = get_opp_no(current_opp); > @@ -940,6 +951,7 @@ static int __init omap3_sr_init(void) > return -ENODEV; > } > > +#ifdef CONFIG_TWL4030_CORE > /* Enable SR on T2 */ > ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg, > R_DCDC_GLOBAL_CFG); > @@ -947,6 +959,7 @@ static int __init omap3_sr_init(void) > RdReg |= DCDC_GLOBAL_CFG_ENABLE_SRFLX; > ret |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, RdReg, > R_DCDC_GLOBAL_CFG); > +#endif > > if (cpu_is_omap34xx()) { > sr1.clk = clk_get(NULL, "sr1_fck"); > diff --git a/arch/arm/mach-omap2/smartreflex.h > b/arch/arm/mach-omap2/smartreflex.h > index 2a0e823..c4aca9d 100644 > --- a/arch/arm/mach-omap2/smartreflex.h > +++ b/arch/arm/mach-omap2/smartreflex.h > @@ -248,9 +248,13 @@ void disable_smartreflex(int srid); > int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 c_vsel); > void sr_start_vddautocomap(int srid, u32 target_opp_no); > int sr_stop_vddautocomap(int srid); > +typedef int (*omap3_voltagescale_vcbypass_t)(u32 t_opp, u32 c_opp, > + u8 t_vsel, u8 c_vsel); > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun); > #else > static inline void enable_smartreflex(int srid) {} > static inline void disable_smartreflex(int srid) {} > +#define omap3_voltagescale_vcbypass_setup(fun) do {} while (0); > #endif > > #endif > diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig > index c8ba1e2..8d2c607 100644 > --- a/arch/arm/plat-omap/Kconfig > +++ b/arch/arm/plat-omap/Kconfig > @@ -68,7 +68,7 @@ config OMAP_DEBUG_CLOCKDOMAIN > > config OMAP_SMARTREFLEX > bool "SmartReflex support" > - depends on ARCH_OMAP34XX && TWL4030_CORE && PM > + depends on ARCH_OMAP34XX && PM > help > Say Y if you want to enable SmartReflex. > > -- > 1.5.4.3 > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-25 23:55 [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC sawsd wang 2009-06-26 14:57 ` Kevin Hilman @ 2009-09-30 18:57 ` Kevin Hilman 1 sibling, 0 replies; 13+ messages in thread From: Kevin Hilman @ 2009-09-30 18:57 UTC (permalink / raw) To: sawsd wang; +Cc: linux-omap sawsd wang <sawsdwang@gmail.com> writes: > From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 00:00:00 2001 > From: Chunqiu Wang <cqwang@motorola.com> > Date: Wed, 24 Jun 2009 06:48:52 +0800 > Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC > > Current OMAP SmartReflex driver only supports TI Triton > Power IC, add a callback to make it possible to use > different PowerIC and use different settings to > configure OMAP3 Voltage Controller for DVFS > > Board file can setup a new function to have different settings > on SR to configure their Power IC for voltage scaling > > Signed-off-by: Chunqiu Wang <cqwang@motorola.com> Are there any plans to update this patch to fix line-wrapping and patch apply issues? If not, I will drop it from my incoming queue. Kevin > --- > arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ > arch/arm/mach-omap2/smartreflex.h | 4 ++++ > arch/arm/plat-omap/Kconfig | 2 +- > 3 files changed, 18 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/mach-omap2/smartreflex.c > b/arch/arm/mach-omap2/smartreflex.c > index 9d462e3..bacf602 100644 > --- a/arch/arm/mach-omap2/smartreflex.c > +++ b/arch/arm/mach-omap2/smartreflex.c > @@ -52,6 +52,8 @@ struct omap_sr { > > #define SR_REGADDR(offs) (sr->srbase_addr + offset) > > +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; > + > static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) > { > __raw_writel(value, SR_REGADDR(offset)); > @@ -767,6 +769,11 @@ void disable_smartreflex(int srid) > } > } > > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun) > +{ > + omap3_volscale_vcbypass_fun = fun; > +} > + > /* Voltage Scaling using SR VCBYPASS */ > int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, > u8 target_vsel, u8 current_vsel) > @@ -779,6 +786,10 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 > current_opp, > u32 t2_smps_steps = 0; > u32 t2_smps_delay = 0; > > + if (omap3_volscale_vcbypass_fun) > + return omap3_volscale_vcbypass_fun(target_opp, current_opp, > + target_vsel, current_vsel); > + > vdd = get_vdd(target_opp); > target_opp_no = get_opp_no(target_opp); > current_opp_no = get_opp_no(current_opp); > @@ -940,6 +951,7 @@ static int __init omap3_sr_init(void) > return -ENODEV; > } > > +#ifdef CONFIG_TWL4030_CORE > /* Enable SR on T2 */ > ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg, > R_DCDC_GLOBAL_CFG); > @@ -947,6 +959,7 @@ static int __init omap3_sr_init(void) > RdReg |= DCDC_GLOBAL_CFG_ENABLE_SRFLX; > ret |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, RdReg, > R_DCDC_GLOBAL_CFG); > +#endif > > if (cpu_is_omap34xx()) { > sr1.clk = clk_get(NULL, "sr1_fck"); > diff --git a/arch/arm/mach-omap2/smartreflex.h > b/arch/arm/mach-omap2/smartreflex.h > index 2a0e823..c4aca9d 100644 > --- a/arch/arm/mach-omap2/smartreflex.h > +++ b/arch/arm/mach-omap2/smartreflex.h > @@ -248,9 +248,13 @@ void disable_smartreflex(int srid); > int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 c_vsel); > void sr_start_vddautocomap(int srid, u32 target_opp_no); > int sr_stop_vddautocomap(int srid); > +typedef int (*omap3_voltagescale_vcbypass_t)(u32 t_opp, u32 c_opp, > + u8 t_vsel, u8 c_vsel); > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun); > #else > static inline void enable_smartreflex(int srid) {} > static inline void disable_smartreflex(int srid) {} > +#define omap3_voltagescale_vcbypass_setup(fun) do {} while (0); > #endif > > #endif > diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig > index c8ba1e2..8d2c607 100644 > --- a/arch/arm/plat-omap/Kconfig > +++ b/arch/arm/plat-omap/Kconfig > @@ -68,7 +68,7 @@ config OMAP_DEBUG_CLOCKDOMAIN > > config OMAP_SMARTREFLEX > bool "SmartReflex support" > - depends on ARCH_OMAP34XX && TWL4030_CORE && PM > + depends on ARCH_OMAP34XX && PM > help > Say Y if you want to enable SmartReflex. > > -- > 1.5.4.3 > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC @ 2009-06-24 0:15 Wang Sawsd-A24013 2009-06-24 0:19 ` Kevin Hilman 2009-06-25 1:25 ` Mike Chan 0 siblings, 2 replies; 13+ messages in thread From: Wang Sawsd-A24013 @ 2009-06-24 0:15 UTC (permalink / raw) To: linux-omap >From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 00:00:00 2001 From: Chunqiu Wang <cqwang@motorola.com> Date: Wed, 24 Jun 2009 06:48:52 +0800 Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC Current OMAP SmartReflex driver only supports TI Triton Power IC, add a callback to make it possible to use different PowerIC and use different settings to configure OMAP3 Voltage Controller for DVFS Board file can setup a new function to have different settings on SR to configure their Power IC for voltage scaling Signed-off-by: Chunqiu Wang <cqwang@motorola.com> --- arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ arch/arm/mach-omap2/smartreflex.h | 4 ++++ arch/arm/plat-omap/Kconfig | 2 +- 3 files changed, 18 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 9d462e3..bacf602 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -52,6 +52,8 @@ struct omap_sr { #define SR_REGADDR(offs) (sr->srbase_addr + offset) +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; + static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) { __raw_writel(value, SR_REGADDR(offset)); @@ -767,6 +769,11 @@ void disable_smartreflex(int srid) } } +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun) +{ + omap3_volscale_vcbypass_fun = fun; +} + /* Voltage Scaling using SR VCBYPASS */ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, u8 target_vsel, u8 current_vsel) @@ -779,6 +786,10 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, u32 t2_smps_steps = 0; u32 t2_smps_delay = 0; + if (omap3_volscale_vcbypass_fun) + return omap3_volscale_vcbypass_fun(target_opp, current_opp, + target_vsel, current_vsel); + vdd = get_vdd(target_opp); target_opp_no = get_opp_no(target_opp); current_opp_no = get_opp_no(current_opp); @@ -940,6 +951,7 @@ static int __init omap3_sr_init(void) return -ENODEV; } +#ifdef CONFIG_TWL4030_CORE /* Enable SR on T2 */ ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg, R_DCDC_GLOBAL_CFG); @@ -947,6 +959,7 @@ static int __init omap3_sr_init(void) RdReg |= DCDC_GLOBAL_CFG_ENABLE_SRFLX; ret |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, RdReg, R_DCDC_GLOBAL_CFG); +#endif if (cpu_is_omap34xx()) { sr1.clk = clk_get(NULL, "sr1_fck"); diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h index 2a0e823..c4aca9d 100644 --- a/arch/arm/mach-omap2/smartreflex.h +++ b/arch/arm/mach-omap2/smartreflex.h @@ -248,9 +248,13 @@ void disable_smartreflex(int srid); int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 c_vsel); void sr_start_vddautocomap(int srid, u32 target_opp_no); int sr_stop_vddautocomap(int srid); +typedef int (*omap3_voltagescale_vcbypass_t)(u32 t_opp, u32 c_opp, + u8 t_vsel, u8 c_vsel); +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun); #else static inline void enable_smartreflex(int srid) {} static inline void disable_smartreflex(int srid) {} +#define omap3_voltagescale_vcbypass_setup(fun) do {} while (0); #endif #endif diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index c8ba1e2..8d2c607 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -68,7 +68,7 @@ config OMAP_DEBUG_CLOCKDOMAIN config OMAP_SMARTREFLEX bool "SmartReflex support" - depends on ARCH_OMAP34XX && TWL4030_CORE && PM + depends on ARCH_OMAP34XX && PM help Say Y if you want to enable SmartReflex. -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-24 0:15 Wang Sawsd-A24013 @ 2009-06-24 0:19 ` Kevin Hilman 2009-06-24 16:10 ` Wang Sawsd-A24013 2009-06-25 1:25 ` Mike Chan 1 sibling, 1 reply; 13+ messages in thread From: Kevin Hilman @ 2009-06-24 0:19 UTC (permalink / raw) To: Wang Sawsd-A24013; +Cc: linux-omap "Wang Sawsd-A24013" <cqwang@motorola.com> writes: > From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 00:00:00 2001 > From: Chunqiu Wang <cqwang@motorola.com> > Date: Wed, 24 Jun 2009 06:48:52 +0800 > Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC > > Current OMAP SmartReflex driver only supports TI Triton > Power IC, add a callback to make it possible to use > different PowerIC and use different settings to > configure OMAP3 Voltage Controller for DVFS > > Board file can setup a new function to have different settings > on SR to configure their Power IC for voltage scaling > > Signed-off-by: Chunqiu Wang <cqwang@motorola.com> Your patch seems wrapped again: checkpatch reports: ERROR: patch seems to be corrupt (line wrapped?) #38: FILE: arch/arm/mach-omap2/smartreflex.c:57: u32 value) ERROR: trailing whitespace #95: FILE: arch/arm/mach-omap2/smartreflex.h:252: +^I^I^I^I^I^Iu8 t_vsel, u8 c_vsel); $ total: 2 errors, 0 warnings, 71 lines checked > --- > arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ > arch/arm/mach-omap2/smartreflex.h | 4 ++++ > arch/arm/plat-omap/Kconfig | 2 +- > 3 files changed, 18 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/mach-omap2/smartreflex.c > b/arch/arm/mach-omap2/smartreflex.c > index 9d462e3..bacf602 100644 > --- a/arch/arm/mach-omap2/smartreflex.c > +++ b/arch/arm/mach-omap2/smartreflex.c > @@ -52,6 +52,8 @@ struct omap_sr { > > #define SR_REGADDR(offs) (sr->srbase_addr + offset) > > +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; > + > static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, > u32 value) > { > __raw_writel(value, SR_REGADDR(offset)); > @@ -767,6 +769,11 @@ void disable_smartreflex(int srid) > } > } > > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t > fun) > +{ > + omap3_volscale_vcbypass_fun = fun; > +} > + > /* Voltage Scaling using SR VCBYPASS */ > int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, > u8 target_vsel, u8 current_vsel) > @@ -779,6 +786,10 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 > current_opp, > u32 t2_smps_steps = 0; > u32 t2_smps_delay = 0; > > + if (omap3_volscale_vcbypass_fun) > + return omap3_volscale_vcbypass_fun(target_opp, > current_opp, > + target_vsel, > current_vsel); > + > vdd = get_vdd(target_opp); > target_opp_no = get_opp_no(target_opp); > current_opp_no = get_opp_no(current_opp); > @@ -940,6 +951,7 @@ static int __init omap3_sr_init(void) > return -ENODEV; > } > > +#ifdef CONFIG_TWL4030_CORE > /* Enable SR on T2 */ > ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg, > R_DCDC_GLOBAL_CFG); > @@ -947,6 +959,7 @@ static int __init omap3_sr_init(void) > RdReg |= DCDC_GLOBAL_CFG_ENABLE_SRFLX; > ret |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, RdReg, > R_DCDC_GLOBAL_CFG); > +#endif > > if (cpu_is_omap34xx()) { > sr1.clk = clk_get(NULL, "sr1_fck"); > diff --git a/arch/arm/mach-omap2/smartreflex.h > b/arch/arm/mach-omap2/smartreflex.h > index 2a0e823..c4aca9d 100644 > --- a/arch/arm/mach-omap2/smartreflex.h > +++ b/arch/arm/mach-omap2/smartreflex.h > @@ -248,9 +248,13 @@ void disable_smartreflex(int srid); > int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 > c_vsel); > void sr_start_vddautocomap(int srid, u32 target_opp_no); > int sr_stop_vddautocomap(int srid); > +typedef int (*omap3_voltagescale_vcbypass_t)(u32 t_opp, u32 c_opp, > + u8 t_vsel, u8 c_vsel); > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t > fun); > #else > static inline void enable_smartreflex(int srid) {} > static inline void disable_smartreflex(int srid) {} > +#define omap3_voltagescale_vcbypass_setup(fun) do {} while (0); > #endif > > #endif > diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig > index c8ba1e2..8d2c607 100644 > --- a/arch/arm/plat-omap/Kconfig > +++ b/arch/arm/plat-omap/Kconfig > @@ -68,7 +68,7 @@ config OMAP_DEBUG_CLOCKDOMAIN > > config OMAP_SMARTREFLEX > bool "SmartReflex support" > - depends on ARCH_OMAP34XX && TWL4030_CORE && PM > + depends on ARCH_OMAP34XX && PM > help > Say Y if you want to enable SmartReflex. > > -- > 1.5.4.3 > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-24 0:19 ` Kevin Hilman @ 2009-06-24 16:10 ` Wang Sawsd-A24013 2009-06-25 17:38 ` Kevin Hilman 0 siblings, 1 reply; 13+ messages in thread From: Wang Sawsd-A24013 @ 2009-06-24 16:10 UTC (permalink / raw) To: Kevin Hilman; +Cc: linux-omap [-- Attachment #1: Type: text/plain, Size: 1438 bytes --] > -----Original Message----- > From: Kevin Hilman [mailto:khilman@deeprootsystems.com] > Sent: 2009年6月24日 8:19 > To: Wang Sawsd-A24013 > Cc: linux-omap@vger.kernel.org > Subject: Re: [PATCH 1/2] Support OMAP3 VC adaptation with > different Power IC > > "Wang Sawsd-A24013" <cqwang@motorola.com> writes: > > > From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 > 00:00:00 2001 > > From: Chunqiu Wang <cqwang@motorola.com> > > Date: Wed, 24 Jun 2009 06:48:52 +0800 > > Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC > > > > Current OMAP SmartReflex driver only supports TI Triton > > Power IC, add a callback to make it possible to use > > different PowerIC and use different settings to > > configure OMAP3 Voltage Controller for DVFS > > > > Board file can setup a new function to have different settings > > on SR to configure their Power IC for voltage scaling > > > > Signed-off-by: Chunqiu Wang <cqwang@motorola.com> > > Your patch seems wrapped again: > > checkpatch reports: > > ERROR: patch seems to be corrupt (line wrapped?) > #38: FILE: arch/arm/mach-omap2/smartreflex.c:57: > u32 value) > > ERROR: trailing whitespace > #95: FILE: arch/arm/mach-omap2/smartreflex.h:252: > +^I^I^I^I^I^Iu8 t_vsel, u8 c_vsel); $ > > total: 2 errors, 0 warnings, 71 lines checked > Sorry about that, this time I attached these two patch files. Thanks, Chunqiu [-- Attachment #2: 0001-Support-OMAP3-VC-adaptation-with-different-Power-IC.patch --] [-- Type: application/octet-stream, Size: 3692 bytes --] From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 00:00:00 2001 From: Chunqiu Wang <cqwang@motorola.com> Date: Wed, 24 Jun 2009 06:48:52 +0800 Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC Current OMAP SmartReflex driver only supports TI Triton Power IC, add a callback to make it possible to use different PowerIC and use different settings to configure OMAP3 Voltage Controller for DVFS Board file can setup a new function to have different settings on SR to configure their Power IC for voltage scaling Signed-off-by: Chunqiu Wang <cqwang@motorola.com> --- arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ arch/arm/mach-omap2/smartreflex.h | 4 ++++ arch/arm/plat-omap/Kconfig | 2 +- 3 files changed, 18 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 9d462e3..bacf602 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -52,6 +52,8 @@ struct omap_sr { #define SR_REGADDR(offs) (sr->srbase_addr + offset) +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; + static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) { __raw_writel(value, SR_REGADDR(offset)); @@ -767,6 +769,11 @@ void disable_smartreflex(int srid) } } +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun) +{ + omap3_volscale_vcbypass_fun = fun; +} + /* Voltage Scaling using SR VCBYPASS */ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, u8 target_vsel, u8 current_vsel) @@ -779,6 +786,10 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, u32 t2_smps_steps = 0; u32 t2_smps_delay = 0; + if (omap3_volscale_vcbypass_fun) + return omap3_volscale_vcbypass_fun(target_opp, current_opp, + target_vsel, current_vsel); + vdd = get_vdd(target_opp); target_opp_no = get_opp_no(target_opp); current_opp_no = get_opp_no(current_opp); @@ -940,6 +951,7 @@ static int __init omap3_sr_init(void) return -ENODEV; } +#ifdef CONFIG_TWL4030_CORE /* Enable SR on T2 */ ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg, R_DCDC_GLOBAL_CFG); @@ -947,6 +959,7 @@ static int __init omap3_sr_init(void) RdReg |= DCDC_GLOBAL_CFG_ENABLE_SRFLX; ret |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, RdReg, R_DCDC_GLOBAL_CFG); +#endif if (cpu_is_omap34xx()) { sr1.clk = clk_get(NULL, "sr1_fck"); diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h index 2a0e823..c4aca9d 100644 --- a/arch/arm/mach-omap2/smartreflex.h +++ b/arch/arm/mach-omap2/smartreflex.h @@ -248,9 +248,13 @@ void disable_smartreflex(int srid); int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 c_vsel); void sr_start_vddautocomap(int srid, u32 target_opp_no); int sr_stop_vddautocomap(int srid); +typedef int (*omap3_voltagescale_vcbypass_t)(u32 t_opp, u32 c_opp, + u8 t_vsel, u8 c_vsel); +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t fun); #else static inline void enable_smartreflex(int srid) {} static inline void disable_smartreflex(int srid) {} +#define omap3_voltagescale_vcbypass_setup(fun) do {} while (0); #endif #endif diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index c8ba1e2..8d2c607 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -68,7 +68,7 @@ config OMAP_DEBUG_CLOCKDOMAIN config OMAP_SMARTREFLEX bool "SmartReflex support" - depends on ARCH_OMAP34XX && TWL4030_CORE && PM + depends on ARCH_OMAP34XX && PM help Say Y if you want to enable SmartReflex. -- 1.5.4.3 [-- Attachment #3: 0002-OMAP3-Implement-separate-function-to-send-bypass-co.patch --] [-- Type: application/octet-stream, Size: 5469 bytes --] From 803cbdcd8df3d6f931089979c2dbad8942512cb4 Mon Sep 17 00:00:00 2001 From: Chunqiu Wang <cqwang@motorola.com> Date: Wed, 24 Jun 2009 07:57:17 +0800 Subject: [PATCH] OMAP3: Implement separate function to send bypass command through VC Some system may need use OMAP VC to configure their Power IC, so make the common code to send bypass command using SR VC Signed-off-by: Chunqiu Wang <cqwang@motorola.com> --- arch/arm/mach-omap2/pm.h | 1 + arch/arm/mach-omap2/pm34xx.c | 36 ++++++++++++++++++++++ arch/arm/mach-omap2/smartreflex.c | 59 +++--------------------------------- 3 files changed, 42 insertions(+), 54 deletions(-) diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index ddc9453..fa118cd 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -44,6 +44,7 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc); +extern int omap3_vc_bypass_cmd(u8 slave_addr, u8 reg_addr, u8 cmd); #ifdef CONFIG_CPU_IDLE int omap3_idle_init(void); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 7a4a525..85b0944 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -26,6 +26,7 @@ #include <linux/err.h> #include <linux/gpio.h> #include <linux/clk.h> +#include <linux/delay.h> #include <mach/sram.h> #include <mach/prcm.h> @@ -1135,6 +1136,41 @@ err2: return ret; } +/* Program Power IC via OMAP3 voltage controller bypass interface */ +int omap3_vc_bypass_cmd(u8 slave_addr, u8 reg_addr, u8 cmd) +{ + u32 vc_bypass_value; + u32 loop_cnt = 0, retries_cnt = 0; + + vc_bypass_value = (cmd << OMAP3430_DATA_SHIFT) | + (reg_addr << OMAP3430_REGADDR_SHIFT) | + (slave_addr << OMAP3430_SLAVEADDR_SHIFT); + + prm_write_mod_reg(vc_bypass_value, OMAP3430_GR_MOD, + OMAP3_PRM_VC_BYPASS_VAL_OFFSET); + + vc_bypass_value = prm_set_mod_reg_bits(OMAP3430_VALID, OMAP3430_GR_MOD, + OMAP3_PRM_VC_BYPASS_VAL_OFFSET); + + while ((vc_bypass_value & OMAP3430_VALID) != 0x0) { + loop_cnt++; + if (retries_cnt > 10) { + printk(KERN_ERR"Loop count exceeded in check SR I2C" + "write\n"); + return 1; + } + if (loop_cnt > 50) { + retries_cnt++; + loop_cnt = 0; + udelay(10); + } + vc_bypass_value = prm_read_mod_reg(OMAP3430_GR_MOD, + OMAP3_PRM_VC_BYPASS_VAL_OFFSET); + } + + return 0; +} + static void __init configure_vc(void) { diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index bacf602..2158b5c 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -35,6 +35,7 @@ #include "prm.h" #include "smartreflex.h" #include "prm-regbits-34xx.h" +#include "pm.h" struct omap_sr { int srid; @@ -449,8 +450,6 @@ static int sr_reset_voltage(int srid) { u32 target_opp_no, vsel = 0; u32 reg_addr = 0; - u32 loop_cnt = 0, retries_cnt = 0; - u32 vc_bypass_value; u32 t2_smps_steps = 0; u32 t2_smps_delay = 0; u32 prm_vp1_voltage, prm_vp2_voltage; @@ -479,31 +478,8 @@ static int sr_reset_voltage(int srid) t2_smps_steps = abs(vsel - prm_vp2_voltage); } - vc_bypass_value = (vsel << OMAP3430_DATA_SHIFT) | - (reg_addr << OMAP3430_REGADDR_SHIFT) | - (R_SRI2C_SLAVE_ADDR << OMAP3430_SLAVEADDR_SHIFT); - - prm_write_mod_reg(vc_bypass_value, OMAP3430_GR_MOD, - OMAP3_PRM_VC_BYPASS_VAL_OFFSET); - - vc_bypass_value = prm_set_mod_reg_bits(OMAP3430_VALID, OMAP3430_GR_MOD, - OMAP3_PRM_VC_BYPASS_VAL_OFFSET); - - while ((vc_bypass_value & OMAP3430_VALID) != 0x0) { - loop_cnt++; - if (retries_cnt > 10) { - pr_info("Loop count exceeded in check SR I2C" - "write\n"); - return 1; - } - if (loop_cnt > 50) { - retries_cnt++; - loop_cnt = 0; - udelay(10); - } - vc_bypass_value = prm_read_mod_reg(OMAP3430_GR_MOD, - OMAP3_PRM_VC_BYPASS_VAL_OFFSET); - } + if (omap3_vc_bypass_cmd(R_SRI2C_SLAVE_ADDR, reg_addr, vsel)) + return 1; /* * T2 SMPS slew rate (min) 4mV/uS, step size 12.5mV, @@ -780,9 +756,7 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, { int sr_status = 0; u32 vdd, target_opp_no, current_opp_no; - u32 vc_bypass_value; u32 reg_addr = 0; - u32 loop_cnt = 0, retries_cnt = 0; u32 t2_smps_steps = 0; u32 t2_smps_delay = 0; @@ -815,31 +789,8 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, reg_addr = R_VDD2_SR_CONTROL; } - vc_bypass_value = (target_vsel << OMAP3430_DATA_SHIFT) | - (reg_addr << OMAP3430_REGADDR_SHIFT) | - (R_SRI2C_SLAVE_ADDR << OMAP3430_SLAVEADDR_SHIFT); - - prm_write_mod_reg(vc_bypass_value, OMAP3430_GR_MOD, - OMAP3_PRM_VC_BYPASS_VAL_OFFSET); - - vc_bypass_value = prm_set_mod_reg_bits(OMAP3430_VALID, OMAP3430_GR_MOD, - OMAP3_PRM_VC_BYPASS_VAL_OFFSET); - - while ((vc_bypass_value & OMAP3430_VALID) != 0x0) { - loop_cnt++; - if (retries_cnt > 10) { - pr_info("Loop count exceeded in check SR I2C" - "write\n"); - return 1; - } - if (loop_cnt > 50) { - retries_cnt++; - loop_cnt = 0; - udelay(10); - } - vc_bypass_value = prm_read_mod_reg(OMAP3430_GR_MOD, - OMAP3_PRM_VC_BYPASS_VAL_OFFSET); - } + if (omap3_vc_bypass_cmd(R_SRI2C_SLAVE_ADDR, reg_addr, target_vsel)) + return 1; /* * T2 SMPS slew rate (min) 4mV/uS, step size 12.5mV, -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-24 16:10 ` Wang Sawsd-A24013 @ 2009-06-25 17:38 ` Kevin Hilman 2009-06-25 20:10 ` Wang Sawsd-A24013 0 siblings, 1 reply; 13+ messages in thread From: Kevin Hilman @ 2009-06-25 17:38 UTC (permalink / raw) To: Wang Sawsd-A24013; +Cc: linux-omap "Wang Sawsd-A24013" <cqwang@motorola.com> writes: >> -----Original Message----- >> From: Kevin Hilman [mailto:khilman@deeprootsystems.com] >> Sent: 2009年6月24日 8:19 >> To: Wang Sawsd-A24013 >> Cc: linux-omap@vger.kernel.org >> Subject: Re: [PATCH 1/2] Support OMAP3 VC adaptation with >> different Power IC >> >> "Wang Sawsd-A24013" <cqwang@motorola.com> writes: >> >> > From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 >> 00:00:00 2001 >> > From: Chunqiu Wang <cqwang@motorola.com> >> > Date: Wed, 24 Jun 2009 06:48:52 +0800 >> > Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC >> > >> > Current OMAP SmartReflex driver only supports TI Triton >> > Power IC, add a callback to make it possible to use >> > different PowerIC and use different settings to >> > configure OMAP3 Voltage Controller for DVFS >> > >> > Board file can setup a new function to have different settings >> > on SR to configure their Power IC for voltage scaling >> > >> > Signed-off-by: Chunqiu Wang <cqwang@motorola.com> >> >> Your patch seems wrapped again: >> >> checkpatch reports: >> >> ERROR: patch seems to be corrupt (line wrapped?) >> #38: FILE: arch/arm/mach-omap2/smartreflex.c:57: >> u32 value) >> >> ERROR: trailing whitespace >> #95: FILE: arch/arm/mach-omap2/smartreflex.h:252: >> +^I^I^I^I^I^Iu8 t_vsel, u8 c_vsel); $ >> >> total: 2 errors, 0 warnings, 71 lines checked >> > Sorry about that, this time I attached these two patch files. > Can you please fix your mailer setup so you can resend patches inline and get a broader review. I suggest bypassing any mailer such as outlook and configuring git-send-email to send them directly to an SMTP server. If your local SMTP is really that broken to be wrapping text, I suggest you send via a gmail account. This link describes how to set this up for gmail, but also works for a local SMTP server. http://git.or.cz/gitwiki/GitTips#Mail Kevin -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-25 17:38 ` Kevin Hilman @ 2009-06-25 20:10 ` Wang Sawsd-A24013 0 siblings, 0 replies; 13+ messages in thread From: Wang Sawsd-A24013 @ 2009-06-25 20:10 UTC (permalink / raw) To: Kevin Hilman; +Cc: linux-omap > > > > Can you please fix your mailer setup so you can resend patches inline > and get a broader review. > > I suggest bypassing any mailer such as outlook and configuring > git-send-email to send them directly to an SMTP server. If your local > SMTP is really that broken to be wrapping text, I suggest you > send via a gmail account. This link describes how to set this > up for gmail, but also works for a local SMTP server. > > http://git.or.cz/gitwiki/GitTips#Mail > > Kevin > Thanks Kevin, sure I will resend them. Thanks, Chunqiu ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-24 0:15 Wang Sawsd-A24013 2009-06-24 0:19 ` Kevin Hilman @ 2009-06-25 1:25 ` Mike Chan 2009-06-25 16:00 ` Wang Sawsd-A24013 1 sibling, 1 reply; 13+ messages in thread From: Mike Chan @ 2009-06-25 1:25 UTC (permalink / raw) To: Wang Sawsd-A24013; +Cc: linux-omap Wang Sawsd-A24013 wrote: > From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 00:00:00 2001 > From: Chunqiu Wang <cqwang@motorola.com> > Date: Wed, 24 Jun 2009 06:48:52 +0800 > Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC > > Current OMAP SmartReflex driver only supports TI Triton > Power IC, add a callback to make it possible to use > different PowerIC and use different settings to > configure OMAP3 Voltage Controller for DVFS > > Board file can setup a new function to have different settings > on SR to configure their Power IC for voltage scaling > > Signed-off-by: Chunqiu Wang <cqwang@motorola.com> > --- > arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ > arch/arm/mach-omap2/smartreflex.h | 4 ++++ > arch/arm/plat-omap/Kconfig | 2 +- > 3 files changed, 18 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/mach-omap2/smartreflex.c > b/arch/arm/mach-omap2/smartreflex.c > index 9d462e3..bacf602 100644 > --- a/arch/arm/mach-omap2/smartreflex.c > +++ b/arch/arm/mach-omap2/smartreflex.c > @@ -52,6 +52,8 @@ struct omap_sr { > > #define SR_REGADDR(offs) (sr->srbase_addr + offset) > > +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; > Perhaps use static int (*omap3_volscale_vcbypass_fun) (u32, u32, u8, u8); This gets rid of the compiler warning on incompatible pointer types when you register a function via omap3_voltagescale_vcbypass_setup(). -- Mike > + > static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, > u32 value) > { > __raw_writel(value, SR_REGADDR(offset)); > @@ -767,6 +769,11 @@ void disable_smartreflex(int srid) > } > } > > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t > fun) > +{ > + omap3_volscale_vcbypass_fun = fun; > +} > + > /* Voltage Scaling using SR VCBYPASS */ > int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp, > u8 target_vsel, u8 current_vsel) > @@ -779,6 +786,10 @@ int sr_voltagescale_vcbypass(u32 target_opp, u32 > current_opp, > u32 t2_smps_steps = 0; > u32 t2_smps_delay = 0; > > + if (omap3_volscale_vcbypass_fun) > + return omap3_volscale_vcbypass_fun(target_opp, > current_opp, > + target_vsel, > current_vsel); > + > vdd = get_vdd(target_opp); > target_opp_no = get_opp_no(target_opp); > current_opp_no = get_opp_no(current_opp); > @@ -940,6 +951,7 @@ static int __init omap3_sr_init(void) > return -ENODEV; > } > > +#ifdef CONFIG_TWL4030_CORE > /* Enable SR on T2 */ > ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg, > R_DCDC_GLOBAL_CFG); > @@ -947,6 +959,7 @@ static int __init omap3_sr_init(void) > RdReg |= DCDC_GLOBAL_CFG_ENABLE_SRFLX; > ret |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, RdReg, > R_DCDC_GLOBAL_CFG); > +#endif > > if (cpu_is_omap34xx()) { > sr1.clk = clk_get(NULL, "sr1_fck"); > diff --git a/arch/arm/mach-omap2/smartreflex.h > b/arch/arm/mach-omap2/smartreflex.h > index 2a0e823..c4aca9d 100644 > --- a/arch/arm/mach-omap2/smartreflex.h > +++ b/arch/arm/mach-omap2/smartreflex.h > @@ -248,9 +248,13 @@ void disable_smartreflex(int srid); > int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 > c_vsel); > void sr_start_vddautocomap(int srid, u32 target_opp_no); > int sr_stop_vddautocomap(int srid); > +typedef int (*omap3_voltagescale_vcbypass_t)(u32 t_opp, u32 c_opp, > + u8 t_vsel, u8 c_vsel); > +void omap3_voltagescale_vcbypass_setup(omap3_voltagescale_vcbypass_t > fun); > #else > static inline void enable_smartreflex(int srid) {} > static inline void disable_smartreflex(int srid) {} > +#define omap3_voltagescale_vcbypass_setup(fun) do {} while (0); > #endif > > #endif > diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig > index c8ba1e2..8d2c607 100644 > --- a/arch/arm/plat-omap/Kconfig > +++ b/arch/arm/plat-omap/Kconfig > @@ -68,7 +68,7 @@ config OMAP_DEBUG_CLOCKDOMAIN > > config OMAP_SMARTREFLEX > bool "SmartReflex support" > - depends on ARCH_OMAP34XX && TWL4030_CORE && PM > + depends on ARCH_OMAP34XX && PM > help > Say Y if you want to enable SmartReflex. > > ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-25 1:25 ` Mike Chan @ 2009-06-25 16:00 ` Wang Sawsd-A24013 2009-06-25 19:25 ` Mike Chan 0 siblings, 1 reply; 13+ messages in thread From: Wang Sawsd-A24013 @ 2009-06-25 16:00 UTC (permalink / raw) To: Mike Chan; +Cc: linux-omap > -----Original Message----- > From: Mike Chan [mailto:mike@android.com] > Sent: 2009年6月25日 9:25 > To: Wang Sawsd-A24013 > Cc: linux-omap@vger.kernel.org > Subject: Re: [PATCH 1/2] Support OMAP3 VC adaptation with > different Power IC > > Wang Sawsd-A24013 wrote: > > From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 > 00:00:00 2001 > > From: Chunqiu Wang <cqwang@motorola.com> > > Date: Wed, 24 Jun 2009 06:48:52 +0800 > > Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC > > > > Current OMAP SmartReflex driver only supports TI Triton > > Power IC, add a callback to make it possible to use > > different PowerIC and use different settings to > > configure OMAP3 Voltage Controller for DVFS > > > > Board file can setup a new function to have different settings > > on SR to configure their Power IC for voltage scaling > > > > Signed-off-by: Chunqiu Wang <cqwang@motorola.com> > > --- > > arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ > > arch/arm/mach-omap2/smartreflex.h | 4 ++++ > > arch/arm/plat-omap/Kconfig | 2 +- > > 3 files changed, 18 insertions(+), 1 deletions(-) > > > > diff --git a/arch/arm/mach-omap2/smartreflex.c > > b/arch/arm/mach-omap2/smartreflex.c > > index 9d462e3..bacf602 100644 > > --- a/arch/arm/mach-omap2/smartreflex.c > > +++ b/arch/arm/mach-omap2/smartreflex.c > > @@ -52,6 +52,8 @@ struct omap_sr { > > > > #define SR_REGADDR(offs) (sr->srbase_addr + offset) > > > > +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; > > > Perhaps use > static int (*omap3_volscale_vcbypass_fun) (u32, u32, u8, u8); > > This gets rid of the compiler warning on incompatible pointer > types when > you register a function via omap3_voltagescale_vcbypass_setup(). > > -- Mike Thanks Mike, but we do not see the warnning with the original Code, note this patch is slightly different with the one we sent To you based on K29, this new patch have four parameters Sinc some change has been made in the sr_voltagescale_vcbypass to add two more parameters. Is your warnning caused by this? Thanks, Chunqiu -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-25 16:00 ` Wang Sawsd-A24013 @ 2009-06-25 19:25 ` Mike Chan 2009-06-25 20:12 ` Wang Sawsd-A24013 0 siblings, 1 reply; 13+ messages in thread From: Mike Chan @ 2009-06-25 19:25 UTC (permalink / raw) To: Wang Sawsd-A24013; +Cc: linux-omap Wang Sawsd-A24013 wrote: >> -----Original Message----- >> From: Mike Chan [mailto:mike@android.com] >> Sent: 2009年6月25日 9:25 >> To: Wang Sawsd-A24013 >> Cc: linux-omap@vger.kernel.org >> Subject: Re: [PATCH 1/2] Support OMAP3 VC adaptation with >> different Power IC >> >> Wang Sawsd-A24013 wrote: >> >>> From c1aba8ba7af3ddd16346d95795bda71e65baa4d0 Mon Sep 17 >>> >> 00:00:00 2001 >> >>> From: Chunqiu Wang <cqwang@motorola.com> >>> Date: Wed, 24 Jun 2009 06:48:52 +0800 >>> Subject: [PATCH] Support OMAP3 VC adaptation with different Power IC >>> >>> Current OMAP SmartReflex driver only supports TI Triton >>> Power IC, add a callback to make it possible to use >>> different PowerIC and use different settings to >>> configure OMAP3 Voltage Controller for DVFS >>> >>> Board file can setup a new function to have different settings >>> on SR to configure their Power IC for voltage scaling >>> >>> Signed-off-by: Chunqiu Wang <cqwang@motorola.com> >>> --- >>> arch/arm/mach-omap2/smartreflex.c | 13 +++++++++++++ >>> arch/arm/mach-omap2/smartreflex.h | 4 ++++ >>> arch/arm/plat-omap/Kconfig | 2 +- >>> 3 files changed, 18 insertions(+), 1 deletions(-) >>> >>> diff --git a/arch/arm/mach-omap2/smartreflex.c >>> b/arch/arm/mach-omap2/smartreflex.c >>> index 9d462e3..bacf602 100644 >>> --- a/arch/arm/mach-omap2/smartreflex.c >>> +++ b/arch/arm/mach-omap2/smartreflex.c >>> @@ -52,6 +52,8 @@ struct omap_sr { >>> >>> #define SR_REGADDR(offs) (sr->srbase_addr + offset) >>> >>> +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; >>> >>> >> Perhaps use >> static int (*omap3_volscale_vcbypass_fun) (u32, u32, u8, u8); >> >> This gets rid of the compiler warning on incompatible pointer >> types when >> you register a function via omap3_voltagescale_vcbypass_setup(). >> >> -- Mike >> > Thanks Mike, but we do not see the warnning with the original > Code, note this patch is slightly different with the one we sent > To you based on K29, this new patch have four parameters > Sinc some change has been made in the > sr_voltagescale_vcbypass to add two more parameters. > > Is your warnning caused by this? > > This patch stand-alone doesn't give me any warnings. Its only when you hook into this from your board file. Might be the compiler I'm using. I used this patch + modified version of the patches you sent me before to get the two working. (Yes, 4 params). -- MIke > Thanks, > Chunqiu > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-25 19:25 ` Mike Chan @ 2009-06-25 20:12 ` Wang Sawsd-A24013 2009-06-25 21:18 ` Mike Chan 0 siblings, 1 reply; 13+ messages in thread From: Wang Sawsd-A24013 @ 2009-06-25 20:12 UTC (permalink / raw) To: Mike Chan; +Cc: linux-omap > >>> diff --git a/arch/arm/mach-omap2/smartreflex.c > >>> b/arch/arm/mach-omap2/smartreflex.c > >>> index 9d462e3..bacf602 100644 > >>> --- a/arch/arm/mach-omap2/smartreflex.c > >>> +++ b/arch/arm/mach-omap2/smartreflex.c > >>> @@ -52,6 +52,8 @@ struct omap_sr { > >>> > >>> #define SR_REGADDR(offs) (sr->srbase_addr + offset) > >>> > >>> +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; > >>> > >>> > >> Perhaps use > >> static int (*omap3_volscale_vcbypass_fun) (u32, u32, u8, u8); > >> > >> This gets rid of the compiler warning on incompatible pointer > >> types when > >> you register a function via omap3_voltagescale_vcbypass_setup(). > >> > >> -- Mike > >> > > Thanks Mike, but we do not see the warnning with the original > > Code, note this patch is slightly different with the one we sent > > To you based on K29, this new patch have four parameters > > Sinc some change has been made in the > > sr_voltagescale_vcbypass to add two more parameters. > > > > Is your warnning caused by this? > > > > > > This patch stand-alone doesn't give me any warnings. Its only when you > hook into this from your board file. Might be the compiler I'm using. > I used this patch + modified version of the patches you sent me before > to get the two working. (Yes, 4 params). I just verified the change on both current linux-omap pm branch and The branch we are using, neither of them reports any warnning. Just reminder, the patch I sent to you are different in all these files, Since we should use 2 params in our kernel, the patch I sent to This list has 4 params. Please check whether the warnning Is caused by the mismatch in the function declaration and The function definition in the board file. It should not cause the warning even you are using different Compiler. > > -- MIke > > Thanks, > > Chunqiu > > > > ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC 2009-06-25 20:12 ` Wang Sawsd-A24013 @ 2009-06-25 21:18 ` Mike Chan 0 siblings, 0 replies; 13+ messages in thread From: Mike Chan @ 2009-06-25 21:18 UTC (permalink / raw) To: Wang Sawsd-A24013; +Cc: linux-omap On Thu, Jun 25, 2009 at 1:12 PM, Wang Sawsd-A24013<cqwang@motorola.com> wrote: >> >>> diff --git a/arch/arm/mach-omap2/smartreflex.c >> >>> b/arch/arm/mach-omap2/smartreflex.c >> >>> index 9d462e3..bacf602 100644 >> >>> --- a/arch/arm/mach-omap2/smartreflex.c >> >>> +++ b/arch/arm/mach-omap2/smartreflex.c >> >>> @@ -52,6 +52,8 @@ struct omap_sr { >> >>> >> >>> #define SR_REGADDR(offs) (sr->srbase_addr + offset) >> >>> >> >>> +static omap3_voltagescale_vcbypass_t omap3_volscale_vcbypass_fun; >> >>> >> >>> >> >> Perhaps use >> >> static int (*omap3_volscale_vcbypass_fun) (u32, u32, u8, u8); >> >> >> >> This gets rid of the compiler warning on incompatible pointer >> >> types when >> >> you register a function via omap3_voltagescale_vcbypass_setup(). >> >> >> >> -- Mike >> >> >> > Thanks Mike, but we do not see the warnning with the original >> > Code, note this patch is slightly different with the one we sent >> > To you based on K29, this new patch have four parameters >> > Sinc some change has been made in the >> > sr_voltagescale_vcbypass to add two more parameters. >> > >> > Is your warnning caused by this? >> > >> > >> >> This patch stand-alone doesn't give me any warnings. Its only when you >> hook into this from your board file. Might be the compiler I'm using. >> I used this patch + modified version of the patches you sent me before >> to get the two working. (Yes, 4 params). > I just verified the change on both current linux-omap pm branch and > The branch we are using, neither of them reports any warnning. > > Just reminder, the patch I sent to you are different in all these files, > Since we should use 2 params in our kernel, the patch I sent to > This list has 4 params. Please check whether the warnning > Is caused by the mismatch in the function declaration and > The function definition in the board file. > > It should not cause the warning even you are using different > Compiler. > Ah you're right, I must have done something wrong on my side. It was probably the 2 vs 4 params. -- Mike >> >> -- MIke >> > Thanks, >> > Chunqiu >> > >> >> > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2009-09-30 18:57 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-06-25 23:55 [PATCH 1/2] Support OMAP3 VC adaptation with different Power IC sawsd wang 2009-06-26 14:57 ` Kevin Hilman 2009-09-30 18:57 ` Kevin Hilman -- strict thread matches above, loose matches on Subject: below -- 2009-06-24 0:15 Wang Sawsd-A24013 2009-06-24 0:19 ` Kevin Hilman 2009-06-24 16:10 ` Wang Sawsd-A24013 2009-06-25 17:38 ` Kevin Hilman 2009-06-25 20:10 ` Wang Sawsd-A24013 2009-06-25 1:25 ` Mike Chan 2009-06-25 16:00 ` Wang Sawsd-A24013 2009-06-25 19:25 ` Mike Chan 2009-06-25 20:12 ` Wang Sawsd-A24013 2009-06-25 21:18 ` Mike Chan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox