Re: [PATCH] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-12 Thread Peter Ujfalusi
On 07/11/2013 05:45 PM, Peter Ujfalusi wrote:
>> We could get rid of all the #ifdef from the code that way. OMAP3 is the
>> only platform that still depends on this - Further, with this change,
> 
> Yep, I can do that. I'll send a separate patch to do this.

Now that I have looked at this: we might need to wait a bit and clean up other
files first: if we compile twl-common only if OMAP3 is selected, a build for
OMAP4/5 only will break due to missing symbol in pm.c (omap_pmic_late_init is
missing).
I could add another set of #ifdef there, but it defeats the point IMHO.

-- 
Péter
--
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] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-12 Thread Peter Ujfalusi
On 07/11/2013 06:35 PM, Nishanth Menon wrote:
> right - now that we removed the set_voltage/get_voltage custom code,
> there are no longer any way the code introduced in the commit can be
> exercised.

If we boot with DT (which is the case with OMAP4/5) this part was not even
executed, so the custom callbacks were not added from here for OMAP4. I might
be wrong here...

-- 
Péter
--
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] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-12 Thread Tony Lindgren
* Peter Ujfalusi  [130712 01:20]:
> On 07/12/2013 09:26 AM, Tony Lindgren wrote:
> > * Peter Ujfalusi  [130711 07:30]:
> >> OMAP4 no longer boots in legacy mode so the code here is no longer used.
> >>
> >> Signed-off-by: Peter Ujfalusi 
> >> ---
> >>  arch/arm/mach-omap2/twl-common.c | 332 
> >> ++-
> >>  arch/arm/mach-omap2/twl-common.h |   8 -
> >>  2 files changed, 12 insertions(+), 328 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-omap2/twl-common.c 
> >> b/arch/arm/mach-omap2/twl-common.c
> >> index c05898f..932dea7 100644
> >> --- a/arch/arm/mach-omap2/twl-common.c
> >> +++ b/arch/arm/mach-omap2/twl-common.c
> >> @@ -38,20 +38,6 @@ static struct i2c_board_info __initdata 
> >> pmic_i2c_board_info = {
> >>.flags  = I2C_CLIENT_WAKE,
> >>  };
> >>  
> >> -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
> >> -static int twl_set_voltage(void *data, int target_uV)
> >> -{
> >> -  struct voltagedomain *voltdm = (struct voltagedomain *)data;
> >> -  return voltdm_scale(voltdm, target_uV);
> >> -}
> >> -
> >> -static int twl_get_voltage(void *data)
> >> -{
> >> -  struct voltagedomain *voltdm = (struct voltagedomain *)data;
> >> -  return voltdm_get_voltage(voltdm);
> >> -}
> >> -#endif
> > 
> > Looks like the code above is also needed for omap3 based on the
> > if defined?
> 
> Yes it is still needed for OMAP3 when booting in legacy. I have moved these
> two function down within the #if defined(CONFIG_ARCH_OMAP3) :
> 
>  #if defined(CONFIG_ARCH_OMAP3)
> @@ -189,6 +160,18 @@ static struct regulator_init_data omap3_vdd2 = {
>   .consumer_supplies  = omap3_vdd2_supply,
>  };
> 
> +static int twl_set_voltage(void *data, int target_uV)
> +{
> + struct voltagedomain *voltdm = (struct voltagedomain *)data;
> + return voltdm_scale(voltdm, target_uV);
> +}
> +
> +static int twl_get_voltage(void *data)
> +{
> + struct voltagedomain *voltdm = (struct voltagedomain *)data;
> + return voltdm_get_voltage(voltdm);
> +}
> +
>  static struct twl_regulator_driver_data omap3_vdd1_drvdata = {
>   .get_voltage = twl_get_voltage,
>   .set_voltage = twl_set_voltage,
> @@ -235,297 +218,6 @@ void __init omap3_pmic_get_config(struct
> twl4030_platform_data *pmic_data,
>  }
>  #endif /* CONFIG_ARCH_OMAP3 */

Oh OK sorry I missed that while glancing over it.

Regards,

Tony
--
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] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-12 Thread Peter Ujfalusi
On 07/12/2013 09:26 AM, Tony Lindgren wrote:
> * Peter Ujfalusi  [130711 07:30]:
>> OMAP4 no longer boots in legacy mode so the code here is no longer used.
>>
>> Signed-off-by: Peter Ujfalusi 
>> ---
>>  arch/arm/mach-omap2/twl-common.c | 332 
>> ++-
>>  arch/arm/mach-omap2/twl-common.h |   8 -
>>  2 files changed, 12 insertions(+), 328 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/twl-common.c 
>> b/arch/arm/mach-omap2/twl-common.c
>> index c05898f..932dea7 100644
>> --- a/arch/arm/mach-omap2/twl-common.c
>> +++ b/arch/arm/mach-omap2/twl-common.c
>> @@ -38,20 +38,6 @@ static struct i2c_board_info __initdata 
>> pmic_i2c_board_info = {
>>  .flags  = I2C_CLIENT_WAKE,
>>  };
>>  
>> -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
>> -static int twl_set_voltage(void *data, int target_uV)
>> -{
>> -struct voltagedomain *voltdm = (struct voltagedomain *)data;
>> -return voltdm_scale(voltdm, target_uV);
>> -}
>> -
>> -static int twl_get_voltage(void *data)
>> -{
>> -struct voltagedomain *voltdm = (struct voltagedomain *)data;
>> -return voltdm_get_voltage(voltdm);
>> -}
>> -#endif
> 
> Looks like the code above is also needed for omap3 based on the
> if defined?

