Commit 783bc788 authored by Thierry Reding's avatar Thierry Reding Committed by Robert Jarzmik

ARM: pxa: cm-x300: Use PWM lookup table

Use a PWM lookup table to provide the PWM to the pwm-backlight device.
The driver has a legacy code path that is required only because boards
still use the legacy method of requesting PWMs by global ID. Replacing
these usages allows that legacy fallback to be removed.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
parent bfcb3117
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/dm9000.h> #include <linux/dm9000.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/rtc-v3020.h> #include <linux/rtc-v3020.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h> #include <linux/pwm_backlight.h>
#include <linux/i2c.h> #include <linux/i2c.h>
...@@ -305,11 +306,14 @@ static inline void cm_x300_init_lcd(void) {} ...@@ -305,11 +306,14 @@ static inline void cm_x300_init_lcd(void) {}
#endif #endif
#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
static struct pwm_lookup cm_x300_pwm_lookup[] = {
PWM_LOOKUP("pxa27x-pwm.0", 1, "pwm-backlight.0", NULL, 10000,
PWM_POLARITY_NORMAL),
};
static struct platform_pwm_backlight_data cm_x300_backlight_data = { static struct platform_pwm_backlight_data cm_x300_backlight_data = {
.pwm_id = 2,
.max_brightness = 100, .max_brightness = 100,
.dft_brightness = 100, .dft_brightness = 100,
.pwm_period_ns = 10000,
.enable_gpio = -1, .enable_gpio = -1,
}; };
...@@ -323,6 +327,7 @@ static struct platform_device cm_x300_backlight_device = { ...@@ -323,6 +327,7 @@ static struct platform_device cm_x300_backlight_device = {
static void cm_x300_init_bl(void) static void cm_x300_init_bl(void)
{ {
pwm_add_table(cm_x300_pwm_lookup, ARRAY_SIZE(cm_x300_pwm_lookup));
platform_device_register(&cm_x300_backlight_device); platform_device_register(&cm_x300_backlight_device);
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment