diff options
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 909e7fa6d299..2a6e8ad1d68b 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
| 21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
| 22 | #include <linux/leds.h> | 22 | #include <linux/leds.h> |
| 23 | #include <linux/pwm.h> | ||
| 24 | #include <linux/leds_pwm.h> | ||
| 23 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
| 24 | #include <linux/input.h> | 26 | #include <linux/input.h> |
| 25 | #include <linux/gpio_keys.h> | 27 | #include <linux/gpio_keys.h> |
| @@ -55,6 +57,32 @@ | |||
| 55 | 57 | ||
| 56 | #define NAND_CS 0 | 58 | #define NAND_CS 0 |
| 57 | 59 | ||
| 60 | static struct pwm_lookup pwm_lookup[] = { | ||
| 61 | /* LEDB -> PMU_STAT */ | ||
| 62 | PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat"), | ||
| 63 | }; | ||
| 64 | |||
| 65 | static struct led_pwm pwm_leds[] = { | ||
| 66 | { | ||
| 67 | .name = "beagleboard::pmu_stat", | ||
| 68 | .max_brightness = 127, | ||
| 69 | .pwm_period_ns = 7812500, | ||
| 70 | }, | ||
| 71 | }; | ||
| 72 | |||
| 73 | static struct led_pwm_platform_data pwm_data = { | ||
| 74 | .num_leds = ARRAY_SIZE(pwm_leds), | ||
| 75 | .leds = pwm_leds, | ||
| 76 | }; | ||
| 77 | |||
| 78 | static struct platform_device leds_pwm = { | ||
| 79 | .name = "leds_pwm", | ||
| 80 | .id = -1, | ||
| 81 | .dev = { | ||
| 82 | .platform_data = &pwm_data, | ||
| 83 | }, | ||
| 84 | }; | ||
| 85 | |||
| 58 | /* | 86 | /* |
| 59 | * OMAP3 Beagle revision | 87 | * OMAP3 Beagle revision |
| 60 | * Run time detection of Beagle revision is done by reading GPIO. | 88 | * Run time detection of Beagle revision is done by reading GPIO. |
| @@ -292,9 +320,6 @@ static int beagle_twl_gpio_setup(struct device *dev, | |||
| 292 | gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, | 320 | gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, |
| 293 | "nEN_USB_PWR"); | 321 | "nEN_USB_PWR"); |
| 294 | 322 | ||
| 295 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | ||
| 296 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | ||
| 297 | |||
| 298 | return 0; | 323 | return 0; |
| 299 | } | 324 | } |
| 300 | 325 | ||
| @@ -376,11 +401,6 @@ static struct gpio_led gpio_leds[] = { | |||
| 376 | .default_trigger = "mmc0", | 401 | .default_trigger = "mmc0", |
| 377 | .gpio = 149, | 402 | .gpio = 149, |
| 378 | }, | 403 | }, |
| 379 | { | ||
| 380 | .name = "beagleboard::pmu_stat", | ||
| 381 | .gpio = -EINVAL, /* gets replaced */ | ||
| 382 | .active_low = true, | ||
| 383 | }, | ||
| 384 | }; | 404 | }; |
| 385 | 405 | ||
| 386 | static struct gpio_led_platform_data gpio_led_info = { | 406 | static struct gpio_led_platform_data gpio_led_info = { |
| @@ -428,6 +448,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = { | |||
| 428 | &leds_gpio, | 448 | &leds_gpio, |
| 429 | &keys_gpio, | 449 | &keys_gpio, |
| 430 | &madc_hwmon, | 450 | &madc_hwmon, |
| 451 | &leds_pwm, | ||
| 431 | }; | 452 | }; |
| 432 | 453 | ||
| 433 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | 454 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
| @@ -532,6 +553,8 @@ static void __init omap3_beagle_init(void) | |||
| 532 | /* Ensure SDRC pins are mux'd for self-refresh */ | 553 | /* Ensure SDRC pins are mux'd for self-refresh */ |
| 533 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 554 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
| 534 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 555 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
| 556 | |||
| 557 | pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); | ||
| 535 | } | 558 | } |
| 536 | 559 | ||
| 537 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 560 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
