From patchwork Sat Sep 14 08:32:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 274900 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 674142C0123 for ; Sat, 14 Sep 2013 18:34:50 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 379D24A080; Sat, 14 Sep 2013 10:34:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o5atLxf1HWog; Sat, 14 Sep 2013 10:34:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C74A24A081; Sat, 14 Sep 2013 10:34:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5AD0A4A07F for ; Sat, 14 Sep 2013 10:34:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WnvUJEiuMolj for ; Sat, 14 Sep 2013 10:34:13 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by theia.denx.de (Postfix) with ESMTP id 168354A061 for ; Sat, 14 Sep 2013 10:34:09 +0200 (CEST) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MT300FEPX4RUD40@mailout1.samsung.com> for u-boot@lists.denx.de; Sat, 14 Sep 2013 17:34:04 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 51.CB.20109.C7F14325; Sat, 14 Sep 2013 17:34:04 +0900 (KST) X-AuditID: cbfee68f-b7f1e6d000004e8d-7d-52341f7c92b2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 46.03.09055.C7F14325; Sat, 14 Sep 2013 17:34:04 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.214.169]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MT3000S4X4MT840@mmp2.samsung.com>; Sat, 14 Sep 2013 17:34:04 +0900 (KST) From: Vivek Gautam To: u-boot@lists.denx.de, patches@linaro.org Date: Sat, 14 Sep 2013 14:02:44 +0530 Message-id: <1379147573-21897-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1379147573-21897-1-git-send-email-gautam.vivek@samsung.com> References: <1379147573-21897-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeLIzCtJLcpLzFFi42JZI2JSpVsjbxJk8O2pkUX36S2sFh2HHjNZ vGlrZLToONLCaDHl8BcWi29btjFaLH+9kd3i7d5OdgcOj9kNF1k85s06weKxYFOpx51re9g8 zt7ZwejRt2UVo8fxG9uZAtijuGxSUnMyy1KL9O0SuDK6J6xgK1giXNG0ooupgfEZfxcjB4eE gInElmNWXYycQKaYxIV769m6GLk4hASWMkp8Wr2CESJhInHr3QsWEFtIYDqjxKyGTAh7CpPE iY/OIDabgK5E09tdYPUiAjoSz5fdZAUZxCx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4k1JrKxKLcqPLyrNSS0+xJgMdNVEZinR5Hxg/OeVxBsam5ibGptamliYmFmSJqwkznug 1TpQSCA9sSQ1OzW1ILUIZgsTB6dUA+PCcwbCnws5c7vL5ysZvrrzSTq7+ctbTuceXRbDvOZD PBOuz+XwStgVzXf9w2zXibelIydbmi5YkuUte/G09vptTbXvJa+W7r/QIBG4cxrTpzu5YXp8 GfGP934uWFG4k+VZ3fZzT834VObs5enqn9a+I3LtMYsPR/We3P7FfTPkSuus4nmPvO8rsRRn JBpqMRcVJwIAI/9DS/UCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: Marek Vasut , u-boot-review@google.com, Julius Werner Subject: [U-Boot] [PATCH v3 01/10] usb: Move 'bmRequestType' USB device request macros from EHCI header X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Macros defining bmRequestType field of USB device request, given in table 9.2 USB 2.0 spec, are rather generic macros which can be further used by other Host controller stacks. So moving them to usb_defs header. Signed-off-by: Vivek Gautam Cc: Julius Werner Cc: Simon Glass Cc: Minkyu Kang Cc: Dan Murphy Cc: Marek Vasut --- Changes since v2: - This patch is newly added in this version of the series. drivers/usb/host/ehci.h | 16 ---------------- include/usb_defs.h | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index bd52afe..3e1c312 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -28,22 +28,6 @@ #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 #endif -/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */ -#define DeviceRequest \ - ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8) - -#define DeviceOutRequest \ - ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8) - -#define InterfaceRequest \ - ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) - -#define EndpointRequest \ - ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) - -#define EndpointOutRequest \ - ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) - /* * Register Space. */ diff --git a/include/usb_defs.h b/include/usb_defs.h index 0cf5f2d..236a5ec 100644 --- a/include/usb_defs.h +++ b/include/usb_defs.h @@ -63,6 +63,25 @@ #define USB_DIR_OUT 0 #define USB_DIR_IN 0x80 +/* + * bmRequestType: USB Device Requests, table 9.2 USB 2.0 spec. + * (shifted) direction/type/recipient. + */ +#define DeviceRequest \ + ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8) + +#define DeviceOutRequest \ + ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8) + +#define InterfaceRequest \ + ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) + +#define EndpointRequest \ + ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) + +#define EndpointOutRequest \ + ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) + /* Descriptor types */ #define USB_DT_DEVICE 0x01 #define USB_DT_CONFIG 0x02