From patchwork Mon Nov 22 06:28:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piyush Mehta X-Patchwork-Id: 12631267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37F8BC433EF for ; Mon, 22 Nov 2021 06:28:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232609AbhKVGcE (ORCPT ); Mon, 22 Nov 2021 01:32:04 -0500 Received: from mail-bn8nam11on2066.outbound.protection.outlook.com ([40.107.236.66]:63524 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232591AbhKVGcC (ORCPT ); Mon, 22 Nov 2021 01:32:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZMb0c2YdF13YMSgohykCdaYFGVdf4D0O4THZzXuelvOsG178ym4UiA6mGkEcsB00q85BJZv6p8h4ytNbHTBNZ+3+wYKBi2bimRBB3uH915nQ1VFMoQN21jMJC5a1tqO/WyJtn+8LaqY9vdxo04zI3iBvEFHAJII+7hilGYn4FGmsEpk8VEz4vrW3saCmtVrnLFmJFlmNdFkyZa15FwZWqvrg5KslVdVMA7Ip9q78VHcTAFf+RbYsmOm6VxGkaVQ6XrY+Ig1luB42XbMcXOyQ3m1pBL5acnDJjKfadjG82VX6EdxCacppvVwRY4Aq5lfQbKQ9lLWZaj4laatTP5RFyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3MnOfSy3F/bEnR8vD0YqgyM1rk/8vLVjYmxTClK4Qjs=; b=ZrjTTsi0o8cUKdUgYrl4oqd0CpAiCBZLF+hiHgDqanUyR/ptMKAHMpqHgUvvS4y1ZcYKaO/1DibmuxePisOVUNLDfPBR/2Uw7SOppDsGKDojMNVI5QRWggAVbHevgV/WvzL90lKg05/1R3n9xY8edEy96HANE6B3nzYzWhhvLPovP1V6098pjnAVsgUjzlC/ra/A6ErJasua5LzjGRB0nkFIkgcOyyfMiYX78CPNjj0QT9O6QAs8QtOcT9zQXw7fvnWtiz+dru8eB7VOanQ6Vlo05qQlmdwbdOb1o4aXR5JUDHJU6Q2BjSBgjNbqp9VenALAmpBet+U2uJboCPC4dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3MnOfSy3F/bEnR8vD0YqgyM1rk/8vLVjYmxTClK4Qjs=; b=I5stB6cFRd+zTiHo7J6eeWsncHxuj3h3d+JH9IbT2NNR3iRjV89yHaZ2UhhMedR0mlZp8UO9CPLtfFl4xgX6f8AqSqUwO3OtxNuIwV0YtGGnNTyarhsic2spti9oRMj//XucsZhYMlB7hi2Td4c/gq+Mp+Y5ypJYFRXN09Yua0s= Received: from DM6PR08CA0060.namprd08.prod.outlook.com (2603:10b6:5:1e0::34) by DM6PR02MB4155.namprd02.prod.outlook.com (2603:10b6:5:97::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Mon, 22 Nov 2021 06:28:54 +0000 Received: from DM3NAM02FT012.eop-nam02.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::59) by DM6PR08CA0060.outlook.office365.com (2603:10b6:5:1e0::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22 via Frontend Transport; Mon, 22 Nov 2021 06:28:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT012.mail.protection.outlook.com (10.13.5.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4713.19 via Frontend Transport; Mon, 22 Nov 2021 06:28:54 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Sun, 21 Nov 2021 22:28:53 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Sun, 21 Nov 2021 22:28:53 -0800 Envelope-to: git@xilinx.com, gregkh@linuxfoundation.org, robh+dt@kernel.org, mka@chromium.org, ravisadineni@chromium.org, stern@rowland.harvard.edu, alcooperx@gmail.com, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Received: from [10.140.6.35] (port=53536 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mp2ou-0001Mv-MQ; Sun, 21 Nov 2021 22:28:53 -0800 From: Piyush Mehta To: , , , , , , CC: , , , , , Subject: [PATCH V2 1/2] dt-bindings: usb: misc: Add binding for Microchip usb2244 Controller Date: Mon, 22 Nov 2021 11:58:33 +0530 Message-ID: <20211122062834.1812005-2-piyush.mehta@xilinx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122062834.1812005-1-piyush.mehta@xilinx.com> References: <20211122062834.1812005-1-piyush.mehta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e7193f7-ee99-4d08-453c-08d9ad815b2d X-MS-TrafficTypeDiagnostic: DM6PR02MB4155: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ET1Wv2RgbNsPPyUDOMhqvJOa8PHMgSJjlxRfhzm49jH0FI9Ko3d2YLnZHS+aKzQYdcyA2vqfY0HravbnbUYWj4K3AuMF8goUQSk5BLfhXr5SyMg4Sk1pQyw8b1KxqL00VyiJSD8t24D8k6tfBH1iZMOeX17EI6M8MW1l2BBbLrUqMiS9S3VNm3Td+pgKjJS1VJExjzVVHMXS/JqMhZo1C5kSawZPnL5Hnz8t15+LsUEUe3gror65A9cSAMoazKmXi41noRGi06FD2HB60Ea50l4P0YJ+4il+PvQjOGkxLQbGrD4pZ11XiqmhDsf+WANW+4n2yxqOO9RzD+ZdFpuRsEfjcsNjvv+FdZxRkYVIbIRFNjLL8TJJuJDEax/ts2mrbmi7vka791Mz4QcB7l46L88wGBJ+IcRoppI+aGBdDq/8HF9oOiBIECRFVAFEhKkHk3c66YUmRJrxKpXK2gS+BHuc8OFALm6Kx032lXbskFZMZ3NOFzMuSLGb4OHGEsMaK3CH61zNnfNmrtWMRj5GeJzhOdH1W2aIWBQTY1i4Er3x24nlawkHXWKTnBWQ0vKU9LhihJNmmvrzI8Ax81HBmVUGdGBhIZJS/9PwwBu6XUOwfZFtp0SEUGAJ7MxoNvnlSFXZnr4j2JxEYQcAD6JvLwxvKbdcC2fCK5QTKU1mEfJLvyPCotiiR7l9sBWH19n0tHQB9uKRN1d1A4TCM/BW4XtpCS5Al6nJquRLrI2PL1WEvL3CI2RAHHarwlcAj2zGlVpCxaaUfeIOb5Lb1T2N0EKweR0nQEuppBqDaWn9eBU6/J28kGKtF6O3sBJKRaPuKE3GxJZfTzP52Vl1pKcvjEqpu/eWgxOXv9tDyxtQauI= X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(36840700001)(46966006)(6666004)(26005)(2906002)(107886003)(83380400001)(6636002)(54906003)(7696005)(36756003)(186003)(7636003)(82310400003)(8936002)(44832011)(36860700001)(2616005)(70206006)(8676002)(110136005)(508600001)(70586007)(4326008)(1076003)(426003)(336012)(36906005)(966005)(47076005)(5660300002)(356005)(9786002)(316002)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2021 06:28:54.0806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e7193f7-ee99-4d08-453c-08d9ad815b2d X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT012.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4155 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Microchip's USB224x family of Hi-Speed USB 2.0 flash media card controllers provides an ultra-fast interface between a USB host controller and flash media cards. Add dt-bindings documentation for Microchip's usb2244 Controller. USB224x is a USB 2.0 compliant ultra fast USB 2.0 multi-format, SD/MMC, and MS Flash Media Controllers. Signed-off-by: Piyush Mehta --- Changes for V2: - Update reset polarity, make reset ACTIVE LOW in the dt-binding document. - Added usbsd node under the usb controller (usb0) node. - Remove Warning: decoded text below may be mangled, UTF-8 assumed. Review comments: Link: https://lore.kernel.org/lkml/CAL_JsqKu6vr3iCz1G7MtK6gyqAvn4s4mpuLOwPzJDEmyZeROig@mail.gmail.com/ --- .../devicetree/bindings/usb/microchip,usb2244.yaml | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/microchip,usb2244.yaml diff --git a/Documentation/devicetree/bindings/usb/microchip,usb2244.yaml b/Documentation/devicetree/bindings/usb/microchip,usb2244.yaml new file mode 100644 index 0000000..1854313 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/microchip,usb2244.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/usb/microchip,usb2244.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Bindings for the Microchip USB2244 Ultra Fast USB-SD Controller + +description: + Microchip USB224x is a USB 2.0 compliant, Hi-Speed bulk only mass + storage class peripheral controller intended for reading and writing + to popular flash media from the xDPicture Card, Memory Stick (MS), + Secure Digital (SD), and MultiMediaCard (MMC) families. + + USB224x is a flash media card reader solution fully compliant with the + USB 2.0 specification. + +maintainers: + - Piyush Mehta + +properties: + compatible: + const: microchip,usb2244 + + reset-gpios: + maxItems: 1 + description: + The phandle and specifier for the GPIO that controls the RESET line of + flash media controller. + +required: + - compatible + - reset-gpios + +additionalProperties: false + +examples: + - | + #include + usb0 { + usbsd { + compatible = "microchip,usb2244"; + reset-gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + }; + +... From patchwork Mon Nov 22 06:28:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piyush Mehta X-Patchwork-Id: 12631269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03AF8C433FE for ; Mon, 22 Nov 2021 06:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232793AbhKVGcJ (ORCPT ); Mon, 22 Nov 2021 01:32:09 -0500 Received: from mail-dm6nam12on2046.outbound.protection.outlook.com ([40.107.243.46]:2368 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232591AbhKVGcG (ORCPT ); Mon, 22 Nov 2021 01:32:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fcdKou8YToW+bw7RuhWeqhFCrEpikl6ReWK3oVwuMe6xE2bV9+NcFtmwm9vuZe4DotgY0q9e2zFYpKzo7sfVJSGXbC1x843R7evfhufQFz+GAdRtt8+1VWL0scOCYSJh3fvpq7yi1V4PV54G7927OfnDjDVKqtvFAwpJBhdffEBXmWsimfBmeeWASlrQSsnm+X0cwYh40wprMSOTz0jJ9hBXMx1DShF9UVgU+xi8LVez9JrXgR05dI30e4uEUYdvabQc8RApGCuCi7iKLCmvAAFNZoInTHfunA9N4cMUIiDIy4INdcAA719kMNqmKswxrXonJ7e/SN5msq0zpz8E0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YN910XI6z3skkYOzoacoTmkdp3jER45kd98bZV0orvQ=; b=ev5/v7aHJeY61tHsU0DVf9/FrfnixuWaBHIVjQ5n2x86tDhxFUm1+fGscFujPSJI7B4ky1gw237O1hG+MwVFQpGVBILCk8oe28NK5C6OjwgHCpZIbnCunlpsPvMaaJMH6Ijt0dApWimiJOQyOc8DmPSnLNvhovUM/rTxLJ+rUxj3bS65VqIwydI4v7Bk2iemAurbuxSVJmZgEvOEfvIKL47MEIMe2DfxTr2ziw7Q+0Pn58SBlAXK5MOjkkqcTbyAiIrWDCZ7cbeFzmB0szpOKEP8zV1om6adJ/iQqnE0M+MrzWEutZvyXymM2yj90au+pkfVFTIZCmTdUpe+F/USJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YN910XI6z3skkYOzoacoTmkdp3jER45kd98bZV0orvQ=; b=P8zFyc80B3xID62sSoUEaouA1o80zmaFuw2A8joxY5hauEIChmiQoGZ8Umjwd0foD/k8mpofAs5t6cafstLmjk9pP0sOYp0uHqpm2tOhP/UKv4C/fZoGZDoSF4zgg6/uN3GARyLv3GgpAm2V1xxXqI4GAzQ3RbUyOWMfOamYXAM= Received: from DM6PR08CA0049.namprd08.prod.outlook.com (2603:10b6:5:1e0::23) by CO1PR02MB8489.namprd02.prod.outlook.com (2603:10b6:303:158::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21; Mon, 22 Nov 2021 06:28:58 +0000 Received: from DM3NAM02FT012.eop-nam02.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::90) by DM6PR08CA0049.outlook.office365.com (2603:10b6:5:1e0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21 via Frontend Transport; Mon, 22 Nov 2021 06:28:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT012.mail.protection.outlook.com (10.13.5.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4713.19 via Frontend Transport; Mon, 22 Nov 2021 06:28:58 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Sun, 21 Nov 2021 22:28:56 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Sun, 21 Nov 2021 22:28:56 -0800 Envelope-to: git@xilinx.com, gregkh@linuxfoundation.org, robh+dt@kernel.org, mka@chromium.org, ravisadineni@chromium.org, stern@rowland.harvard.edu, alcooperx@gmail.com, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Received: from [10.140.6.35] (port=53536 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mp2oy-0001Mv-DQ; Sun, 21 Nov 2021 22:28:56 -0800 From: Piyush Mehta To: , , , , , , CC: , , , , , Subject: [PATCH V2 2/2] usb: misc: usb244: add support for USB2 ultra fast sd controller Date: Mon, 22 Nov 2021 11:58:34 +0530 Message-ID: <20211122062834.1812005-3-piyush.mehta@xilinx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122062834.1812005-1-piyush.mehta@xilinx.com> References: <20211122062834.1812005-1-piyush.mehta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e646402a-0ef4-4b36-eb4f-08d9ad815dc2 X-MS-TrafficTypeDiagnostic: CO1PR02MB8489: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1T6GHFw3l+uYU5QtaYU2T2S0BqszzXgzu0tIwDI+3Va0A7QPmbDy+2WP3QCojmo4xhvABmFB2olYWB9KlN/UcmvhRwMS9zfF80jfQfDl+0M1B9kXnJBg8gMOp8N2q/tzF79UVt1UfziMp2DmMEY8kk0858KpzliD9q6sttWpfoHNIReOWn8RXSmYvZwURAjuiyoa3BZFgrzvKOalvk2npiIrnHtbTgAMhPPrtCy7s2bAdCEO4FcQd9WIVFDbLa1VcDKI4b2ehkuNk+Cnp3nJDebG2uY2b58IvLbpIfM+F1u4fS0FKIKJjliLoD7F73jG8d3txN9Ajsk0kOybhI2f9wvlkxy9tocXOAPUG7Sz7xilkvwY88gMWlppYu5wrYZO248ULu6/a1cnG6b5ZsWTPbOpGXiIcawTYmiBCUUCFSa8Q9nYnUvJszMEafL+IfLEwdPa5aFdMHTVMvLsuH9zuW0/+fNpxIzEaAELV/K8nb5lN1DMoS8Rc8CYuZhN2c84BtOk/8nPy/JFrJIWosY4iiAqP3+6jzmBE9JPSBAr0t0MhlqA4aAMzBEtbTdpk26cncL3U38pPRmjDxT5aGArN5vu/MUCXbwLp8d08e2sZLCQje4wv2UZylLq/Jchfvtts/Z5Rcvm0whYx78coy65mwwVnsVNxD4w25FlAA2X9HsaBI+XdzCniJbyBDQ7kTYqNEnrvT6Yiwoc26Hu/Jiqr+j9Y9/qhsiNz0fdf3MScwQWz9Qx37hDdSYvjSGzeIWIagpq4L1qh2wNCqR7du1MBQ== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(36840700001)(46966006)(107886003)(7636003)(6666004)(36756003)(36906005)(9786002)(5660300002)(966005)(356005)(4326008)(83380400001)(7696005)(44832011)(70206006)(70586007)(1076003)(54906003)(2616005)(110136005)(6636002)(8676002)(316002)(426003)(508600001)(2906002)(8936002)(336012)(36860700001)(82310400003)(47076005)(186003)(26005)(102446001)(15866825006);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2021 06:28:58.4167 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e646402a-0ef4-4b36-eb4f-08d9ad815dc2 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT012.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB8489 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Microchip's USB224x family of Hi-Speed USB 2.0 flash media card controllers provides an ultra-fast interface between a USB host controller and flash media cards. This patch adds a GPIO based usb-sd reset for USB2244 USB2 ultra fast SD controller. This usb2244 driver trigger sd reset signal after soft reset or core Reset. The SD needs to be resetted after completion of phy initialization. After the toggling of gpio, controller gets out form reset. USB2244 is a simple platform device driver. As part of the reset, sets the direction of the pin to output before toggling the pin. Delay of microseconds is added in between high and low to meet the setup and hold time requirement of the reset. Signed-off-by: Piyush Mehta --- Changes for V2: - Update reset polarity, make reset ACTIVE LOW in the usb2244 driver. - Fix WARNING: msleep < 20ms can sleep for up to 20ms by changing msleep to usleep_range() --- drivers/usb/misc/Kconfig | 10 +++++++ drivers/usb/misc/Makefile | 1 + drivers/usb/misc/usb2244.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 drivers/usb/misc/usb2244.c diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig index 8f11443..e1c66a2 100644 --- a/drivers/usb/misc/Kconfig +++ b/drivers/usb/misc/Kconfig @@ -215,6 +215,16 @@ config USB_ISIGHTFW driver beforehand. Tools for doing so are available at http://bersace03.free.fr +config USB_USB2244 + tristate "Microchip USB2244 Ultra Fast USB 2.0 SD driver" + depends on GPIOLIB + help + Say Y or M here if you want to reset Microchip USB2244 Ultra Fast + USB 2.0 SD controller. + This option enables support for Microchip USB2244 Ultra Fast USB 2.0 + SD controller. This driver reset the gpio pin makes controller out of + reset. + config USB_YUREX tristate "USB YUREX driver support" help diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile index 5f4e598..5b4af7d 100644 --- a/drivers/usb/misc/Makefile +++ b/drivers/usb/misc/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_USB_LEGOTOWER) += legousbtower.o obj-$(CONFIG_USB_TEST) += usbtest.o obj-$(CONFIG_USB_EHSET_TEST_FIXTURE) += ehset.o obj-$(CONFIG_USB_TRANCEVIBRATOR) += trancevibrator.o +obj-$(CONFIG_USB_USB2244) += usb2244.o obj-$(CONFIG_USB_USS720) += uss720.o obj-$(CONFIG_USB_SEVSEG) += usbsevseg.o obj-$(CONFIG_USB_YUREX) += yurex.o diff --git a/drivers/usb/misc/usb2244.c b/drivers/usb/misc/usb2244.c new file mode 100644 index 0000000..5a868c2 --- /dev/null +++ b/drivers/usb/misc/usb2244.c @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Driver for the Microchip USB2244 Ultra Fast USB 2.0 Multi-Format, + * SD/MMC, and MS Flash Media Controllers + * + * Copyright (c) 2021 Xilinx, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +struct usb2244 { + struct gpio_desc *reset_gpio; +}; + +static int usb2244_init_hw(struct device *dev, struct usb2244 *data) +{ + data = devm_kzalloc(dev, sizeof(struct usb2244), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(data->reset_gpio)) { + dev_err_probe(dev, PTR_ERR(data->reset_gpio), + "Failed to request reset GPIO %ld, errcode", + PTR_ERR(data->reset_gpio)); + return PTR_ERR(data->reset_gpio); + } + + /* Toggle RESET_N to reset the hub. */ + gpiod_set_value_cansleep(data->reset_gpio, 1); + usleep_range(5, 10); + gpiod_set_value_cansleep(data->reset_gpio, 0); + usleep_range(5000, 6000); + + return 0; +} + +static int usb2244_probe(struct platform_device *pdev) +{ + struct usb2244 *data = NULL; + + /* Trigger gpio reset to the hub. */ + return usb2244_init_hw(&pdev->dev, data); +} + +static const struct of_device_id usb2244_of_match[] = { + { .compatible = "microchip,usb2244", }, + { } +}; + +static struct platform_driver usb2244_driver = { + .driver = { + .name = "microchip,usb2244", + .of_match_table = usb2244_of_match, + }, + .probe = usb2244_probe, +}; + +module_platform_driver(usb2244_driver); + +MODULE_AUTHOR("Piyush Mehta "); +MODULE_DESCRIPTION("USB2244 Ultra Fast SD-Controller"); +MODULE_LICENSE("GPL v2");