dm: usb: Add support for USB keyboards with driver model
Switch USB keyboards over to use driver model instead of scanning with the
horrible usb_get_dev_index() function. This involves creating a new uclass
for keyboards, although so far there is no API.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 1ef55dc..4679134 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -527,11 +527,14 @@
/* Driver model will probe the devices as they are found */
#ifndef CONFIG_DM_USB
-#ifdef CONFIG_USB_STORAGE
+# ifdef CONFIG_USB_STORAGE
/* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
-#endif
-#endif
+# endif
+# ifdef CONFIG_USB_KEYBOARD
+ drv_usb_kbd_init();
+# endif
+#endif /* !CONFIG_DM_USB */
#ifdef CONFIG_USB_HOST_ETHER
# ifdef CONFIG_DM_ETH
# ifndef CONFIG_DM_USB
@@ -542,9 +545,6 @@
usb_ether_curr_dev = usb_host_eth_scan(1);
# endif
#endif
-#ifdef CONFIG_USB_KEYBOARD
- drv_usb_kbd_init();
-#endif
}
#ifdef CONFIG_DM_USB