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

ARM: pxa: palmte2: 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 e2d5b780
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/gpio_keys.h> #include <linux/gpio_keys.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/pda_power.h> #include <linux/pda_power.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h> #include <linux/pwm_backlight.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/wm97xx.h> #include <linux/wm97xx.h>
...@@ -138,6 +139,11 @@ static struct platform_device palmte2_pxa_keys = { ...@@ -138,6 +139,11 @@ static struct platform_device palmte2_pxa_keys = {
/****************************************************************************** /******************************************************************************
* Backlight * Backlight
******************************************************************************/ ******************************************************************************/
static struct pwm_lookup palmte2_pwm_lookup[] = {
PWM_LOOKUP("pxa25x-pwm.0", 0, "pwm-backlight.0", NULL,
PALMTE2_PERIOD_NS, PWM_POLARITY_NORMAL),
};
static struct gpio palmte_bl_gpios[] = { static struct gpio palmte_bl_gpios[] = {
{ GPIO_NR_PALMTE2_BL_POWER, GPIOF_INIT_LOW, "Backlight power" }, { GPIO_NR_PALMTE2_BL_POWER, GPIOF_INIT_LOW, "Backlight power" },
{ GPIO_NR_PALMTE2_LCD_POWER, GPIOF_INIT_LOW, "LCD power" }, { GPIO_NR_PALMTE2_LCD_POWER, GPIOF_INIT_LOW, "LCD power" },
...@@ -161,10 +167,8 @@ static void palmte2_backlight_exit(struct device *dev) ...@@ -161,10 +167,8 @@ static void palmte2_backlight_exit(struct device *dev)
} }
static struct platform_pwm_backlight_data palmte2_backlight_data = { static struct platform_pwm_backlight_data palmte2_backlight_data = {
.pwm_id = 0,
.max_brightness = PALMTE2_MAX_INTENSITY, .max_brightness = PALMTE2_MAX_INTENSITY,
.dft_brightness = PALMTE2_MAX_INTENSITY, .dft_brightness = PALMTE2_MAX_INTENSITY,
.pwm_period_ns = PALMTE2_PERIOD_NS,
.enable_gpio = -1, .enable_gpio = -1,
.init = palmte2_backlight_init, .init = palmte2_backlight_init,
.notify = palmte2_backlight_notify, .notify = palmte2_backlight_notify,
...@@ -355,6 +359,7 @@ static void __init palmte2_init(void) ...@@ -355,6 +359,7 @@ static void __init palmte2_init(void)
pxa_set_ac97_info(&palmte2_ac97_pdata); pxa_set_ac97_info(&palmte2_ac97_pdata);
pxa_set_ficp_info(&palmte2_ficp_platform_data); pxa_set_ficp_info(&palmte2_ficp_platform_data);
pwm_add_table(palmte2_pwm_lookup, ARRAY_SIZE(palmte2_pwm_lookup));
platform_add_devices(devices, ARRAY_SIZE(devices)); platform_add_devices(devices, ARRAY_SIZE(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