Yes it is still needed for OMAP3 when booting in legacy. I have moved these
two function down within the #if defined(CONFIG_ARCH_OMAP3) :

 #if defined(CONFIG_ARCH_OMAP3)
@@ -189,6 +160,18 @@ static struct regulator_init_data omap3_vdd2 = {
.consumer_supplies  = omap3_vdd2_supply,
 };

+static int twl_set_voltage(void *data, int target_uV)
+{
+   struct voltagedomain *voltdm = (struct voltagedomain *)data;
+   return voltdm_scale(voltdm, target_uV);
+}
+
+static int twl_get_voltage(void *data)
+{
+   struct voltagedomain *voltdm = (struct voltagedomain *)data;
+   return voltdm_get_voltage(voltdm);
+}
+
 static struct twl_regulator_driver_data omap3_vdd1_drvdata = {
.get_voltage = twl_get_voltage,
.set_voltage = twl_set_voltage,
@@ -235,297 +218,6 @@ void __init omap3_pmic_get_config(struct
twl4030_platform_data *pmic_data,
 }
 #endif /* CONFIG_ARCH_OMAP3 */


-- 
Péter
--
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] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-12 Thread Tony Lindgren
* Peter Ujfalusi  [130711 07:30]:
> OMAP4 no longer boots in legacy mode so the code here is no longer used.
> 
> Signed-off-by: Peter Ujfalusi 
> ---
>  arch/arm/mach-omap2/twl-common.c | 332 
> ++-
>  arch/arm/mach-omap2/twl-common.h |   8 -
>  2 files changed, 12 insertions(+), 328 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/twl-common.c 
> b/arch/arm/mach-omap2/twl-common.c
> index c05898f..932dea7 100644
> --- a/arch/arm/mach-omap2/twl-common.c
> +++ b/arch/arm/mach-omap2/twl-common.c
> @@ -38,20 +38,6 @@ static struct i2c_board_info __initdata 
> pmic_i2c_board_info = {
>   .flags  = I2C_CLIENT_WAKE,
>  };
>  
> -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
> -static int twl_set_voltage(void *data, int target_uV)
> -{
> - struct voltagedomain *voltdm = (struct voltagedomain *)data;
> - return voltdm_scale(voltdm, target_uV);
> -}
> -
> -static int twl_get_voltage(void *data)
> -{
> - struct voltagedomain *voltdm = (struct voltagedomain *)data;
> - return voltdm_get_voltage(voltdm);
> -}
> -#endif

