diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-07-25 10:40:14 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-07-25 10:40:14 -0400 |
commit | ff877ea80efa2015b6263766f78ee42c2a1b32f9 (patch) | |
tree | 85205005c611ab774702148558321c6fb92f1ccd /arch/arm/mach-pxa/lpd270.c | |
parent | 30821fee4f0cb3e6d241d9f7ddc37742212e3eb7 (diff) | |
parent | d37e6bf68fc1eb34a4ad21d9ae8890ed37ea80e7 (diff) |
Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6
Diffstat (limited to 'arch/arm/mach-pxa/lpd270.c')
-rw-r--r-- | arch/arm/mach-pxa/lpd270.c | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index a20e4b1649d6..cc1c4fa06145 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 | ||
135 | static int __init lpd270_irq_device_init(void) | 136 | static 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 | ||
@@ -164,11 +168,6 @@ static struct platform_device smc91x_device = { | |||
164 | .resource = smc91x_resources, | 168 | .resource = smc91x_resources, |
165 | }; | 169 | }; |
166 | 170 | ||
167 | static struct platform_device lpd270_audio_device = { | ||
168 | .name = "pxa2xx-ac97", | ||
169 | .id = -1, | ||
170 | }; | ||
171 | |||
172 | static struct resource lpd270_flash_resources[] = { | 171 | static struct resource lpd270_flash_resources[] = { |
173 | [0] = { | 172 | [0] = { |
174 | .start = PXA_CS0_PHYS, | 173 | .start = PXA_CS0_PHYS, |
@@ -233,21 +232,20 @@ static struct platform_device lpd270_flash_device[2] = { | |||
233 | }, | 232 | }, |
234 | }; | 233 | }; |
235 | 234 | ||
236 | static void lpd270_backlight_power(int on) | 235 | static struct platform_pwm_backlight_data lpd270_backlight_data = { |
237 | { | 236 | .pwm_id = 0, |
238 | if (on) { | 237 | .max_brightness = 1, |
239 | pxa_gpio_mode(GPIO16_PWM0_MD); | 238 | .dft_brightness = 1, |
240 | pxa_set_cken(CKEN_PWM0, 1); | 239 | .pwm_period_ns = 78770, |
241 | PWM_CTRL0 = 0; | 240 | }; |
242 | PWM_PWDUTY0 = 0x3ff; | 241 | |
243 | PWM_PERVAL0 = 0x3ff; | 242 | static struct platform_device lpd270_backlight_device = { |
244 | } else { | 243 | .name = "pwm-backlight", |
245 | PWM_CTRL0 = 0; | 244 | .dev = { |
246 | PWM_PWDUTY0 = 0x0; | 245 | .parent = &pxa27x_device_pwm0.dev, |
247 | PWM_PERVAL0 = 0x3FF; | 246 | .platform_data = &lpd270_backlight_data, |
248 | pxa_set_cken(CKEN_PWM0, 0); | 247 | }, |
249 | } | 248 | }; |
250 | } | ||
251 | 249 | ||
252 | /* 5.7" TFT QVGA (LoLo display number 1) */ | 250 | /* 5.7" TFT QVGA (LoLo display number 1) */ |
253 | static struct pxafb_mode_info sharp_lq057q3dc02_mode = { | 251 | static struct pxafb_mode_info sharp_lq057q3dc02_mode = { |
@@ -269,7 +267,6 @@ static struct pxafb_mach_info sharp_lq057q3dc02 = { | |||
269 | .num_modes = 1, | 267 | .num_modes = 1, |
270 | .lccr0 = 0x07800080, | 268 | .lccr0 = 0x07800080, |
271 | .lccr3 = 0x00400000, | 269 | .lccr3 = 0x00400000, |
272 | .pxafb_backlight_power = lpd270_backlight_power, | ||
273 | }; | 270 | }; |
274 | 271 | ||
275 | /* 12.1" TFT SVGA (LoLo display number 2) */ | 272 | /* 12.1" TFT SVGA (LoLo display number 2) */ |
@@ -292,7 +289,6 @@ static struct pxafb_mach_info sharp_lq121s1dg31 = { | |||
292 | .num_modes = 1, | 289 | .num_modes = 1, |
293 | .lccr0 = 0x07800080, | 290 | .lccr0 = 0x07800080, |
294 | .lccr3 = 0x00400000, | 291 | .lccr3 = 0x00400000, |
295 | .pxafb_backlight_power = lpd270_backlight_power, | ||
296 | }; | 292 | }; |
297 | 293 | ||
298 | /* 3.6" TFT QVGA (LoLo display number 3) */ | 294 | /* 3.6" TFT QVGA (LoLo display number 3) */ |
@@ -315,7 +311,6 @@ static struct pxafb_mach_info sharp_lq036q1da01 = { | |||
315 | .num_modes = 1, | 311 | .num_modes = 1, |
316 | .lccr0 = 0x07800080, | 312 | .lccr0 = 0x07800080, |
317 | .lccr3 = 0x00400000, | 313 | .lccr3 = 0x00400000, |
318 | .pxafb_backlight_power = lpd270_backlight_power, | ||
319 | }; | 314 | }; |
320 | 315 | ||
321 | /* 6.4" TFT VGA (LoLo display number 5) */ | 316 | /* 6.4" TFT VGA (LoLo display number 5) */ |
@@ -338,7 +333,6 @@ static struct pxafb_mach_info sharp_lq64d343 = { | |||
338 | .num_modes = 1, | 333 | .num_modes = 1, |
339 | .lccr0 = 0x07800080, | 334 | .lccr0 = 0x07800080, |
340 | .lccr3 = 0x00400000, | 335 | .lccr3 = 0x00400000, |
341 | .pxafb_backlight_power = lpd270_backlight_power, | ||
342 | }; | 336 | }; |
343 | 337 | ||
344 | /* 10.4" TFT VGA (LoLo display number 7) */ | 338 | /* 10.4" TFT VGA (LoLo display number 7) */ |
@@ -361,7 +355,6 @@ static struct pxafb_mach_info sharp_lq10d368 = { | |||
361 | .num_modes = 1, | 355 | .num_modes = 1, |
362 | .lccr0 = 0x07800080, | 356 | .lccr0 = 0x07800080, |
363 | .lccr3 = 0x00400000, | 357 | .lccr3 = 0x00400000, |
364 | .pxafb_backlight_power = lpd270_backlight_power, | ||
365 | }; | 358 | }; |
366 | 359 | ||
367 | /* 3.5" TFT QVGA (LoLo display number 8) */ | 360 | /* 3.5" TFT QVGA (LoLo display number 8) */ |
@@ -384,7 +377,6 @@ static struct pxafb_mach_info sharp_lq035q7db02_20 = { | |||
384 | .num_modes = 1, | 377 | .num_modes = 1, |
385 | .lccr0 = 0x07800080, | 378 | .lccr0 = 0x07800080, |
386 | .lccr3 = 0x00400000, | 379 | .lccr3 = 0x00400000, |
387 | .pxafb_backlight_power = lpd270_backlight_power, | ||
388 | }; | 380 | }; |
389 | 381 | ||
390 | static struct pxafb_mach_info *lpd270_lcd_to_use; | 382 | static struct pxafb_mach_info *lpd270_lcd_to_use; |
@@ -414,7 +406,7 @@ __setup("lcd=", lpd270_set_lcd); | |||
414 | 406 | ||
415 | static struct platform_device *platform_devices[] __initdata = { | 407 | static struct platform_device *platform_devices[] __initdata = { |
416 | &smc91x_device, | 408 | &smc91x_device, |
417 | &lpd270_audio_device, | 409 | &lpd270_backlight_device, |
418 | &lpd270_flash_device[0], | 410 | &lpd270_flash_device[0], |
419 | &lpd270_flash_device[1], | 411 | &lpd270_flash_device[1], |
420 | }; | 412 | }; |
@@ -454,9 +446,12 @@ static void __init lpd270_init(void) | |||
454 | * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45. | 446 | * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45. |
455 | */ | 447 | */ |
456 | pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); | 448 | pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); |
449 | pxa_gpio_mode(GPIO16_PWM0_MD); | ||
457 | 450 | ||
458 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 451 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
459 | 452 | ||
453 | pxa_set_ac97_info(NULL); | ||
454 | |||
460 | if (lpd270_lcd_to_use != NULL) | 455 | if (lpd270_lcd_to_use != NULL) |
461 | set_pxa_fb_info(lpd270_lcd_to_use); | 456 | set_pxa_fb_info(lpd270_lcd_to_use); |
462 | 457 | ||