提交 dd7b2a05 编写于 作者: P Philippe Langlais 提交者: Linus Walleij

mach-ux500: platform data for LP5521 leds driver

Signed-off-by: NPhilippe Langlais <philippe.langlais@linaro.org>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 a71b819b
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/mfd/ab8500.h> #include <linux/mfd/ab8500.h>
#include <linux/mfd/tc3589x.h> #include <linux/mfd/tc3589x.h>
#include <linux/leds-lp5521.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/gpio_keys.h> #include <linux/gpio_keys.h>
...@@ -138,14 +139,77 @@ static struct tc3589x_platform_data mop500_tc35892_data = { ...@@ -138,14 +139,77 @@ static struct tc3589x_platform_data mop500_tc35892_data = {
.irq_base = MOP500_EGPIO_IRQ_BASE, .irq_base = MOP500_EGPIO_IRQ_BASE,
}; };
static struct lp5521_led_config lp5521_pri_led[] = {
[0] = {
.chan_nr = 0,
.led_current = 0x2f,
.max_current = 0x5f,
},
[1] = {
.chan_nr = 1,
.led_current = 0x2f,
.max_current = 0x5f,
},
[2] = {
.chan_nr = 2,
.led_current = 0x2f,
.max_current = 0x5f,
},
};
static struct lp5521_platform_data __initdata lp5521_pri_data = {
.label = "lp5521_pri",
.led_config = &lp5521_pri_led[0],
.num_channels = 3,
.clock_mode = LP5521_CLOCK_EXT,
};
static struct lp5521_led_config lp5521_sec_led[] = {
[0] = {
.chan_nr = 0,
.led_current = 0x2f,
.max_current = 0x5f,
},
[1] = {
.chan_nr = 1,
.led_current = 0x2f,
.max_current = 0x5f,
},
[2] = {
.chan_nr = 2,
.led_current = 0x2f,
.max_current = 0x5f,
},
};
static struct lp5521_platform_data __initdata lp5521_sec_data = {
.label = "lp5521_sec",
.led_config = &lp5521_sec_led[0],
.num_channels = 3,
.clock_mode = LP5521_CLOCK_EXT,
};
static struct i2c_board_info mop500_i2c0_devices[] = { static struct i2c_board_info mop500_i2c0_devices[] = {
{ {
I2C_BOARD_INFO("tc3589x", 0x42), I2C_BOARD_INFO("tc3589x", 0x42),
.irq = NOMADIK_GPIO_TO_IRQ(217), .irq = NOMADIK_GPIO_TO_IRQ(217),
.platform_data = &mop500_tc35892_data, .platform_data = &mop500_tc35892_data,
}, },
}; };
static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
{
/* lp5521 LED driver, 1st device */
I2C_BOARD_INFO("lp5521", 0x33),
.platform_data = &lp5521_pri_data,
},
{
/* lp5521 LED driver, 2st device */
I2C_BOARD_INFO("lp5521", 0x34),
.platform_data = &lp5521_sec_data,
},
};
#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \
static struct nmk_i2c_controller u8500_i2c##id##_data = { \ static struct nmk_i2c_controller u8500_i2c##id##_data = { \
/* \ /* \
...@@ -266,6 +330,8 @@ static void __init u8500_init_machine(void) ...@@ -266,6 +330,8 @@ static void __init u8500_init_machine(void)
i2c_register_board_info(0, mop500_i2c0_devices, i2c_register_board_info(0, mop500_i2c0_devices,
ARRAY_SIZE(mop500_i2c0_devices)); ARRAY_SIZE(mop500_i2c0_devices));
i2c_register_board_info(2, mop500_i2c2_devices,
ARRAY_SIZE(mop500_i2c2_devices));
} }
MACHINE_START(U8500, "ST-Ericsson MOP500 platform") MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册