aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-05-18 08:11:02 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-03 08:25:04 -0400
commit4a73071947d21f3aa39fa3a4bac104aaab94cfca (patch)
tree1976fac39f1322a3bec7df79f847afd3b34a6a76 /arch/arm/mach-pxa
parent402e490997ddaae310a080534a61d7ec24df8124 (diff)
[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>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/Kconfig1
-rw-r--r--arch/arm/mach-pxa/lpd270.c38
2 files changed, 18 insertions, 21 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 2d711308076f..7db0fd87a45d 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -37,6 +37,7 @@ config ARCH_LUBBOCK
37config MACH_LOGICPD_PXA270 37config MACH_LOGICPD_PXA270
38 bool "LogicPD PXA270 Card Engine Development Platform" 38 bool "LogicPD PXA270 Card Engine Development Platform"
39 select PXA27x 39 select PXA27x
40 select HAVE_PWM
40 41
41config MACH_MAINSTONE 42config MACH_MAINSTONE
42 bool "Intel HCDDBBVA0 Development Platform" 43 bool "Intel HCDDBBVA0 Development Platform"
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index a20e4b1649d6..f958403b43e8 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -23,6 +23,7 @@
23#include <linux/ioport.h> 23#include <linux/ioport.h>
24#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/pwm_backlight.h>
26 27
27#include <asm/types.h> 28#include <asm/types.h>
28#include <asm/setup.h> 29#include <asm/setup.h>
@@ -233,21 +234,20 @@ static struct platform_device lpd270_flash_device[2] = {
233 }, 234 },
234}; 235};
235 236
236static void lpd270_backlight_power(int on) 237static struct platform_pwm_backlight_data lpd270_backlight_data = {
237{ 238 .pwm_id = 0,
238 if (on) { 239 .max_brightness = 1,
239 pxa_gpio_mode(GPIO16_PWM0_MD); 240 .dft_brightness = 1,
240 pxa_set_cken(CKEN_PWM0, 1); 241 .pwm_period_ns = 78770,
241 PWM_CTRL0 = 0; 242};
242 PWM_PWDUTY0 = 0x3ff; 243
243 PWM_PERVAL0 = 0x3ff; 244static struct platform_device lpd270_backlight_device = {
244 } else { 245 .name = "pwm-backlight",
245 PWM_CTRL0 = 0; 246 .dev = {
246 PWM_PWDUTY0 = 0x0; 247 .parent = &pxa27x_device_pwm0.dev,
247 PWM_PERVAL0 = 0x3FF; 248 .platform_data = &lpd270_backlight_data,
248 pxa_set_cken(CKEN_PWM0, 0); 249 },
249 } 250};
250}
251 251
252/* 5.7" TFT QVGA (LoLo display number 1) */ 252/* 5.7" TFT QVGA (LoLo display number 1) */
253static struct pxafb_mode_info sharp_lq057q3dc02_mode = { 253static struct pxafb_mode_info sharp_lq057q3dc02_mode = {
@@ -269,7 +269,6 @@ static struct pxafb_mach_info sharp_lq057q3dc02 = {
269 .num_modes = 1, 269 .num_modes = 1,
270 .lccr0 = 0x07800080, 270 .lccr0 = 0x07800080,
271 .lccr3 = 0x00400000, 271 .lccr3 = 0x00400000,
272 .pxafb_backlight_power = lpd270_backlight_power,
273}; 272};
274 273
275/* 12.1" TFT SVGA (LoLo display number 2) */ 274/* 12.1" TFT SVGA (LoLo display number 2) */
@@ -292,7 +291,6 @@ static struct pxafb_mach_info sharp_lq121s1dg31 = {
292 .num_modes = 1, 291 .num_modes = 1,
293 .lccr0 = 0x07800080, 292 .lccr0 = 0x07800080,
294 .lccr3 = 0x00400000, 293 .lccr3 = 0x00400000,
295 .pxafb_backlight_power = lpd270_backlight_power,
296}; 294};
297 295
298/* 3.6" TFT QVGA (LoLo display number 3) */ 296/* 3.6" TFT QVGA (LoLo display number 3) */
@@ -315,7 +313,6 @@ static struct pxafb_mach_info sharp_lq036q1da01 = {
315 .num_modes = 1, 313 .num_modes = 1,
316 .lccr0 = 0x07800080, 314 .lccr0 = 0x07800080,
317 .lccr3 = 0x00400000, 315 .lccr3 = 0x00400000,
318 .pxafb_backlight_power = lpd270_backlight_power,
319}; 316};
320 317
321/* 6.4" TFT VGA (LoLo display number 5) */ 318/* 6.4" TFT VGA (LoLo display number 5) */
@@ -338,7 +335,6 @@ static struct pxafb_mach_info sharp_lq64d343 = {
338 .num_modes = 1, 335 .num_modes = 1,
339 .lccr0 = 0x07800080, 336 .lccr0 = 0x07800080,
340 .lccr3 = 0x00400000, 337 .lccr3 = 0x00400000,
341 .pxafb_backlight_power = lpd270_backlight_power,
342}; 338};
343 339
344/* 10.4" TFT VGA (LoLo display number 7) */ 340/* 10.4" TFT VGA (LoLo display number 7) */
@@ -361,7 +357,6 @@ static struct pxafb_mach_info sharp_lq10d368 = {
361 .num_modes = 1, 357 .num_modes = 1,
362 .lccr0 = 0x07800080, 358 .lccr0 = 0x07800080,
363 .lccr3 = 0x00400000, 359 .lccr3 = 0x00400000,
364 .pxafb_backlight_power = lpd270_backlight_power,
365}; 360};
366 361
367/* 3.5" TFT QVGA (LoLo display number 8) */ 362/* 3.5" TFT QVGA (LoLo display number 8) */
@@ -384,7 +379,6 @@ static struct pxafb_mach_info sharp_lq035q7db02_20 = {
384 .num_modes = 1, 379 .num_modes = 1,
385 .lccr0 = 0x07800080, 380 .lccr0 = 0x07800080,
386 .lccr3 = 0x00400000, 381 .lccr3 = 0x00400000,
387 .pxafb_backlight_power = lpd270_backlight_power,
388}; 382};
389 383
390static struct pxafb_mach_info *lpd270_lcd_to_use; 384static struct pxafb_mach_info *lpd270_lcd_to_use;
@@ -414,6 +408,7 @@ __setup("lcd=", lpd270_set_lcd);
414 408
415static struct platform_device *platform_devices[] __initdata = { 409static struct platform_device *platform_devices[] __initdata = {
416 &smc91x_device, 410 &smc91x_device,
411 &lpd270_backlight_device,
417 &lpd270_audio_device, 412 &lpd270_audio_device,
418 &lpd270_flash_device[0], 413 &lpd270_flash_device[0],
419 &lpd270_flash_device[1], 414 &lpd270_flash_device[1],
@@ -454,6 +449,7 @@ static void __init lpd270_init(void)
454 * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45. 449 * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45.
455 */ 450 */
456 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); 451 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
452 pxa_gpio_mode(GPIO16_PWM0_MD);
457 453
458 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 454 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
459 455