aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2015-10-05 04:49:51 -0400
committerRobert Jarzmik <robert.jarzmik@free.fr>2015-10-14 17:06:48 -0400
commitf5a3b55287dd571967c8b83927cb8740fa977426 (patch)
treeb143ae7fafe9c2ffec279d295fd8a266f8b74bda
parente2d5b780aacea75777a93953e6967886014ad4f0 (diff)
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: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
-rw-r--r--arch/arm/mach-pxa/palmte2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 956fd24ee6fd..e64bb4326e69 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -21,6 +21,7 @@
21#include <linux/gpio_keys.h> 21#include <linux/gpio_keys.h>
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/pda_power.h> 23#include <linux/pda_power.h>
24#include <linux/pwm.h>
24#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
25#include <linux/gpio.h> 26#include <linux/gpio.h>
26#include <linux/wm97xx.h> 27#include <linux/wm97xx.h>
@@ -138,6 +139,11 @@ static struct platform_device palmte2_pxa_keys = {
138/****************************************************************************** 139/******************************************************************************
139 * Backlight 140 * Backlight
140 ******************************************************************************/ 141 ******************************************************************************/
142static struct pwm_lookup palmte2_pwm_lookup[] = {
143 PWM_LOOKUP("pxa25x-pwm.0", 0, "pwm-backlight.0", NULL,
144 PALMTE2_PERIOD_NS, PWM_POLARITY_NORMAL),
145};
146
141static struct gpio palmte_bl_gpios[] = { 147static struct gpio palmte_bl_gpios[] = {
142 { GPIO_NR_PALMTE2_BL_POWER, GPIOF_INIT_LOW, "Backlight power" }, 148 { GPIO_NR_PALMTE2_BL_POWER, GPIOF_INIT_LOW, "Backlight power" },
143 { GPIO_NR_PALMTE2_LCD_POWER, GPIOF_INIT_LOW, "LCD power" }, 149 { GPIO_NR_PALMTE2_LCD_POWER, GPIOF_INIT_LOW, "LCD power" },
@@ -161,10 +167,8 @@ static void palmte2_backlight_exit(struct device *dev)
161} 167}
162 168
163static struct platform_pwm_backlight_data palmte2_backlight_data = { 169static struct platform_pwm_backlight_data palmte2_backlight_data = {
164 .pwm_id = 0,
165 .max_brightness = PALMTE2_MAX_INTENSITY, 170 .max_brightness = PALMTE2_MAX_INTENSITY,
166 .dft_brightness = PALMTE2_MAX_INTENSITY, 171 .dft_brightness = PALMTE2_MAX_INTENSITY,
167 .pwm_period_ns = PALMTE2_PERIOD_NS,
168 .enable_gpio = -1, 172 .enable_gpio = -1,
169 .init = palmte2_backlight_init, 173 .init = palmte2_backlight_init,
170 .notify = palmte2_backlight_notify, 174 .notify = palmte2_backlight_notify,
@@ -355,6 +359,7 @@ static void __init palmte2_init(void)
355 pxa_set_ac97_info(&palmte2_ac97_pdata); 359 pxa_set_ac97_info(&palmte2_ac97_pdata);
356 pxa_set_ficp_info(&palmte2_ficp_platform_data); 360 pxa_set_ficp_info(&palmte2_ficp_platform_data);
357 361
362 pwm_add_table(palmte2_pwm_lookup, ARRAY_SIZE(palmte2_pwm_lookup));
358 platform_add_devices(devices, ARRAY_SIZE(devices)); 363 platform_add_devices(devices, ARRAY_SIZE(devices));
359} 364}
360 365