Thread (23 messages) 23 messages, 3 authors, 2024-02-23
STALE827d

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

From: Michael Zaidman <michael.zaidman@gmail.com>
Date: 2024-02-10 21:53:27
Also in: linux-serial, lkml
Subsystem: ft260 ftdi usb-hid to i2c bridge driver, hid core layer, the rest · Maintainers: Michael Zaidman, Jiri Kosina, Benjamin Tissoires, Linus Torvalds

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 --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));
-- 
2.40.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help