diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-zoom-peripherals.c')
-rw-r--r-- | arch/arm/mach-omap2/board-zoom-peripherals.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index cdc0c1021863..a90375d5b2b6 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -22,6 +22,9 @@ | |||
22 | #include <linux/platform_data/gpio-omap.h> | 22 | #include <linux/platform_data/gpio-omap.h> |
23 | #include <linux/platform_data/omap-twl4030.h> | 23 | #include <linux/platform_data/omap-twl4030.h> |
24 | #include <linux/usb/phy.h> | 24 | #include <linux/usb/phy.h> |
25 | #include <linux/pwm.h> | ||
26 | #include <linux/leds_pwm.h> | ||
27 | #include <linux/pwm_backlight.h> | ||
25 | 28 | ||
26 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
@@ -193,6 +196,53 @@ static struct platform_device omap_vwlan_device = { | |||
193 | }, | 196 | }, |
194 | }; | 197 | }; |
195 | 198 | ||
199 | static struct pwm_lookup zoom_pwm_lookup[] = { | ||
200 | PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "zoom::keypad"), | ||
201 | PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", "backlight"), | ||
202 | }; | ||
203 | |||
204 | static struct led_pwm zoom_pwm_leds[] = { | ||
205 | { | ||
206 | .name = "zoom::keypad", | ||
207 | .max_brightness = 127, | ||
208 | .pwm_period_ns = 7812500, | ||
209 | }, | ||
210 | }; | ||
211 | |||
212 | static struct led_pwm_platform_data zoom_pwm_data = { | ||
213 | .num_leds = ARRAY_SIZE(zoom_pwm_leds), | ||
214 | .leds = zoom_pwm_leds, | ||
215 | }; | ||
216 | |||
217 | static struct platform_device zoom_leds_pwm = { | ||
218 | .name = "leds_pwm", | ||
219 | .id = -1, | ||
220 | .dev = { | ||
221 | .platform_data = &zoom_pwm_data, | ||
222 | }, | ||
223 | }; | ||
224 | |||
225 | static struct platform_pwm_backlight_data zoom_backlight_data = { | ||
226 | .pwm_id = 1, | ||
227 | .max_brightness = 127, | ||
228 | .dft_brightness = 127, | ||
229 | .pwm_period_ns = 7812500, | ||
230 | }; | ||
231 | |||
232 | static struct platform_device zoom_backlight_pwm = { | ||
233 | .name = "pwm-backlight", | ||
234 | .id = -1, | ||
235 | .dev = { | ||
236 | .platform_data = &zoom_backlight_data, | ||
237 | }, | ||
238 | }; | ||
239 | |||
240 | static struct platform_device *zoom_devices[] __initdata = { | ||
241 | &omap_vwlan_device, | ||
242 | &zoom_leds_pwm, | ||
243 | &zoom_backlight_pwm, | ||
244 | }; | ||
245 | |||
196 | static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = { | 246 | static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = { |
197 | .board_ref_clock = WL12XX_REFCLOCK_26, /* 26 MHz */ | 247 | .board_ref_clock = WL12XX_REFCLOCK_26, /* 26 MHz */ |
198 | }; | 248 | }; |
@@ -301,7 +351,8 @@ void __init zoom_peripherals_init(void) | |||
301 | 351 | ||
302 | omap_hsmmc_init(mmc); | 352 | omap_hsmmc_init(mmc); |
303 | omap_i2c_init(); | 353 | omap_i2c_init(); |
304 | platform_device_register(&omap_vwlan_device); | 354 | pwm_add_table(zoom_pwm_lookup, ARRAY_SIZE(zoom_pwm_lookup)); |
355 | platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices)); | ||
305 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); | 356 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); |
306 | usb_musb_init(NULL); | 357 | usb_musb_init(NULL); |
307 | enable_board_wakeup_source(); | 358 | enable_board_wakeup_source(); |