diff options
author | Ameya Palande <ameya.palande@nokia.com> | 2011-07-05 06:38:22 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-07-05 06:38:22 -0400 |
commit | eeada9e89ff72cfb66e46d682bb3b8acdc0d95bd (patch) | |
tree | ec8218a5feae30a02b5985e5331264e9399b2c5c | |
parent | fdcc205fb9ba006bcd37f72e1b1b904704257351 (diff) |
omap: rx51: Platform support for lp5523 led chip
Platform support for lp5523 led chip
Signed-off-by: Ameya Palande <ameya.palande@nokia.com>
Signed-off-by: Mathias Nyman <mathias.nyman@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 5e559dda3cc3..c1938dffb946 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <sound/tpa6130a2-plat.h> | 39 | #include <sound/tpa6130a2-plat.h> |
40 | #include <media/radio-si4713.h> | 40 | #include <media/radio-si4713.h> |
41 | #include <media/si4713.h> | 41 | #include <media/si4713.h> |
42 | #include <linux/leds-lp5523.h> | ||
42 | 43 | ||
43 | #include <../drivers/staging/iio/light/tsl2563.h> | 44 | #include <../drivers/staging/iio/light/tsl2563.h> |
44 | 45 | ||
@@ -53,6 +54,7 @@ | |||
53 | #define RX51_WL1251_IRQ_GPIO 42 | 54 | #define RX51_WL1251_IRQ_GPIO 42 |
54 | #define RX51_FMTX_RESET_GPIO 163 | 55 | #define RX51_FMTX_RESET_GPIO 163 |
55 | #define RX51_FMTX_IRQ 53 | 56 | #define RX51_FMTX_IRQ 53 |
57 | #define RX51_LP5523_CHIP_EN_GPIO 41 | ||
56 | 58 | ||
57 | #define RX51_USB_TRANSCEIVER_RST_GPIO 67 | 59 | #define RX51_USB_TRANSCEIVER_RST_GPIO 67 |
58 | 60 | ||
@@ -71,6 +73,64 @@ static struct tsl2563_platform_data rx51_tsl2563_platform_data = { | |||
71 | }; | 73 | }; |
72 | #endif | 74 | #endif |
73 | 75 | ||
76 | #if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE) | ||
77 | static struct lp5523_led_config rx51_lp5523_led_config[] = { | ||
78 | { | ||
79 | .chan_nr = 0, | ||
80 | .led_current = 50, | ||
81 | }, { | ||
82 | .chan_nr = 1, | ||
83 | .led_current = 50, | ||
84 | }, { | ||
85 | .chan_nr = 2, | ||
86 | .led_current = 50, | ||
87 | }, { | ||
88 | .chan_nr = 3, | ||
89 | .led_current = 50, | ||
90 | }, { | ||
91 | .chan_nr = 4, | ||
92 | .led_current = 50, | ||
93 | }, { | ||
94 | .chan_nr = 5, | ||
95 | .led_current = 50, | ||
96 | }, { | ||
97 | .chan_nr = 6, | ||
98 | .led_current = 50, | ||
99 | }, { | ||
100 | .chan_nr = 7, | ||
101 | .led_current = 50, | ||
102 | }, { | ||
103 | .chan_nr = 8, | ||
104 | .led_current = 50, | ||
105 | } | ||
106 | }; | ||
107 | |||
108 | static int rx51_lp5523_setup(void) | ||
109 | { | ||
110 | return gpio_request_one(RX51_LP5523_CHIP_EN_GPIO, GPIOF_DIR_OUT, | ||
111 | "lp5523_enable"); | ||
112 | } | ||
113 | |||
114 | static void rx51_lp5523_release(void) | ||
115 | { | ||
116 | gpio_free(RX51_LP5523_CHIP_EN_GPIO); | ||
117 | } | ||
118 | |||
119 | static void rx51_lp5523_enable(bool state) | ||
120 | { | ||
121 | gpio_set_value(RX51_LP5523_CHIP_EN_GPIO, !!state); | ||
122 | } | ||
123 | |||
124 | static struct lp5523_platform_data rx51_lp5523_platform_data = { | ||
125 | .led_config = rx51_lp5523_led_config, | ||
126 | .num_channels = ARRAY_SIZE(rx51_lp5523_led_config), | ||
127 | .clock_mode = LP5523_CLOCK_AUTO, | ||
128 | .setup_resources = rx51_lp5523_setup, | ||
129 | .release_resources = rx51_lp5523_release, | ||
130 | .enable = rx51_lp5523_enable, | ||
131 | }; | ||
132 | #endif | ||
133 | |||
74 | static struct omap2_mcspi_device_config wl1251_mcspi_config = { | 134 | static struct omap2_mcspi_device_config wl1251_mcspi_config = { |
75 | .turbo_mode = 0, | 135 | .turbo_mode = 0, |
76 | .single_channel = 1, | 136 | .single_channel = 1, |
@@ -833,6 +893,12 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { | |||
833 | .platform_data = &rx51_tsl2563_platform_data, | 893 | .platform_data = &rx51_tsl2563_platform_data, |
834 | }, | 894 | }, |
835 | #endif | 895 | #endif |
896 | #if defined(CONFIG_LEDS_LP5523) || defined(CONFIG_LEDS_LP5523_MODULE) | ||
897 | { | ||
898 | I2C_BOARD_INFO("lp5523", 0x32), | ||
899 | .platform_data = &rx51_lp5523_platform_data, | ||
900 | }, | ||
901 | #endif | ||
836 | { | 902 | { |
837 | I2C_BOARD_INFO("tpa6130a2", 0x60), | 903 | I2C_BOARD_INFO("tpa6130a2", 0x60), |
838 | .platform_data = &rx51_tpa6130a2_data, | 904 | .platform_data = &rx51_tpa6130a2_data, |