[media] tm6000: Add fast USB access quirk
authorThierry Reding <thierry.reding@avionic-design.de>
Thu, 1 Sep 2011 05:43:03 +0000 (02:43 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 21 Sep 2011 18:59:19 +0000 (15:59 -0300)
Some devices support fast access to registers using the USB interface
while others require a certain delay after each operation. This commit
adds a quirk that can be enabled by devices that don't need the delay.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/tm6000/tm6000-core.c
drivers/staging/tm6000/tm6000.h

index b3c4e0529f4fecc77eeb02a572f87aab278780f2..6d0803c886be3197ddb3dd63fbb25acea7d50be2 100644 (file)
@@ -619,7 +619,8 @@ int tm6000_reset(struct tm6000_core *dev)
                return err;
        }
 
-       msleep(5);
+       if ((dev->quirks & TM6000_QUIRK_NO_USB_DELAY) == 0)
+               msleep(5);
 
        /*
         * Not all devices have int_in defined
index dac20637c6960465922a71ddf77b61f34c0d432b..5bdce84f8d60787a7d4fc5640b7fd7db672ca4a4 100644 (file)
@@ -169,6 +169,8 @@ struct tm6000_endpoint {
        unsigned                        maxsize;
 };
 
+#define TM6000_QUIRK_NO_USB_DELAY (1 << 0)
+
 struct tm6000_core {
        /* generic device properties */
        char                            name[30];       /* name (including minor) of the device */
@@ -260,6 +262,8 @@ struct tm6000_core {
        struct usb_isoc_ctl          isoc_ctl;
 
        spinlock_t                   slock;
+
+       unsigned long quirks;
 };
 
 enum tm6000_ops_type {