diff options
author | Philippe Langlais <philippe.langlais@linaro.org> | 2011-01-12 05:26:20 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2011-03-14 09:05:11 -0400 |
commit | dd7b2a055622e23c9354bd9b081973c9a15ac639 (patch) | |
tree | 593e25e50d5dfc934806b15e5adc2e9ab9e6f42c /arch/arm/mach-ux500 | |
parent | a71b819b6edfb31d6866d084167583bd92f4ad29 (diff) |
mach-ux500: platform data for LP5521 leds driver
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index dce68788be39..daebcb4ba709 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
21 | #include <linux/mfd/ab8500.h> | 21 | #include <linux/mfd/ab8500.h> |
22 | #include <linux/mfd/tc3589x.h> | 22 | #include <linux/mfd/tc3589x.h> |
23 | #include <linux/leds-lp5521.h> | ||
23 | #include <linux/input.h> | 24 | #include <linux/input.h> |
24 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
25 | 26 | ||
@@ -138,14 +139,77 @@ static struct tc3589x_platform_data mop500_tc35892_data = { | |||
138 | .irq_base = MOP500_EGPIO_IRQ_BASE, | 139 | .irq_base = MOP500_EGPIO_IRQ_BASE, |
139 | }; | 140 | }; |
140 | 141 | ||
142 | static struct lp5521_led_config lp5521_pri_led[] = { | ||
143 | [0] = { | ||
144 | .chan_nr = 0, | ||
145 | .led_current = 0x2f, | ||
146 | .max_current = 0x5f, | ||
147 | }, | ||
148 | [1] = { | ||
149 | .chan_nr = 1, | ||
150 | .led_current = 0x2f, | ||
151 | .max_current = 0x5f, | ||
152 | }, | ||
153 | [2] = { | ||
154 | .chan_nr = 2, | ||
155 | .led_current = 0x2f, | ||
156 | .max_current = 0x5f, | ||
157 | }, | ||
158 | }; | ||
159 | |||
160 | static struct lp5521_platform_data __initdata lp5521_pri_data = { | ||
161 | .label = "lp5521_pri", | ||
162 | .led_config = &lp5521_pri_led[0], | ||
163 | .num_channels = 3, | ||
164 | .clock_mode = LP5521_CLOCK_EXT, | ||
165 | }; | ||
166 | |||
167 | static struct lp5521_led_config lp5521_sec_led[] = { | ||
168 | [0] = { | ||
169 | .chan_nr = 0, | ||
170 | .led_current = 0x2f, | ||
171 | .max_current = 0x5f, | ||
172 | }, | ||
173 | [1] = { | ||
174 | .chan_nr = 1, | ||
175 | .led_current = 0x2f, | ||
176 | .max_current = 0x5f, | ||
177 | }, | ||
178 | [2] = { | ||
179 | .chan_nr = 2, | ||
180 | .led_current = 0x2f, | ||
181 | .max_current = 0x5f, | ||
182 | }, | ||
183 | }; | ||
184 | |||
185 | static struct lp5521_platform_data __initdata lp5521_sec_data = { | ||
186 | .label = "lp5521_sec", | ||
187 | .led_config = &lp5521_sec_led[0], | ||
188 | .num_channels = 3, | ||
189 | .clock_mode = LP5521_CLOCK_EXT, | ||
190 | }; | ||
191 | |||
141 | static struct i2c_board_info mop500_i2c0_devices[] = { | 192 | static struct i2c_board_info mop500_i2c0_devices[] = { |
142 | { | 193 | { |
143 | I2C_BOARD_INFO("tc3589x", 0x42), | 194 | I2C_BOARD_INFO("tc3589x", 0x42), |
144 | .irq = NOMADIK_GPIO_TO_IRQ(217), | 195 | .irq = NOMADIK_GPIO_TO_IRQ(217), |
145 | .platform_data = &mop500_tc35892_data, | 196 | .platform_data = &mop500_tc35892_data, |
146 | }, | 197 | }, |
147 | }; | 198 | }; |
148 | 199 | ||
200 | static struct i2c_board_info __initdata mop500_i2c2_devices[] = { | ||
201 | { | ||
202 | /* lp5521 LED driver, 1st device */ | ||
203 | I2C_BOARD_INFO("lp5521", 0x33), | ||
204 | .platform_data = &lp5521_pri_data, | ||
205 | }, | ||
206 | { | ||
207 | /* lp5521 LED driver, 2st device */ | ||
208 | I2C_BOARD_INFO("lp5521", 0x34), | ||
209 | .platform_data = &lp5521_sec_data, | ||
210 | }, | ||
211 | }; | ||
212 | |||
149 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ | 213 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ |
150 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ | 214 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ |
151 | /* \ | 215 | /* \ |
@@ -266,6 +330,8 @@ static void __init u8500_init_machine(void) | |||
266 | 330 | ||
267 | i2c_register_board_info(0, mop500_i2c0_devices, | 331 | i2c_register_board_info(0, mop500_i2c0_devices, |
268 | ARRAY_SIZE(mop500_i2c0_devices)); | 332 | ARRAY_SIZE(mop500_i2c0_devices)); |
333 | i2c_register_board_info(2, mop500_i2c2_devices, | ||
334 | ARRAY_SIZE(mop500_i2c2_devices)); | ||
269 | } | 335 | } |
270 | 336 | ||
271 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | 337 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") |