aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-12-07 01:22:18 -0500
committerBryan Wu <cooloney@gmail.com>2014-01-27 20:28:49 -0500
commit01a7a063e8cf4bc09af2c02d28c12f3d72bf9649 (patch)
tree203bc7e800afe602eca8ff4edbbab02643f3c4fd /include/linux/mfd
parent33ca15325ff371be7f20be7534f5aa5b6a00b558 (diff)
leds: leds-mc13783: Remove duplicate field in platform data
LED platform data are overwhelmed by excessive field "max_cur" which just replicates few bits of "led_control" field. This patch removes this field and adds a definition for the current settings in the header. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/mc13xxx.h37
1 files changed, 28 insertions, 9 deletions
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index 67c17b5a6f44..ac2230561fc8 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -112,9 +112,6 @@ struct mc13xxx_led_platform_data {
112 int id; 112 int id;
113 const char *name; 113 const char *name;
114 const char *default_trigger; 114 const char *default_trigger;
115
116/* Three or two bits current selection depending on the led */
117 char max_current;
118}; 115};
119 116
120#define MAX_LED_CONTROL_REGS 6 117#define MAX_LED_CONTROL_REGS 6
@@ -123,7 +120,7 @@ struct mc13xxx_leds_platform_data {
123 struct mc13xxx_led_platform_data *led; 120 struct mc13xxx_led_platform_data *led;
124 int num_leds; 121 int num_leds;
125 122
126/* LED Control 0 */ 123/* MC13783 LED Control 0 */
127#define MC13783_LED_C0_ENABLE (1 << 0) 124#define MC13783_LED_C0_ENABLE (1 << 0)
128#define MC13783_LED_C0_TRIODE_MD (1 << 7) 125#define MC13783_LED_C0_TRIODE_MD (1 << 7)
129#define MC13783_LED_C0_TRIODE_AD (1 << 8) 126#define MC13783_LED_C0_TRIODE_AD (1 << 8)
@@ -131,21 +128,43 @@ struct mc13xxx_leds_platform_data {
131#define MC13783_LED_C0_BOOST (1 << 10) 128#define MC13783_LED_C0_BOOST (1 << 10)
132#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11) 129#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11)
133#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14) 130#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14)
134/* LED Control 1 */ 131/* MC13783 LED Control 1 */
135#define MC13783_LED_C1_TC1HALF (1 << 18) 132#define MC13783_LED_C1_TC1HALF (1 << 18)
136#define MC13783_LED_C1_SLEWLIM (1 << 23) 133#define MC13783_LED_C1_SLEWLIM (1 << 23)
137/* LED Control 2 */ 134/* MC13783 LED Control 2 */
135#define MC13783_LED_C2_CURRENT_MD(x) (((x) & 0x7) << 0)
136#define MC13783_LED_C2_CURRENT_AD(x) (((x) & 0x7) << 3)
137#define MC13783_LED_C2_CURRENT_KP(x) (((x) & 0x7) << 6)
138#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21) 138#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21)
139#define MC13783_LED_C2_SLEWLIM (1 << 23) 139#define MC13783_LED_C2_SLEWLIM (1 << 23)
140/* LED Control 3 */ 140/* MC13783 LED Control 3 */
141#define MC13783_LED_C3_CURRENT_R1(x) (((x) & 0x3) << 0)
142#define MC13783_LED_C3_CURRENT_G1(x) (((x) & 0x3) << 2)
143#define MC13783_LED_C3_CURRENT_B1(x) (((x) & 0x3) << 4)
141#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21) 144#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21)
142#define MC13783_LED_C3_TRIODE_TC1 (1 << 23) 145#define MC13783_LED_C3_TRIODE_TC1 (1 << 23)
143/* LED Control 4 */ 146/* MC13783 LED Control 4 */
147#define MC13783_LED_C4_CURRENT_R2(x) (((x) & 0x3) << 0)
148#define MC13783_LED_C4_CURRENT_G2(x) (((x) & 0x3) << 2)
149#define MC13783_LED_C4_CURRENT_B2(x) (((x) & 0x3) << 4)
144#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21) 150#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21)
145#define MC13783_LED_C4_TRIODE_TC2 (1 << 23) 151#define MC13783_LED_C4_TRIODE_TC2 (1 << 23)
146/* LED Control 5 */ 152/* MC13783 LED Control 5 */
153#define MC13783_LED_C5_CURRENT_R3(x) (((x) & 0x3) << 0)
154#define MC13783_LED_C5_CURRENT_G3(x) (((x) & 0x3) << 2)
155#define MC13783_LED_C5_CURRENT_B3(x) (((x) & 0x3) << 4)
147#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21) 156#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21)
148#define MC13783_LED_C5_TRIODE_TC3 (1 << 23) 157#define MC13783_LED_C5_TRIODE_TC3 (1 << 23)
158/* MC13892 LED Control 0 */
159#define MC13892_LED_C0_CURRENT_MD(x) (((x) & 0x7) << 9)
160#define MC13892_LED_C0_CURRENT_AD(x) (((x) & 0x7) << 21)
161/* MC13892 LED Control 1 */
162#define MC13892_LED_C1_CURRENT_KP(x) (((x) & 0x7) << 9)
163/* MC13892 LED Control 2 */
164#define MC13892_LED_C2_CURRENT_R(x) (((x) & 0x7) << 9)
165#define MC13892_LED_C2_CURRENT_G(x) (((x) & 0x7) << 21)
166/* MC13892 LED Control 3 */
167#define MC13892_LED_C3_CURRENT_B(x) (((x) & 0x7) << 9)
149 u32 led_control[MAX_LED_CONTROL_REGS]; 168 u32 led_control[MAX_LED_CONTROL_REGS];
150}; 169};
151 170