Looks like the code above is also needed for omap3 based on the
if defined?

Tony
--
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] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-11 Thread Nishanth Menon
On 17:45-20130711, Peter Ujfalusi wrote:
> On 07/11/2013 04:59 PM, Nishanth Menon wrote:
> > On 16:23-20130711, Peter Ujfalusi wrote:
> >> OMAP4 no longer boots in legacy mode so the code here is no longer used.
> >>
> >> Signed-off-by: Peter Ujfalusi 
> >> ---
> >>  arch/arm/mach-omap2/twl-common.c | 332 
> >> ++-
> >>  arch/arm/mach-omap2/twl-common.h |   8 -
> >>  2 files changed, 12 insertions(+), 328 deletions(-)
> > Could we modify the Makefile and build twl-common.o only for
> > CONFIG_ARCH_OMAP3?
> > 
> > We could get rid of all the #ifdef from the code that way. OMAP3 is the
> > only platform that still depends on this - Further, with this change,
> 
> Yep, I can do that. I'll send a separate patch to do this.
> 
> > commit 34a38440689b06a515104d668494e0ff8a4e1537
> > (regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators)
> > will need a relook as well. currently part of the discussion with Mark
> > in [1]
> > 
> > [1] http://marc.info/?t=13718501633&r=1&w=2
> 
> I don't see anything touching twl-common.c/h in the series.
> But at the end we should get rid of the legacy support in all of the drivers
> aimed for OMAP4+ gradually since it is pointless to keep dead code. Emphasis
> on gradually ;)
right - now that we removed the set_voltage/get_voltage custom code,
there are no longer any way the code introduced in the commit can be
exercised.

-- 
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: [PATCH] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-11 Thread Peter Ujfalusi
On 07/11/2013 04:59 PM, Nishanth Menon wrote:
> On 16:23-20130711, Peter Ujfalusi wrote:
>> OMAP4 no longer boots in legacy mode so the code here is no longer used.
>>
>> Signed-off-by: Peter Ujfalusi 
>> ---
>>  arch/arm/mach-omap2/twl-common.c | 332 
>> ++-
>>  arch/arm/mach-omap2/twl-common.h |   8 -
>>  2 files changed, 12 insertions(+), 328 deletions(-)
> Could we modify the Makefile and build twl-common.o only for
> CONFIG_ARCH_OMAP3?
> 
> We could get rid of all the #ifdef from the code that way. OMAP3 is the
> only platform that still depends on this - Further, with this change,

Yep, I can do that. I'll send a separate patch to do this.

> commit 34a38440689b06a515104d668494e0ff8a4e1537
> (regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators)
> will need a relook as well. currently part of the discussion with Mark
> in [1]
> 
> [1] http://marc.info/?t=13718501633&r=1&w=2

I don't see anything touching twl-common.c/h in the series.
But at the end we should get rid of the legacy support in all of the drivers
aimed for OMAP4+ gradually since it is pointless to keep dead code. Emphasis
on gradually ;)

-- 
Péter
--
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] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-11 Thread Nishanth Menon
On 16:23-20130711, Peter Ujfalusi wrote:
> OMAP4 no longer boots in legacy mode so the code here is no longer used.
> 
> Signed-off-by: Peter Ujfalusi 
> ---
>  arch/arm/mach-omap2/twl-common.c | 332 
> ++-
>  arch/arm/mach-omap2/twl-common.h |   8 -
>  2 files changed, 12 insertions(+), 328 deletions(-)
Could we modify the Makefile and build twl-common.o only for
CONFIG_ARCH_OMAP3?

We could get rid of all the #ifdef from the code that way. OMAP3 is the
only platform that still depends on this - Further, with this change,

commit 34a38440689b06a515104d668494e0ff8a4e1537
(regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators)
will need a relook as well. currently part of the discussion with Mark
in [1]


[1] http://marc.info/?t=13718501633&r=1&w=2


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


[PATCH] ARM: OMAP2+: twl-common: Remove code for twl6030 and twl6040 setup for legacy boot

