Karoly Pados a8eda9fa1b USB: serial: ftdi_sio: fix GPIO not working in autosuspend
There is a bug in the current GPIO code for ftdi_sio: it failed to take USB
autosuspend into account. If the device is in autosuspend, calls to
usb_control_msg() fail with -EHOSTUNREACH. Because the standard value for
autosuspend timeout is usually 2-5 seconds, this made it almost impossible
to use the GPIOs on machines that have USB autosuspend enabled. This patch
fixes the issue by acquiring a PM lock on the device for the duration of
the USB transfers. Tested on an FT231X device.

Signed-off-by: Karoly Pados <pados@pados.hu>
[ johan: simplify code somewhat ]
Fixes: ba93cc7da896 ("USB: serial: ftdi_sio: implement GPIO support for FT-X devices")
Cc: stable <stable@vger.kernel.org>	# 4.20
Signed-off-by: Johan Hovold <johan@kernel.org>
2019-01-14 14:40:11 +01:00
..
2018-10-13 00:50:35 -04:00
2018-07-20 21:47:15 +02:00
2017-11-04 11:58:00 +01:00
2018-10-13 00:50:35 -04:00
2018-10-13 00:50:38 -04:00
2018-10-13 00:50:38 -04:00
2018-10-13 00:50:39 -04:00
2017-11-04 11:58:00 +01:00
2018-10-13 00:50:41 -04:00