diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-03-28 11:18:54 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-06-11 10:20:44 -0400 |
commit | d5af27783f8c898b64f7079908ad3e27632a71ea (patch) | |
tree | fadee7695d8f7eaf79f6e002e5eb519e51d3a149 /arch/arm/mach-pxa/sharpsl_pm.c | |
parent | 5452537210d59268cbc283526dc050f0822385f1 (diff) |
[ARM] pxa/sharpsl_pm: cleanup of gpio-related code.
Replace calls to pxa_gpio_mode with respective gpio_request() /
gpio_direction_input(). In principle these calls can be dropped as
the only use of those GPIO are IRQs and IRQ code does setup GPIO
correctly.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-pxa/sharpsl_pm.c')
-rw-r--r-- | arch/arm/mach-pxa/sharpsl_pm.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index a8facf476fa4..dfac7b9a7352 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/leds.h> | 24 | #include <linux/leds.h> |
25 | #include <linux/suspend.h> | 25 | #include <linux/suspend.h> |
26 | #include <linux/gpio.h> | ||
26 | 27 | ||
27 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
28 | #include <mach/pm.h> | 29 | #include <mach/pm.h> |
@@ -918,9 +919,12 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev) | |||
918 | 919 | ||
919 | sharpsl_pm.machinfo->init(); | 920 | sharpsl_pm.machinfo->init(); |
920 | 921 | ||
921 | pxa_gpio_mode(sharpsl_pm.machinfo->gpio_acin | GPIO_IN); | 922 | gpio_request(sharpsl_pm.machinfo->gpio_acin, "AC IN"); |
922 | pxa_gpio_mode(sharpsl_pm.machinfo->gpio_batfull | GPIO_IN); | 923 | gpio_direction_input(sharpsl_pm.machinfo->gpio_acin); |
923 | pxa_gpio_mode(sharpsl_pm.machinfo->gpio_batlock | GPIO_IN); | 924 | gpio_request(sharpsl_pm.machinfo->gpio_batfull, "Battery Full"); |
925 | gpio_direction_input(sharpsl_pm.machinfo->gpio_batfull); | ||
926 | gpio_request(sharpsl_pm.machinfo->gpio_batlock, "Battery Lock"); | ||
927 | gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); | ||
924 | 928 | ||
925 | /* Register interrupt handlers */ | 929 | /* Register interrupt handlers */ |
926 | if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) { | 930 | if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) { |
@@ -979,6 +983,10 @@ static int sharpsl_pm_remove(struct platform_device *pdev) | |||
979 | if (sharpsl_pm.machinfo->batfull_irq) | 983 | if (sharpsl_pm.machinfo->batfull_irq) |
980 | free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); | 984 | free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); |
981 | 985 | ||
986 | gpio_free(sharpsl_pm.machinfo->gpio_batlock); | ||
987 | gpio_free(sharpsl_pm.machinfo->gpio_batfull); | ||
988 | gpio_free(sharpsl_pm.machinfo->gpio_acin); | ||
989 | |||
982 | if (sharpsl_pm.machinfo->exit) | 990 | if (sharpsl_pm.machinfo->exit) |
983 | sharpsl_pm.machinfo->exit(); | 991 | sharpsl_pm.machinfo->exit(); |
984 | 992 | ||