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>
This commit is contained in:
parent
2c43ec9448
commit
035c3d2a45
1 changed files with 22 additions and 12 deletions
|
@ -17,6 +17,8 @@
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
#include <linux/leds.h>
|
#include <linux/leds.h>
|
||||||
|
#include <linux/pwm.h>
|
||||||
|
#include <linux/leds_pwm.h>
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <linux/gpio_keys.h>
|
#include <linux/gpio_keys.h>
|
||||||
#include <linux/atmel_serial.h>
|
#include <linux/atmel_serial.h>
|
||||||
|
@ -155,21 +157,28 @@ static struct platform_device rmt_ts_device = {
|
||||||
|
|
||||||
#ifdef CONFIG_BOARD_MRMT_BL_PWM
|
#ifdef CONFIG_BOARD_MRMT_BL_PWM
|
||||||
/* PWM LEDs: LCD Backlight, etc */
|
/* PWM LEDs: LCD Backlight, etc */
|
||||||
static struct gpio_led rmt_pwm_led[] = {
|
static struct pwm_lookup pwm_lookup[] = {
|
||||||
/* here the "gpio" is actually a PWM channel */
|
PWM_LOOKUP("at91sam9rl-pwm", PWM_CH_BL, "leds_pwm", "ds1",
|
||||||
{ .name = "backlight", .gpio = PWM_CH_BL, },
|
5000, PWM_POLARITY_INVERSED),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct gpio_led_platform_data rmt_pwm_led_data = {
|
static struct led_pwm pwm_leds[] = {
|
||||||
.num_leds = ARRAY_SIZE(rmt_pwm_led),
|
{
|
||||||
.leds = rmt_pwm_led,
|
.name = "backlight",
|
||||||
|
.max_brightness = 255,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device rmt_pwm_led_dev = {
|
static struct led_pwm_platform_data pwm_data = {
|
||||||
.name = "leds-atmel-pwm",
|
.num_leds = ARRAY_SIZE(pwm_leds),
|
||||||
.id = -1,
|
.leds = pwm_leds,
|
||||||
.dev = {
|
};
|
||||||
.platform_data = &rmt_pwm_led_data,
|
|
||||||
|
static struct platform_device leds_pwm = {
|
||||||
|
.name = "leds_pwm",
|
||||||
|
.id = -1,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &pwm_data,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -325,7 +334,8 @@ static int __init mrmt1_init(void)
|
||||||
#ifdef CONFIG_BOARD_MRMT_BL_PWM
|
#ifdef CONFIG_BOARD_MRMT_BL_PWM
|
||||||
/* Use PWM for Backlight controls */
|
/* Use PWM for Backlight controls */
|
||||||
at32_add_device_pwm(1 << PWM_CH_BL);
|
at32_add_device_pwm(1 << PWM_CH_BL);
|
||||||
platform_device_register(&rmt_pwm_led_dev);
|
pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
|
||||||
|
platform_device_register(&leds_pwm);
|
||||||
#else
|
#else
|
||||||
/* Backlight always on */
|
/* Backlight always on */
|
||||||
udelay( 1 );
|
udelay( 1 );
|
||||||
|
|
Loading…
Reference in a new issue