From patchwork Wed Jul 8 18:04:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 11652337 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9BC76C1 for ; Wed, 8 Jul 2020 19:33:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF6B1206DF for ; Wed, 8 Jul 2020 19:33:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IE51uHVF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b="JrkBxlZ5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF6B1206DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rere.qmqm.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References:In-Reply-To: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OhHiDjdlnaA7CkKMQit/McBEbZ9egAQOX1d6RYfbNJY=; b=IE51uHVFKfdU+HzxTx0CS4mdp hSolk1237VPiXlhQCSMNtmYQ01dzzUm4WMOXMIdKu9/Zu2OK7Bh1QG4puJlw1EW2GyTe83nH1cH09 8O7ikQ5W3EJ7VfDZG8FSrlttY+UitzBhouprECmj4+Oo36DnqEeoXx4fO2RfOcEob8aW2B2SiaKDr BJ7He7qKuZITgHwNB87kiRjmJ8DffIWW8xCtvzXUkuWAmllaU/s7EEne+QRJksPzPSfi/CRAwJWES UAi9blDpJL5VZGNMhq283dWnoCqGoMfuRotVyYGT987s2IRWAdyA/YmD8HSpo6rJYwJqnsnM/vQ7g xnkYkRuFA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtFnk-0000SQ-Oa; Wed, 08 Jul 2020 19:32:16 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtEQf-0006Ao-Tt for linux-arm-kernel@lists.infradead.org; Wed, 08 Jul 2020 18:04:39 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4B26d556fGzHb; Wed, 8 Jul 2020 20:04:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1594231449; bh=QmkFZ9eFWaDioQbY5TlOYF/cOWllJop5t2LIsaqe1rM=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=JrkBxlZ5jKWUHDm0hXV++Dlk2XK/I2oBoMGhHmhzOgs3LeFkbiDUGKtMARXjl4mCa QJf6hPBpozoCeTK1oeycyVo2/UfeqYH+S7Y2+QxrEXmKROhG6XT1aA4L0isgZL3OED JfWJ8ckX5mlTI5pxvC597tXlBNNCSsaPmmh5EbFib4vyqa4UTqtlxyf/UbZxytxXTF UiYpbO+9qBlTfMdY3uFBJfs3cRU1weXgPxxE2TcjfCqtPF8JZ8kw0zZ6w8NzunWdHf OD9zCdlDQ0ehUtUd+LF66u5dQMh7O2q7529Q2bYPCc1uN5m+XWAMEudgqZJye5Ae0D 7LEl+p9MObGlw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at mail Date: Wed, 08 Jul 2020 20:04:09 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH RESEND 1/3] usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable() MIME-Version: 1.0 To: Alexandre Belloni , Cristian Birsan , Felipe Balbi , Greg Kroah-Hartman , Ludovic Desroches , Nicolas Ferre , Songjun Wu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200708_140422_488325_5707E393 X-CRM114-Status: GOOD ( 10.46 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fixed commit removed the offending behaviour from the driver, but missed the comment and associated test. Remove them now. Fixes: 38e58986e6fc ("usb: gadget: udc: atmel: don't disable enpdoints we don't own") Signed-off-by: Michał Mirosław Acked-by: Alexandre Belloni Acked-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index d69f61ff0181..9153e220848d 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -676,13 +676,7 @@ static int usba_ep_disable(struct usb_ep *_ep) if (!ep->ep.desc) { spin_unlock_irqrestore(&udc->lock, flags); - /* REVISIT because this driver disables endpoints in - * reset_all_endpoints() before calling disconnect(), - * most gadget drivers would trigger this non-error ... - */ - if (udc->gadget.speed != USB_SPEED_UNKNOWN) - DBG(DBG_ERR, "ep_disable: %s not enabled\n", - ep->ep.name); + DBG(DBG_ERR, "ep_disable: %s not enabled\n", ep->ep.name); return -EINVAL; } ep->ep.desc = NULL; From patchwork Wed Jul 8 18:04:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 11652227 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A314513B1 for ; Wed, 8 Jul 2020 18:26:53 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CBF9206F6 for ; Wed, 8 Jul 2020 18:26:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FOfLJZjf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b="Dy2H4kyZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CBF9206F6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rere.qmqm.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References:In-Reply-To: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=A3BMFnkCrjF2qDs0A2OwupCMPJEVMHhbu+YA1+v6NNM=; b=FOfLJZjfpTHm6Ut6MBvu8E2uB CRw0bOarN6N1Whbzp3FvlDS1OqF6b+E/0RtZzRg3a8/hXt4S1MGxKOJWcqKNyxSF0EvXH/fqZTpJU Bhr8kqn9MUdOuWH3sYBz2/rYrcvI0e3DHXSPHVA0xf5F7X/N1cWjZnWxWWRQYK/yZEnNho/pEgCq+ vLWrhPhIrIbRtgjdnp59SyRI7/FSAxtZOWEczotmw2CSNCEqw2s0ZrbNpys6jk2KkCOwjErEfPC6P lRLG6OYJix2df+ZXRt2By35MndOnXr1RndNhQreFGklBhHq0LyLZagQUKYKfbi64zFKD+fSioKv3i 3dDiEJ2qA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtEks-0007xb-P8; Wed, 08 Jul 2020 18:25:14 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtEQf-0006An-VM for linux-arm-kernel@lists.infradead.org; Wed, 08 Jul 2020 18:04:40 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4B26d60W3NzMK; Wed, 8 Jul 2020 20:04:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1594231450; bh=r3FexnWOGPLoKtGxgqbQb3w5FegJpG2pFaJligFub9Q=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=Dy2H4kyZY48Pt9ZFLiCLIJdFhup5pYVlRW+XQV6z2hbmGRqKUKENRqLzyE0FQ/KAs eI02tfwbOv8vq7EbqdHy7+NiMiUhwW65EhHNSOZ3f0MxfYnMe+OvfAEH3dSKzPn8ts GrnMw4+l7qGZZSvkHO9tyOC+hw4syiE4j/qxVWZnkojFHew1fCjYowsXsppzHGVr9E 0aDaRLZJR9PBbohHnMD68VGmir/B/XHJDKFwv1MfTFYx0heNVvNG25JaxjPtaHjEyv Qwh366QO+esPNguUjtvLAM5S8oO294/OxUfSSBYa9foSPtg2ZtrI5ybFrAeYMIhjiB ZLx+PPDvyx8yQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at mail Date: Wed, 08 Jul 2020 20:04:09 +0200 Message-Id: <248e7089f7fbb3727e83a1dfb43820d96a69e8c2.1594231056.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH RESEND 2/3] usb: gadget: udc: atmel: fix uninitialized read in debug printk MIME-Version: 1.0 To: Alexandre Belloni , Cristian Birsan , Felipe Balbi , Greg Kroah-Hartman , Ludovic Desroches , Nicolas Ferre , Songjun Wu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200708_140422_506733_A506F3D9 X-CRM114-Status: GOOD ( 11.26 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fixed commit moved the assignment of 'req', but did not update a reference in the DBG() call. Use the argument as it was renamed. Fixes: 5fb694f96e7c ("usb: gadget: udc: atmel: fix possible oops when unloading module") Signed-off-by: Michał Mirosław Acked-by: Alexandre Belloni Acked-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 9153e220848d..9342a3d24963 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -865,7 +865,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) u32 status; DBG(DBG_GADGET | DBG_QUEUE, "ep_dequeue: %s, req %p\n", - ep->ep.name, req); + ep->ep.name, _req); spin_lock_irqsave(&udc->lock, flags); From patchwork Wed Jul 8 18:04:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 11652229 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3D90913 for ; Wed, 8 Jul 2020 18:27:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CDC1206F6 for ; Wed, 8 Jul 2020 18:27:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DScmtZ+u"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b="bum1GQm0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CDC1206F6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rere.qmqm.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References:In-Reply-To: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=F2+wpcaMc/b30DNmPfWEmNXYYsUqQjmQ1kuGoS6qyCM=; b=DScmtZ+uJditNZTAT/KgSl+oU h+3qID4ScX0VljU4Qm+quUxY+96SzzlIIzV1XNKqvQrUNC5BOQIFbclAJDB5imHi2pZCZfyFRlaWQ U59XO8DWKL3dfOruBcsMIG8kg9LwsXfgdH6cs8x22ptIwEasafpiP6N8+uWX5QEDTNQ+QuMl7fFNY D1JTUJN1pW+F5ssfKZf0rcJA9Wl29WiSZ/CVd8uOqqm4OCdqc9oGvSlkArzlqDjafE0y7hJAKNavS JN3O23GAOTvZV8jbPGi/3p7ZQPzYv9N2KTxahEmjEZiwSEA4h82R4Pnu1IwKI1ZfTHcAjbcOg/mcc 1pQoYktBg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtEl4-00083w-9M; Wed, 08 Jul 2020 18:25:26 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtEQf-0006B8-UX for linux-arm-kernel@lists.infradead.org; Wed, 08 Jul 2020 18:04:41 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4B26d75cftzMP; Wed, 8 Jul 2020 20:04:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1594231451; bh=xM/vWleWXURnCmkoT1m4VqMEiH0DaR/Qp4g8IWC4YVs=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=bum1GQm0msIj7p2nETmbGZKQvjcCCBWedhvYhFIwdap2XWn9HbP4noedwDNa9Bqf9 yJPsrYv7s7dGMaZcWKLKGDV6FdkSPNxd4uca77CeZwf9geRele95F5ejAyU47ERikf es/U/qXq156uvIANDAhaILaey+XAN/h/8ruo/L76LJoaBUr2hWqhyBJNxjbGzyUogM qbwXpz+YTAzfLBviQq1ZHqtKtqe8hmd+Vzal2ZgE7rym8D0S1L8ijOfqKLCoLFwIyP bOyC4dAkIyhlJrRlie0BDBBauiNyiyj0WoIZyKvJeq3logf0xzrkc1mMdhekB0DINQ mpdTeCwmyyG/g== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at mail Date: Wed, 08 Jul 2020 20:04:10 +0200 Message-Id: <63121e624012996a2f6f5f3763270ad834667a12.1594231056.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH RESEND 3/3] usb: gadget: udc: atmel: implement .pullup callback MIME-Version: 1.0 To: Alexandre Belloni , Cristian Birsan , Felipe Balbi , Greg Kroah-Hartman , Ludovic Desroches , Nicolas Ferre , Songjun Wu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200708_140422_489985_347718FB X-CRM114-Status: GOOD ( 10.21 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Implement udc->pullup callback, so that udc_connect/disconnect work. This is needed for composite gadget, as it assumes udc_disconnect() actually works and calls its ->disconnect callback. Signed-off-by: Michał Mirosław Acked-by: Alexandre Belloni Acked-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 9342a3d24963..c5128c229c52 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1028,6 +1028,7 @@ usba_udc_set_selfpowered(struct usb_gadget *gadget, int is_selfpowered) return 0; } +static int atmel_usba_pullup(struct usb_gadget *gadget, int is_on); static int atmel_usba_start(struct usb_gadget *gadget, struct usb_gadget_driver *driver); static int atmel_usba_stop(struct usb_gadget *gadget); @@ -1101,6 +1102,7 @@ static const struct usb_gadget_ops usba_udc_ops = { .get_frame = usba_udc_get_frame, .wakeup = usba_udc_wakeup, .set_selfpowered = usba_udc_set_selfpowered, + .pullup = atmel_usba_pullup, .udc_start = atmel_usba_start, .udc_stop = atmel_usba_stop, .match_ep = atmel_usba_match_ep, @@ -1957,6 +1959,24 @@ static irqreturn_t usba_vbus_irq_thread(int irq, void *devid) return IRQ_HANDLED; } +static int atmel_usba_pullup(struct usb_gadget *gadget, int is_on) +{ + struct usba_udc *udc = container_of(gadget, struct usba_udc, gadget); + unsigned long flags; + u32 ctrl; + + spin_lock_irqsave(&udc->lock, flags); + ctrl = usba_readl(udc, CTRL); + if (is_on) + ctrl &= ~USBA_DETACH; + else + ctrl |= USBA_DETACH; + usba_writel(udc, CTRL, ctrl); + spin_unlock_irqrestore(&udc->lock, flags); + + return 0; +} + static int atmel_usba_start(struct usb_gadget *gadget, struct usb_gadget_driver *driver) {