]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb_kbd: Add support for watchdog
authorMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jun 2018 12:16:54 +0000 (14:16 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 19 Jul 2018 08:49:53 +0000 (10:49 +0200)
There is need to service watchdog in while loop or system will be
restarted when idlying.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
common/usb_kbd.c

index 8b2fccf9ca46eb0c1f56c61113c72cffa993c11e..406bd37e6a7f31639d852163f8969b1c098b0a38 100644 (file)
@@ -13,6 +13,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <stdio_dev.h>
+#include <watchdog.h>
 #include <asm/byteorder.h>
 
 #include <usb.h>
@@ -387,8 +388,10 @@ static int usb_kbd_getc(struct stdio_dev *sdev)
        usb_kbd_dev = (struct usb_device *)dev->priv;
        data = usb_kbd_dev->privptr;
 
-       while (data->usb_in_pointer == data->usb_out_pointer)
+       while (data->usb_in_pointer == data->usb_out_pointer) {
+               WATCHDOG_RESET();
                usb_kbd_poll_for_event(usb_kbd_dev);
+       }
 
        if (data->usb_out_pointer == USB_KBD_BUFFER_LEN - 1)
                data->usb_out_pointer = 0;