diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2015-09-21 11:47:01 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-10-03 12:40:30 -0400 |
commit | daea5a65dec21de4b1f83c05162b5cb66b1f6c4c (patch) | |
tree | b51df8e9b5f64c48c0e114e60e26e7bebbe68c03 /drivers/platform | |
parent | d9a427ec81e7f1f81cb30777e8fe7dc1f4d03803 (diff) |
intel_mid_powerbtn: Remove misuse of IRQF_NO_SUSPEND flag
The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
be left enabled so as to allow them to work as expected during the
suspend-resume cycle, but doesn't guarantee that it will wake the system
from a suspended state, enable_irq_wake is recommended to be used for
the wakeup.
This patch removes the use of IRQF_NO_SUSPEND flags and uses newly
introduce PM wakeup APIs dev_pm_{set,clear}_wake_irq.
Cc: Darren Hart <dvhart@infradead.org>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel_mid_powerbtn.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/platform/x86/intel_mid_powerbtn.c b/drivers/platform/x86/intel_mid_powerbtn.c index 22606d6b2af3..1fc0de870ff8 100644 --- a/drivers/platform/x86/intel_mid_powerbtn.c +++ b/drivers/platform/x86/intel_mid_powerbtn.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/input.h> | 25 | #include <linux/input.h> |
26 | #include <linux/mfd/intel_msic.h> | 26 | #include <linux/mfd/intel_msic.h> |
27 | #include <linux/pm_wakeirq.h> | ||
27 | 28 | ||
28 | #define DRIVER_NAME "msic_power_btn" | 29 | #define DRIVER_NAME "msic_power_btn" |
29 | 30 | ||
@@ -76,14 +77,17 @@ static int mfld_pb_probe(struct platform_device *pdev) | |||
76 | 77 | ||
77 | input_set_capability(input, EV_KEY, KEY_POWER); | 78 | input_set_capability(input, EV_KEY, KEY_POWER); |
78 | 79 | ||
79 | error = request_threaded_irq(irq, NULL, mfld_pb_isr, IRQF_NO_SUSPEND, | 80 | error = request_threaded_irq(irq, NULL, mfld_pb_isr, 0, |
80 | DRIVER_NAME, input); | 81 | DRIVER_NAME, input); |
81 | if (error) { | 82 | if (error) { |
82 | dev_err(&pdev->dev, "Unable to request irq %d for mfld power" | 83 | dev_err(&pdev->dev, "Unable to request irq %d for mfld power" |
83 | "button\n", irq); | 84 | "button\n", irq); |
84 | goto err_free_input; | 85 | goto err_free_input; |
85 | } | 86 | } |
86 | 87 | ||
88 | device_init_wakeup(&pdev->dev, true); | ||
89 | dev_pm_set_wake_irq(&pdev->dev, irq); | ||
90 | |||
87 | error = input_register_device(input); | 91 | error = input_register_device(input); |
88 | if (error) { | 92 | if (error) { |
89 | dev_err(&pdev->dev, "Unable to register input dev, error " | 93 | dev_err(&pdev->dev, "Unable to register input dev, error " |
@@ -124,6 +128,8 @@ static int mfld_pb_remove(struct platform_device *pdev) | |||
124 | struct input_dev *input = platform_get_drvdata(pdev); | 128 | struct input_dev *input = platform_get_drvdata(pdev); |
125 | int irq = platform_get_irq(pdev, 0); | 129 | int irq = platform_get_irq(pdev, 0); |
126 | 130 | ||
131 | dev_pm_clear_wake_irq(&pdev->dev); | ||
132 | device_init_wakeup(&pdev->dev, false); | ||
127 | free_irq(irq, input); | 133 | free_irq(irq, input); |
128 | input_unregister_device(input); | 134 | input_unregister_device(input); |
129 | 135 | ||