From patchwork Tue Apr 7 12:28:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11478057 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 E24F01392 for ; Tue, 7 Apr 2020 12:30:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFEB72078C for ; Tue, 7 Apr 2020 12:30:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="pVakwL8z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728674AbgDGM3g (ORCPT ); Tue, 7 Apr 2020 08:29:36 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:7949 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgDGM3f (ORCPT ); Tue, 7 Apr 2020 08:29:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1586262575; x=1617798575; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=8OHvKFojSgEFCTGWAhdU7SNu+dqnlwN7/WnZMvI74jc=; b=pVakwL8zyJ//+R0iuA4j74dQBrL8a8arIKy+h6sn45OBfxLVl7y1jGOb T/kHz+o6HBdLlFecg4O5SZhyR+AWovL3r2af/dLvfJO2DbYMzF1qgViVw Q7lhMo+oSQVW0i1snWbe/gLTTFLhcycVZzPmP0Z4PIAFjBOMkMoF+oiM8 RPLXb2cK7rBhEDn2FZtoPfmOZHXKIXaD0qaIXk7nm0Kj1icHVE4ycgWTM QH7ClA55gyVyMyvDphyP7WhPD93QLUZoVG4V4GdtVLGHYGy1g9UAhrOgI cyKf/MaYppPwc2wgOZArWRmH0fR+GAGz3Iey9AP6rIN9nVwEo0KGOQofT g==; IronPort-SDR: GwZBSIHIFfiCoXZbUHyuHr/b8kzx/lzfndBhSKU1syyWMLvo6vX3GISvsznv6MwZjk1VLm+mNQ yFxcC6hloe3Nsblo9YDBjsBjoSZkdGBS1k5KrqST8SVPWWlLMkQtEkw6TTukKxuELsleKWWpcX BeYrbgpYB2sfI4I+531nHXtfGa7A35/RH6K/goAWan4SEHG3o0X1bcENSHYHa7DhCmzBPX5k26 Z937XmSZ5GIfHdEDrhjVm6apI/QkNKuY9idjQS3GmeS+A273NIgIhR+dny8b5D18e3aTQZEODY eKg= X-IronPort-AV: E=Sophos;i="5.72,354,1580799600"; d="scan'208";a="69643576" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2020 05:29:34 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 05:29:46 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 05:29:32 -0700 From: To: , , , , , CC: , , Claudiu Beznea Subject: [PATCH 1/7] usb: gadget: udc: atmel: use of_find_matching_node_and_match Date: Tue, 7 Apr 2020 15:28:46 +0300 Message-ID: <20200407122852.19422-2-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407122852.19422-1-cristian.birsan@microchip.com> References: <20200407122852.19422-1-cristian.birsan@microchip.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Claudiu Beznea Instead of trying to match every possible compatible use of_find_matching_node_and_match() and pass the compatible array. Signed-off-by: Claudiu Beznea --- drivers/usb/gadget/udc/atmel_usba_udc.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 6e0432141c40..32e5b44d9fbd 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2052,6 +2052,12 @@ static const struct of_device_id atmel_udc_dt_ids[] = { MODULE_DEVICE_TABLE(of, atmel_udc_dt_ids); +static const struct of_device_id atmel_pmc_dt_ids[] = { + { .compatible = "atmel,at91sam9g45-pmc" }, + { .compatible = "atmel,at91sam9rl-pmc" }, + { .compatible = "atmel,at91sam9x5-pmc" }, +}; + static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, struct usba_udc *udc) { @@ -2067,13 +2073,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, return ERR_PTR(-EINVAL); udc->errata = match->data; - udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc"); - if (IS_ERR(udc->pmc)) - udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9rl-pmc"); - if (IS_ERR(udc->pmc)) - udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9x5-pmc"); - if (udc->errata && IS_ERR(udc->pmc)) - return ERR_CAST(udc->pmc); + if (udc->errata) { + pp = of_find_matching_node_and_match(NULL, atmel_pmc_dt_ids, + NULL); + if (!pp) + return ERR_PTR(-ENODEV); + + udc->pmc = syscon_node_to_regmap(pp); + of_node_put(pp); + if (IS_ERR(udc->pmc)) + return ERR_CAST(udc->pmc); + } udc->num_ep = 0; From patchwork Tue Apr 7 12:28:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11478055 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 910A5912 for ; Tue, 7 Apr 2020 12:30:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B5AF2078A for ; Tue, 7 Apr 2020 12:30:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="vJPB6SKl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728695AbgDGM3i (ORCPT ); Tue, 7 Apr 2020 08:29:38 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:26852 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgDGM3i (ORCPT ); Tue, 7 Apr 2020 08:29:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1586262577; x=1617798577; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=RRSV6rYP6IiNnoNhQap/FmU0DmkdgZjsIA231yL8M+Y=; b=vJPB6SKlTYrdvXd73CaZOt1ID1UVFxU5tIOGo3MzBBosiYuIwBk8oMSq YIQShkx/Nfnk+HXq+hPbv+Qe6R8I9UyriE75W+cv35Q4f3Z3jOOGXTJna Qcu31/R/dXa1TZ31lS+iyutTRiJwDSeXCh8OR1e0oLi5msMzmoL/7mTJN 8CU4WAR45KCg97YOK74FNQcohGX0yOJL0FuVMLFPpB8AuqXSsdjKz5j8S Il7mfwpwB0/ABSjObZCafq6sQadcfTeCCKJgm8cefY6n5ahifhc6NTtqI Ufz8qvy1+NlfYeOgU/5HJpeunhUPiOBI17+WsPhGFhZCqiGots+V4whfm A==; IronPort-SDR: mUWa5jbx10NY5DqQQ9TYyHOl/G1UJsCCuhwjyfqQ82Q7NIxvXssrUX/12MpNsAZ6JzMd9qZ8WG G0D6MP2oywTTgTT0GKE39ec18Qm4q45GSWCbLwf2eFMSkOJqpmQ4mn5stUZgtQIiwJyDmJ6g58 YysAtzTFnuPNYfuU/U/JRVAuaMHHDdkzM0M3tYzy4QdshqPJhGl/INpBtiMcnTlQr+K8KHb6Qi 2lxa9l8JJCK911Dk6RKOV2oAQdXzXxSC7DEV0jaR/RWw+6TcNsr8SNfyM5EvR9icSjmdQ1MkT0 ne0= X-IronPort-AV: E=Sophos;i="5.72,354,1580799600"; d="scan'208";a="75013414" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2020 05:29:37 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 05:29:48 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 05:29:34 -0700 From: To: , , , , , CC: , , Claudiu Beznea Subject: [PATCH 2/7] usb: gadget: udc: atmel: add compatible for SAM9X60's PMC Date: Tue, 7 Apr 2020 15:28:47 +0300 Message-ID: <20200407122852.19422-3-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407122852.19422-1-cristian.birsan@microchip.com> References: <20200407122852.19422-1-cristian.birsan@microchip.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Claudiu Beznea Add compatible for SAM9X60's PMC. Signed-off-by: Claudiu Beznea [cristian.birsan@microchip.com Add sentinel at the end of the array] Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 32e5b44d9fbd..c50902b91a96 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2056,6 +2056,8 @@ static const struct of_device_id atmel_pmc_dt_ids[] = { { .compatible = "atmel,at91sam9g45-pmc" }, { .compatible = "atmel,at91sam9rl-pmc" }, { .compatible = "atmel,at91sam9x5-pmc" }, + { .compatible = "microchip,sam9x60-pmc" }, + { /* sentinel */ } }; static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, From patchwork Tue Apr 7 12:28:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11478053 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 A1705912 for ; Tue, 7 Apr 2020 12:30:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 742F82051A for ; Tue, 7 Apr 2020 12:30:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="ARTkUIkP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728714AbgDGM3l (ORCPT ); Tue, 7 Apr 2020 08:29:41 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:32794 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgDGM3k (ORCPT ); Tue, 7 Apr 2020 08:29:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1586262581; x=1617798581; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=NM+S8OMTmsMYRTLlSMp9bGaPdfxmccXI/+aoH5UKQmY=; b=ARTkUIkPQ89J+jvLV/6RwIC+m3CRVLP9uqeUPoc4LVGb9UPDcqyw/Hna 6SLhxQ9iFn0SmKeF4ZxXvymjTtE4adwnB4pbeM9ErxzqpBGmYa2ItQcwl 0pFu2A7lqpzbQa4VIMG7bHm5MapAQaZ183fjoe101YL0wm+aMHMv77Lrx Wifw9McoNF1LJpsuDo7mQmevMKvPE3nfhLIKylgy7MdCfni9FT10nBR77 fNWpMTBvOsYINJGLWiWxG+xeNBsD9yP+ElDhpq6Da8EXxYyvqgYbOrA0X N78icLfZSrG3dMRSL0qwfklvut0FjFn1QeIZ1EGTZyRQiY78t81qkg2hD w==; IronPort-SDR: iUlV/m0red8C47RO7L5KQr8rbp6swxs+xdLN7tIAtARdQcTP7m6avMkU6oMHHT2XS1Fp8CoS5J 7jYJ0XP93JKicD3AJb7YNQ0UBk/BEoBS7OtENmRoqAGx0fWxvNnQpmntazIGpFW6H6BL6028GN m4cyZrPnixcUfJpnP4S2iH7+L8odZHvp9aBQDPGz3/hGUQSrEwe1ldvYCiU8ZJoGZfRd3V4OCS t0FcSPKHM4QOpN6demaPby1e9ppSbvgaI7Z6qUSREAYntXQiyJvwzzKM59C0cq1uqF+AxV+x7Z L3c= X-IronPort-AV: E=Sophos;i="5.72,354,1580799600"; d="scan'208";a="71684386" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2020 05:29:40 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 05:29:39 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 05:29:37 -0700 From: To: , , , , , CC: , , Cristian Birsan Subject: [PATCH 3/7] usb: gadget: at91_udc: Update DT binding documentation Date: Tue, 7 Apr 2020 15:28:48 +0300 Message-ID: <20200407122852.19422-4-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407122852.19422-1-cristian.birsan@microchip.com> References: <20200407122852.19422-1-cristian.birsan@microchip.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Cristian Birsan Add sam9x60 binding. Signed-off-by: Cristian Birsan --- Documentation/devicetree/bindings/usb/atmel-usb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt index 44e80153b148..bae2b928a014 100644 --- a/Documentation/devicetree/bindings/usb/atmel-usb.txt +++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt @@ -82,6 +82,7 @@ Required properties: "atmel,at91sam9rl-udc" "atmel,at91sam9g45-udc" "atmel,sama5d3-udc" + "microchip,sam9x60-udc" - reg: Address and length of the register set for the device - interrupts: Should contain usba interrupt - clocks: Should reference the peripheral and host clocks From patchwork Tue Apr 7 12:28:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11478043 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 724D2912 for ; Tue, 7 Apr 2020 12:29:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50A0320731 for ; Tue, 7 Apr 2020 12:29:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="A41iwzCU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728737AbgDGM3n (ORCPT ); Tue, 7 Apr 2020 08:29:43 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:26852 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbgDGM3m (ORCPT ); Tue, 7 Apr 2020 08:29:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1586262582; x=1617798582; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Ga/0SlfGS3qQ6nkqm0e0OaiYc62izyThJ4tbzNT9M+s=; b=A41iwzCULSPhVCWajU5H/XuNc0PxeLx+7hzvgFhen/YD5qQSXyh6S95v uk97/Ftq7uHuksIIDrqy6YSo22Obyy3WUBnZv6rKjKfUkU2uzzHohdvyq GmA3JtXFIOE8Q8Q7GoLI9kO75u2sWTcxsphq/Q/zWZRnURJCXBATPg2EB ULBVGpb+BFnaATA6QZ7vpTRE7yRb0NeRrXKsCN2OYxIkoCIaJnV8z+Yjp WcOugzfv4k9XaeFUdb2feZ7Ibl6GkS+6FrFud45sgCi2QBs3JeNflr6NU HuRjk/YnoApdXbkcvu+FRdvj/k7lHY6VIALqn/THeP52MM1lIDIC43ljy A==; IronPort-SDR: 8v8xkZSTzVcSEVuDQc1ZmZqSTT0EpuN8LgWMoGsih4E9Wie2T0Z08eCCQT/vfUvuq9NqVJjvVW HBL3SJvggUSaYw07CIqOY8A4O/hZx7+m9Uws6R1xKbcxsVw4LS2iTftwErVR+f8Bsk7tT0vrFv 0g+q93VGKmsqXw4FcM7iZQ22ued4qhDekcHO9M5GbkRxWRfDcA7G9AEc2P2fFo8sDeE7qDwess 3F3eidGFE2gGblr+BShX8EZPt/J/McnDFm2+dosK6UAJr1Zl4H5oIqEcITtRgeJXIK6uTilIwI Utw= X-IronPort-AV: E=Sophos;i="5.72,354,1580799600"; d="scan'208";a="75013431" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2020 05:29:42 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 05:29:53 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 05:29:39 -0700 From: To: , , , , , CC: , , Cristian Birsan Subject: [PATCH 4/7] usb: gadget: udc: atmel: simplify endpoint allocation Date: Tue, 7 Apr 2020 15:28:49 +0300 Message-ID: <20200407122852.19422-5-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407122852.19422-1-cristian.birsan@microchip.com> References: <20200407122852.19422-1-cristian.birsan@microchip.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Cristian Birsan Simplify the endpoint allocation and cleanup the code. Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 21 ++++++++------------- drivers/usb/gadget/udc/atmel_usba_udc.h | 1 - 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index c50902b91a96..7011438f91d6 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1097,7 +1097,6 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, ep->ept_cfg |= USBA_BF(BK_NUMBER, ep->nr_banks); - ep->udc->configured_ep++; } return _ep; @@ -1790,7 +1789,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) if (status & USBA_END_OF_RESET) { struct usba_ep *ep0, *ep; - int i, n; + int i; usba_writel(udc, INT_CLR, USBA_END_OF_RESET|USBA_END_OF_RESUME @@ -1838,13 +1837,14 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) "ODD: EP0 configuration is invalid!\n"); /* Preallocate other endpoints */ - n = fifo_mode ? udc->num_ep : udc->configured_ep; - for (i = 1; i < n; i++) { + for (i = 1; i < udc->num_ep; i++) { ep = &udc->usba_ep[i]; - usba_ep_writel(ep, CFG, ep->ept_cfg); - if (!(usba_ep_readl(ep, CFG) & USBA_EPT_MAPPED)) - dev_err(&udc->pdev->dev, - "ODD: EP%d configuration is invalid!\n", i); + if (ep->ep.claimed) { + usba_ep_writel(ep, CFG, ep->ept_cfg); + if (!(usba_ep_readl(ep, CFG) & USBA_EPT_MAPPED)) + dev_err(&udc->pdev->dev, + "ODD: EP%d configuration is invalid!\n", i); + } } } @@ -2011,10 +2011,6 @@ static int atmel_usba_stop(struct usb_gadget *gadget) if (udc->vbus_pin) disable_irq(gpiod_to_irq(udc->vbus_pin)); - if (fifo_mode == 0) - udc->configured_ep = 1; - - udc->suspended = false; usba_stop(udc); udc->driver = NULL; @@ -2096,7 +2092,6 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, pp = NULL; while ((pp = of_get_next_child(np, pp))) udc->num_ep++; - udc->configured_ep = 1; } else { udc->num_ep = usba_config_fifo_table(udc); } diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index a0225e4543d4..8de79356d31d 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -324,7 +324,6 @@ struct usba_udc { int irq; struct gpio_desc *vbus_pin; int num_ep; - int configured_ep; struct usba_fifo_cfg *fifo_cfg; struct clk *pclk; struct clk *hclk; From patchwork Tue Apr 7 12:28:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11478045 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 7558B1392 for ; Tue, 7 Apr 2020 12:29:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52FCA2078C for ; Tue, 7 Apr 2020 12:29:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="j85GSKkx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728750AbgDGM3q (ORCPT ); Tue, 7 Apr 2020 08:29:46 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:26852 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728748AbgDGM3p (ORCPT ); Tue, 7 Apr 2020 08:29:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1586262584; x=1617798584; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=5tHbCVV6N4tgdVdrHys4d0EWJHVdHgwDEcQ6SvD2Tt4=; b=j85GSKkxeNymz9np6/vg8+U62/0FwwLS9X6HgfKPKcnIBuEjGuzvSnpY 7V8Kllchl33wVFTnWWCQKbgtaw72eSpbZRBI9wkyMKOsHeRiXR3BqtAq/ 37zG3zmAYuzumBI0/xKMU4jKrx/N6h7nMFmAoNBtvG5DOa2YJYMlGt3hQ oz/ktb8anDK43CRl0Lw71gyAo2DczWu9GiSoaxKWvRle97KxOJtjEqOpC 1tyEAUzb1+YKPkvPLJfdz3Vw4/SLEnT3QnYrqQQlXkkTONpRB+8K2neph rxVGV87fvh4xq7W7wqbF1Qc02X0yPy6KjtKd/Iy4xYwgteyf6AjCooeRw g==; IronPort-SDR: z9miHr9GYeetv0nHWCnswn2u4RsGiP3ywilfFYrcEYXaX1tMoCeQryyvXZ0k8bwY9K2r+8DFiM TSyXFT17VcyX7dXINP5HFYlEwjRXMOhi4AB6D/M1D62cdu2qOfqAAOMSOAv3zEafUmLyJKGy7z 9clJGI58GHt6V/y31H9Wm/kBl4aGjopsXkK7r1hubsJyGhh/qvNOHkJJKD7fnGSWb6znokbA7J pjrKrKo3WKiWwixGCxvISjJPd2WjJvrduapV/lIGpVUERJ9zFe6Byr9nJ+iA86MWFAPk8voRRA uN0= X-IronPort-AV: E=Sophos;i="5.72,354,1580799600"; d="scan'208";a="75013437" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2020 05:29:44 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 05:29:56 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 05:29:42 -0700 From: To: , , , , , CC: , , Cristian Birsan Subject: [PATCH 5/7] usb: gadget: udc: atmel: use 1 bank endpoints for control transfers Date: Tue, 7 Apr 2020 15:28:50 +0300 Message-ID: <20200407122852.19422-6-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407122852.19422-1-cristian.birsan@microchip.com> References: <20200407122852.19422-1-cristian.birsan@microchip.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Cristian Birsan Use 1 bank endpoints for control transfers Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 7011438f91d6..1e2194fe06cb 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1061,6 +1061,7 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, switch (usb_endpoint_type(desc)) { case USB_ENDPOINT_XFER_CONTROL: + ep->nr_banks = 1; break; case USB_ENDPOINT_XFER_ISOC: From patchwork Tue Apr 7 12:28:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11478047 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 6E1231392 for ; Tue, 7 Apr 2020 12:29:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 410D4208FE for ; Tue, 7 Apr 2020 12:29:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="vE2bus5D" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbgDGM3s (ORCPT ); Tue, 7 Apr 2020 08:29:48 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:16110 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728771AbgDGM3s (ORCPT ); Tue, 7 Apr 2020 08:29:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1586262587; x=1617798587; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=EFXIwExObMHjh1goNYVJztAIzdQCu9r/PBJ7CO6BaHE=; b=vE2bus5D7NurWeY6PVm7d+3cDY4Lzw//TcguL1WgpZLHPqIpSJrHL9dQ 6QOGkBckz2Yv7l4+pkcXqQnkQQOB71TvxVVvLJYZLfLCxhgECLXuHtCoj XioCFNsIFNxTWJRJlSK78nUfIuKszP2uPk2C9Qi4UAnLw/lzJI4TKwGrh zqk/8lcQN6aRAAW3Xr2YYQSPk2FtN8EA/qMWwImiH050Zu1ctkUQvVHJZ lLqZB36Rbgo7BvdLZqMow6prYp2be8bWRfuB4BbCrCr0euZbAgCP/GXCe BfLJhcEwCZtvaWcwynwo731IL4NSfM2sCv7MXucqgn5FFB9gi5Y205m2Q g==; IronPort-SDR: Spjj5RbgFc3kEczZLkPqDcNWpJRu6HNsZOf6PzTOlB/qz6FI8ALxNbzNo+4gjKS6nB9xV8Mff7 5QGWgjn6MoviJcWAkxTh58YcyMibB2m2dBYsNARPpI10XrgbTpcLN+/V2hEtuDvyqw1xv8jZCN +lc2qHEGkN/bMGEJMZhok1EPQvpXGiQf4/WSOh2inrrR+jdLa+4g1iiPIYFjsDPlCZ54arag9G 4+gg0WZGOSIRfmVzhz2h0JydeCmpkev045bDlfxF043APpLkrdPujpgoxa+psTj0nzo8pQq2XN xwk= X-IronPort-AV: E=Sophos;i="5.72,354,1580799600"; d="scan'208";a="72565062" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2020 05:29:47 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 05:29:46 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 05:29:44 -0700 From: To: , , , , , CC: , , Cristian Birsan Subject: [PATCH 6/7] usb: gadget: udc: atmel: rename errata into caps Date: Tue, 7 Apr 2020 15:28:51 +0300 Message-ID: <20200407122852.19422-7-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407122852.19422-1-cristian.birsan@microchip.com> References: <20200407122852.19422-1-cristian.birsan@microchip.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Cristian Birsan Rename errata structure into capabilities (caps). It will be used to add capabilities for new SoCs. Get the pointer to PMC only for the SoCs that need it to perform toggle_bias or pulse_bias. Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 21 ++++++++++----------- drivers/usb/gadget/udc/atmel_usba_udc.h | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 1e2194fe06cb..dfe30913c76b 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -389,8 +389,8 @@ static int vbus_is_present(struct usba_udc *udc) static void toggle_bias(struct usba_udc *udc, int is_on) { - if (udc->errata && udc->errata->toggle_bias) - udc->errata->toggle_bias(udc, is_on); + if (udc->caps && udc->caps->toggle_bias) + udc->caps->toggle_bias(udc, is_on); } static void generate_bias_pulse(struct usba_udc *udc) @@ -398,8 +398,8 @@ static void generate_bias_pulse(struct usba_udc *udc) if (!udc->bias_pulse_needed) return; - if (udc->errata && udc->errata->pulse_bias) - udc->errata->pulse_bias(udc); + if (udc->caps && udc->caps->pulse_bias) + udc->caps->pulse_bias(udc); udc->bias_pulse_needed = false; } @@ -2032,17 +2032,17 @@ static void at91sam9g45_pulse_bias(struct usba_udc *udc) AT91_PMC_BIASEN); } -static const struct usba_udc_errata at91sam9rl_errata = { +static const struct usba_udc_caps at91sam9rl_caps = { .toggle_bias = at91sam9rl_toggle_bias, }; -static const struct usba_udc_errata at91sam9g45_errata = { +static const struct usba_udc_caps at91sam9g45_caps = { .pulse_bias = at91sam9g45_pulse_bias, }; static const struct of_device_id atmel_udc_dt_ids[] = { - { .compatible = "atmel,at91sam9rl-udc", .data = &at91sam9rl_errata }, - { .compatible = "atmel,at91sam9g45-udc", .data = &at91sam9g45_errata }, + { .compatible = "atmel,at91sam9rl-udc", .data = &at91sam9rl_caps }, + { .compatible = "atmel,at91sam9g45-udc", .data = &at91sam9g45_caps }, { .compatible = "atmel,sama5d3-udc" }, { /* sentinel */ } }; @@ -2053,7 +2053,6 @@ static const struct of_device_id atmel_pmc_dt_ids[] = { { .compatible = "atmel,at91sam9g45-pmc" }, { .compatible = "atmel,at91sam9rl-pmc" }, { .compatible = "atmel,at91sam9x5-pmc" }, - { .compatible = "microchip,sam9x60-pmc" }, { /* sentinel */ } }; @@ -2071,8 +2070,8 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, if (!match) return ERR_PTR(-EINVAL); - udc->errata = match->data; - if (udc->errata) { + udc->caps = match->data; + if (udc->caps && (udc->caps->pulse_bias || udc->caps->toggle_bias)) { pp = of_find_matching_node_and_match(NULL, atmel_pmc_dt_ids, NULL); if (!pp) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index 8de79356d31d..1a0f77bf8d4f 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -302,7 +302,7 @@ struct usba_request { unsigned int mapped:1; }; -struct usba_udc_errata { +struct usba_udc_caps { void (*toggle_bias)(struct usba_udc *udc, int is_on); void (*pulse_bias)(struct usba_udc *udc); }; @@ -320,7 +320,7 @@ struct usba_udc { struct usb_gadget gadget; struct usb_gadget_driver *driver; struct platform_device *pdev; - const struct usba_udc_errata *errata; + const struct usba_udc_caps *caps; int irq; struct gpio_desc *vbus_pin; int num_ep; From patchwork Tue Apr 7 12:28:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11478049 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 76427912 for ; Tue, 7 Apr 2020 12:29:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 524C92078A for ; Tue, 7 Apr 2020 12:29:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="LK30PICy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728771AbgDGM3v (ORCPT ); Tue, 7 Apr 2020 08:29:51 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:32823 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728784AbgDGM3u (ORCPT ); Tue, 7 Apr 2020 08:29:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1586262591; x=1617798591; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=V1XGm8+lrs3ttcPc2wge9SGUo/478sGSJ11eiBPE2ok=; b=LK30PICyp+bgymBN0GWSd/r6pQt1TIdJSPYpdp3nTIxkt+SqzuJQjMpw Qvyfj/qtQMS0Fu61NLe5sRWz6v1aTdhC3rVQReBUXPbpk058HFBgGE9xW LYXhjk9CW9w3Tz0wITov0g+Cm5maIrSSr/ZDfUQf/OwOBEPhfyl1qFNTP zg1O6hWF4HQV0HArTBeRT7ZRZkMgAxYV17rMyJkBzVZb/cubsYsyfi1O3 /5JbKKJkyYsl3Cm1OSFNmsjs78OnDUBL1yJm0vOpDe84KqlVmzlbQkJZ7 1Or2ipB/hiwUJ2gNhD2THOHXSsbfUHOqOaShltjYpqHE6JyUC4Hp+PqZ/ w==; IronPort-SDR: ny0bsXupWmmLJSObKBLCIa7mRcQpCK/WsszZcDt9MkE1Ft+xygV0uI8zVBuae/W0ncSOuHVhuh brhDl7LVWjr7rWLr06nzZraSirFUjAD+9ln7AeDG1HuNI6nJmrIwb2WLlSNRzLUvVNIeNekc4+ cFIYTsKrW4b4Z61q7ecXIg96pDSVoWEzEhu0ctrj0DkLYbAeoQti/i3OV9FflSbWKxfsunKpIH 2gkQ7MpeePZITu8tZDbtF9d5yFQ8dCkR0CjwGKOX56nZDC8eUS6UnGsZ0B78+Vrf5eEjw4KkPS eAA= X-IronPort-AV: E=Sophos;i="5.72,354,1580799600"; d="scan'208";a="71684398" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Apr 2020 05:29:50 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 05:29:49 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 05:29:47 -0700 From: To: , , , , , CC: , , Cristian Birsan Subject: [PATCH 7/7] usb: gadget: udc: atmel: update endpoint allocation for sam9x60 Date: Tue, 7 Apr 2020 15:28:52 +0300 Message-ID: <20200407122852.19422-8-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407122852.19422-1-cristian.birsan@microchip.com> References: <20200407122852.19422-1-cristian.birsan@microchip.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Cristian Birsan The DPRAM memory from the USB High Speed Device Port (UDPHS) hardware block was increased. This patch updates the endpoint allocation for sam9x60 to take advantage of this larger memory. At the same time the constraint to allocate the endpoints in order was lifted. To handle old and new hardware in the same driver the capabilities (caps) structure was extended. Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 22 ++++++++++++++++++---- drivers/usb/gadget/udc/atmel_usba_udc.h | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index dfe30913c76b..3eb715d4d786 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1066,12 +1066,14 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, case USB_ENDPOINT_XFER_ISOC: ep->fifo_size = 1024; - ep->nr_banks = 2; + if (ep->udc->caps->ep_prealloc) + ep->nr_banks = 2; break; case USB_ENDPOINT_XFER_BULK: ep->fifo_size = 512; - ep->nr_banks = 1; + if (ep->udc->caps->ep_prealloc) + ep->nr_banks = 1; break; case USB_ENDPOINT_XFER_INT: @@ -1081,7 +1083,8 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, else ep->fifo_size = roundup_pow_of_two(le16_to_cpu(desc->wMaxPacketSize)); - ep->nr_banks = 1; + if (ep->udc->caps->ep_prealloc) + ep->nr_banks = 1; break; } @@ -2034,16 +2037,27 @@ static void at91sam9g45_pulse_bias(struct usba_udc *udc) static const struct usba_udc_caps at91sam9rl_caps = { .toggle_bias = at91sam9rl_toggle_bias, + .ep_prealloc = true, }; static const struct usba_udc_caps at91sam9g45_caps = { .pulse_bias = at91sam9g45_pulse_bias, + .ep_prealloc = true, +}; + +static const struct usba_udc_caps sama5d3_caps = { + .ep_prealloc = true, +}; + +static const struct usba_udc_caps at91sam9x60_caps = { + .ep_prealloc = false, }; static const struct of_device_id atmel_udc_dt_ids[] = { { .compatible = "atmel,at91sam9rl-udc", .data = &at91sam9rl_caps }, { .compatible = "atmel,at91sam9g45-udc", .data = &at91sam9g45_caps }, - { .compatible = "atmel,sama5d3-udc" }, + { .compatible = "atmel,sama5d3-udc", .data = &sama5d3_caps }, + { .compatible = "microchip,sam9x60-udc", .data = &at91sam9x60_caps }, { /* sentinel */ } }; diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index 1a0f77bf8d4f..f9239e200e7a 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -305,6 +305,7 @@ struct usba_request { struct usba_udc_caps { void (*toggle_bias)(struct usba_udc *udc, int is_on); void (*pulse_bias)(struct usba_udc *udc); + bool ep_prealloc; }; struct usba_udc {