From patchwork Thu Sep 1 06:43:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1118422 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p816hAk2024653 for ; Thu, 1 Sep 2011 06:43:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752946Ab1IAGnI (ORCPT ); Thu, 1 Sep 2011 02:43:08 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:53785 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097Ab1IAGnG (ORCPT ); Thu, 1 Sep 2011 02:43:06 -0400 Received: from localhost (p548E0789.dip0.t-ipconnect.de [84.142.7.137]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MPIp6-1QudGi2ipM-0054lN; Thu, 01 Sep 2011 08:43:04 +0200 From: Thierry Reding To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v2 1/2] [media] tm6000: Add fast USB access quirk Date: Thu, 1 Sep 2011 08:43:03 +0200 Message-Id: <1314859384-31465-1-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <4E5F1C87.9050207@redhat.com> References: <4E5F1C87.9050207@redhat.com> X-Provags-ID: V02:K0:JmFZ6NJmIL7HCaT/Z2EXyXPuc9Biush8y/I0GHU9pR6 VcjCUoMVXN/s7gM7jrQ0CM84Y8Q6sG/myufkw3M4+8Jpv4XF+7 epmwWXpGi2WQLn6fqB6XTtqG/EDI0CB+xU08+DoGPRHncAjfMA 6Bi56EC1FSCracf12F1kHbyiIhbyc+POBGieQVmIHoA57XqsC8 rcN/XBa2zCRf/LUxowfgn5+SFWA3QrGa/41IgEmaN5hoby+KTW wzOI1vafgjzyGeT9Gk09CfOGPb/5mqO0GwPNShD0G4kyamNDpa s7P5lYUwdmRIqBQvjewvNF0Fco79Vi+q70Z0k50Xe97Zotxsyn jA+PDpADV74y1DhC81SgBXw3lMer7WS2vt8jppmmsjC1E99Qa6 ImUFAPLnUJuYo+45lyW4vrwqu0kfpZkSFw= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 01 Sep 2011 06:43:10 +0000 (UTC) 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 --- drivers/staging/tm6000/tm6000-core.c | 3 ++- drivers/staging/tm6000/tm6000.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index 64fc1c6..93a0772 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c @@ -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; diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h index dac2063..5bdce84 100644 --- a/drivers/staging/tm6000/tm6000.h +++ b/drivers/staging/tm6000/tm6000.h @@ -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 {