diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2011-10-17 05:37:23 (GMT) |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@marvell.com> | 2011-11-14 13:07:59 (GMT) |
commit | 9bf448c66d4b4cb03813b39195d408701ecf1fab (patch) | |
tree | a3beacb964fe5765d73687342da3b4851bc098eb /arch/arm/mach-pxa/spitz_pm.c | |
parent | df664d20814f9b3c3020ced7088a328b477ecf8d (diff) | |
download | linux-9bf448c66d4b4cb03813b39195d408701ecf1fab.tar.xz |
ARM: pxa: use generic gpio operation instead of gpio register
Remove the code of accessing gpio register. Use the generic read
operation instead.
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Diffstat (limited to 'arch/arm/mach-pxa/spitz_pm.c')
-rw-r--r-- | arch/arm/mach-pxa/spitz_pm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 094279a..5cc05d1 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c @@ -41,6 +41,7 @@ static int spitz_last_ac_status; static struct gpio spitz_charger_gpios[] = { { SPITZ_GPIO_KEY_INT, GPIOF_IN, "Keyboard Interrupt" }, { SPITZ_GPIO_SYNC, GPIOF_IN, "Sync" }, + { SPITZ_GPIO_AC_IN, GPIOF_IN, "Charger Detection" }, { SPITZ_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" }, { SPITZ_GPIO_JK_B, GPIOF_OUT_INIT_LOW, "JK B" }, { SPITZ_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" }, @@ -169,14 +170,19 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm) static unsigned long spitz_charger_wakeup(void) { - return (~GPLR0 & GPIO_bit(SPITZ_GPIO_KEY_INT)) | (GPLR0 & GPIO_bit(SPITZ_GPIO_SYNC)); + unsigned long ret; + ret = (!gpio_get_value(SPITZ_GPIO_KEY_INT) + << GPIO_bit(SPITZ_GPIO_KEY_INT)) + | (!gpio_get_value(SPITZ_GPIO_SYNC) + << GPIO_bit(SPITZ_GPIO_SYNC)); + return ret; } unsigned long spitzpm_read_devdata(int type) { switch (type) { case SHARPSL_STATUS_ACIN: - return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0); + return !gpio_get_value(SPITZ_GPIO_AC_IN); case SHARPSL_STATUS_LOCK: return gpio_get_value(sharpsl_pm.machinfo->gpio_batlock); case SHARPSL_STATUS_CHRGFULL: |