uart: mediatek: support Rx in-band wakeup
authorClaire Chang <tientzu@chromium.org>
Mon, 27 May 2019 08:31:50 +0000 (16:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Jun 2019 17:10:27 +0000 (19:10 +0200)
commit9315ad99ed5bc3865cef0da56e705549cd04fe7e
tree6e392aa766be3d212940821ebab53900969dbcfa
parent277375b864e8147975b064b513f491e2a910e66a
uart: mediatek: support Rx in-band wakeup

In order to support Rx in-band wakeup, we need to enable irq wake on an
edge sensitive interrupt of Rx pin before suspend and disable it when
resuming.

This interrupt is used only as wake source to resume the system when
suspended. Note that the sent character will be lost as the controller is
actually suspended.

We use this to support wakeup on bluetooth. Bluetooth will repeatedly send
0xFD to wakeup host. Once host detects Rx falling, an interrupt is
triggered, and the system leaves sleep state. Then, the bluetooth driver
will send 0xFC to bluetooth and bluetooth can start to send normal HCI
packets.

Signed-off-by: Claire Chang <tientzu@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_mtk.c