Commit c3322022 authored by Thierry Reding's avatar Thierry Reding Committed by Robert Jarzmik

ARM: pxa: ezx: 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 bd2e2b3c
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h> #include <linux/pwm_backlight.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/gpio.h> #include <linux/gpio.h>
...@@ -49,11 +50,14 @@ ...@@ -49,11 +50,14 @@
#define GPIO19_GEN1_CAM_RST 19 #define GPIO19_GEN1_CAM_RST 19
#define GPIO28_GEN2_CAM_RST 28 #define GPIO28_GEN2_CAM_RST 28
static struct pwm_lookup ezx_pwm_lookup[] = {
PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78700,
PWM_POLARITY_NORMAL),
};
static struct platform_pwm_backlight_data ezx_backlight_data = { static struct platform_pwm_backlight_data ezx_backlight_data = {
.pwm_id = 0,
.max_brightness = 1023, .max_brightness = 1023,
.dft_brightness = 1023, .dft_brightness = 1023,
.pwm_period_ns = 78770,
.enable_gpio = -1, .enable_gpio = -1,
}; };
...@@ -817,6 +821,7 @@ static void __init a780_init(void) ...@@ -817,6 +821,7 @@ static void __init a780_init(void)
platform_device_register(&a780_camera); platform_device_register(&a780_camera);
} }
pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
platform_add_devices(ARRAY_AND_SIZE(a780_devices)); platform_add_devices(ARRAY_AND_SIZE(a780_devices));
} }
......
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