diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2008-11-18 14:23:32 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2008-12-02 01:43:48 -0500 |
commit | c96763d4dc2f4032369f068a5d185238e01da478 (patch) | |
tree | f6fca23cb7de429019536f6fcbc7dfc81560a55a | |
parent | a0361a8afeaa07274e21907e4488eedceb12e3d6 (diff) |
[ARM] pxa/MioA701: discovered new gpio definitions.
The charger enable gpio is straight (1 means draw from USB
Vbus, 0 mean do not draw). The USB Vbus sensing is inverted
(1 means no Vbus voltage sensed, 0 means Vbus voltage
present).
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
-rw-r--r-- | arch/arm/mach-pxa/include/mach/mioa701.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-pxa/mioa701.c | 22 |
2 files changed, 18 insertions, 13 deletions
diff --git a/arch/arm/mach-pxa/include/mach/mioa701.h b/arch/arm/mach-pxa/include/mach/mioa701.h index 8483cb511831..02868447b0b1 100644 --- a/arch/arm/mach-pxa/include/mach/mioa701.h +++ b/arch/arm/mach-pxa/include/mach/mioa701.h | |||
@@ -10,12 +10,14 @@ | |||
10 | (MFP_PIN(pin) | MFP_##af | MFP_DIR_OUT | MFP_LPM_##state)) | 10 | (MFP_PIN(pin) | MFP_##af | MFP_DIR_OUT | MFP_LPM_##state)) |
11 | 11 | ||
12 | /* Global GPIOs */ | 12 | /* Global GPIOs */ |
13 | #define GPIO9_CHARGE_nEN 9 | 13 | #define GPIO9_CHARGE_EN 9 |
14 | #define GPIO18_POWEROFF 18 | 14 | #define GPIO18_POWEROFF 18 |
15 | #define GPIO87_LCD_POWER 87 | 15 | #define GPIO87_LCD_POWER 87 |
16 | #define GPIO96_AC_DETECT 96 | ||
17 | #define GPIO80_MAYBE_CHARGE_VDROP 80 /* Drop of 88mV */ | ||
16 | 18 | ||
17 | /* USB */ | 19 | /* USB */ |
18 | #define GPIO13_USB_DETECT 13 | 20 | #define GPIO13_nUSB_DETECT 13 |
19 | #define GPIO22_USB_ENABLE 22 | 21 | #define GPIO22_USB_ENABLE 22 |
20 | 22 | ||
21 | /* SDIO bits */ | 23 | /* SDIO bits */ |
@@ -24,7 +26,10 @@ | |||
24 | #define GPIO91_SDIO_EN 91 | 26 | #define GPIO91_SDIO_EN 91 |
25 | 27 | ||
26 | /* Bluetooth */ | 28 | /* Bluetooth */ |
29 | #define GPIO14_BT_nACTIVITY 14 | ||
27 | #define GPIO83_BT_ON 83 | 30 | #define GPIO83_BT_ON 83 |
31 | #define GPIO77_BT_UNKNOWN1 77 | ||
32 | #define GPIO86_BT_MAYBE_nRESET 86 | ||
28 | 33 | ||
29 | /* GPS */ | 34 | /* GPS */ |
30 | #define GPIO23_GPS_UNKNOWN1 23 | 35 | #define GPIO23_GPS_UNKNOWN1 23 |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 8252f329ad70..04a2cb38b075 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -57,10 +57,11 @@ | |||
57 | 57 | ||
58 | static unsigned long mioa701_pin_config[] = { | 58 | static unsigned long mioa701_pin_config[] = { |
59 | /* Mio global */ | 59 | /* Mio global */ |
60 | MIO_CFG_OUT(GPIO9_CHARGE_nEN, AF0, DRIVE_LOW), | 60 | MIO_CFG_OUT(GPIO9_CHARGE_EN, AF0, DRIVE_LOW), |
61 | MIO_CFG_OUT(GPIO18_POWEROFF, AF0, DRIVE_LOW), | 61 | MIO_CFG_OUT(GPIO18_POWEROFF, AF0, DRIVE_LOW), |
62 | MFP_CFG_OUT(GPIO3, AF0, DRIVE_HIGH), | 62 | MFP_CFG_OUT(GPIO3, AF0, DRIVE_HIGH), |
63 | MFP_CFG_OUT(GPIO4, AF0, DRIVE_HIGH), | 63 | MFP_CFG_OUT(GPIO4, AF0, DRIVE_HIGH), |
64 | MIO_CFG_IN(GPIO80_MAYBE_CHARGE_VDROP, AF0), | ||
64 | 65 | ||
65 | /* Backlight PWM 0 */ | 66 | /* Backlight PWM 0 */ |
66 | GPIO16_PWM0_OUT, | 67 | GPIO16_PWM0_OUT, |
@@ -77,7 +78,7 @@ static unsigned long mioa701_pin_config[] = { | |||
77 | MIO_CFG_OUT(GPIO91_SDIO_EN, AF0, DRIVE_LOW), | 78 | MIO_CFG_OUT(GPIO91_SDIO_EN, AF0, DRIVE_LOW), |
78 | 79 | ||
79 | /* USB */ | 80 | /* USB */ |
80 | MIO_CFG_IN(GPIO13_USB_DETECT, AF0), | 81 | MIO_CFG_IN(GPIO13_nUSB_DETECT, AF0), |
81 | MIO_CFG_OUT(GPIO22_USB_ENABLE, AF0, DRIVE_LOW), | 82 | MIO_CFG_OUT(GPIO22_USB_ENABLE, AF0, DRIVE_LOW), |
82 | 83 | ||
83 | /* LCD */ | 84 | /* LCD */ |
@@ -116,11 +117,14 @@ static unsigned long mioa701_pin_config[] = { | |||
116 | GPIO85_CIF_LV, | 117 | GPIO85_CIF_LV, |
117 | 118 | ||
118 | /* Bluetooth */ | 119 | /* Bluetooth */ |
120 | MIO_CFG_IN(GPIO14_BT_nACTIVITY, AF0), | ||
119 | GPIO44_BTUART_CTS, | 121 | GPIO44_BTUART_CTS, |
120 | GPIO42_BTUART_RXD, | 122 | GPIO42_BTUART_RXD, |
121 | GPIO45_BTUART_RTS, | 123 | GPIO45_BTUART_RTS, |
122 | GPIO43_BTUART_TXD, | 124 | GPIO43_BTUART_TXD, |
123 | MIO_CFG_OUT(GPIO83_BT_ON, AF0, DRIVE_LOW), | 125 | MIO_CFG_OUT(GPIO83_BT_ON, AF0, DRIVE_LOW), |
126 | MIO_CFG_OUT(GPIO77_BT_UNKNOWN1, AF0, DRIVE_HIGH), | ||
127 | MIO_CFG_OUT(GPIO86_BT_MAYBE_nRESET, AF0, DRIVE_HIGH), | ||
124 | 128 | ||
125 | /* GPS */ | 129 | /* GPS */ |
126 | MIO_CFG_OUT(GPIO23_GPS_UNKNOWN1, AF0, DRIVE_LOW), | 130 | MIO_CFG_OUT(GPIO23_GPS_UNKNOWN1, AF0, DRIVE_LOW), |
@@ -173,15 +177,11 @@ static unsigned long mioa701_pin_config[] = { | |||
173 | GPIO118_I2C_SDA, | 177 | GPIO118_I2C_SDA, |
174 | 178 | ||
175 | /* Unknown */ | 179 | /* Unknown */ |
176 | MFP_CFG_IN(GPIO14, AF0), | ||
177 | MFP_CFG_IN(GPIO20, AF0), | 180 | MFP_CFG_IN(GPIO20, AF0), |
178 | MFP_CFG_IN(GPIO21, AF0), | 181 | MFP_CFG_IN(GPIO21, AF0), |
179 | MFP_CFG_IN(GPIO33, AF0), | 182 | MFP_CFG_IN(GPIO33, AF0), |
180 | MFP_CFG_OUT(GPIO49, AF0, DRIVE_HIGH), | 183 | MFP_CFG_OUT(GPIO49, AF0, DRIVE_HIGH), |
181 | MFP_CFG_OUT(GPIO57, AF0, DRIVE_HIGH), | 184 | MFP_CFG_OUT(GPIO57, AF0, DRIVE_HIGH), |
182 | MFP_CFG_OUT(GPIO77, AF0, DRIVE_HIGH), | ||
183 | MFP_CFG_IN(GPIO80, AF0), | ||
184 | MFP_CFG_OUT(GPIO86, AF0, DRIVE_HIGH), | ||
185 | MFP_CFG_IN(GPIO96, AF0), | 185 | MFP_CFG_IN(GPIO96, AF0), |
186 | MFP_CFG_OUT(GPIO116, AF0, DRIVE_HIGH), | 186 | MFP_CFG_OUT(GPIO116, AF0, DRIVE_HIGH), |
187 | }; | 187 | }; |
@@ -428,7 +428,7 @@ static void udc_power_command(int cmd) | |||
428 | 428 | ||
429 | static int is_usb_connected(void) | 429 | static int is_usb_connected(void) |
430 | { | 430 | { |
431 | return !!gpio_get_value(GPIO13_USB_DETECT); | 431 | return !gpio_get_value(GPIO13_nUSB_DETECT); |
432 | } | 432 | } |
433 | 433 | ||
434 | static struct pxa2xx_udc_mach_info mioa701_udc_info = { | 434 | static struct pxa2xx_udc_mach_info mioa701_udc_info = { |
@@ -682,7 +682,7 @@ static char *supplicants[] = { | |||
682 | 682 | ||
683 | static void mioa701_set_charge(int flags) | 683 | static void mioa701_set_charge(int flags) |
684 | { | 684 | { |
685 | gpio_set_value(GPIO9_CHARGE_nEN, !flags); | 685 | gpio_set_value(GPIO9_CHARGE_EN, (flags == PDA_POWER_CHARGE_USB)); |
686 | } | 686 | } |
687 | 687 | ||
688 | static struct pda_power_pdata power_pdata = { | 688 | static struct pda_power_pdata power_pdata = { |
@@ -695,8 +695,8 @@ static struct pda_power_pdata power_pdata = { | |||
695 | static struct resource power_resources[] = { | 695 | static struct resource power_resources[] = { |
696 | [0] = { | 696 | [0] = { |
697 | .name = "ac", | 697 | .name = "ac", |
698 | .start = gpio_to_irq(GPIO13_USB_DETECT), | 698 | .start = gpio_to_irq(GPIO13_nUSB_DETECT), |
699 | .end = gpio_to_irq(GPIO13_USB_DETECT), | 699 | .end = gpio_to_irq(GPIO13_nUSB_DETECT), |
700 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | | 700 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | |
701 | IORESOURCE_IRQ_LOWEDGE, | 701 | IORESOURCE_IRQ_LOWEDGE, |
702 | }, | 702 | }, |
@@ -908,7 +908,7 @@ static void mioa701_restart(char c) | |||
908 | } | 908 | } |
909 | 909 | ||
910 | struct gpio_ress global_gpios[] = { | 910 | struct gpio_ress global_gpios[] = { |
911 | MIO_GPIO_OUT(GPIO9_CHARGE_nEN, 1, "Charger enable"), | 911 | MIO_GPIO_OUT(GPIO9_CHARGE_EN, 1, "Charger enable"), |
912 | MIO_GPIO_OUT(GPIO18_POWEROFF, 0, "Power Off"), | 912 | MIO_GPIO_OUT(GPIO18_POWEROFF, 0, "Power Off"), |
913 | MIO_GPIO_OUT(GPIO87_LCD_POWER, 0, "LCD Power") | 913 | MIO_GPIO_OUT(GPIO87_LCD_POWER, 0, "LCD Power") |
914 | }; | 914 | }; |