aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-08-29 16:51:58 -0400
committerRob Herring <rob.herring@calxeda.com>2012-09-14 10:21:58 -0400
commit74595e1764e271911c73e8ab816e0be269420134 (patch)
treead24da1725e997ce4edf2801f13c346591ce9919 /arch/arm
parent121f3f9b42eb1e1e9edb6ab0f8672e92dd610a31 (diff)
ARM: pxa: use gpio_to_irq for sharppm_sl
Replace custom PXA_GPIO_TO_IRQ macro with standard gpio_to_irq. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Diffstat (limited to 'arch/arm')
-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);