Mailing List Archive

[PATCH 1/2] twl-regulator: define all feature flags in one place.
twl-regulator has a collection of feature flags, some defined
in twl-core.c and one defined in i2c/twl.h.
This is confusing for anyone adding a new feature flag.

So collect them together and place them in twl.h immediately
after the structure in which they are initially set.

Signed-off-by: NeilBrown <neilb@suse.de>
---

drivers/mfd/twl-core.c | 7 -------
include/linux/i2c/twl.h | 8 ++++++--
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 4cbf285..269b296 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -224,13 +224,6 @@
#define HIGH_PERF_SQ (1 << 3)
#define CK32K_LOWPWR_EN (1 << 7)

-
-/* chip-specific feature flags, for i2c_device_id.driver_data */
-#define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */
-#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */
-#define TWL5031 BIT(2) /* twl5031 has different registers */
-#define TWL6030_CLASS BIT(3) /* TWL6030 class */
-
/*----------------------------------------------------------------------*/

/* is driver active, bound to a chip? */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index b526031..88e8cd8 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -171,8 +171,6 @@ static inline int twl_class_is_ ##class(void) \
TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
TWL_CLASS_IS(6030, TWL6030_CLASS_ID)

-#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */
-
/*
* Read and write single 8-bit registers
*/
@@ -748,6 +746,12 @@ struct twl_regulator_driver_data {
void *data;
unsigned long features;
};
+/* chip-specific feature flags, for twl_regulator_driver_data.features */
+#define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */
+#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */
+#define TWL5031 BIT(2) /* twl5031 has different registers */
+#define TWL6030_CLASS BIT(3) /* TWL6030 class */
+#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */

/*----------------------------------------------------------------------*/



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] twl-regulator: define all feature flags in one place. [ In reply to ]
On Wed, May 02, 2012 at 06:44:50AM +1000, NeilBrown wrote:
> twl-regulator has a collection of feature flags, some defined
> in twl-core.c and one defined in i2c/twl.h.
> This is confusing for anyone adding a new feature flag.
>
> So collect them together and place them in twl.h immediately
> after the structure in which they are initially set.

Please remember to always CC maintainers on patches and always use
subject lines appropriate for the subsystem. Adding Samuel since this
is not a regulator patch.

> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>
> drivers/mfd/twl-core.c | 7 -------
> include/linux/i2c/twl.h | 8 ++++++--
> 2 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index 4cbf285..269b296 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -224,13 +224,6 @@
> #define HIGH_PERF_SQ (1 << 3)
> #define CK32K_LOWPWR_EN (1 << 7)
>
> -
> -/* chip-specific feature flags, for i2c_device_id.driver_data */
> -#define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */
> -#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */
> -#define TWL5031 BIT(2) /* twl5031 has different registers */
> -#define TWL6030_CLASS BIT(3) /* TWL6030 class */
> -
> /*----------------------------------------------------------------------*/
>
> /* is driver active, bound to a chip? */
> diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
> index b526031..88e8cd8 100644
> --- a/include/linux/i2c/twl.h
> +++ b/include/linux/i2c/twl.h
> @@ -171,8 +171,6 @@ static inline int twl_class_is_ ##class(void) \
> TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
> TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
>
> -#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */
> -
> /*
> * Read and write single 8-bit registers
> */
> @@ -748,6 +746,12 @@ struct twl_regulator_driver_data {
> void *data;
> unsigned long features;
> };
> +/* chip-specific feature flags, for twl_regulator_driver_data.features */
> +#define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */
> +#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */
> +#define TWL5031 BIT(2) /* twl5031 has different registers */
> +#define TWL6030_CLASS BIT(3) /* TWL6030 class */
> +#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */
>
> /*----------------------------------------------------------------------*/
>
>
>
Re: [PATCH 1/2] twl-regulator: define all feature flags in one place. [ In reply to ]
Hi Neil,

On Wed, May 02, 2012 at 10:08:49AM +0100, Mark Brown wrote:
> On Wed, May 02, 2012 at 06:44:50AM +1000, NeilBrown wrote:
> > twl-regulator has a collection of feature flags, some defined
> > in twl-core.c and one defined in i2c/twl.h.
> > This is confusing for anyone adding a new feature flag.
> >
> > So collect them together and place them in twl.h immediately
> > after the structure in which they are initially set.
>
> Please remember to always CC maintainers on patches and always use
> subject lines appropriate for the subsystem. Adding Samuel since this
> is not a regulator patch.
Could you please re-send this patch to me ?

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] twl-regulator: define all feature flags in one place. [ In reply to ]
On Wed, May 09, 2012 at 09:50:41PM +0200, Samuel Ortiz wrote:

> Could you please re-send this patch to me ?

Neil did actually resend this the other day as the regulator bit needed
rebasing to current regulator code - I ended up applying it since it
looked like you'd missed it after you went through things the other day
and the main thing was the regulator change based off it but I can
easily drop the patches again if that's a problem.