diff mbox series

[v1,09/19] hid-ft260: uart: wakeup device early to not lose rx data

Message ID 20240210215147.77629-10-michael.zaidman@gmail.com
State New
Headers show
Series hid-ft260: Fixes for serial driver patch v4 | expand

Commit Message

Michael Zaidman Feb. 10, 2024, 9:51 p.m. UTC
Waking up the ft260 device from power saving mode earlier reduces the
probability of incoming data loss.

Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com>
---
 drivers/hid/hid-ft260.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index ccd20f590720..6266e4f1100d 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -1285,8 +1285,6 @@  static int ft260_uart_change_speed(struct ft260_device *port,
 	bool wakeup_workaraund = false;
 	int ret;
 
-	ft260_uart_wakeup(port);
-
 	memset(&req, 0, sizeof(req));
 
 	req.report = FT260_SYSTEM_SETTINGS;
@@ -1529,6 +1527,9 @@  static int ft260_uart_activate(struct tty_port *tport, struct tty_struct *tty)
 	ft260_uart_change_speed(port, &tty->termios, NULL);
 	clear_bit(TTY_IO_ERROR, &tty->flags);
 
+	/* Wake up the chip as early as possible to not miss incoming data */
+	ft260_uart_wakeup(port);
+
 	if (port->reschedule_work) {
 		mod_timer(&port->wakeup_timer, jiffies +
 			  msecs_to_jiffies(FT260_WAKEUP_NEEDED_AFTER_MS));