aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/mainstone.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 19:06:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 19:06:58 -0400
commit85082fd7cbe3173198aac0eb5e85ab1edcc6352c (patch)
treeedbc09b7945994f78668d218fa02e991c3b3b365 /arch/arm/mach-pxa/mainstone.c
parent666484f0250db2e016948d63b3ef33e202e3b8d0 (diff)
parent53ffe3b440aa85af6fc4eda09b2d44bcdd312d4d (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (241 commits) [ARM] 5171/1: ep93xx: fix compilation of modules using clocks [ARM] 5133/2: at91sam9g20 defconfig file [ARM] 5130/4: Support for the at91sam9g20 [ARM] 5160/1: IOP3XX: gpio/gpiolib support [ARM] at91: Fix NAND FLASH timings for at91sam9x evaluation kits. [ARM] 5084/1: zylonite: Register AC97 device [ARM] 5085/2: PXA: Move AC97 over to the new central device declaration model [ARM] 5120/1: pxa: correct platform driver names for PXA25x and PXA27x UDC drivers [ARM] 5147/1: pxaficp_ir: drop pxa_gpio_mode calls, as pin setting [ARM] 5145/1: PXA2xx: provide api to control IrDA pins state [ARM] 5144/1: pxaficp_ir: cleanup includes [ARM] pxa: remove pxa_set_cken() [ARM] pxa: allow clk aliases [ARM] Feroceon: don't disable BPU on boot [ARM] Orion: LED support for HP mv2120 [ARM] Orion: add RD88F5181L-FXO support [ARM] Orion: add RD88F5181L-GE support [ARM] Orion: add Netgear WNR854T support [ARM] s3c2410_defconfig: update for current build [ARM] Acer n30: Minor style and indentation fixes. ...
Diffstat (limited to 'arch/arm/mach-pxa/mainstone.c')
-rw-r--r--arch/arm/mach-pxa/mainstone.c71
1 files changed, 18 insertions, 53 deletions
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 7399fb34da4e..f2e9e7c4da8e 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -23,9 +23,9 @@
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/backlight.h>
27#include <linux/input.h> 26#include <linux/input.h>
28#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
28#include <linux/pwm_backlight.h>
29 29
30#include <asm/types.h> 30#include <asm/types.h>
31#include <asm/setup.h> 31#include <asm/setup.h>
@@ -280,12 +280,6 @@ static pxa2xx_audio_ops_t mst_audio_ops = {
280 .resume = mst_audio_resume, 280 .resume = mst_audio_resume,
281}; 281};
282 282
283static struct platform_device mst_audio_device = {
284 .name = "pxa2xx-ac97",
285 .id = -1,
286 .dev = { .platform_data = &mst_audio_ops },
287};
288
289static struct resource flash_resources[] = { 283static struct resource flash_resources[] = {
290 [0] = { 284 [0] = {
291 .start = PXA_CS0_PHYS, 285 .start = PXA_CS0_PHYS,
@@ -349,56 +343,27 @@ static struct platform_device mst_flash_device[2] = {
349 }, 343 },
350}; 344};
351 345
352#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE 346#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
353static int mainstone_backlight_update_status(struct backlight_device *bl) 347static struct platform_pwm_backlight_data mainstone_backlight_data = {
354{ 348 .pwm_id = 0,
355 int brightness = bl->props.brightness; 349 .max_brightness = 1023,
356 350 .dft_brightness = 1023,
357 if (bl->props.power != FB_BLANK_UNBLANK || 351 .pwm_period_ns = 78770,
358 bl->props.fb_blank != FB_BLANK_UNBLANK) 352};
359 brightness = 0;
360
361 if (brightness != 0)
362 pxa_set_cken(CKEN_PWM0, 1);
363
364 PWM_CTRL0 = 0;
365 PWM_PWDUTY0 = brightness;
366 PWM_PERVAL0 = bl->props.max_brightness;
367
368 if (brightness == 0)
369 pxa_set_cken(CKEN_PWM0, 0);
370 return 0; /* pointless return value */
371}
372
373static int mainstone_backlight_get_brightness(struct backlight_device *bl)
374{
375 return PWM_PWDUTY0;
376}
377 353
378static /*const*/ struct backlight_ops mainstone_backlight_ops = { 354static struct platform_device mainstone_backlight_device = {
379 .update_status = mainstone_backlight_update_status, 355 .name = "pwm-backlight",
380 .get_brightness = mainstone_backlight_get_brightness, 356 .dev = {
357 .parent = &pxa27x_device_pwm0.dev,
358 .platform_data = &mainstone_backlight_data,
359 },
381}; 360};
382 361
383static void __init mainstone_backlight_register(void) 362static void __init mainstone_backlight_register(void)
384{ 363{
385 struct backlight_device *bl; 364 int ret = platform_device_register(&mainstone_backlight_device);
386 365 if (ret)
387 bl = backlight_device_register("mainstone-bl", &pxa_device_fb.dev, 366 printk(KERN_ERR "mainstone: failed to register backlight device: %d\n", ret);
388 NULL, &mainstone_backlight_ops);
389 if (IS_ERR(bl)) {
390 printk(KERN_ERR "mainstone: unable to register backlight: %ld\n",
391 PTR_ERR(bl));
392 return;
393 }
394
395 /*
396 * broken design - register-then-setup interfaces are
397 * utterly broken by definition.
398 */
399 bl->props.max_brightness = 1023;
400 bl->props.brightness = 1023;
401 backlight_update_status(bl);
402} 367}
403#else 368#else
404#define mainstone_backlight_register() do { } while (0) 369#define mainstone_backlight_register() do { } while (0)
@@ -528,7 +493,6 @@ static struct platform_device mst_gpio_keys_device = {
528 493
529static struct platform_device *platform_devices[] __initdata = { 494static struct platform_device *platform_devices[] __initdata = {
530 &smc91x_device, 495 &smc91x_device,
531 &mst_audio_device,
532 &mst_flash_device[0], 496 &mst_flash_device[0],
533 &mst_flash_device[1], 497 &mst_flash_device[1],
534 &mst_gpio_keys_device, 498 &mst_gpio_keys_device,
@@ -638,6 +602,7 @@ static void __init mainstone_init(void)
638 pxa_set_ficp_info(&mainstone_ficp_platform_data); 602 pxa_set_ficp_info(&mainstone_ficp_platform_data);
639 pxa_set_ohci_info(&mainstone_ohci_platform_data); 603 pxa_set_ohci_info(&mainstone_ohci_platform_data);
640 pxa_set_i2c_info(NULL); 604 pxa_set_i2c_info(NULL);
605 pxa_set_ac97_info(&mst_audio_ops);
641 606
642 mainstone_init_keypad(); 607 mainstone_init_keypad();
643} 608}