diff options
author | Philippe Langlais <philippe.langlais@stericsson.com> | 2011-10-12 16:02:13 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:01:54 +0200 |
commit | d760d37cc5edeba38592c53b59cfe4055e7d9265 (patch) | |
tree | 8d233960d27b27995a842a4d6a21c8b1b78946e2 | |
parent | 668226ab486e373feca540bac7af3aa3de4f346b (diff) |
ab5500: leds: driver for ab5500 leds
Simple HV LED controller driver for AB5500v1.0 MFD chips
ST-Ericsson ID: WP 332221
ST-Ericsson Linux next: ER 336280
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: Ic787cd1a2277a4c5782dd18d3436cd95b763c81a
Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21898
Reviewed-by: QATEST
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r-- | arch/arm/mach-ux500/board-u5500.c | 62 |
1 files changed, 46 insertions, 16 deletions
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c index cf3cec3b401..50e0f1b26d9 100644 --- a/arch/arm/mach-ux500/board-u5500.c +++ b/arch/arm/mach-ux500/board-u5500.c @@ -15,6 +15,7 @@ #include <linux/led-lm3530.h> #include <../../../drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h> #include <linux/lsm303dlh.h> +#include <linux/leds-ab5500.h> #include <video/av8100.h> @@ -76,6 +77,49 @@ static struct av8100_platform_data av8100_plat_data = { /* + * leds LM3530 + */ +static struct lm3530_platform_data u5500_als_platform_data = { + .mode = LM3530_BL_MODE_MANUAL, + .als_input_mode = LM3530_INPUT_ALS1, + .max_current = LM3530_FS_CURR_26mA, + .pwm_pol_hi = true, + .als_avrg_time = LM3530_ALS_AVRG_TIME_512ms, + .brt_ramp_law = 1, /* Linear */ + .brt_ramp_fall = LM3530_RAMP_TIME_1ms, + .brt_ramp_rise = LM3530_RAMP_TIME_1ms, + .als1_resistor_sel = LM3530_ALS_IMPD_2_27kOhm, + .als2_resistor_sel = LM3530_ALS_IMPD_2_27kOhm, + .brt_val = 0x7F, /* Max brightness */ +}; + + +/* leds-ab5500 */ +static struct ab5500_hvleds_platform_data ab5500_hvleds_data = { + .hw_blink = false, + .leds = { + [0] = { + .name = "ab5500-hvled:channel-0:", + .led_id = 0, + .status = AB5500_LED_ON, + .max_current = 10, /* wrong value may damage h/w */ + }, + [1] = { + .name = "ab5500-hvled:channel-1:", + .led_id = 1, + .status = AB5500_LED_ON, + .max_current = 10, /* wrong value may damage h/w */ + }, + [2] { + .name = "ab5500-hvled:channel-2:", + .led_id = 2, + .status = AB5500_LED_ON, + .max_current = 10, /* wrong value may damage h/w */ + }, + }, +}; + +/* * I2C */ @@ -110,22 +154,6 @@ U5500_I2C_CONTROLLER(1, 0xe, 1, 1, 400000, 200, I2C_FREQ_MODE_FAST); U5500_I2C_CONTROLLER(2, 0xe, 1, 1, 400000, 200, I2C_FREQ_MODE_FAST); U5500_I2C_CONTROLLER(3, 0xe, 1, 1, 400000, 200, I2C_FREQ_MODE_FAST); -static struct lm3530_platform_data u5500_als_platform_data = { - .mode = LM3530_BL_MODE_MANUAL, - .als_input_mode = LM3530_INPUT_ALS1, - .max_current = LM3530_FS_CURR_26mA, - .pwm_pol_hi = true, - .als_avrg_time = LM3530_ALS_AVRG_TIME_512ms, - .brt_ramp_law = 1, /* Linear */ - .brt_ramp_fall = LM3530_RAMP_TIME_8s, - .brt_ramp_rise = LM3530_RAMP_TIME_8s, - .als1_resistor_sel = LM3530_ALS_IMPD_13_53kOhm, - .als2_resistor_sel = LM3530_ALS_IMPD_Z, - .als_vmin = 730, /* mV */ - .als_vmax = 1020, /* mV */ - .brt_val = 0x7F, /* Max brightness */ -}; - static struct i2c_board_info __initdata u5500_i2c1_devices[] = { { I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), @@ -257,6 +285,8 @@ static struct ab5500_platform_data ab5500_plf_data = { }, .pm_power_off = true, .regulator = &u5500_ab5500_regulator_data, + .dev_data[AB5500_DEVID_LEDS] = &ab5500_hvleds_data, + .dev_data_sz[AB5500_DEVID_LEDS] = sizeof(ab5500_hvleds_data), }; static struct platform_device u5500_ab5500_device = { |