aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-usb-gpio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 14:38:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 14:38:22 -0500
commite30aee9e10bb5168579e047f05c3d13d09e23356 (patch)
tree12371bdcd52d2427cad838201997479e31b6a9c9 /drivers/extcon/extcon-usb-gpio.c
parent8ff546b801e5cca0337c0f0a7234795d0a6309a1 (diff)
parent6cf18e6927c0b224f972e3042fb85770d63cb9f8 (diff)
Merge tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver patchset for 4.11-rc1. Lots of different driver subsystems updated here: rework for the hyperv subsystem to handle new platforms better, mei and w1 and extcon driver updates, as well as a number of other "minor" driver updates. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (169 commits) goldfish: Sanitize the broken interrupt handler x86/platform/goldfish: Prevent unconditional loading vmbus: replace modulus operation with subtraction vmbus: constify parameters where possible vmbus: expose hv_begin/end_read vmbus: remove conditional locking of vmbus_write vmbus: add direct isr callback mode vmbus: change to per channel tasklet vmbus: put related per-cpu variable together vmbus: callback is in softirq not workqueue binder: Add support for file-descriptor arrays binder: Add support for scatter-gather binder: Add extra size to allocator binder: Refactor binder_transact() binder: Support multiple /dev instances binder: Deal with contexts in debugfs binder: Support multiple context managers binder: Split flat_binder_object auxdisplay: ht16k33: remove private workqueue auxdisplay: ht16k33: rework input device initialization ...
Diffstat (limited to 'drivers/extcon/extcon-usb-gpio.c')
-rw-r--r--drivers/extcon/extcon-usb-gpio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
index d589c5feff3d..a5e1882b4ca6 100644
--- a/drivers/extcon/extcon-usb-gpio.c
+++ b/drivers/extcon/extcon-usb-gpio.c
@@ -27,6 +27,7 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/workqueue.h> 28#include <linux/workqueue.h>
29#include <linux/acpi.h> 29#include <linux/acpi.h>
30#include <linux/pinctrl/consumer.h>
30 31
31#define USB_GPIO_DEBOUNCE_MS 20 /* ms */ 32#define USB_GPIO_DEBOUNCE_MS 20 /* ms */
32 33
@@ -245,6 +246,9 @@ static int usb_extcon_suspend(struct device *dev)
245 if (info->vbus_gpiod) 246 if (info->vbus_gpiod)
246 disable_irq(info->vbus_irq); 247 disable_irq(info->vbus_irq);
247 248
249 if (!device_may_wakeup(dev))
250 pinctrl_pm_select_sleep_state(dev);
251
248 return ret; 252 return ret;
249} 253}
250 254
@@ -253,6 +257,9 @@ static int usb_extcon_resume(struct device *dev)
253 struct usb_extcon_info *info = dev_get_drvdata(dev); 257 struct usb_extcon_info *info = dev_get_drvdata(dev);
254 int ret = 0; 258 int ret = 0;
255 259
260 if (!device_may_wakeup(dev))
261 pinctrl_pm_select_default_state(dev);
262
256 if (device_may_wakeup(dev)) { 263 if (device_may_wakeup(dev)) {
257 if (info->id_gpiod) { 264 if (info->id_gpiod) {
258 ret = disable_irq_wake(info->id_irq); 265 ret = disable_irq_wake(info->id_irq);