aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/lpd270.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/lpd270.c')
-rw-r--r--arch/arm/mach-pxa/lpd270.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index a20e4b1649d6..183b587672a6 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>
@@ -134,9 +135,12 @@ static struct sys_device lpd270_irq_device = {
134 135
135static int __init lpd270_irq_device_init(void) 136static int __init lpd270_irq_device_init(void)
136{ 137{
137 int ret = sysdev_class_register(&lpd270_irq_sysclass); 138 int ret = -ENODEV;
138 if (ret == 0) 139 if (machine_is_logicpd_pxa270()) {
139 ret = sysdev_register(&lpd270_irq_device); 140 ret = sysdev_class_register(&lpd270_irq_sysclass);
141 if (ret == 0)
142 ret = sysdev_register(&lpd270_irq_device);
143 }
140 return ret; 144 return ret;
141} 145}
142 146
@@ -233,21 +237,20 @@ static struct platform_device lpd270_flash_device[2] = {
233 }, 237 },
234}; 238};
235 239
236static void lpd270_backlight_power(int on) 240static struct platform_pwm_backlight_data lpd270_backlight_data = {
237{ 241 .pwm_id = 0,
238 if (on) { 242 .max_brightness = 1,
239 pxa_gpio_mode(GPIO16_PWM0_MD); 243 .dft_brightness = 1,
240 pxa_set_cken(CKEN_PWM0, 1); 244 .pwm_period_ns = 78770,
241 PWM_CTRL0 = 0; 245};
242 PWM_PWDUTY0 = 0x3ff; 246
243 PWM_PERVAL0 = 0x3ff; 247static struct platform_device lpd270_backlight_device = {
244 } else { 248 .name = "pwm-backlight",
245 PWM_CTRL0 = 0; 249 .dev = {
246 PWM_PWDUTY0 = 0x0; 250 .parent = &pxa27x_device_pwm0.dev,
247 PWM_PERVAL0 = 0x3FF; 251 .platform_data = &lpd270_backlight_data,
248 pxa_set_cken(CKEN_PWM0, 0); 252 },
249 } 253};
250}
251 254
252/* 5.7" TFT QVGA (LoLo display number 1) */ 255/* 5.7" TFT QVGA (LoLo display number 1) */
253static struct pxafb_mode_info sharp_lq057q3dc02_mode = { 256static struct pxafb_mode_info sharp_lq057q3dc02_mode = {
@@ -269,7 +272,6 @@ static struct pxafb_mach_info sharp_lq057q3dc02 = {
269 .num_modes = 1, 272 .num_modes = 1,
270 .lccr0 = 0x07800080, 273 .lccr0 = 0x07800080,
271 .lccr3 = 0x00400000, 274 .lccr3 = 0x00400000,
272 .pxafb_backlight_power = lpd270_backlight_power,
273}; 275};
274 276
275/* 12.1" TFT SVGA (LoLo display number 2) */ 277/* 12.1" TFT SVGA (LoLo display number 2) */
@@ -292,7 +294,6 @@ static struct pxafb_mach_info sharp_lq121s1dg31 = {
292 .num_modes = 1, 294 .num_modes = 1,
293 .lccr0 = 0x07800080, 295 .lccr0 = 0x07800080,
294 .lccr3 = 0x00400000, 296 .lccr3 = 0x00400000,
295 .pxafb_backlight_power = lpd270_backlight_power,
296}; 297};
297 298
298/* 3.6" TFT QVGA (LoLo display number 3) */ 299/* 3.6" TFT QVGA (LoLo display number 3) */
@@ -315,7 +316,6 @@ static struct pxafb_mach_info sharp_lq036q1da01 = {
315 .num_modes = 1, 316 .num_modes = 1,
316 .lccr0 = 0x07800080, 317 .lccr0 = 0x07800080,
317 .lccr3 = 0x00400000, 318 .lccr3 = 0x00400000,
318 .pxafb_backlight_power = lpd270_backlight_power,
319}; 319};
320 320
321/* 6.4" TFT VGA (LoLo display number 5) */ 321/* 6.4" TFT VGA (LoLo display number 5) */
@@ -338,7 +338,6 @@ static struct pxafb_mach_info sharp_lq64d343 = {
338 .num_modes = 1, 338 .num_modes = 1,
339 .lccr0 = 0x07800080, 339 .lccr0 = 0x07800080,
340 .lccr3 = 0x00400000, 340 .lccr3 = 0x00400000,
341 .pxafb_backlight_power = lpd270_backlight_power,
342}; 341};
343 342
344/* 10.4" TFT VGA (LoLo display number 7) */ 343/* 10.4" TFT VGA (LoLo display number 7) */
@@ -361,7 +360,6 @@ static struct pxafb_mach_info sharp_lq10d368 = {
361 .num_modes = 1, 360 .num_modes = 1,
362 .lccr0 = 0x07800080, 361 .lccr0 = 0x07800080,
363 .lccr3 = 0x00400000, 362 .lccr3 = 0x00400000,
364 .pxafb_backlight_power = lpd270_backlight_power,
365}; 363};
366 364
367/* 3.5" TFT QVGA (LoLo display number 8) */ 365/* 3.5" TFT QVGA (LoLo display number 8) */
@@ -384,7 +382,6 @@ static struct pxafb_mach_info sharp_lq035q7db02_20 = {
384 .num_modes = 1, 382 .num_modes = 1,
385 .lccr0 = 0x07800080, 383 .lccr0 = 0x07800080,
386 .lccr3 = 0x00400000, 384 .lccr3 = 0x00400000,
387 .pxafb_backlight_power = lpd270_backlight_power,
388}; 385};
389 386
390static struct pxafb_mach_info *lpd270_lcd_to_use; 387static struct pxafb_mach_info *lpd270_lcd_to_use;
@@ -414,6 +411,7 @@ __setup("lcd=", lpd270_set_lcd);
414 411
415static struct platform_device *platform_devices[] __initdata = { 412static struct platform_device *platform_devices[] __initdata = {
416 &smc91x_device, 413 &smc91x_device,
414 &lpd270_backlight_device,
417 &lpd270_audio_device, 415 &lpd270_audio_device,
418 &lpd270_flash_device[0], 416 &lpd270_flash_device[0],
419 &lpd270_flash_device[1], 417 &lpd270_flash_device[1],
@@ -454,6 +452,7 @@ static void __init lpd270_init(void)
454 * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45. 452 * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45.
455 */ 453 */
456 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); 454 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
455 pxa_gpio_mode(GPIO16_PWM0_MD);
457 456
458 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 457 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
459 458