aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2011-07-25 20:13:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 23:57:15 -0400
commitb09628ef56352a77bcf38e314869a8205c21a756 (patch)
treee2820312f7710203236bf57901fd42110f3fa489 /arch/arm
parent40b1445b1b6afc1ddac6ac31f4533277a0fb75dc (diff)
mach-ux500: add lm3530 ALS platform data for U5500
From: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> platform data for simple backlight driver for LM3530 in the u5500 platform Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Lee Jones <lee.jones@linaro.org> Cc: Russell King <linux@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-ux500/board-u5500.c84
1 files changed, 83 insertions, 1 deletions
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
index 44fd3b5c33ec..e58f0f562426 100644
--- a/arch/arm/mach-ux500/board-u5500.c
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -10,16 +10,97 @@
10#include <linux/amba/bus.h> 10#include <linux/amba/bus.h>
11#include <linux/gpio.h> 11#include <linux/gpio.h>
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/i2c.h>
13 14
14#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16 17
18#include <plat/pincfg.h>
19#include <plat/i2c.h>
20
17#include <mach/hardware.h> 21#include <mach/hardware.h>
18#include <mach/devices.h> 22#include <mach/devices.h>
19#include <mach/setup.h> 23#include <mach/setup.h>
20 24
25#include "pins-db5500.h"
21#include "devices-db5500.h" 26#include "devices-db5500.h"
27#include <linux/led-lm3530.h>
28
29/*
30 * GPIO
31 */
32
33static pin_cfg_t u5500_pins[] = {
34 /* I2C */
35 GPIO218_I2C2_SCL | PIN_INPUT_PULLUP,
36 GPIO219_I2C2_SDA | PIN_INPUT_PULLUP,
37
38 /* DISPLAY_ENABLE */
39 GPIO226_GPIO | PIN_OUTPUT_LOW,
40
41 /* Backlight Enbale */
42 GPIO224_GPIO | PIN_OUTPUT_HIGH,
43};
44/*
45 * I2C
46 */
47
48#define U5500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \
49static struct nmk_i2c_controller u5500_i2c##id##_data = { \
50 /* \
51 * slave data setup time, which is \
52 * 250 ns,100ns,10ns which is 14,6,2 \
53 * respectively for a 48 Mhz \
54 * i2c clock \
55 */ \
56 .slsu = _slsu, \
57 /* Tx FIFO threshold */ \
58 .tft = _tft, \
59 /* Rx FIFO threshold */ \
60 .rft = _rft, \
61 /* std. mode operation */ \
62 .clk_freq = clk, \
63 .sm = _sm, \
64}
65/*
66 * The board uses TODO <3> i2c controllers, initialize all of
67 * them with slave data setup time of 250 ns,
68 * Tx & Rx FIFO threshold values as 1 and standard
69 * mode of operation
70 */
71
72U5500_I2C_CONTROLLER(2, 0xe, 1, 1, 400000, I2C_FREQ_MODE_FAST);
73
74static struct lm3530_platform_data u5500_als_platform_data = {
75 .mode = LM3530_BL_MODE_MANUAL,
76 .als_input_mode = LM3530_INPUT_ALS1,
77 .max_current = LM3530_FS_CURR_26mA,
78 .pwm_pol_hi = true,
79 .als_avrg_time = LM3530_ALS_AVRG_TIME_512ms,
80 .brt_ramp_law = 1, /* Linear */
81 .brt_ramp_fall = LM3530_RAMP_TIME_8s,
82 .brt_ramp_rise = LM3530_RAMP_TIME_8s,
83 .als1_resistor_sel = LM3530_ALS_IMPD_13_53kOhm,
84 .als2_resistor_sel = LM3530_ALS_IMPD_Z,
85 .als_vmin = 730, /* mV */
86 .als_vmax = 1020, /* mV */
87 .brt_val = 0x7F, /* Max brightness */
88};
22 89
90
91static struct i2c_board_info __initdata u5500_i2c2_devices[] = {
92 {
93 /* Backlight */
94 I2C_BOARD_INFO("lm3530-led", 0x36),
95 .platform_data = &u5500_als_platform_data,
96 },
97};
98
99static void __init u5500_i2c_init(void)
100{
101 db5500_add_i2c2(&u5500_i2c2_data);
102 i2c_register_board_info(2, ARRAY_AND_SIZE(u5500_i2c2_devices));
103}
23static void __init u5500_uart_init(void) 104static void __init u5500_uart_init(void)
24{ 105{
25 db5500_add_uart0(NULL); 106 db5500_add_uart0(NULL);
@@ -30,7 +111,8 @@ static void __init u5500_uart_init(void)
30static void __init u5500_init_machine(void) 111static void __init u5500_init_machine(void)
31{ 112{
32 u5500_init_devices(); 113 u5500_init_devices();
33 114 nmk_config_pins(u5500_pins, ARRAY_SIZE(u5500_pins));
115 u5500_i2c_init();
34 u5500_sdi_init(); 116 u5500_sdi_init();
35 u5500_uart_init(); 117 u5500_uart_init();
36} 118}