summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-01-11 18:25:13 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-01-11 18:25:13 +0100
commitdac862f29b50e72b3e8125bdd6a7785ea1accb17 (patch)
tree8039119fd8e4736cf0ada1e24dd069a9bded7180 /arch/arm/mach-tegra
parent5b1395ecb68d31b14516a2bb46a18a63fcc5c1ba (diff)
colibri_t30: integrate PWM LED functionality
Make PWM B, C, D accessible from userspace. e.g as /sys/class/leds/pwm_b.
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-colibri_t30.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c
index 4b41036e26e1..75ffa81a2260 100644
--- a/arch/arm/mach-tegra/board-colibri_t30.c
+++ b/arch/arm/mach-tegra/board-colibri_t30.c
@@ -18,6 +18,7 @@
#include <linux/i2c-tegra.h>
#include <linux/input.h>
#include <linux/io.h>
+#include <linux/leds_pwm.h>
#include <linux/lm95245.h>
#include <linux/mfd/stmpe.h>
#include <linux/platform_data/tegra_usb.h>
@@ -350,6 +351,41 @@ static void __init colibri_t30_sdhci_init(void)
#endif
}
+/* PWM LEDs */
+static struct led_pwm tegra_leds_pwm[] = {
+ {
+ .name = "pwm_b",
+ .pwm_id = 1,
+ .max_brightness = 255,
+ .pwm_period_ns = 19600,
+ },
+ {
+ .name = "pwm_c",
+ .pwm_id = 2,
+ .max_brightness = 255,
+ .pwm_period_ns = 19600,
+ },
+ {
+ .name = "pwm_d",
+ .pwm_id = 3,
+ .max_brightness = 255,
+ .pwm_period_ns = 19600,
+ },
+};
+
+static struct led_pwm_platform_data tegra_leds_pwm_data = {
+ .num_leds = ARRAY_SIZE(tegra_leds_pwm),
+ .leds = tegra_leds_pwm,
+};
+
+static struct platform_device tegra_led_pwm_device = {
+ .name = "leds_pwm",
+ .id = -1,
+ .dev = {
+ .platform_data = &tegra_leds_pwm_data,
+ },
+};
+
/* RTC */
#ifdef CONFIG_RTC_DRV_TEGRA
@@ -1080,6 +1116,10 @@ static struct platform_device *colibri_t30_devices[] __initdata = {
#ifdef CONFIG_KEYBOARD_GPIO
&colibri_t30_keys_device,
#endif
+ &tegra_led_pwm_device,
+ &tegra_pwfm1_device,
+ &tegra_pwfm2_device,
+ &tegra_pwfm3_device,
};
static void __init colibri_t30_init(void)