]> git.sur5r.net Git - u-boot/commitdiff
usb: Add an interval parameter to create_int_queue
authorHans de Goede <hdegoede@redhat.com>
Sun, 11 Jan 2015 19:38:28 +0000 (20:38 +0100)
committerMarek Vasut <marex@denx.de>
Sun, 18 Jan 2015 11:31:35 +0000 (12:31 +0100)
Currently create_int_queue is only implemented by the ehci code, and that
does not honor interrupt intervals, but other drivers which might also want
to implement create_int_queue may honor intervals, so add an interval param.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
common/usb_kbd.c
drivers/usb/host/ehci-hcd.c
include/usb.h

index bc7145ea79d38b87ce173b2b14dc9bf444f40826..0d477439076cbf4d60c6a89a4d25ab5f2a78207b 100644 (file)
@@ -332,7 +332,8 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev)
                /* We've consumed all queued int packets, create new */
                destroy_int_queue(dev, data->intq);
                data->intq = create_int_queue(dev, data->intpipe, 1,
-                                     USB_KBD_BOOT_REPORT_SIZE, data->new);
+                                     USB_KBD_BOOT_REPORT_SIZE, data->new,
+                                     data->intinterval);
        }
 #endif
 }
@@ -453,7 +454,8 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
        debug("USB KBD: enable interrupt pipe...\n");
 #ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
        data->intq = create_int_queue(dev, data->intpipe, 1,
-                                     USB_KBD_BOOT_REPORT_SIZE, data->new);
+                                     USB_KBD_BOOT_REPORT_SIZE, data->new,
+                                     data->intinterval);
        if (!data->intq) {
 #else
        if (usb_submit_int_msg(dev, data->intpipe, data->new, data->intpktsize,
index bc7606646bbcf9ac76ab679a8f85405ceaa6d45a..f1fb19013281c6483c052ce77b64689faf09fe93 100644 (file)
@@ -1148,7 +1148,7 @@ disable_periodic(struct ehci_ctrl *ctrl)
 
 struct int_queue *
 create_int_queue(struct usb_device *dev, unsigned long pipe, int queuesize,
-                int elementsize, void *buffer)
+                int elementsize, void *buffer, int interval)
 {
        struct ehci_ctrl *ctrl = dev->controller;
        struct int_queue *result = NULL;
@@ -1398,7 +1398,7 @@ submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        debug("dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d",
              dev, pipe, buffer, length, interval);
 
-       queue = create_int_queue(dev, pipe, 1, length, buffer);
+       queue = create_int_queue(dev, pipe, 1, length, buffer, interval);
        if (!queue)
                return -1;
 
index d3c741597c64f64c06281f3d3ce807769d91f4e9..3d33b2d46aa9e0bc822a6aa7f638a9da9651ffb6 100644 (file)
@@ -169,7 +169,7 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
 #ifdef CONFIG_USB_EHCI /* Only the ehci code has pollable int support */
 struct int_queue *create_int_queue(struct usb_device *dev, unsigned long pipe,
-       int queuesize, int elementsize, void *buffer);
+       int queuesize, int elementsize, void *buffer, int interval);
 int destroy_int_queue(struct usb_device *dev, struct int_queue *queue);
 void *poll_int_queue(struct usb_device *dev, struct int_queue *queue);
 #endif