misc: ti-st: Adding IORESOURCE_IRQ_OPTIONAL case
Harry Hong [Mon, 26 Aug 2013 05:53:01 +0000 (14:53 +0900)]
if flag is IORESOURCE_IRQ_OPTIONAL, don't request irq
because this irq need to be registered in another driver.

bug 1347948

Change-Id: I3178aca5b09421b5f6c53d28b6327f530d405e9c
Signed-off-by: Harry Hong <hhong@nvidia.com>
Reviewed-on: http://git-master/r/265925
(cherry picked from commit a69c29fc91cf581fdd678fa05a6b33568ef9ccc7)
Reviewed-on: http://git-master/r/288819
Reviewed-by: Peter Kim <pekim@nvidia.com>
Tested-by: Peter Kim <pekim@nvidia.com>

drivers/misc/ti-st/st_host_wake.c

index fed9ba3..2568a04 100644 (file)
@@ -2,6 +2,7 @@
  *  Shared Transport Host wake up driver
  *  For protocols registered over Shared Transport
  *  Copyright (C) 2011-2012 Texas Instruments
+ *  Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -176,15 +177,16 @@ static int st_host_wake_probe(struct platform_device *pdev)
                goto free_bsi;
        }
 
-       if (res->flags & IORESOURCE_IRQ_LOWEDGE)
-               ret = request_irq(bsi->host_wake_irq, st_host_wake_isr,
-                               IRQF_DISABLED | IRQF_TRIGGER_FALLING,
-                               "bluetooth hostwake", dev_id);
-       else
-               ret = request_irq(bsi->host_wake_irq, st_host_wake_isr,
-                               IRQF_DISABLED | IRQF_TRIGGER_RISING,
-                               "bluetooth hostwake", dev_id);
-
+       if (!(res->flags & IORESOURCE_IRQ_OPTIONAL)) {
+               if (res->flags & IORESOURCE_IRQ_LOWEDGE)
+                       ret = request_irq(bsi->host_wake_irq, st_host_wake_isr,
+                                       IRQF_DISABLED | IRQF_TRIGGER_FALLING,
+                                       "bluetooth hostwake", dev_id);
+               else
+                       ret = request_irq(bsi->host_wake_irq, st_host_wake_isr,
+                                       IRQF_DISABLED | IRQF_TRIGGER_RISING,
+                                       "bluetooth hostwake", dev_id);
+       }
        if (ret < 0) {
                pr_err("Couldn't acquire HOST_WAKE IRQ");
                goto free_bsi;