diff options
| author | Marek Vasut <marek.vasut@gmail.com> | 2009-06-01 16:34:14 -0400 |
|---|---|---|
| committer | Eric Miao <eric.y.miao@gmail.com> | 2009-06-16 04:55:24 -0400 |
| commit | eb73e6221c5013b32647bcf44bcc570232ba2804 (patch) | |
| tree | d960bcbaa53a241ca5e95950984ddf1392140a29 | |
| parent | 7517b3fbe40c231d79d36f31c1e9930cbb8c4be2 (diff) | |
[ARM] pxa/palm: various fixes for PalmZ72 (mostly audio asoc and usb)
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
| -rw-r--r-- | arch/arm/mach-pxa/include/mach/palmz72.h | 5 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/palmz72.c | 65 |
2 files changed, 65 insertions, 5 deletions
diff --git a/arch/arm/mach-pxa/include/mach/palmz72.h b/arch/arm/mach-pxa/include/mach/palmz72.h index 5032307ebf7d..2806ef69ba5a 100644 --- a/arch/arm/mach-pxa/include/mach/palmz72.h +++ b/arch/arm/mach-pxa/include/mach/palmz72.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | /* SD/MMC */ | 21 | /* SD/MMC */ |
| 22 | #define GPIO_NR_PALMZ72_SD_DETECT_N 14 | 22 | #define GPIO_NR_PALMZ72_SD_DETECT_N 14 |
| 23 | #define GPIO_NR_PALMZ72_SD_POWER_N 98 | 23 | #define GPIO_NR_PALMZ72_SD_POWER_N 98 |
| 24 | #define GPIO_NR_PALMZ72_SD_RO 115 | 24 | #define GPIO_NR_PALMZ72_SD_RO 115 |
| 25 | 25 | ||
| 26 | /* Touchscreen */ | 26 | /* Touchscreen */ |
| 27 | #define GPIO_NR_PALMZ72_WM9712_IRQ 27 | 27 | #define GPIO_NR_PALMZ72_WM9712_IRQ 27 |
| @@ -31,8 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | /* USB */ | 32 | /* USB */ |
| 33 | #define GPIO_NR_PALMZ72_USB_DETECT_N 15 | 33 | #define GPIO_NR_PALMZ72_USB_DETECT_N 15 |
| 34 | #define GPIO_NR_PALMZ72_USB_POWER 95 | 34 | #define GPIO_NR_PALMZ72_USB_PULLUP 95 |
| 35 | #define GPIO_NR_PALMZ72_USB_PULLUP 12 | ||
| 36 | 35 | ||
| 37 | /* LCD/Backlight */ | 36 | /* LCD/Backlight */ |
| 38 | #define GPIO_NR_PALMZ72_BL_POWER 20 | 37 | #define GPIO_NR_PALMZ72_BL_POWER 20 |
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index b88eb4dd2c84..c3645aa3fa3d 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c | |||
| @@ -27,7 +27,9 @@ | |||
| 27 | #include <linux/pda_power.h> | 27 | #include <linux/pda_power.h> |
| 28 | #include <linux/pwm_backlight.h> | 28 | #include <linux/pwm_backlight.h> |
| 29 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
| 30 | #include <linux/wm97xx_batt.h> | ||
| 30 | #include <linux/power_supply.h> | 31 | #include <linux/power_supply.h> |
| 32 | #include <linux/usb/gpio_vbus.h> | ||
| 31 | 33 | ||
| 32 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
| 33 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
| @@ -41,6 +43,8 @@ | |||
| 41 | #include <mach/irda.h> | 43 | #include <mach/irda.h> |
| 42 | #include <mach/pxa27x_keypad.h> | 44 | #include <mach/pxa27x_keypad.h> |
| 43 | #include <mach/udc.h> | 45 | #include <mach/udc.h> |
| 46 | #include <mach/palmasoc.h> | ||
| 47 | |||
| 44 | #include <mach/pm.h> | 48 | #include <mach/pm.h> |
| 45 | 49 | ||
| 46 | #include "generic.h" | 50 | #include "generic.h" |
| @@ -66,6 +70,8 @@ static unsigned long palmz72_pin_config[] __initdata = { | |||
| 66 | GPIO29_AC97_SDATA_IN_0, | 70 | GPIO29_AC97_SDATA_IN_0, |
| 67 | GPIO30_AC97_SDATA_OUT, | 71 | GPIO30_AC97_SDATA_OUT, |
| 68 | GPIO31_AC97_SYNC, | 72 | GPIO31_AC97_SYNC, |
| 73 | GPIO89_AC97_SYSCLK, | ||
| 74 | GPIO113_AC97_nRESET, | ||
| 69 | 75 | ||
| 70 | /* IrDA */ | 76 | /* IrDA */ |
| 71 | GPIO49_GPIO, /* ir disable */ | 77 | GPIO49_GPIO, /* ir disable */ |
| @@ -77,8 +83,7 @@ static unsigned long palmz72_pin_config[] __initdata = { | |||
| 77 | 83 | ||
| 78 | /* USB */ | 84 | /* USB */ |
| 79 | GPIO15_GPIO, /* usb detect */ | 85 | GPIO15_GPIO, /* usb detect */ |
| 80 | GPIO12_GPIO, /* usb pullup */ | 86 | GPIO95_GPIO, /* usb pullup */ |
| 81 | GPIO95_GPIO, /* usb power */ | ||
| 82 | 87 | ||
| 83 | /* Matrix keypad */ | 88 | /* Matrix keypad */ |
| 84 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, | 89 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, |
| @@ -355,6 +360,22 @@ static struct platform_device palmz72_leds = { | |||
| 355 | }; | 360 | }; |
| 356 | 361 | ||
| 357 | /****************************************************************************** | 362 | /****************************************************************************** |
| 363 | * UDC | ||
| 364 | ******************************************************************************/ | ||
| 365 | static struct gpio_vbus_mach_info palmz72_udc_info = { | ||
| 366 | .gpio_vbus = GPIO_NR_PALMZ72_USB_DETECT_N, | ||
| 367 | .gpio_pullup = GPIO_NR_PALMZ72_USB_PULLUP, | ||
| 368 | }; | ||
| 369 | |||
| 370 | static struct platform_device palmz72_gpio_vbus = { | ||
| 371 | .name = "gpio-vbus", | ||
| 372 | .id = -1, | ||
| 373 | .dev = { | ||
| 374 | .platform_data = &palmz72_udc_info, | ||
| 375 | }, | ||
| 376 | }; | ||
| 377 | |||
| 378 | /****************************************************************************** | ||
| 358 | * Power supply | 379 | * Power supply |
| 359 | ******************************************************************************/ | 380 | ******************************************************************************/ |
| 360 | static int power_supply_init(struct device *dev) | 381 | static int power_supply_init(struct device *dev) |
| @@ -422,6 +443,31 @@ static struct platform_device power_supply = { | |||
| 422 | }; | 443 | }; |
| 423 | 444 | ||
| 424 | /****************************************************************************** | 445 | /****************************************************************************** |
| 446 | * WM97xx battery | ||
| 447 | ******************************************************************************/ | ||
| 448 | static struct wm97xx_batt_info wm97xx_batt_pdata = { | ||
| 449 | .batt_aux = WM97XX_AUX_ID3, | ||
| 450 | .temp_aux = WM97XX_AUX_ID2, | ||
| 451 | .charge_gpio = -1, | ||
| 452 | .max_voltage = PALMZ72_BAT_MAX_VOLTAGE, | ||
| 453 | .min_voltage = PALMZ72_BAT_MIN_VOLTAGE, | ||
| 454 | .batt_mult = 1000, | ||
| 455 | .batt_div = 414, | ||
| 456 | .temp_mult = 1, | ||
| 457 | .temp_div = 1, | ||
| 458 | .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO, | ||
| 459 | .batt_name = "main-batt", | ||
| 460 | }; | ||
| 461 | |||
| 462 | /****************************************************************************** | ||
| 463 | * aSoC audio | ||
| 464 | ******************************************************************************/ | ||
| 465 | static struct platform_device palmz72_asoc = { | ||
| 466 | .name = "palm27x-asoc", | ||
| 467 | .id = -1, | ||
| 468 | }; | ||
| 469 | |||
| 470 | /****************************************************************************** | ||
| 425 | * Framebuffer | 471 | * Framebuffer |
| 426 | ******************************************************************************/ | 472 | ******************************************************************************/ |
| 427 | static struct pxafb_mode_info palmz72_lcd_modes[] = { | 473 | static struct pxafb_mode_info palmz72_lcd_modes[] = { |
| @@ -527,17 +573,32 @@ device_initcall(palmz72_pm_init); | |||
| 527 | static struct platform_device *devices[] __initdata = { | 573 | static struct platform_device *devices[] __initdata = { |
| 528 | &palmz72_backlight, | 574 | &palmz72_backlight, |
| 529 | &palmz72_leds, | 575 | &palmz72_leds, |
| 576 | &palmz72_asoc, | ||
| 530 | &power_supply, | 577 | &power_supply, |
| 578 | &palmz72_gpio_vbus, | ||
| 531 | }; | 579 | }; |
| 532 | 580 | ||
| 581 | /* setup udc GPIOs initial state */ | ||
| 582 | static void __init palmz72_udc_init(void) | ||
| 583 | { | ||
| 584 | if (!gpio_request(GPIO_NR_PALMZ72_USB_PULLUP, "USB Pullup")) { | ||
| 585 | gpio_direction_output(GPIO_NR_PALMZ72_USB_PULLUP, 0); | ||
| 586 | gpio_free(GPIO_NR_PALMZ72_USB_PULLUP); | ||
| 587 | } | ||
| 588 | } | ||
| 589 | |||
| 533 | static void __init palmz72_init(void) | 590 | static void __init palmz72_init(void) |
| 534 | { | 591 | { |
| 535 | pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config)); | 592 | pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config)); |
| 593 | |||
| 536 | set_pxa_fb_info(&palmz72_lcd_screen); | 594 | set_pxa_fb_info(&palmz72_lcd_screen); |
| 537 | pxa_set_mci_info(&palmz72_mci_platform_data); | 595 | pxa_set_mci_info(&palmz72_mci_platform_data); |
| 596 | palmz72_udc_init(); | ||
| 538 | pxa_set_ac97_info(NULL); | 597 | pxa_set_ac97_info(NULL); |
| 539 | pxa_set_ficp_info(&palmz72_ficp_platform_data); | 598 | pxa_set_ficp_info(&palmz72_ficp_platform_data); |
| 540 | pxa_set_keypad_info(&palmz72_keypad_platform_data); | 599 | pxa_set_keypad_info(&palmz72_keypad_platform_data); |
| 600 | wm97xx_bat_set_pdata(&wm97xx_batt_pdata); | ||
| 601 | |||
| 541 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 602 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 542 | } | 603 | } |
| 543 | 604 | ||
