]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[ARM] pxa/palm: various fixes for PalmZ72 (mostly audio asoc and usb)
authorMarek Vasut <marek.vasut@gmail.com>
Mon, 1 Jun 2009 20:34:14 +0000 (22:34 +0200)
committerEric Miao <eric.y.miao@gmail.com>
Tue, 16 Jun 2009 08:55:24 +0000 (16:55 +0800)
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
arch/arm/mach-pxa/include/mach/palmz72.h
arch/arm/mach-pxa/palmz72.c

index 5032307ebf7d28cef1ae97005e85eeb363990988..2806ef69ba5a0b99fefe4b92534e96822255d7cc 100644 (file)
@@ -21,7 +21,7 @@
 /* SD/MMC */
 #define GPIO_NR_PALMZ72_SD_DETECT_N            14
 #define GPIO_NR_PALMZ72_SD_POWER_N             98
-#define GPIO_NR_PALMZ72_SD_RO 115
+#define GPIO_NR_PALMZ72_SD_RO                  115
 
 /* Touchscreen */
 #define GPIO_NR_PALMZ72_WM9712_IRQ             27
@@ -31,8 +31,7 @@
 
 /* USB */
 #define GPIO_NR_PALMZ72_USB_DETECT_N           15
-#define GPIO_NR_PALMZ72_USB_POWER              95
-#define GPIO_NR_PALMZ72_USB_PULLUP             12
+#define GPIO_NR_PALMZ72_USB_PULLUP             95
 
 /* LCD/Backlight */
 #define GPIO_NR_PALMZ72_BL_POWER               20
index b88eb4dd2c84169a6b912c9322dceac5e6c416de..c3645aa3fa3d6592910d01f2cc9eb465d044108b 100644 (file)
@@ -27,7 +27,9 @@
 #include <linux/pda_power.h>
 #include <linux/pwm_backlight.h>
 #include <linux/gpio.h>
+#include <linux/wm97xx_batt.h>
 #include <linux/power_supply.h>
+#include <linux/usb/gpio_vbus.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -41,6 +43,8 @@
 #include <mach/irda.h>
 #include <mach/pxa27x_keypad.h>
 #include <mach/udc.h>
+#include <mach/palmasoc.h>
+
 #include <mach/pm.h>
 
 #include "generic.h"
@@ -66,6 +70,8 @@ static unsigned long palmz72_pin_config[] __initdata = {
        GPIO29_AC97_SDATA_IN_0,
        GPIO30_AC97_SDATA_OUT,
        GPIO31_AC97_SYNC,
+       GPIO89_AC97_SYSCLK,
+       GPIO113_AC97_nRESET,
 
        /* IrDA */
        GPIO49_GPIO,    /* ir disable */
@@ -77,8 +83,7 @@ static unsigned long palmz72_pin_config[] __initdata = {
 
        /* USB */
        GPIO15_GPIO,    /* usb detect */
-       GPIO12_GPIO,    /* usb pullup */
-       GPIO95_GPIO,    /* usb power */
+       GPIO95_GPIO,    /* usb pullup */
 
        /* Matrix keypad */
        GPIO100_KP_MKIN_0       | WAKEUP_ON_LEVEL_HIGH,
@@ -354,6 +359,22 @@ static struct platform_device palmz72_leds = {
        }
 };
 
+/******************************************************************************
+ * UDC
+ ******************************************************************************/
+static struct gpio_vbus_mach_info palmz72_udc_info = {
+       .gpio_vbus              = GPIO_NR_PALMZ72_USB_DETECT_N,
+       .gpio_pullup            = GPIO_NR_PALMZ72_USB_PULLUP,
+};
+
+static struct platform_device palmz72_gpio_vbus = {
+       .name   = "gpio-vbus",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &palmz72_udc_info,
+       },
+};
+
 /******************************************************************************
  * Power supply
  ******************************************************************************/
@@ -421,6 +442,31 @@ static struct platform_device power_supply = {
        },
 };
 
+/******************************************************************************
+ * WM97xx battery
+ ******************************************************************************/
+static struct wm97xx_batt_info wm97xx_batt_pdata = {
+       .batt_aux       = WM97XX_AUX_ID3,
+       .temp_aux       = WM97XX_AUX_ID2,
+       .charge_gpio    = -1,
+       .max_voltage    = PALMZ72_BAT_MAX_VOLTAGE,
+       .min_voltage    = PALMZ72_BAT_MIN_VOLTAGE,
+       .batt_mult      = 1000,
+       .batt_div       = 414,
+       .temp_mult      = 1,
+       .temp_div       = 1,
+       .batt_tech      = POWER_SUPPLY_TECHNOLOGY_LIPO,
+       .batt_name      = "main-batt",
+};
+
+/******************************************************************************
+ * aSoC audio
+ ******************************************************************************/
+static struct platform_device palmz72_asoc = {
+       .name = "palm27x-asoc",
+       .id   = -1,
+};
+
 /******************************************************************************
  * Framebuffer
  ******************************************************************************/
@@ -527,17 +573,32 @@ device_initcall(palmz72_pm_init);
 static struct platform_device *devices[] __initdata = {
        &palmz72_backlight,
        &palmz72_leds,
+       &palmz72_asoc,
        &power_supply,
+       &palmz72_gpio_vbus,
 };
 
+/* setup udc GPIOs initial state */
+static void __init palmz72_udc_init(void)
+{
+       if (!gpio_request(GPIO_NR_PALMZ72_USB_PULLUP, "USB Pullup")) {
+               gpio_direction_output(GPIO_NR_PALMZ72_USB_PULLUP, 0);
+               gpio_free(GPIO_NR_PALMZ72_USB_PULLUP);
+       }
+}
+
 static void __init palmz72_init(void)
 {
        pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
+
        set_pxa_fb_info(&palmz72_lcd_screen);
        pxa_set_mci_info(&palmz72_mci_platform_data);
+       palmz72_udc_init();
        pxa_set_ac97_info(NULL);
        pxa_set_ficp_info(&palmz72_ficp_platform_data);
        pxa_set_keypad_info(&palmz72_keypad_platform_data);
+       wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
+
        platform_add_devices(devices, ARRAY_SIZE(devices));
 }