aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/boards
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2014-05-28 19:20:12 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2014-07-09 09:13:32 -0400
commit035c3d2a4593a60465c9a63554396164d3c92292 (patch)
tree6b7533f39bc5814ea7bfd4fa17856041ba848089 /arch/avr32/boards
parent2c43ec94480020bf5297e62a1f4e412c1d625fb1 (diff)
avr32: MRMT: use generic leds_pwm driver
Switch to the generic leds_pwm driver instead of leds-atmel-pwm. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r--arch/avr32/boards/atngw100/mrmt.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/arch/avr32/boards/atngw100/mrmt.c b/arch/avr32/boards/atngw100/mrmt.c
index 1ba09e4c02b1..91146b416cdb 100644
--- a/arch/avr32/boards/atngw100/mrmt.c
+++ b/arch/avr32/boards/atngw100/mrmt.c
@@ -17,6 +17,8 @@
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/leds.h> 19#include <linux/leds.h>
20#include <linux/pwm.h>
21#include <linux/leds_pwm.h>
20#include <linux/input.h> 22#include <linux/input.h>
21#include <linux/gpio_keys.h> 23#include <linux/gpio_keys.h>
22#include <linux/atmel_serial.h> 24#include <linux/atmel_serial.h>
@@ -155,21 +157,28 @@ static struct platform_device rmt_ts_device = {
155 157
156#ifdef CONFIG_BOARD_MRMT_BL_PWM 158#ifdef CONFIG_BOARD_MRMT_BL_PWM
157/* PWM LEDs: LCD Backlight, etc */ 159/* PWM LEDs: LCD Backlight, etc */
158static struct gpio_led rmt_pwm_led[] = { 160static struct pwm_lookup pwm_lookup[] = {
159 /* here the "gpio" is actually a PWM channel */ 161 PWM_LOOKUP("at91sam9rl-pwm", PWM_CH_BL, "leds_pwm", "ds1",
160 { .name = "backlight", .gpio = PWM_CH_BL, }, 162 5000, PWM_POLARITY_INVERSED),
161}; 163};
162 164
163static struct gpio_led_platform_data rmt_pwm_led_data = { 165static struct led_pwm pwm_leds[] = {
164 .num_leds = ARRAY_SIZE(rmt_pwm_led), 166 {
165 .leds = rmt_pwm_led, 167 .name = "backlight",
168 .max_brightness = 255,
169 },
170};
171
172static struct led_pwm_platform_data pwm_data = {
173 .num_leds = ARRAY_SIZE(pwm_leds),
174 .leds = pwm_leds,
166}; 175};
167 176
168static struct platform_device rmt_pwm_led_dev = { 177static struct platform_device leds_pwm = {
169 .name = "leds-atmel-pwm", 178 .name = "leds_pwm",
170 .id = -1, 179 .id = -1,
171 .dev = { 180 .dev = {
172 .platform_data = &rmt_pwm_led_data, 181 .platform_data = &pwm_data,
173 }, 182 },
174}; 183};
175#endif 184#endif
@@ -325,7 +334,8 @@ static int __init mrmt1_init(void)
325#ifdef CONFIG_BOARD_MRMT_BL_PWM 334#ifdef CONFIG_BOARD_MRMT_BL_PWM
326 /* Use PWM for Backlight controls */ 335 /* Use PWM for Backlight controls */
327 at32_add_device_pwm(1 << PWM_CH_BL); 336 at32_add_device_pwm(1 << PWM_CH_BL);
328 platform_device_register(&rmt_pwm_led_dev); 337 pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
338 platform_device_register(&leds_pwm);
329#else 339#else
330 /* Backlight always on */ 340 /* Backlight always on */
331 udelay( 1 ); 341 udelay( 1 );