2013-07-11 Thread Peter Ujfalusi
OMAP4 no longer boots in legacy mode so the code here is no longer used.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/mach-omap2/twl-common.c | 332 ++-
 arch/arm/mach-omap2/twl-common.h |   8 -
 2 files changed, 12 insertions(+), 328 deletions(-)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index c05898f..932dea7 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -38,20 +38,6 @@ static struct i2c_board_info __initdata pmic_i2c_board_info 
= {
.flags  = I2C_CLIENT_WAKE,
 };
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
-static int twl_set_voltage(void *data, int target_uV)
-{
-   struct voltagedomain *voltdm = (struct voltagedomain *)data;
-   return voltdm_scale(voltdm, target_uV);
-}
-
-static int twl_get_voltage(void *data)
-{
-   struct voltagedomain *voltdm = (struct voltagedomain *)data;
-   return voltdm_get_voltage(voltdm);
-}
-#endif
-
 void __init omap_pmic_init(int bus, u32 clkrate,
   const char *pmic_type, int pmic_irq,
   struct twl4030_platform_data *pmic_data)
@@ -65,20 +51,6 @@ void __init omap_pmic_init(int bus, u32 clkrate,
omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
 }
 
-void __init omap4_pmic_init(const char *pmic_type,
-   struct twl4030_platform_data *pmic_data,
-   struct i2c_board_info *devices, int nr_devices)
-{
-   /* PMIC part*/
-   omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | 
OMAP_PIN_OFF_WAKEUPENABLE);
-   omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT);
-   omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, 
pmic_data);
-
-   /* Register additional devices on i2c1 bus if needed */
-   if (devices)
-   i2c_register_board_info(1, devices, nr_devices);
-}
-
 void __init omap_pmic_late_init(void)
 {
/* Init the OMAP TWL parameters (if PMIC has been registerd) */
@@ -86,7 +58,6 @@ void __init omap_pmic_late_init(void)
return;
 
omap3_twl_init();
-   omap4_twl_init();
 }
 
 #if defined(CONFIG_ARCH_OMAP3)
@@ -189,6 +160,18 @@ static struct regulator_init_data omap3_vdd2 = {
.consumer_supplies  = omap3_vdd2_supply,
 };
 
+static int twl_set_voltage(void *data, int target_uV)
+{
+   struct voltagedomain *voltdm = (struct voltagedomain *)data;
+   return voltdm_scale(voltdm, target_uV);
+}
+
+static int twl_get_voltage(void *data)
+{
+   struct voltagedomain *voltdm = (struct voltagedomain *)data;
+   return voltdm_get_voltage(voltdm);
+}
+
 static struct twl_regulator_driver_data omap3_vdd1_drvdata = {
.get_voltage = twl_get_voltage,
.set_voltage = twl_set_voltage,
@@ -235,297 +218,6 @@ void __init omap3_pmic_get_config(struct 
twl4030_platform_data *pmic_data,
 }
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#if defined(CONFIG_ARCH_OMAP4)
-static struct twl4030_usb_data omap4_usb_pdata = {
-};
-
-static struct regulator_consumer_supply omap4_vdda_hdmi_dac_supplies[] = {
-   REGULATOR_SUPPLY("vdda_hdmi_dac", "omapdss_hdmi"),
-};
-
-static struct regulator_init_data omap4_vdac_idata = {
-   .constraints = {
-   .min_uV = 180,
-   .max_uV = 180,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask = REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-   .num_consumer_supplies  = ARRAY_SIZE(omap4_vdda_hdmi_dac_supplies),
-   .consumer_supplies  = omap4_vdda_hdmi_dac_supplies,
-   .supply_regulator   = "V2V1",
-};
-
-static struct regulator_init_data omap4_vaux2_idata = {
-   .constraints = {
-   .min_uV = 120,
-   .max_uV = 280,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
-static struct regulator_init_data omap4_vaux3_idata = {
-   .constraints = {
-   .min_uV = 100,
-   .max_uV = 300,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATO