diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-11-13 03:28:48 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-11-21 10:08:02 -0500 |
commit | da059ecfc9f9d98556607c6d6db065aa3b7f162d (patch) | |
tree | 1378a6df2584381951a41bd3da14165c33699668 /include/linux/i2c | |
parent | 0e8f1398a388bbaa5ca965711b9ed5ac4794332d (diff) |
mfd: twl: Convert module id definitions to enums
Use enum list for the module definitions (TWL4030_MODULE_*) which will ease
up future work with the IDs.
At the same time group the IDs in block of five so it is easier to find the
ID we are looking for (to count the number they stand for).
At the same time define TWL_MODULE_LED so client drivers can switch to use
it as soon as it is possible.
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/i2c')
-rw-r--r-- | include/linux/i2c/twl.h | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 7278c72479d1..b1c44cccef31 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -39,39 +39,39 @@ | |||
39 | * address each module uses within a given i2c slave. | 39 | * address each module uses within a given i2c slave. |
40 | */ | 40 | */ |
41 | 41 | ||
42 | /* Slave 0 (i2c address 0x48) */ | 42 | enum twl4030_module_ids { |
43 | #define TWL4030_MODULE_USB 0x00 | 43 | TWL4030_MODULE_USB = 0, /* Slave 0 (i2c address 0x48) */ |
44 | 44 | TWL4030_MODULE_AUDIO_VOICE, /* Slave 1 (i2c address 0x49) */ | |
45 | /* Slave 1 (i2c address 0x49) */ | 45 | TWL4030_MODULE_GPIO, |
46 | #define TWL4030_MODULE_AUDIO_VOICE 0x01 | 46 | TWL4030_MODULE_INTBR, |
47 | #define TWL4030_MODULE_GPIO 0x02 | 47 | TWL4030_MODULE_PIH, |
48 | #define TWL4030_MODULE_INTBR 0x03 | 48 | |
49 | #define TWL4030_MODULE_PIH 0x04 | 49 | TWL4030_MODULE_TEST, |
50 | #define TWL4030_MODULE_TEST 0x05 | 50 | TWL4030_MODULE_KEYPAD, /* Slave 2 (i2c address 0x4a) */ |
51 | 51 | TWL4030_MODULE_MADC, | |
52 | /* Slave 2 (i2c address 0x4a) */ | 52 | TWL4030_MODULE_INTERRUPTS, |
53 | #define TWL4030_MODULE_KEYPAD 0x06 | 53 | TWL4030_MODULE_LED, |
54 | #define TWL4030_MODULE_MADC 0x07 | 54 | |
55 | #define TWL4030_MODULE_INTERRUPTS 0x08 | 55 | TWL4030_MODULE_MAIN_CHARGE, |
56 | #define TWL4030_MODULE_LED 0x09 | 56 | TWL4030_MODULE_PRECHARGE, |
57 | #define TWL4030_MODULE_MAIN_CHARGE 0x0A | 57 | TWL4030_MODULE_PWM0, |
58 | #define TWL4030_MODULE_PRECHARGE 0x0B | 58 | TWL4030_MODULE_PWM1, |
59 | #define TWL4030_MODULE_PWM0 0x0C | 59 | TWL4030_MODULE_PWMA, |
60 | #define TWL4030_MODULE_PWM1 0x0D | 60 | |
61 | #define TWL4030_MODULE_PWMA 0x0E | 61 | TWL4030_MODULE_PWMB, |
62 | #define TWL4030_MODULE_PWMB 0x0F | 62 | TWL5031_MODULE_ACCESSORY, |
63 | 63 | TWL5031_MODULE_INTERRUPTS, | |
64 | #define TWL5031_MODULE_ACCESSORY 0x10 | 64 | TWL4030_MODULE_BACKUP, /* Slave 3 (i2c address 0x4b) */ |
65 | #define TWL5031_MODULE_INTERRUPTS 0x11 | 65 | TWL4030_MODULE_INT, |
66 | 66 | ||
67 | /* Slave 3 (i2c address 0x4b) */ | 67 | TWL4030_MODULE_PM_MASTER, |
68 | #define TWL4030_MODULE_BACKUP 0x12 | 68 | TWL4030_MODULE_PM_RECEIVER, |
69 | #define TWL4030_MODULE_INT 0x13 | 69 | TWL4030_MODULE_RTC, |
70 | #define TWL4030_MODULE_PM_MASTER 0x14 | 70 | TWL4030_MODULE_SECURED_REG, |
71 | #define TWL4030_MODULE_PM_RECEIVER 0x15 | 71 | TWL4030_MODULE_LAST, |
72 | #define TWL4030_MODULE_RTC 0x16 | 72 | }; |
73 | #define TWL4030_MODULE_SECURED_REG 0x17 | ||
74 | 73 | ||
74 | /* Similar functionalities implemented in TWL4030/6030 */ | ||
75 | #define TWL_MODULE_USB TWL4030_MODULE_USB | 75 | #define TWL_MODULE_USB TWL4030_MODULE_USB |
76 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH | 76 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH |
77 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE | 77 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE |
@@ -79,6 +79,7 @@ | |||
79 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER | 79 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER |
80 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | 80 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC |
81 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 | 81 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 |
82 | #define TWL_MODULE_LED TWL4030_MODULE_LED | ||
82 | 83 | ||
83 | #define TWL6030_MODULE_ID0 0x0D | 84 | #define TWL6030_MODULE_ID0 0x0D |
84 | #define TWL6030_MODULE_ID1 0x0E | 85 | #define TWL6030_MODULE_ID1 0x0E |