[RFC 1/3] omap: voltage: Allow custom vp_init() implementation

2011-02-23 Thread Sanjeev Premi
Current implementation expects AVS to be available
on the processor - by default. May not be true.

This patch allows the vp_init() to be implemented
per processor (or family) - same as vc_init().

Signed-off-by: Sanjeev Premi pr...@ti.com
---
 arch/arm/mach-omap2/voltage.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index 12be525..bbc36e7 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -312,6 +312,8 @@ static struct dentry *voltage_dir;
 
 /* Init function pointers */
 static void (*vc_init) (struct omap_vdd_info *vdd);
+static void (*vp_init) (struct omap_vdd_info *vdd);
+
 static int (*vdd_data_configure) (struct omap_vdd_info *vdd);
 
 static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
@@ -416,7 +418,7 @@ static void vp_latch_vsel(struct omap_vdd_info *vdd)
 }
 
 /* Generic voltage init functions */
-static void __init vp_init(struct omap_vdd_info *vdd)
+static void __init omap_vp_init(struct omap_vdd_info *vdd)
 {
u32 vp_val;
u16 mod;
@@ -1557,11 +1559,13 @@ static int __init omap_voltage_early_init(void)
vdd_info = omap3_vdd_info;
nr_scalable_vdd = OMAP3_NR_SCALABLE_VDD;
vc_init = omap3_vc_init;
+   vp_init = omap_vp_init;
vdd_data_configure = omap3_vdd_data_configure;
} else if (cpu_is_omap44xx()) {
vdd_info = omap4_vdd_info;
nr_scalable_vdd = OMAP4_NR_SCALABLE_VDD;
vc_init = omap4_vc_init;
+   vp_init = omap_vp_init;
vdd_data_configure = omap4_vdd_data_configure;
} else {
pr_warning(%s: voltage driver support not added\n, __func__);
-- 
1.7.2.2

--
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: [RFC 1/3] omap: voltage: Allow custom vp_init() implementation

2011-02-23 Thread Menon, Nishanth
On Wed, Feb 23, 2011 at 23:28, Sanjeev Premi pr...@ti.com wrote:
 Current implementation expects AVS to be available
 on the processor - by default. May not be true.

 This patch allows the vp_init() to be implemented
 per processor (or family) - same as vc_init().

I believe Voltage Processor != Smart reflex AVS. Smart reflex AVS
module talks to VP talks to VC talks over I2C_SR to PMIC.
absence of AVS does'nt imply VP,VC dont exist or the potential to hook
up a PMIC over I2C_SR. no?


 Signed-off-by: Sanjeev Premi pr...@ti.com
 ---
  arch/arm/mach-omap2/voltage.c |    6 +-
  1 files changed, 5 insertions(+), 1 deletions(-)

 diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
 index 12be525..bbc36e7 100644
 --- a/arch/arm/mach-omap2/voltage.c
 +++ b/arch/arm/mach-omap2/voltage.c
 @@ -312,6 +312,8 @@ static struct dentry *voltage_dir;

  /* Init function pointers */
  static void (*vc_init) (struct omap_vdd_info *vdd);
 +static void (*vp_init) (struct omap_vdd_info *vdd);
 +
  static int (*vdd_data_configure) (struct omap_vdd_info *vdd);

  static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
 @@ -416,7 +418,7 @@ static void vp_latch_vsel(struct omap_vdd_info *vdd)
  }

  /* Generic voltage init functions */
 -static void __init vp_init(struct omap_vdd_info *vdd)
 +static void __init omap_vp_init(struct omap_vdd_info *vdd)
  {
        u32 vp_val;
        u16 mod;
 @@ -1557,11 +1559,13 @@ static int __init omap_voltage_early_init(void)
                vdd_info = omap3_vdd_info;
                nr_scalable_vdd = OMAP3_NR_SCALABLE_VDD;
                vc_init = omap3_vc_init;
 +               vp_init = omap_vp_init;
                vdd_data_configure = omap3_vdd_data_configure;
        } else if (cpu_is_omap44xx()) {
                vdd_info = omap4_vdd_info;
                nr_scalable_vdd = OMAP4_NR_SCALABLE_VDD;
                vc_init = omap4_vc_init;
 +               vp_init = omap_vp_init;
                vdd_data_configure = omap4_vdd_data_configure;
        } else {
                pr_warning(%s: voltage driver support not added\n, __func__);


Regards,
Nishanth Menon
--
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: [RFC 1/3] omap: voltage: Allow custom vp_init() implementation

2011-02-23 Thread Premi, Sanjeev
 -Original Message-
 From: Menon, Nishanth
 Sent: Thursday, February 24, 2011 12:06 AM
 To: Premi, Sanjeev
 Cc: linux-omap@vger.kernel.org
 Subject: Re: [RFC 1/3] omap: voltage: Allow custom vp_init()
 implementation
 
 On Wed, Feb 23, 2011 at 23:28, Sanjeev Premi pr...@ti.com wrote:
  Current implementation expects AVS to be available
  on the processor - by default. May not be true.
 
  This patch allows the vp_init() to be implemented
  per processor (or family) - same as vc_init().
 
 I believe Voltage Processor != Smart reflex AVS. Smart reflex AVS
 module talks to VP talks to VC talks over I2C_SR to PMIC.
 absence of AVS does'nt imply VP,VC dont exist or the potential to hook
 up a PMIC over I2C_SR. no?

[sp] But their role is limited to AVS only. If there is/was no AVS
 what would they be doing? Delta value written via SW on I2C would
 still get TWL working.

 And if you look into the omap_vdd_info you'd see what I meant.
 
 
 
  Signed-off-by: Sanjeev Premi pr...@ti.com
  ---
   arch/arm/mach-omap2/voltage.c |    6 +-
   1 files changed, 5 insertions(+), 1 deletions(-)
 
  diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-
 omap2/voltage.c
  index 12be525..bbc36e7 100644
  --- a/arch/arm/mach-omap2/voltage.c
  +++ b/arch/arm/mach-omap2/voltage.c
  @@ -312,6 +312,8 @@ static struct dentry *voltage_dir;
 
   /* Init function pointers */
   static void (*vc_init) (struct omap_vdd_info *vdd);
  +static void (*vp_init) (struct omap_vdd_info *vdd);
  +
   static int (*vdd_data_configure) (struct omap_vdd_info *vdd);
 
   static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
  @@ -416,7 +418,7 @@ static void vp_latch_vsel(struct omap_vdd_info *vdd)
   }
 
   /* Generic voltage init functions */
  -static void __init vp_init(struct omap_vdd_info *vdd)
  +static void __init omap_vp_init(struct omap_vdd_info *vdd)
   {
         u32 vp_val;
         u16 mod;
  @@ -1557,11 +1559,13 @@ static int __init omap_voltage_early_init(void)
                 vdd_info = omap3_vdd_info;
                 nr_scalable_vdd = OMAP3_NR_SCALABLE_VDD;
                 vc_init = omap3_vc_init;
  +               vp_init = omap_vp_init;
                 vdd_data_configure = omap3_vdd_data_configure;
         } else if (cpu_is_omap44xx()) {
                 vdd_info = omap4_vdd_info;
                 nr_scalable_vdd = OMAP4_NR_SCALABLE_VDD;
                 vc_init = omap4_vc_init;
  +               vp_init = omap_vp_init;
                 vdd_data_configure = omap4_vdd_data_configure;
         } else {
                 pr_warning(%s: voltage driver support not added\n,
 __func__);
 
 
 Regards,
 Nishanth Menon
--
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: [RFC 1/3] omap: voltage: Allow custom vp_init() implementation

2011-02-23 Thread Nishanth Menon

Premi, Sanjeev wrote, on 02/24/2011 02:15 AM:

-Original Message-
From: Menon, Nishanth
Sent: Thursday, February 24, 2011 12:06 AM
To: Premi, Sanjeev
Cc: linux-omap@vger.kernel.org
Subject: Re: [RFC 1/3] omap: voltage: Allow custom vp_init()
implementation

On Wed, Feb 23, 2011 at 23:28, Sanjeev Premipr...@ti.com  wrote:

Current implementation expects AVS to be available
on the processor - by default. May not be true.

This patch allows the vp_init() to be implemented
per processor (or family) - same as vc_init().


I believe Voltage Processor != Smart reflex AVS. Smart reflex AVS
module talks to VP talks to VC talks over I2C_SR to PMIC.
absence of AVS does'nt imply VP,VC dont exist or the potential to hook
up a PMIC over I2C_SR. no?


[sp] But their role is limited to AVS only. If there is/was no AVS
  what would they be doing? Delta value written via SW on I2C would
  still get TWL working.
I dont think so. with SR, the prominence is higher, but normal voltage 
setting, + additional FSMs hooked to VC, VP make it's existance 
independent of AVS - mebbe this detail is just a technical nuance..


  And if you look into the omap_vdd_info you'd see what I meant.


data structure wise, yeah I think we'd have to evolve a bit, Pauls' 
voltage.c cleanup series is one of the tiny steps we have to take.


do feel free to propose any improvements and we can discuss in the ML.

[..]
--
Regards,
Nishanth Menon
--
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