summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-09-20 15:23:00 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-09-20 15:23:00 -0600
commitce278bce8cf2d091e69a6640ad8e23b889cbbedd (patch)
tree15f262a6f5f2f5dcf8c32c04119eaa2b811e6e1c
parent4351d43bb8480bcdb0bc0cb033ed0a6fb37668b3 (diff)
downloadnuttx-ce278bce8cf2d091e69a6640ad8e23b889cbbedd.tar.gz
nuttx-ce278bce8cf2d091e69a6640ad8e23b889cbbedd.tar.bz2
nuttx-ce278bce8cf2d091e69a6640ad8e23b889cbbedd.zip
SAMA5 + HID Keyboard. Fixes to initialize the HID keyboard class
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sam_usb.c20
-rw-r--r--nuttx/drivers/usbhost/usbhost_hidkbd.c12
2 files changed, 25 insertions, 7 deletions
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_usb.c b/nuttx/configs/sama5d3x-ek/src/sam_usb.c
index 8c180ad05..5efc5ad7e 100644
--- a/nuttx/configs/sama5d3x-ek/src/sam_usb.c
+++ b/nuttx/configs/sama5d3x-ek/src/sam_usb.c
@@ -309,7 +309,9 @@ int sam_usbhost_initialize(void)
int ret;
/* First, register all of the class drivers needed to support the drivers
- * that we care about:
+ * that we care about
+ *
+ * Register theUSB host Mass Storage Class:
*/
ret = usbhost_storageinit();
@@ -318,6 +320,22 @@ int sam_usbhost_initialize(void)
udbg("ERROR: Failed to register the mass storage class: %d\n", ret);
}
+ /* Register the USB host HID keyboard class driver */
+
+ ret = usbhost_kbdinit();
+ if (ret != OK)
+ {
+ udbg("ERROR: Failed to register the KBD class\n");
+ }
+
+ /* Then get an instance of the USB host interface.
+ *
+ * REVISIT: This logic needs to be modified. There must be a call-out to
+ * platform specific logic to get the connection hangle. usbhost_initialize()
+ * is not longer common to all platforms and is no longer prototyped in
+ * include/nuttx/usb/usbhost.h.
+ */
+
#ifdef CONFIG_SAMA5_OHCI
/* Get an instance of the USB OHCI interface */
diff --git a/nuttx/drivers/usbhost/usbhost_hidkbd.c b/nuttx/drivers/usbhost/usbhost_hidkbd.c
index 1710a2bb8..e2995628f 100644
--- a/nuttx/drivers/usbhost/usbhost_hidkbd.c
+++ b/nuttx/drivers/usbhost/usbhost_hidkbd.c
@@ -354,7 +354,7 @@ static int usbhost_poll(FAR struct file *filep, FAR struct pollfd *fds,
* device.
*/
-static const const struct usbhost_id_s g_id =
+static const const struct usbhost_id_s g_hidkbd_id =
{
USB_CLASS_HID, /* base */
USBHID_SUBCLASS_BOOTIF, /* subclass */
@@ -365,15 +365,15 @@ static const const struct usbhost_id_s g_id =
/* This is the USB host storage class's registry entry */
-static struct usbhost_registry_s g_skeleton =
+static struct usbhost_registry_s g_hidkbd =
{
NULL, /* flink */
usbhost_create, /* create */
1, /* nids */
- &g_id /* id[] */
+ &g_hidkbd_id /* id[] */
};
-static const struct file_operations usbhost_fops =
+static const struct file_operations g_hidkbd_fops =
{
usbhost_open, /* open */
usbhost_close, /* close */
@@ -1598,7 +1598,7 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
uvdbg("Register driver\n");
usbhost_mkdevname(priv, devname);
- ret = register_driver(devname, &usbhost_fops, 0666, priv);
+ ret = register_driver(devname, &g_hidkbd_fops, 0666, priv);
/* We now have to be concerned about asynchronous modification of crefs
* because the driver has been registerd.
@@ -2350,7 +2350,7 @@ int usbhost_kbdinit(void)
/* Advertise our availability to support (certain) devices */
- return usbhost_registerclass(&g_skeleton);
+ return usbhost_registerclass(&g_hidkbd);
}
#endif /* CONFIG_USBHOST)&& !CONFIG_USBHOST_INT_DISABLE && CONFIG_NFILE_DESCRIPTORS */