@@ -89,7 +89,8 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
kfree(data);
- msleep(5);
+ if ((dev->quirks & TM6000_QUIRK_NO_USB_DELAY) == 0)
+ msleep(5);
mutex_unlock(&dev->usb_lock);
return ret;
@@ -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 {
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> --- drivers/staging/tm6000/tm6000-core.c | 3 ++- drivers/staging/tm6000/tm6000.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletions(-)