diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2013-01-16 08:53:50 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-02-13 18:22:49 -0500 |
commit | 5d4e9bd79a5ab5bd4695d3becaa71da447a76a94 (patch) | |
tree | 1135e16a579f105c9eabc259fe4e3afaf129cfd0 /include/linux | |
parent | c6dc96467ad94e3fe848d883d3a5a7e18a387abd (diff) |
mfd: twl-core: Clean up module id lookup and definitions
Use enums for all module definitions:
twl_module_ids for common functionality among twl4030/twl6030
twl4030_module_ids for twl4030 specific ids
twl6030_module_ids for twl6030 specific ids
In this way the list can be managed easier when new functionality going to
be implemented.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2c/twl.h | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 1ff54b114efc..72adc8807912 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -39,51 +39,55 @@ | |||
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 | /* Module IDs for similar functionalities found in twl4030/twl6030 */ | ||
43 | enum twl_module_ids { | ||
44 | TWL_MODULE_USB, | ||
45 | TWL_MODULE_PIH, | ||
46 | TWL_MODULE_MAIN_CHARGE, | ||
47 | TWL_MODULE_PM_MASTER, | ||
48 | TWL_MODULE_PM_RECEIVER, | ||
49 | |||
50 | TWL_MODULE_RTC, | ||
51 | TWL_MODULE_PWM, | ||
52 | TWL_MODULE_LED, | ||
53 | TWL_MODULE_SECURED_REG, | ||
54 | |||
55 | TWL_MODULE_LAST, | ||
56 | }; | ||
57 | |||
58 | /* Modules only available in twl4030 series */ | ||
42 | enum twl4030_module_ids { | 59 | enum twl4030_module_ids { |
43 | TWL4030_MODULE_USB = 0, /* Slave 0 (i2c address 0x48) */ | 60 | TWL4030_MODULE_AUDIO_VOICE = TWL_MODULE_LAST, |
44 | TWL4030_MODULE_AUDIO_VOICE, /* Slave 1 (i2c address 0x49) */ | ||
45 | TWL4030_MODULE_GPIO, | 61 | TWL4030_MODULE_GPIO, |
46 | TWL4030_MODULE_INTBR, | 62 | TWL4030_MODULE_INTBR, |
47 | TWL4030_MODULE_PIH, | ||
48 | |||
49 | TWL4030_MODULE_TEST, | 63 | TWL4030_MODULE_TEST, |
50 | TWL4030_MODULE_KEYPAD, /* Slave 2 (i2c address 0x4a) */ | 64 | TWL4030_MODULE_KEYPAD, |
65 | |||
51 | TWL4030_MODULE_MADC, | 66 | TWL4030_MODULE_MADC, |
52 | TWL4030_MODULE_INTERRUPTS, | 67 | TWL4030_MODULE_INTERRUPTS, |
53 | TWL4030_MODULE_LED, | ||
54 | |||
55 | TWL4030_MODULE_MAIN_CHARGE, | ||
56 | TWL4030_MODULE_PRECHARGE, | 68 | TWL4030_MODULE_PRECHARGE, |
57 | TWL4030_MODULE_PWM0, | 69 | TWL4030_MODULE_BACKUP, |
58 | TWL4030_MODULE_PWM1, | 70 | TWL4030_MODULE_INT, |
59 | TWL4030_MODULE_PWMA, | ||
60 | 71 | ||
61 | TWL4030_MODULE_PWMB, | ||
62 | TWL5031_MODULE_ACCESSORY, | 72 | TWL5031_MODULE_ACCESSORY, |
63 | TWL5031_MODULE_INTERRUPTS, | 73 | TWL5031_MODULE_INTERRUPTS, |
64 | TWL4030_MODULE_BACKUP, /* Slave 3 (i2c address 0x4b) */ | ||
65 | TWL4030_MODULE_INT, | ||
66 | 74 | ||
67 | TWL4030_MODULE_PM_MASTER, | ||
68 | TWL4030_MODULE_PM_RECEIVER, | ||
69 | TWL4030_MODULE_RTC, | ||
70 | TWL4030_MODULE_SECURED_REG, | ||
71 | TWL4030_MODULE_LAST, | 75 | TWL4030_MODULE_LAST, |
72 | }; | 76 | }; |
73 | 77 | ||
74 | /* Similar functionalities implemented in TWL4030/6030 */ | 78 | /* Modules only available in twl6030 series */ |
75 | #define TWL_MODULE_USB TWL4030_MODULE_USB | 79 | enum twl6030_module_ids { |
76 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH | 80 | TWL6030_MODULE_ID0 = TWL_MODULE_LAST, |
77 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE | 81 | TWL6030_MODULE_ID1, |
78 | #define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER | 82 | TWL6030_MODULE_ID2, |
79 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER | 83 | TWL6030_MODULE_GPADC, |
80 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | 84 | TWL6030_MODULE_GASGAUGE, |
81 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 | 85 | |
82 | #define TWL_MODULE_LED TWL4030_MODULE_LED | 86 | TWL6030_MODULE_LAST, |
83 | 87 | }; | |
84 | #define TWL6030_MODULE_ID0 13 | 88 | |
85 | #define TWL6030_MODULE_ID1 14 | 89 | /* Until the clients has been converted to use TWL_MODULE_LED */ |
86 | #define TWL6030_MODULE_ID2 15 | 90 | #define TWL4030_MODULE_LED TWL_MODULE_LED |
87 | 91 | ||
88 | #define GPIO_INTR_OFFSET 0 | 92 | #define GPIO_INTR_OFFSET 0 |
89 | #define KEYPAD_INTR_OFFSET 1 | 93 | #define KEYPAD_INTR_OFFSET 1 |