aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/sharpsl_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/sharpsl_pm.c')
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index bdf4cb88ca0a..9a154bad1984 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -879,7 +879,7 @@ static const struct platform_suspend_ops sharpsl_pm_ops = {
879 879
880static int __devinit sharpsl_pm_probe(struct platform_device *pdev) 880static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
881{ 881{
882 int ret; 882 int ret, irq;
883 883
884 if (!pdev->dev.platform_data) 884 if (!pdev->dev.platform_data)
885 return -EINVAL; 885 return -EINVAL;
@@ -907,24 +907,28 @@ static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
907 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); 907 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
908 908
909 /* Register interrupt handlers */ 909 /* Register interrupt handlers */
910 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) { 910 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_acin);
911 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin)); 911 if (request_irq(irq, sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
912 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
912 } 913 }
913 914
914 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) { 915 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock);
915 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock)); 916 if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
917 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
916 } 918 }
917 919
918 if (sharpsl_pm.machinfo->gpio_fatal) { 920 if (sharpsl_pm.machinfo->gpio_fatal) {
919 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) { 921 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal);
920 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal)); 922 if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
923 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
921 } 924 }
922 } 925 }
923 926
924 if (sharpsl_pm.machinfo->batfull_irq) { 927 if (sharpsl_pm.machinfo->batfull_irq) {
925 /* Register interrupt handler. */ 928 /* Register interrupt handler. */
926 if (request_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) { 929 irq = gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull);
927 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull)); 930 if (request_irq(irq, sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
931 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
928 } 932 }
929 } 933 }
930 934
@@ -953,14 +957,14 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
953 957
954 led_trigger_unregister_simple(sharpsl_charge_led_trigger); 958 led_trigger_unregister_simple(sharpsl_charge_led_trigger);
955 959
956 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr); 960 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
957 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr); 961 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
958 962
959 if (sharpsl_pm.machinfo->gpio_fatal) 963 if (sharpsl_pm.machinfo->gpio_fatal)
960 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr); 964 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
961 965
962 if (sharpsl_pm.machinfo->batfull_irq) 966 if (sharpsl_pm.machinfo->batfull_irq)
963 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); 967 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
964 968
965 gpio_free(sharpsl_pm.machinfo->gpio_batlock); 969 gpio_free(sharpsl_pm.machinfo->gpio_batlock);
966 gpio_free(sharpsl_pm.machinfo->gpio_batfull); 970 gpio_free(sharpsl_pm.machinfo->gpio_batfull);