From patchwork Wed Jul 22 13:44:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11678521 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 EE2C1912 for ; Wed, 22 Jul 2020 13:46:56 +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 C6B5E2064C for ; Wed, 22 Jul 2020 13:46:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2XB8RlsH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="1BvOKHwC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6B5E2064C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com 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:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bFRxlC2XHWYvkNxKTxV4hdrW7h4Nk/8Xh0NhuLxglZM=; b=2XB8RlsH7o4F9A370AEZgIDeW vl9blSPjYh97zfPrKfYHZl0ktxA1ZBBc7MGCZdaxQUm8r9GmMtQ1vphGokXIDGhn2qIw1YJLFR9U1 7lKfFXMwYmB6OfrQskXs6yLV0hosGSaVtWgQpHmwCQx5onyTRJA9dPJlQd3BNbGpGN8NURq0r6xku StLm+p76L+/vcSFj5FG6O11jBMaMUdkKJRAgvWwJaK/StOilpe9RukW1uiRROFQT4r3PMU5AHkDPQ aLyS7ErW/nfudpiMm2OoJ2L6mScMm6+yl5f8VjUXyuRKKra7mYcCzdy1WJiqg/MC5U95E5SEtYC/p LLMHc9QrA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF2z-00075e-12; Wed, 22 Jul 2020 13:44:37 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF2v-00074h-B4 for linux-arm-kernel@lists.infradead.org; Wed, 22 Jul 2020 13:44:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595425473; x=1626961473; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LJ5a5zW2HlzZmrctuphKUjLbHmULw+4CLiQ9IBxCDFc=; b=1BvOKHwCjl4W4clOOXJ1IVt0Dp41Ap5HWu9ZfwS9U6P2dwZhrPWoTXWo gHnj5gUrkVYxOz++sCgB3O6+0w/KCpLJuk4rtnGppOHCqj2O4U4iwulll jFplh2/bvfYPUj0kaceHl/v9Wzst5P/VpOKvF2r8mJBrtEfFiVrCrwakk YskOYzgf13N3AoqjtGbs0/yBq/H7LglhifCxDngV8WFXnnmqyY4SbY8+C KBNZWwzOODikF2HFt2g7oexqH/VhE3kDWmi2T/e+FrnFXhJ5LxFicSB4P /kLt0l/kqNAbVFL5miIn1F1Cx04v683lx3PIFbepsBoBKlhaQJRfY9mSS A==; IronPort-SDR: c+T80368qAGQokoVoIRBT4mGga38vMwiY9veQa/e7thJA3szdFsuHMhRG579esd66j+IFIoof5 nHQQ5/cUCTI2RPXNWLwabFzDN44pVPUgzLhTsq7dKf4el4MP5lcwqO6Mun23LB4Vgp5n3UmmLj zzcLlmtZINjEpaf6cBUBi2K1UOAIT99hSmlRknRlEoEFVMKjpii9ovI1ATh3TIdx3gFFJAK6KZ Ahf0YelzNbTHyq+nfry3oXVfnxJcJGz2LdKBmlgc/qhrHDVrYsUAW+11C3HFFX0mTxI6IeBm6P o2E= X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="84955380" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Jul 2020 06:44:28 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.1979.3; Wed, 22 Jul 2020 06:44:28 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 22 Jul 2020 06:43:46 -0700 From: To: , , , , , , , , , , Subject: [PATCH v3 1/6] usb: gadget: udc: atmel: use of_find_matching_node_and_match Date: Wed, 22 Jul 2020 16:44:16 +0300 Message-ID: <20200722134421.190741-2-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200722134421.190741-1-cristian.birsan@microchip.com> References: <20200722134421.190741-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_094433_524464_3F8AACDC X-CRM114-Status: GOOD ( 10.61 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Claudiu Beznea Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index c5128c229c52..ee2b550aa400 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2112,6 +2112,13 @@ 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" }, + { /* sentinel */ } +}; + static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, struct usba_udc *udc) { @@ -2128,13 +2135,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, udc_config = match->data; udc->errata = udc_config->errata; - 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 Wed Jul 22 13:44:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11678523 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 62AF1912 for ; Wed, 22 Jul 2020 13:47:10 +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 3A1502064C for ; Wed, 22 Jul 2020 13:47:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oU3Piv/K"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="RkIvw5Io" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A1502064C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com 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:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sspU/BcsLqtAskL2SyuGx2xOMbljOpSkX6acXGRMKz0=; b=oU3Piv/KLj2+zTajDPDdc/4Qo PniGRL599vYpSydc4pAvr0fAubTeCE2uoQVnxboRFhGBGopDofUt726JQvP6nzFFUQBL3FzrGcu0t 1XlPKrzRnByCMNcv/FDmlAwwSNsruu9C7+rRMGnMbXl4Z8O7+l74LfWlOtpABa3pd/rs4Kq0CZC7s bipai1/kj5klm3Lto36hjH/o6gXm7pbZz+k1LTVYXrS2qWvsKtviB0yqRqo51g2ZbqTP0J6HElnOY Xj7WjrIA4MgIzt0FUqZuh0qQ3WB23l5F9oEOt5b2LLBgsM3PhnsVJDAF0Z61AawiANgJGf0c5Rd0Z 3ANR5/uBw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF3H-0007B0-7C; Wed, 22 Jul 2020 13:44:55 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF34-00076M-Cq for linux-arm-kernel@lists.infradead.org; Wed, 22 Jul 2020 13:44:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595425482; x=1626961482; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JFzmp3IpT2/vSAdFB2tkC7kXSDjHPZkrYg58Jnu3Ns4=; b=RkIvw5Iotv+SCA9+IOOQS/oJkUOTygaxZyPVmjSHmkZNI/Un4j32EWac ps6MyPXRffq8idnbI759ksRVlfnuOtbMX3YhElFsOZhkppemge1IchhPc N15vcsW0BHMkZFJ8DoCqcVyV6TEUCfIq5AYmUUTrXjzJ2UVkSjZr04yHA 38vjwbW40Mln9zA9QAcaYV9CbvNKNj6Kml4RevtmLk2lYZfTZDiB/FrO8 InZwaVyz7qEjl/zU5vryY4Ol29OMj6hkFCpK3Pj5O6F1/MHKfsd3FMKBC ukBm1XzaA2jkmVrUyLCMV0p8xbgUIQc1h19fUqP5FgdfCmSxvPSWmTPbX w==; IronPort-SDR: GXI+AelBLfDF4k+vg4jPexQSY4dmsVzVsrIyDtwSkCHaEO9CNQK90IdR5elR1COg+J1keBMh3W skM/d1jPPOLqTTn2lUYjFABaaB+eRdeWPZ5sMB+OjsQWB6LkYCGDFzOok/V8Vs982cNp45Sp7Y 9EfKFLFkx+m40AsUVZ6JyWT1KIlbdLJYVyKBs3XKoaGigFSUVLYSyV845BBbLQv6ath3ow8PD0 yOl87UkwswFC4KTXLDkFkx2bjb/Uyt04gnEK903G+/Ba0ULMvjHpSpCe7tg5FKAr3PUSOkydMG lsk= X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="82819489" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Jul 2020 06:44:32 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.1979.3; Wed, 22 Jul 2020 06:44:31 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 22 Jul 2020 06:43:50 -0700 From: To: , , , , , , , , , , Subject: [PATCH v3 2/6] dt-bindings: usb: atmel: Update DT bindings documentation for sam9x60 Date: Wed, 22 Jul 2020 16:44:17 +0300 Message-ID: <20200722134421.190741-3-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200722134421.190741-1-cristian.birsan@microchip.com> References: <20200722134421.190741-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_094442_565843_E55E42EA X-CRM114-Status: UNSURE ( 7.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Rob Herring , Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Cristian Birsan Add sam9x60 binding. Signed-off-by: Cristian Birsan Acked-by: Rob Herring --- 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 423b99a8fd97..a4002624ba14 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 Wed Jul 22 13:44:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11678525 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 C3FEA138A for ; Wed, 22 Jul 2020 13:47:13 +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 9D06F2064C for ; Wed, 22 Jul 2020 13:47:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S5WgsD5w"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="WiK3yRea" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D06F2064C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com 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:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5mGlfHt+eXKoaMbzGPHSESJBGUIpDsGz0P+4NohljqA=; b=S5WgsD5wU/1pEBwsFEhfdD6jN gH5kii2rwfVH65GGTx7nI5JpNl50xlVAUO4mgmzvpPdmVpkGYcYE4kp6iLruSij2wJ0Dj8RfBYdow Yf6hzR/pK0Nz/1dVi89yaw96eZZ44gI2uhSfnqhYCZMQj8iES0FdoMFDVBvDjB0hTF8mLgcqLSeT+ v3Z5i5SXJIm/PmGYWQf0BOlFI8IU+D8KaSlC4MVo/1FCtiTDvL7CNsJjbnZ1i4TKyzgiz52PIEPgc VjkWM2ds9pQn66CEtCTKUpMqlVFhcsIbhLt5RV2WocLTsHbFule5PkTO7D4zNvH3HteYBUnhLgPtn dkiroXcyw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF3K-0007BV-7s; Wed, 22 Jul 2020 13:44:58 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF35-00075t-62 for linux-arm-kernel@lists.infradead.org; Wed, 22 Jul 2020 13:44:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595425483; x=1626961483; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0CglqN8t+sTEsXBUJ/2FtzkYtZYDjKY0BLV6728dXSU=; b=WiK3yReaGoj1YtVmJb1V5GYPSjBOwCR4cUz2C3wtupFCIifaJj4mgK1j LfxdSRoYQHfk8X26u7Y4Hfzt2ftZ+pSlDTb/IwQ4225XTni5vfGlc5o/8 UNCxcLTs8eDK6vrFGQ3yEqqJD8uAEM/ypx1roJ0IPY+qt+DDbV0Ndy7mE CR44I2/07+b5mbKmtmSL/FwGpjAouoBRbvbYoBjTfKIX0ckFHlYv2Oto5 G51S968q8t31YxYu4urUZNh3Vh4CYTJz3EOhR0S2iIlL53e3GQ2I1cE99 kBXqNQdjEkXQcH1r7X99QjeXYshVxMRSJkbOC7YC+BUrpLDUZ5YFZAiXa Q==; IronPort-SDR: AXgHdc5hrmjiNfDxEtVSDkRkfo421fQzhy/PbGutmo9wv+W/wmSvJEnSYAQIVtQu0FGhmSvqj+ 8qA28PUuJHWboRVEgUE5HTr+4ZFxqDcBESUul/Gn7yIGteb3eM/s8GqG9gRrY+LM9YSSXSoABK A0yvMsUsnM3pGNxZYpCV3eYmmb4lGSrB0Ty/GcyJ+JKLSETnShRnvjz9kzbxcggFxRX2UW1D// l8uLsrVOnNgjCdt7vj19dMwhWSdQRhiZ8keWKytjlSbrsh4CJv2WkvPXaQ9PkwtXPV2zASpjO/ hfk= X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="82819495" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Jul 2020 06:44:35 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.1979.3; Wed, 22 Jul 2020 06:44:34 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 22 Jul 2020 06:43:53 -0700 From: To: , , , , , , , , , , Subject: [PATCH v3 3/6] usb: gadget: udc: atmel: simplify endpoint allocation Date: Wed, 22 Jul 2020 16:44:18 +0300 Message-ID: <20200722134421.190741-4-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200722134421.190741-1-cristian.birsan@microchip.com> References: <20200722134421.190741-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_094443_458606_79A7AF41 X-CRM114-Status: GOOD ( 10.90 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 ee2b550aa400..f767708598a4 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1091,8 +1091,6 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, USBA_BF(EPT_SIZE, fls(ep->fifo_size - 1) - 3); ep->ept_cfg |= USBA_BF(BK_NUMBER, ep->nr_banks); - - ep->udc->configured_ep++; } return _ep; @@ -1786,7 +1784,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 @@ -1834,13 +1832,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); + } } } @@ -2025,9 +2024,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); @@ -2155,7 +2151,6 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, if (fifo_mode == 0) { pp = NULL; udc->num_ep = udc_config->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 48e332439ed5..a9bf655eb513 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -336,7 +336,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 Wed Jul 22 13:44:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11678529 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 C04E4138A for ; Wed, 22 Jul 2020 13:47:24 +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 999852064C for ; Wed, 22 Jul 2020 13:47:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NrZgoE7l"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="qJaXkS5d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 999852064C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com 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:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/0dJlJkSkl07n/lnHzCZfZk8wsMe+OE6UOjhPfaJXU8=; b=NrZgoE7lBOPa5lQQlGEE1F5b8 +ra7S4Bg/3jn5cSAkSoNXqqHAtgecw6GlavWfSkZxTIzWfIu4EZ2P95kWLt/ZbsAX9feok+1FF6kI ee9QHjMBWCpzUF8GxXfcWL/yhwnsN54aaaEygFqLRDe2Tt06dkcb12eCyBiWHCiCFPqoPPnQb50JT OB2GCbyAInVRMn/XlhJeLye3988sGzgXoJC1OFMR05jMSRyQ/l1zM0a/xwye756S6OsO3FYDlQf18 JlBLPgr5slrorAlkMUx2NQy3UZpLiU/o97y/9UuAKNsAjY+xpoSum75r2RVMvPBk7umlEiuGkMgRL lX9P6wb/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF36-00077z-SQ; Wed, 22 Jul 2020 13:44:44 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF33-00075q-On for linux-arm-kernel@lists.infradead.org; Wed, 22 Jul 2020 13:44:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595425483; x=1626961483; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fZFijBDp+zC7Kvsv+QSpK47JNGdPCmrZsJ0YhaqC5bc=; b=qJaXkS5dLo78Fm8pAgOZxV/I84hIRoiRsIyNLsEwJFIRj9AcmPk+qOrs oGsWiAdyyepO95OLDAEsKWnp0bS8WHcmbIB24JF3D6mqWzSB+Yo/r2zt5 yWvWLXt3RnWoQkU2mnnHnNWPkeuI9Yalsj1Zb+vND4wx6c8lRi0HwNr/z G7sH6ocLtA8KSTe4e9VMkxA1RWI39ZGEIeWlbOmizOl3TBr5KU3q57qEV mTPosu22vso+PQVGILegsnEJToVXniSc0KyJ1eUC0hhvM91LyepF/yUyy F/KEsPEHC0wV6wPz5iBdtFPbSKoY0EnDR5TL1NBI6YuV2fqGTTyehgl2d g==; IronPort-SDR: +uya+0eoE4FTv1+6lxDOJXYwlB8UV05G5dGZkZes8Q4SIHHgXYJxW/eg19WdtKD+MuITlDfcL+ GFhtlpz7vhW5cDDyhaj2rXOX2MrbTnbrXCC24pe66ewJBP0hmd1I3HnBBtSiHp9l0AS4oeIMTY W3HsZEkDBibIGveNQRyeBfILi3g4ekw+0Iwe9T8UPDqsm9Ax30IvwnmxDSydiaE29Jb3Y5BQ7b K/3DoYfJSmbfsubW9e0tnqaOWdYT66aD03Yu18NI3+tnnrVi+WSZFkyF0XExU9JE1z0FLJ7gf7 Xe0= X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="84198378" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Jul 2020 06:44:39 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 22 Jul 2020 06:44:37 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 22 Jul 2020 06:43:56 -0700 From: To: , , , , , , , , , , Subject: [PATCH v3 4/6] usb: gadget: udc: atmel: use 1 bank endpoints for control transfers Date: Wed, 22 Jul 2020 16:44:19 +0300 Message-ID: <20200722134421.190741-5-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200722134421.190741-1-cristian.birsan@microchip.com> References: <20200722134421.190741-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_094441_969325_C89500C2 X-CRM114-Status: UNSURE ( 7.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 f767708598a4..843ba525d277 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1056,6 +1056,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 Wed Jul 22 13:44:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11678527 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 0392E912 for ; Wed, 22 Jul 2020 13:47:21 +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 CFBF02064C for ; Wed, 22 Jul 2020 13:47:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hCwcms2J"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="ZywSKfm0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFBF02064C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com 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:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PsOx437XyYhCmNvOxbuYIcXEZ2sIQbGD64fkYkoPEXU=; b=hCwcms2JgjzQj0SfR8DIYwoCh zDeSfRsdXozOm9ktG4JExeCsJhgyvmlX3FJLLbCU19Cjxr77oMo5QeoAiCMXRqLC3AZKuOe/R1qdF LqxBtihhTfztQASK95vtwPfqVUsg59PS81LkSHf4drApKCtb9pd2mnmPZOLXnsc0z0HlTABM1bOLf /N3VLFSz5lYu8544W7H/CALQZizqUxRJl9CCStwfIgguOKz/SxL1aCKKXufE5gLTD9Yg4Grwi2E05 ZqIsIXzFXrbO8+HzlkPssIXQxA3rDjPgIOm+OwKeLf6Dqr1H6P3woCeAdWnGCvk7fcLHtjYNerrFv xNHPZW58w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF3R-0007DO-FI; Wed, 22 Jul 2020 13:45:05 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF35-00077C-Mf for linux-arm-kernel@lists.infradead.org; Wed, 22 Jul 2020 13:44:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595425483; x=1626961483; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AZqakvsW2eY/rh4CY+P6S9cbwQSN2N9lnmvXsIkmBcE=; b=ZywSKfm0GS4ihDP4uf84rRvdgODfMIXNFDfrcLMWTE6lbz5YrWg9UInz I6AnXTY9PpcLUNnrmRatyMjYJuflePjWeAYWhA9fGJfOFxhKkVOPVPvLt YbO9NhcqTAm7KUMaYsrQFDe1f7jQDXutK8IgV8Tb9YkUrt1ZflAwFdKwP JzwNUc8txriXX0JTeAreWyTH1sMK3RFn/WIVdcWXpi0idvi5mxqsRsOaX /5nkuc0Y6xcBcMN0O+2l74fn7amCQQvS+VHA6BxY5WX7jIOSmL8YHnTYY rDlD7v3GTWEnQGi3rUYQJ2cDF0WoQQa5/3BKedV/Ed+M3IRaHtrsv0FNb g==; IronPort-SDR: d41XxWmnb0xhsPys09rpdMOC4O+Jcu8EfT3soG7xYWIeBA6Ib9gYeYcR0KJrx+hwKtylfxRBRf KEZMGuxs2iyud6GwWflKSW2KpfUEGOpwB5+twSUPCeB5rdSJBHNX+hFbD0UvPJsL17tCGEAC5i ulg5Tdhh74wplsnYRiAMqHPa04oOTvuEinxRHGvbDwMBJa4Skl+KThi3vh0ayxmeRnog0B9In0 7lKtBD3zKO4u4JTRlhDG8MVIdVnv2pwDsSxK1Fia3jsETTyWLEBVVSyXYOhgFB9LFBwxSlgrzY L9Q= X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="82819500" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Jul 2020 06:44:41 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 22 Jul 2020 06:44:41 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 22 Jul 2020 06:43:59 -0700 From: To: , , , , , , , , , , Subject: [PATCH v3 5/6] usb: gadget: udc: atmel: update endpoint allocation for sam9x60 Date: Wed, 22 Jul 2020 16:44:20 +0300 Message-ID: <20200722134421.190741-6-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200722134421.190741-1-cristian.birsan@microchip.com> References: <20200722134421.190741-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_094443_928217_55FB2B5A X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 ep_prealloc was added. Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 20 +++++++++++++++++--- drivers/usb/gadget/udc/atmel_usba_udc.h | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 843ba525d277..8015b99f6b5c 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1061,12 +1061,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->ep_prealloc) + ep->nr_banks = 2; break; case USB_ENDPOINT_XFER_BULK: ep->fifo_size = 512; - ep->nr_banks = 1; + if (ep->udc->ep_prealloc) + ep->nr_banks = 1; break; case USB_ENDPOINT_XFER_INT: @@ -1076,7 +1078,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->ep_prealloc) + ep->nr_banks = 1; break; } @@ -2087,23 +2090,33 @@ static const struct usba_udc_config udc_at91sam9rl_cfg = { .errata = &at91sam9rl_errata, .config = ep_config_sam9, .num_ep = ARRAY_SIZE(ep_config_sam9), + .ep_prealloc = true, }; static const struct usba_udc_config udc_at91sam9g45_cfg = { .errata = &at91sam9g45_errata, .config = ep_config_sam9, .num_ep = ARRAY_SIZE(ep_config_sam9), + .ep_prealloc = true, }; static const struct usba_udc_config udc_sama5d3_cfg = { .config = ep_config_sama5, .num_ep = ARRAY_SIZE(ep_config_sama5), + .ep_prealloc = true, +}; + +static const struct usba_udc_config udc_sam9x60_cfg = { + .num_ep = ARRAY_SIZE(ep_config_sam9), + .config = ep_config_sam9, + .ep_prealloc = false, }; static const struct of_device_id atmel_udc_dt_ids[] = { { .compatible = "atmel,at91sam9rl-udc", .data = &udc_at91sam9rl_cfg }, { .compatible = "atmel,at91sam9g45-udc", .data = &udc_at91sam9g45_cfg }, { .compatible = "atmel,sama5d3-udc", .data = &udc_sama5d3_cfg }, + { .compatible = "microchip,sam9x60-udc", .data = &udc_sam9x60_cfg }, { /* sentinel */ } }; @@ -2131,6 +2144,7 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, return ERR_PTR(-EINVAL); udc_config = match->data; + udc->ep_prealloc = udc_config->ep_prealloc; udc->errata = udc_config->errata; if (udc->errata) { pp = of_find_matching_node_and_match(NULL, atmel_pmc_dt_ids, diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index a9bf655eb513..620472f218bc 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -317,6 +317,7 @@ struct usba_udc_config { const struct usba_udc_errata *errata; const struct usba_ep_config *config; const int num_ep; + const bool ep_prealloc; }; struct usba_udc { @@ -343,6 +344,7 @@ struct usba_udc { bool bias_pulse_needed; bool clocked; bool suspended; + bool ep_prealloc; u16 devstatus; From patchwork Wed Jul 22 13:44:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11678531 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 776C1138A for ; Wed, 22 Jul 2020 13:47:30 +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 4FEC22064C for ; Wed, 22 Jul 2020 13:47:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LbA5nUm9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="nlLzWBUD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FEC22064C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com 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:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FNgrVkPYSG/M+a83BQD69l21vxBocBJAht9BfvbDNoQ=; b=LbA5nUm9XZU2SdbsB9n4AqReQ PxWSag4+q6ZqNqJLYgyjMHvVObD1YscdfTcPkWyjkT1xq+2zrjyLUW+RNmxqaDmuK6A9VG9xVJMTX WTFor7tB/8sc2tZ+gQppJ7iK/wTlTu7hN4wBZhoSfSeUdjS3LUWPFZBIo348CRJfc8UlJM9NcZ6zE O4aNj4aSzpSeZeLtnFX7f2TgdTTSLaAJooiOU4vFJUKvXqYuY4LcCY4nxzWWFWnBRzrZiTkZanQOz 0n4eM62IzZ05JjHxufCIwTMBAQie4OvMo1ZE8G+gam8EX6SijUSnkGFuU9qNUrmBdU/KeKPeUWx9K DnwZKwThQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF3W-0007Fl-Mu; Wed, 22 Jul 2020 13:45:10 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyF37-00077C-7k for linux-arm-kernel@lists.infradead.org; Wed, 22 Jul 2020 13:44:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595425485; x=1626961485; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AQ4wWOdIKVge/cPSYMb3D9ty6S2PPK3wNKVv4CCqRH8=; b=nlLzWBUDRwgIDh8+POxeg543AT3HANGaEFx4nLx7x+TJIkFukrdgBvka dMK/Ic91FNsK556fW7yeot43WYbVP8FZSKz+yBiOzh6Q9ES7vSxvxn8pF dqba0m2USMAwDO1es+WNEenvvstdQP5cxyfXVu0Ksy7QMc0CWf5nrJtDQ GgCyCGbbjQgM+senwEXoTwpnH53YYsGDmgueSKzV+oFGXQmxFVjpHobPJ Qh/HJxiF1VHSATMBWe8ayOqTai8Tc6P96YujjXrAYyPaUjSlJKPdtk5XQ jBLa3kG3zOLPqX0jXZtodiZvijOHOcs/4WU+v2HCIGxPqfpl6QbaHG2Yb g==; IronPort-SDR: i+HSXrkki1DPvbMVjDVRBXRvxME0nWWWV776wU6w/EzuTmJ2XRr9NT6vx54gRpARLB6RHVJZ1L UtH8q8aqNmsUR8tlu3aHyJ15q8zW49rvXA4rxYQ/XxY5aaJDiRn703LPXhasKYM84kcij/fZLN eK0kk4LWYtTqHLa7r5N4NFL6AfGcbmCkCdU6DzqFjDiYkzRI76LlUyODkaETEWN3ICRQ9IIlXW z/SmAMbYSUJzCl3xGL/0ykT68CBngqoPRDg9qo+c+3IP+MkDB/+Rug6tROcMBOy+jClfilgyz3 BzU= X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="82819506" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Jul 2020 06:44:44 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.1979.3; Wed, 22 Jul 2020 06:44:44 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 22 Jul 2020 06:44:02 -0700 From: To: , , , , , , , , , , Subject: [PATCH v3 6/6] ARM: dts: at91: sam9x60ek: enable usb device Date: Wed, 22 Jul 2020 16:44:21 +0300 Message-ID: <20200722134421.190741-7-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200722134421.190741-1-cristian.birsan@microchip.com> References: <20200722134421.190741-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_094445_452578_52FF18A7 X-CRM114-Status: UNSURE ( 7.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Cristian Birsan Enable usb device for sam9x60ek board. Signed-off-by: Cristian Birsan --- arch/arm/boot/dts/at91-sam9x60ek.dts | 13 +++++++++++++ arch/arm/boot/dts/sam9x60.dtsi | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/at91-sam9x60ek.dts b/arch/arm/boot/dts/at91-sam9x60ek.dts index a5f5718c711a..984cf596dfe9 100644 --- a/arch/arm/boot/dts/at91-sam9x60ek.dts +++ b/arch/arm/boot/dts/at91-sam9x60ek.dts @@ -559,6 +559,12 @@ pinctrl_key_gpio_default: pinctrl_key_gpio { atmel,pins = ; }; }; + + usb0 { + pinctrl_usba_vbus: usba_vbus { + atmel,pins = ; + }; + }; }; /* pinctrl */ &pmc { @@ -657,6 +663,13 @@ timer1: timer@1 { }; }; +&usb0 { + atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usba_vbus>; + status = "okay"; +}; + &usb1 { num-ports = <3>; atmel,vbus-gpio = <0 diff --git a/arch/arm/boot/dts/sam9x60.dtsi b/arch/arm/boot/dts/sam9x60.dtsi index 6763423d64b8..ef0ef8625f25 100644 --- a/arch/arm/boot/dts/sam9x60.dtsi +++ b/arch/arm/boot/dts/sam9x60.dtsi @@ -69,6 +69,20 @@ ahb { #size-cells = <1>; ranges; + usb0: gadget@500000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "microchip,sam9x60-udc"; + reg = <0x00500000 0x100000 + 0xf803c000 0x400>; + interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 23>, <&pmc PMC_TYPE_CORE PMC_UTMI>; + clock-names = "pclk", "hclk"; + assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>; + assigned-clock-rates = <480000000>; + status = "disabled"; + }; + usb1: ohci@600000 { compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00600000 0x100000>;