[ARM] pxa: make LogicPD 270 use the generic PWM backlight driver
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
402e490997
commit
4a73071947
|
@ -37,6 +37,7 @@ config ARCH_LUBBOCK
|
||||||
config MACH_LOGICPD_PXA270
|
config MACH_LOGICPD_PXA270
|
||||||
bool "LogicPD PXA270 Card Engine Development Platform"
|
bool "LogicPD PXA270 Card Engine Development Platform"
|
||||||
select PXA27x
|
select PXA27x
|
||||||
|
select HAVE_PWM
|
||||||
|
|
||||||
config MACH_MAINSTONE
|
config MACH_MAINSTONE
|
||||||
bool "Intel HCDDBBVA0 Development Platform"
|
bool "Intel HCDDBBVA0 Development Platform"
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <linux/ioport.h>
|
#include <linux/ioport.h>
|
||||||
#include <linux/mtd/mtd.h>
|
#include <linux/mtd/mtd.h>
|
||||||
#include <linux/mtd/partitions.h>
|
#include <linux/mtd/partitions.h>
|
||||||
|
#include <linux/pwm_backlight.h>
|
||||||
|
|
||||||
#include <asm/types.h>
|
#include <asm/types.h>
|
||||||
#include <asm/setup.h>
|
#include <asm/setup.h>
|
||||||
|
@ -233,21 +234,20 @@ static struct platform_device lpd270_flash_device[2] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void lpd270_backlight_power(int on)
|
static struct platform_pwm_backlight_data lpd270_backlight_data = {
|
||||||
{
|
.pwm_id = 0,
|
||||||
if (on) {
|
.max_brightness = 1,
|
||||||
pxa_gpio_mode(GPIO16_PWM0_MD);
|
.dft_brightness = 1,
|
||||||
pxa_set_cken(CKEN_PWM0, 1);
|
.pwm_period_ns = 78770,
|
||||||
PWM_CTRL0 = 0;
|
};
|
||||||
PWM_PWDUTY0 = 0x3ff;
|
|
||||||
PWM_PERVAL0 = 0x3ff;
|
static struct platform_device lpd270_backlight_device = {
|
||||||
} else {
|
.name = "pwm-backlight",
|
||||||
PWM_CTRL0 = 0;
|
.dev = {
|
||||||
PWM_PWDUTY0 = 0x0;
|
.parent = &pxa27x_device_pwm0.dev,
|
||||||
PWM_PERVAL0 = 0x3FF;
|
.platform_data = &lpd270_backlight_data,
|
||||||
pxa_set_cken(CKEN_PWM0, 0);
|
},
|
||||||
}
|
};
|
||||||
}
|
|
||||||
|
|
||||||
/* 5.7" TFT QVGA (LoLo display number 1) */
|
/* 5.7" TFT QVGA (LoLo display number 1) */
|
||||||
static struct pxafb_mode_info sharp_lq057q3dc02_mode = {
|
static struct pxafb_mode_info sharp_lq057q3dc02_mode = {
|
||||||
|
@ -269,7 +269,6 @@ static struct pxafb_mach_info sharp_lq057q3dc02 = {
|
||||||
.num_modes = 1,
|
.num_modes = 1,
|
||||||
.lccr0 = 0x07800080,
|
.lccr0 = 0x07800080,
|
||||||
.lccr3 = 0x00400000,
|
.lccr3 = 0x00400000,
|
||||||
.pxafb_backlight_power = lpd270_backlight_power,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 12.1" TFT SVGA (LoLo display number 2) */
|
/* 12.1" TFT SVGA (LoLo display number 2) */
|
||||||
|
@ -292,7 +291,6 @@ static struct pxafb_mach_info sharp_lq121s1dg31 = {
|
||||||
.num_modes = 1,
|
.num_modes = 1,
|
||||||
.lccr0 = 0x07800080,
|
.lccr0 = 0x07800080,
|
||||||
.lccr3 = 0x00400000,
|
.lccr3 = 0x00400000,
|
||||||
.pxafb_backlight_power = lpd270_backlight_power,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 3.6" TFT QVGA (LoLo display number 3) */
|
/* 3.6" TFT QVGA (LoLo display number 3) */
|
||||||
|
@ -315,7 +313,6 @@ static struct pxafb_mach_info sharp_lq036q1da01 = {
|
||||||
.num_modes = 1,
|
.num_modes = 1,
|
||||||
.lccr0 = 0x07800080,
|
.lccr0 = 0x07800080,
|
||||||
.lccr3 = 0x00400000,
|
.lccr3 = 0x00400000,
|
||||||
.pxafb_backlight_power = lpd270_backlight_power,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 6.4" TFT VGA (LoLo display number 5) */
|
/* 6.4" TFT VGA (LoLo display number 5) */
|
||||||
|
@ -338,7 +335,6 @@ static struct pxafb_mach_info sharp_lq64d343 = {
|
||||||
.num_modes = 1,
|
.num_modes = 1,
|
||||||
.lccr0 = 0x07800080,
|
.lccr0 = 0x07800080,
|
||||||
.lccr3 = 0x00400000,
|
.lccr3 = 0x00400000,
|
||||||
.pxafb_backlight_power = lpd270_backlight_power,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 10.4" TFT VGA (LoLo display number 7) */
|
/* 10.4" TFT VGA (LoLo display number 7) */
|
||||||
|
@ -361,7 +357,6 @@ static struct pxafb_mach_info sharp_lq10d368 = {
|
||||||
.num_modes = 1,
|
.num_modes = 1,
|
||||||
.lccr0 = 0x07800080,
|
.lccr0 = 0x07800080,
|
||||||
.lccr3 = 0x00400000,
|
.lccr3 = 0x00400000,
|
||||||
.pxafb_backlight_power = lpd270_backlight_power,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 3.5" TFT QVGA (LoLo display number 8) */
|
/* 3.5" TFT QVGA (LoLo display number 8) */
|
||||||
|
@ -384,7 +379,6 @@ static struct pxafb_mach_info sharp_lq035q7db02_20 = {
|
||||||
.num_modes = 1,
|
.num_modes = 1,
|
||||||
.lccr0 = 0x07800080,
|
.lccr0 = 0x07800080,
|
||||||
.lccr3 = 0x00400000,
|
.lccr3 = 0x00400000,
|
||||||
.pxafb_backlight_power = lpd270_backlight_power,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct pxafb_mach_info *lpd270_lcd_to_use;
|
static struct pxafb_mach_info *lpd270_lcd_to_use;
|
||||||
|
@ -414,6 +408,7 @@ __setup("lcd=", lpd270_set_lcd);
|
||||||
|
|
||||||
static struct platform_device *platform_devices[] __initdata = {
|
static struct platform_device *platform_devices[] __initdata = {
|
||||||
&smc91x_device,
|
&smc91x_device,
|
||||||
|
&lpd270_backlight_device,
|
||||||
&lpd270_audio_device,
|
&lpd270_audio_device,
|
||||||
&lpd270_flash_device[0],
|
&lpd270_flash_device[0],
|
||||||
&lpd270_flash_device[1],
|
&lpd270_flash_device[1],
|
||||||
|
@ -454,6 +449,7 @@ static void __init lpd270_init(void)
|
||||||
* On LogicPD PXA270, we route AC97_SYSCLK via GPIO45.
|
* On LogicPD PXA270, we route AC97_SYSCLK via GPIO45.
|
||||||
*/
|
*/
|
||||||
pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
|
pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
|
||||||
|
pxa_gpio_mode(GPIO16_PWM0_MD);
|
||||||
|
|
||||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue