Re: [PATCH 5/7] mfd: twl4030-power: Add support for board specific configuration

2014-05-21 Thread Lee Jones
> > > * Lee Jones  [140520 08:18]:
> > > > 
> > > > Ah, I forgot to Ack this last time, didn't I?
> > > > 
> > > >   Acked-by: Lee Jones 
> > > 
> > > Yeah, here's this one updated with your ack.
> > 
> > Has the code changed at all, or are you just reposting with my Ack
> > applied?
> 
> No changes, I just reposted this with your ack as you
> seemed to prefer for some of the other patches :)

Only for whole series re-submissions.  I'm not that lazy. :)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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 5/7] mfd: twl4030-power: Add support for board specific configuration

2014-05-21 Thread Tony Lindgren
* Lee Jones  [140521 02:19]:
> On Tue, 20 May 2014, Tony Lindgren wrote:
> 
> > * Lee Jones  [140520 08:18]:
> > > 
> > > Ah, I forgot to Ack this last time, didn't I?
> > > 
> > >   Acked-by: Lee Jones 
> > 
> > Yeah, here's this one updated with your ack.
> 
> Has the code changed at all, or are you just reposting with my Ack
> applied?

No changes, I just reposted this with your ack as you
seemed to prefer for some of the other patches :)

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 5/7] mfd: twl4030-power: Add support for board specific configuration

2014-05-21 Thread Lee Jones
On Tue, 20 May 2014, Tony Lindgren wrote:

> * Lee Jones  [140520 08:18]:
> > 
> > Ah, I forgot to Ack this last time, didn't I?
> > 
> >   Acked-by: Lee Jones 
> 
> Yeah, here's this one updated with your ack.

Has the code changed at all, or are you just reposting with my Ack
applied?

> 8< ---
> From: Tony Lindgren 
> Date: Tue, 20 May 2014 11:17:54 -0700
> Subject: [PATCH] mfd: twl4030-power: Add support for board specific 
> configuration
> 
> With the recommended twl4030 configuration added, we can now add
> board specific changes as modifications to the recommended
> configuration.
> 
> Note that the data is private to this driver, and the data must
> always have a NULL resource in the sentinel.
> 
> Cc: Peter De Schrijver 
> Cc: Samuel Ortiz 
> Acked-by: Lee Jones 
> Signed-off-by: Tony Lindgren 
> 
> --- a/drivers/mfd/twl4030-power.c
> +++ b/drivers/mfd/twl4030-power.c
> @@ -567,13 +567,34 @@ twl4030_power_configure_scripts(const struct 
> twl4030_power_data *pdata)
>   return 0;
>  }
>  
> +static void twl4030_patch_rconfig(struct twl4030_resconfig *common,
> +   struct twl4030_resconfig *board)
> +{
> + while (common->resource) {
> + struct twl4030_resconfig *b = board;
> +
> + while (b->resource) {
> + if (b->resource == common->resource) {
> + *common = *b;
> + break;
> + }
> + b++;
> + }
> + common++;
> + }
> +}
> +
>  static int
>  twl4030_power_configure_resources(const struct twl4030_power_data *pdata)
>  {
>   struct twl4030_resconfig *resconfig = pdata->resource_config;
> + struct twl4030_resconfig *boardconf = pdata->board_config;
>   int err;
>  
>   if (resconfig) {
> + if (boardconf)
> + twl4030_patch_rconfig(resconfig, boardconf);
> +
>   while (resconfig->resource) {
>   err = twl4030_configure_resource(resconfig);
>   if (err)
> --- a/include/linux/i2c/twl.h
> +++ b/include/linux/i2c/twl.h
> @@ -674,6 +674,7 @@ struct twl4030_power_data {
>   struct twl4030_script **scripts;
>   unsigned num;
>   struct twl4030_resconfig *resource_config;
> + struct twl4030_resconfig *board_config;
>  #define TWL4030_RESCONFIG_UNDEF  ((u8)-1)
>   bool use_poweroff;  /* Board is wired for TWL poweroff */
>  };

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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 5/7] mfd: twl4030-power: Add support for board specific configuration

2014-05-20 Thread Tony Lindgren
* Lee Jones  [140520 08:18]:
> 
> Ah, I forgot to Ack this last time, didn't I?
> 
>   Acked-by: Lee Jones 

Yeah, here's this one updated with your ack.

Regards,

Tony

8< ---
From: Tony Lindgren 
Date: Tue, 20 May 2014 11:17:54 -0700
Subject: [PATCH] mfd: twl4030-power: Add support for board specific 
configuration

With the recommended twl4030 configuration added, we can now add
board specific changes as modifications to the recommended
configuration.

Note that the data is private to this driver, and the data must
always have a NULL resource in the sentinel.

Cc: Peter De Schrijver 
Cc: Samuel Ortiz 
Acked-by: Lee Jones 
Signed-off-by: Tony Lindgren 

--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -567,13 +567,34 @@ twl4030_power_configure_scripts(const struct 
twl4030_power_data *pdata)
return 0;
 }
 
+static void twl4030_patch_rconfig(struct twl4030_resconfig *common,
+ struct twl4030_resconfig *board)
+{
+   while (common->resource) {
+   struct twl4030_resconfig *b = board;
+
+   while (b->resource) {
+   if (b->resource == common->resource) {
+   *common = *b;
+   break;
+   }
+   b++;
+   }
+   common++;
+   }
+}
+
 static int
 twl4030_power_configure_resources(const struct twl4030_power_data *pdata)
 {
struct twl4030_resconfig *resconfig = pdata->resource_config;
+   struct twl4030_resconfig *boardconf = pdata->board_config;
int err;
 
if (resconfig) {
+   if (boardconf)
+   twl4030_patch_rconfig(resconfig, boardconf);
+
while (resconfig->resource) {
err = twl4030_configure_resource(resconfig);
if (err)
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -674,6 +674,7 @@ struct twl4030_power_data {
struct twl4030_script **scripts;
unsigned num;
struct twl4030_resconfig *resource_config;
+   struct twl4030_resconfig *board_config;
 #define TWL4030_RESCONFIG_UNDEF((u8)-1)
bool use_poweroff;  /* Board is wired for TWL poweroff */
 };
--
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 5/7] mfd: twl4030-power: Add support for board specific configuration

2014-05-20 Thread Lee Jones
On Tue, 13 May 2014, Tony Lindgren wrote:

> With the recommended twl4030 configuration added, we can now add
> board specific changes as modifications to the recommended
> configuration.
> 
> Note that the data is private to this driver, and the data must
> always have a NULL resource in the sentinel.
> 
> Cc: Peter De Schrijver 
> Cc: Samuel Ortiz 
> Cc: Lee Jones 
> Signed-off-by: Tony Lindgren 
> ---
>  drivers/mfd/twl4030-power.c | 21 +
>  include/linux/i2c/twl.h |  1 +
>  2 files changed, 22 insertions(+)

Ah, I forgot to Ack this last time, didn't I?

  Acked-by: Lee Jones 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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