aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2014-05-28 19:20:13 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2014-07-09 09:13:33 -0400
commitb2f10803d5c18472a9468e62edfa9570927e374c (patch)
tree28162eb92f7b5100482fb68833843e7199c608f7 /arch/avr32
parent035c3d2a4593a60465c9a63554396164d3c92292 (diff)
avr32: merisc: 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')
-rw-r--r--arch/avr32/boards/merisc/setup.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c
index ed137e335796..83d896cc2aed 100644
--- a/arch/avr32/boards/merisc/setup.c
+++ b/arch/avr32/boards/merisc/setup.c
@@ -22,6 +22,8 @@
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/fb.h> 23#include <linux/fb.h>
24#include <linux/atmel-mci.h> 24#include <linux/atmel-mci.h>
25#include <linux/pwm.h>
26#include <linux/leds_pwm.h>
25 27
26#include <asm/io.h> 28#include <asm/io.h>
27#include <asm/setup.h> 29#include <asm/setup.h>
@@ -167,24 +169,29 @@ static struct i2c_board_info __initdata i2c_info[] = {
167 }, 169 },
168}; 170};
169 171
170#ifdef CONFIG_LEDS_ATMEL_PWM 172#if IS_ENABLED(CONFIG_LEDS_PWM)
171static struct gpio_led stk_pwm_led[] = { 173static struct pwm_lookup pwm_lookup[] = {
174 PWM_LOOKUP("at91sam9rl-pwm", 0, "leds_pwm", "backlight",
175 5000, PWM_POLARITY_NORMAL),
176};
177
178static struct led_pwm pwm_leds[] = {
172 { 179 {
173 .name = "backlight", 180 .name = "backlight",
174 .gpio = 0, /* PWM channel 0 (LCD backlight) */ 181 .max_brightness = 255,
175 }, 182 },
176}; 183};
177 184
178static struct gpio_led_platform_data stk_pwm_led_data = { 185static struct led_pwm_platform_data pwm_data = {
179 .num_leds = ARRAY_SIZE(stk_pwm_led), 186 .num_leds = ARRAY_SIZE(pwm_leds),
180 .leds = stk_pwm_led, 187 .leds = pwm_leds,
181}; 188};
182 189
183static struct platform_device stk_pwm_led_dev = { 190static struct platform_device leds_pwm = {
184 .name = "leds-atmel-pwm", 191 .name = "leds_pwm",
185 .id = -1, 192 .id = -1,
186 .dev = { 193 .dev = {
187 .platform_data = &stk_pwm_led_data, 194 .platform_data = &pwm_data,
188 }, 195 },
189}; 196};
190#endif 197#endif
@@ -278,9 +285,10 @@ static int __init merisc_init(void)
278 285
279 at32_add_device_mci(0, &mci0_data); 286 at32_add_device_mci(0, &mci0_data);
280 287
281#ifdef CONFIG_LEDS_ATMEL_PWM 288#if IS_ENABLED(CONFIG_LEDS_PWM)
289 pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
282 at32_add_device_pwm((1 << 0) | (1 << 2)); 290 at32_add_device_pwm((1 << 0) | (1 << 2));
283 platform_device_register(&stk_pwm_led_dev); 291 platform_device_register(&leds_pwm);
284#else 292#else
285 at32_add_device_pwm((1 << 2)); 293 at32_add_device_pwm((1 << 2));
286#endif 294#endif