diff mbox series

[v1,06/19] hid-ft260: uart: enable wakeup workaround

Message ID 20240210215147.77629-7-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
The FT260 has a "power saving mode" that causes the device to switch
to a 30 kHz oscillator if there's no activity for 5 seconds.
Unfortunately, this mode can only be disabled by reprogramming
internal fuses, or external eeprom if exists.

One effect of this mode is to cause data loss on an Rx line at baud
rates higher than 4800 after being idle for longer than 5 seconds.

We work around this by sending a dummy report at least once per 4.8
seconds if the UART is in use. But it is not acctivated in the
"[PATCH v4 RESEND] hid-ft260: Add serial driver"
https://lore.kernel.org/all/20231218093153.192268-1-contact@christina-quast.de/

It causes data loss on the Rx line at the driver's default 9600 baud rate.

Enable periodic dummy report to prevent data loss on Rx line upon exiting
from power saving mode.

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

Patch

diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index 3d6beac0b8b6..19599e64c6be 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -1575,7 +1575,7 @@  static int ft260_uart_probe(struct hid_device *hdev, struct ft260_device *dev)
 	INIT_WORK(&dev->wakeup_work, ft260_uart_do_wakeup);
 	// FIXME: Do I need that if I have cancel_work_sync?
 	// FIXME: are all kfifo access secured by lock? with irq or not?
-	dev->reschedule_work = false;
+	dev->reschedule_work = true;
 	/* Work not started at this point */
 	timer_setup(&dev->wakeup_timer, ft260_uart_start_wakeup, 0);