diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2010-01-11 03:17:25 -0500 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-05-11 11:25:00 -0400 |
commit | b6eede112673678f8a7a1680d6ad12245443829d (patch) | |
tree | 02431b17ebddb2d4c290901f05e33079763b914e /arch/arm/mach-pxa/spitz_pm.c | |
parent | 1fe8c2bcad52d16e4d31d3680b9bb536c56df3d8 (diff) |
[ARM] pxa/spitz: use generic GPIO API and remove pxa_gpio_mode()
REVISIT: change to GPIO18 is ugly, need to make sure whether that's
really necessary - GPIO18_RDY as an VLIO input signal - we don't
normally need to do such kind of trick during low power mode.
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/spitz_pm.c')
-rw-r--r-- | arch/arm/mach-pxa/spitz_pm.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index fc5a70c40358..4209ddf6da61 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c | |||
@@ -24,9 +24,10 @@ | |||
24 | 24 | ||
25 | #include <mach/sharpsl.h> | 25 | #include <mach/sharpsl.h> |
26 | #include <mach/spitz.h> | 26 | #include <mach/spitz.h> |
27 | #include <mach/pxa2xx-regs.h> | 27 | #include <mach/pxa27x.h> |
28 | #include <mach/pxa2xx-gpio.h> | 28 | |
29 | #include "sharpsl.h" | 29 | #include "sharpsl.h" |
30 | #include "generic.h" | ||
30 | 31 | ||
31 | #define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ | 32 | #define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ |
32 | #define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */ | 33 | #define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */ |
@@ -37,10 +38,17 @@ | |||
37 | 38 | ||
38 | static int spitz_last_ac_status; | 39 | static int spitz_last_ac_status; |
39 | 40 | ||
41 | static struct gpio spitz_charger_gpios[] = { | ||
42 | { SPITZ_GPIO_KEY_INT, GPIOF_IN, "Keyboard Interrupt" }, | ||
43 | { SPITZ_GPIO_SYNC, GPIOF_IN, "Sync" }, | ||
44 | { SPITZ_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" }, | ||
45 | { SPITZ_GPIO_JK_B, GPIOF_OUT_INIT_LOW, "JK B" }, | ||
46 | { SPITZ_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" }, | ||
47 | }; | ||
48 | |||
40 | static void spitz_charger_init(void) | 49 | static void spitz_charger_init(void) |
41 | { | 50 | { |
42 | pxa_gpio_mode(SPITZ_GPIO_KEY_INT | GPIO_IN); | 51 | gpio_request_array(ARRAY_AND_SIZE(spitz_charger_gpios)); |
43 | pxa_gpio_mode(SPITZ_GPIO_SYNC | GPIO_IN); | ||
44 | } | 52 | } |
45 | 53 | ||
46 | static void spitz_measure_temp(int on) | 54 | static void spitz_measure_temp(int on) |
@@ -76,6 +84,11 @@ static void spitz_discharge1(int on) | |||
76 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); | 84 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); |
77 | } | 85 | } |
78 | 86 | ||
87 | static unsigned long gpio18_config[] = { | ||
88 | GPIO18_RDY, | ||
89 | GPIO18_GPIO, | ||
90 | }; | ||
91 | |||
79 | static void spitz_presuspend(void) | 92 | static void spitz_presuspend(void) |
80 | { | 93 | { |
81 | spitz_last_ac_status = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); | 94 | spitz_last_ac_status = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); |
@@ -97,7 +110,9 @@ static void spitz_presuspend(void) | |||
97 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; | 110 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; |
98 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); | 111 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); |
99 | 112 | ||
100 | pxa_gpio_mode(GPIO18_RDY|GPIO_OUT | GPIO_DFLT_HIGH); | 113 | pxa2xx_mfp_config(&gpio18_config[0], 1); |
114 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown"); | ||
115 | gpio_free(18); | ||
101 | 116 | ||
102 | PRER = GPIO_bit(SPITZ_GPIO_KEY_INT); | 117 | PRER = GPIO_bit(SPITZ_GPIO_KEY_INT); |
103 | PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); | 118 | PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); |
@@ -114,8 +129,7 @@ static void spitz_presuspend(void) | |||
114 | 129 | ||
115 | static void spitz_postsuspend(void) | 130 | static void spitz_postsuspend(void) |
116 | { | 131 | { |
117 | pxa_gpio_mode(GPIO18_RDY_MD); | 132 | pxa2xx_mfp_config(&gpio18_config[1], 1); |
118 | pxa_gpio_mode(10 | GPIO_IN); | ||
119 | } | 133 | } |
120 | 134 | ||
121 | static int spitz_should_wakeup(unsigned int resume_on_alarm) | 135 | static int spitz_should_wakeup(unsigned int resume_on_alarm) |