mfd: twl: define all feature flags in one place.
authorNeilBrown <neilb@suse.de>
Tue, 8 May 2012 19:43:59 +0000 (05:43 +1000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 9 May 2012 09:04:23 +0000 (10:04 +0100)
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>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/mfd/twl-core.c
include/linux/i2c/twl.h

index 7c2267e71f8b7f0e75fd2efeef472b85711f967c..6fc90befa79e415bbd377e978191b958abaf6fb1 100644 (file)
 #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? */
index 2463b61003336b0f176b5ed851aa8776a5202697..18fc937c867d381052cbbcf75e52a9ff4a59e73d 100644 (file)
@@ -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
  */
@@ -758,6 +756,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 */
 
 /*----------------------------------------------------------------------*/