From patchwork Mon Apr 30 14:51:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Majewski?= X-Patchwork-Id: 155885 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 66E7BB6F13 for ; Tue, 1 May 2012 00:52:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B61F2816B; Mon, 30 Apr 2012 16:52:03 +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 FB7pYgv0mpU0; Mon, 30 Apr 2012 16:52:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33EF4281FE; Mon, 30 Apr 2012 16:51:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 881022821F for ; Mon, 30 Apr 2012 16:51:44 +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 yJaXoNtxa5W1 for ; Mon, 30 Apr 2012 16:51:32 +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 mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by theia.denx.de (Postfix) with ESMTP id 66958281D4 for ; Mon, 30 Apr 2012 16:51:28 +0200 (CEST) MIME-version: 1.0 Received: from euspt2 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M3A003LURWO2L30@mailout3.w1.samsung.com> for u-boot@lists.denx.de; Mon, 30 Apr 2012 15:50:48 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M3A00099RXKK0@spt2.w1.samsung.com> for u-boot@lists.denx.de; Mon, 30 Apr 2012 15:51:20 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id 1387B27004B; Mon, 30 Apr 2012 16:52:40 +0200 (CEST) Date: Mon, 30 Apr 2012 16:51:19 +0200 From: Lukasz Majewski In-reply-to: <1334762811-23068-4-git-send-email-l.majewski@samsung.com> To: u-boot@lists.denx.de Message-id: <1335797479-1091-1-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10 References: <1334762811-23068-4-git-send-email-l.majewski@samsung.com> Cc: Marek Vasut , Kyungmin Park Subject: [U-Boot] [PATCH v4 RESEND 3/3] usb:udc:samsung Add functions for storing private gadget data in UDC driver 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This commit adds support for storing private data to Samsung's UDC driver. This data is afterward used by usb gadget. Signed-off-by: Lukasz Majewski Signed-off-by: Kyungmin Park Cc: Marek Vasut --- drivers/usb/gadget/s3c_udc_otg.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c index f7f7b54..1b589b2 100644 --- a/drivers/usb/gadget/s3c_udc_otg.c +++ b/drivers/usb/gadget/s3c_udc_otg.c @@ -30,7 +30,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ - +#undef DEBUG #include #include #include @@ -133,6 +133,18 @@ static void nuke(struct s3c_ep *ep, int status); static int s3c_udc_set_halt(struct usb_ep *_ep, int value); static void s3c_udc_set_nak(struct s3c_ep *ep); +void set_udc_gadget_private_data(void *p) +{ + debug("%s: the_controller: 0x%p, p: 0x%p\n", __func__, + the_controller, p); + the_controller->gadget.dev.device_data = p; +} + +void *get_udc_gadget_private_data(struct usb_gadget *gadget) +{ + return gadget->dev.device_data; +} + static struct usb_ep_ops s3c_ep_ops = { .enable = s3c_ep_enable, .disable = s3c_ep_disable,