From patchwork Tue Jun 15 08:05:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piyush Mehta X-Patchwork-Id: 12322297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE329C48BDF for ; Tue, 15 Jun 2021 16:04:36 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.133]) (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 BD37361465 for ; Tue, 15 Jun 2021 16:04:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD37361465 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JMGy3FNsZSKYoCk4ztgF1HHbzu42nNUPIpi28cjmc/k=; b=K+tKS4O/T/ic1t C0NzyZZ8Bnx2GxXUxpl2gdEcnvx5fr3cFVnppo2FcEgEPwdJw2Qid7mhWAmFOtwLe/bnLgvjgGPrK k3GoNrcK4PxaWbZkVtguXhwTNDZLpD7t0qJJd0z4KaawsvN1MaK9zibb4CuA7vH23rLtdCDPYjG5A HyBS4GTb4piKpIb9i7hmwBsUmGJKtMEqKxFb3AdRbZy9/434BId4/ejUBKzUFd+bjHvax6FkSMQr3 +M5ephFCoUCKlEkN3kufUY6GPZynL9yQdcAKm1C6MSs76bKY0jPNSdG+oJ52//g6BtEItg8UsfLCQ ZES11GOrbRftgsMOiCzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltBQX-0019iU-Ev; Tue, 15 Jun 2021 15:56:34 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt9K1-000DEY-I7 for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Jun 2021 13:41:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=zfB/qHTM7/Iv5IYnGXAldJYLby7Jr3vOCEWRpi0FOrY=; b=K0AoDfXGkfkCMuIhxzMRS1l3xV CdIwLoISqQGKgbfpNhA6oWOy5RF0bRh/384rnoSWoquoQaMFVB4l5wtf0L71rXSFyNfrr3aRLiR2F +ijxjnoBsmWFOUUUdctYmHX22iwqFxafw0LE9dupxft4k8jVY3EVZJ2vyyCnBgidc9yChyGkyN4Qc 61RKzpDTd63vs/NTrbaMbsMxbMbmKiFwwRQr7g3qiTtREmmtrGVzGWAPGT4JTOcqU0s4loAGwenS3 kJh+zjzF5EJxpFjtSYpW0emaj3ABcOJV/SV3VrMo12N5/efBsQ3gDpnem8DGmHTSXLzuFsTgADCg/ B6J36TFQ==; Received: from mail-bn7nam10on2068.outbound.protection.outlook.com ([40.107.92.68] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt46N-007U8G-7g for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 08:07:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVkAmR2NW5pUkzH0m/v19Xw33S1kha2soOLSCnbNVHvfv1ClNM3rQF/LR08XoctSCVHjA9QaQ0pjC6FQM/SXyeZgg0a0UkC1MfpKUIAs1vpRcs1jn0J6NizsafPcjVUztUz7HtJvCOVN+OdzYiifj8D5uAgabt2qPzcOAw+KX2g4uVI+TdGyqaruFUh7F/VAdVhKXjuZtdu8KCt7GSj3cHEbdLeD8azFTalX6kpILvBjuAQOF1BIRQw7JOJjnFeSuFTgSW9pGIje53r9ltO2A3s+ywHQOx2jUr4HzTltV9nPUDCFWIu3zfBlT20ucbfxnrpUsibo/BTIB+a6DYFsUg== 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-SenderADCheck; bh=zfB/qHTM7/Iv5IYnGXAldJYLby7Jr3vOCEWRpi0FOrY=; b=It68UYdb5j8nG5t6vuLFiB8HJHF0Ytl7+aFyUgsz4MRmwv1nYnEbs9tOJRFC7CQDDMjHKE/R3kJKdghcoAZF1DaoRL9kgJOoIyh/TCKubcTx0+cEzQk3Jp553cSniPxAEhUVMd0z1e2ZvOzUF5LHD1gu9WgCohboRSLHqLEC5Pye5L3n6CGdFIr2W2kemYx+O9rp5Qgvz2SBektY3hxGMdMTBkU8EES5Ix/ihOelRywMCAYoMjZ3ZqMrb8QwttUBnWiZKCdTMxuWAS0aylb1AxRUwGaSL+1hET/T3CoEh6HqNltVj6OiCN3V754yW/EZLxWVr3XTKMSYf3znxtMIsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=linaro.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=zfB/qHTM7/Iv5IYnGXAldJYLby7Jr3vOCEWRpi0FOrY=; b=oSgh6pXizSP+LRytZj1jzMAhQh9/x0IzJYpfqamjZSnQNV7XKdEQj8XGZazvAqjNJZchj56M4w0HzjZQGxiTJmjJtpGxDuVqYXyCplKjj51YA4c8/t/fI07QXZb81bcRSM0xczl6TY6LkkjoUZygU/TG+vXAxND8k54nR3+8hwg= Received: from BN0PR02CA0050.namprd02.prod.outlook.com (2603:10b6:408:e5::25) by MN2PR02MB6061.namprd02.prod.outlook.com (2603:10b6:208:1b5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Tue, 15 Jun 2021 08:07:16 +0000 Received: from BN1NAM02FT037.eop-nam02.prod.protection.outlook.com (2603:10b6:408:e5:cafe::e1) by BN0PR02CA0050.outlook.office365.com (2603:10b6:408:e5::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 08:07:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none;linaro.org; 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 BN1NAM02FT037.mail.protection.outlook.com (10.13.2.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 08:07:16 +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.2; Tue, 15 Jun 2021 01:06:39 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 15 Jun 2021 01:06:39 -0700 Received: from [10.140.6.35] (port=43350 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lt45m-0002dn-Nm; Tue, 15 Jun 2021 01:06:39 -0700 From: Piyush Mehta To: , , , , , CC: , , , , Piyush Mehta Subject: [PATCH 1/2] dt-bindings: gpio: Add binding documentation for modepin Date: Tue, 15 Jun 2021 13:35:52 +0530 Message-ID: <20210615080553.2021061-2-piyush.mehta@xilinx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210615080553.2021061-1-piyush.mehta@xilinx.com> References: <20210615080553.2021061-1-piyush.mehta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a80e9cc6-03a2-4bef-48f4-08d92fd4973d X-MS-TrafficTypeDiagnostic: MN2PR02MB6061: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xbqMx10Y3SnwN/jC7eA/ZrcKujAJXgYnOKVbw2YcyAzgZeWUYI6eoCD/TtZyfkuXZKLfjra4eN9vh8vkaSOubreaA51iHWhi52/RaGOnsejSyshTsdP3RkvK1SsG8koZosdqIDXxDCmuchIZPqdYlynNY5INvQY6XFx6NF3DIW/RE6fVCuMEw3oA/YmVkmH84AOjuxYT2Nxicz96jGIThvmYfvxkyrbGLpkl823r5AfzWKSDM9w/Sc5n9Ju/IVSfASez0ZndzOCfyDk1XZi34c10L/RnG9/cIrXlMu2m++ieRPqzwbDHPPHsuv4HJLFn/ZNZGH/il6Qtmbbt3hJOEaO25Xy2Nw2Npj9BNNjGPHhayW8dQc8h9zTrBVQg/u3UdhV3f3cJ0r7xWtjPyGIZ1C8AGjJ6oWJVQZhWueY/jGCV3JyiOfp28g9dNFpHByC09GGrx+VCnJ/FyV35LncL4zl6S4i2oujB7OwyASEQGH0wmUJMmYTazZgAxI8cXZEH8LFFoSCJqmjOkWZtSAL4FcTcCiPMIAMhGsuvwNDGcsjsJTfRjp3BtCpzMeBV8EHa6lyV7KJ3lsc5PvpiWC1nIMfhe0ZkygHjndEChjV4xKIIgDImqslRnP35x48PIy2BJcM+CFuprG1/a5WVkKDpJBpGac1HEQIZkaIMHFFf4jRIkzcLoXD8qSK+59rbcafhlb3YgAh9rVQ/zTeLuSVYYwaDqnxxH5RrC9JXZb48vQ2dB0uLxycH3YG5LH735RDpaLJv0v0NvrYzH/maar/GhSAzs7sibbRzW3Rn5tk8WV6pf2lWE46dTCD7ay41lsFD4PDJDwKkAsKtPVu1RZgKtw== 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:(4636009)(136003)(376002)(39850400004)(396003)(346002)(46966006)(36840700001)(7636003)(356005)(70206006)(186003)(110136005)(82310400003)(70586007)(54906003)(107886003)(6666004)(44832011)(82740400003)(4326008)(8676002)(1076003)(336012)(36756003)(8936002)(2906002)(36906005)(316002)(36860700001)(47076005)(9786002)(26005)(478600001)(5660300002)(7696005)(2616005)(426003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 08:07:16.5024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a80e9cc6-03a2-4bef-48f4-08d92fd4973d 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: BN1NAM02FT037.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6061 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_090722_124706_A2431044 X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add DT binding document for modepin GPIO controller. Signed-off-by: Piyush Mehta State: pending --- .../bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml diff --git a/Documentation/devicetree/bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml b/Documentation/devicetree/bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml new file mode 100644 index 0000000..39d78f8 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/xlnx,zynqmp-gpio-modepin.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/gpio/xlnx,zynqmp-gpio-modepin.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: ZynqMP Mode Pin GPIO controller + +description: + PS_MODE is 4-bits boot mode pins sampled on POR deassertion. Mode Pin + GPIO controller with configurable from numbers of pins (from 0 to 3 per + PS_MODE). Every pin can be configured as input/output. + +maintainers: + - Piyush Mehta + +properties: + compatible: + const: xlnx,zynqmp-gpio-modepin + + gpio-controller: true + + "#gpio-cells": + const: 2 + +required: + - compatible + - gpio-controller + - "#gpio-cells" + +additionalProperties: false + +examples: + - | + modepin_gpio: gpio { + compatible = "xlnx,zynqmp-gpio-modepin"; + gpio-controller; + #gpio-cells = <2>; + }; + +... From patchwork Tue Jun 15 08:05:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piyush Mehta X-Patchwork-Id: 12322313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A544C48BE5 for ; Tue, 15 Jun 2021 16:13:25 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.133]) (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 692FD61585 for ; Tue, 15 Jun 2021 16:13:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 692FD61585 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6eeu/MB19OrUy5qU2vBZDkZ+DqlTWS+8V0uMFHIsGsM=; b=uXTm9f4ZdnE3gr FlpTkiW9lv4rorPErVbakmafvSwgRJ+CZzDa1WgExUHfm6lcQ8AtFslxzPX7b3k2usJcVmQ+Ds8Vf /LgwDuFFRrCGCX+Ors8P5G4FoOP8H8b/rF2+IXnnqXbK6GmDd3hfO16jAfjs/z7qlVzUOPCuMtOU/ FacbeINwmI0XUTWvpejDUEwJQb/N6lSoomb1V9rook8fqnz0sVfnDvgEaWy05HOSEJ/pHvJ/fOrDb KT2GaO9EYxKr/sw2Fl/6DO7nO6wbo0Nj8apanEk6Swl93MPZb5MCrlNjx97RupQZFEOvVHC8Nk02r 0h6LpTAthwkmFx2oxQvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltBZI-001D7y-K4; Tue, 15 Jun 2021 16:05:39 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt9K1-000DDm-W6 for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Jun 2021 13:41:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=0z+ajz9oJTabMq/lg1C/vnSrptLSuNT9aIfqDf71ICI=; b=N6FtxvDPvaX7N1fPMmhaO8WOOM 1i7oEIZ29eiS9kLmA2hVlxSF+XwHgxF5hq1aKqR5vkA/fHfZ+ONdkSEB/smCVPCfZrpmMo6j6h0Ug rOJL1fb7ullgr+a8rPiAfyUrRmQLpU+AdVYMZuREKLxgLEv38udHp2FdwlRC15dUVcot3HBC87GDC K4y4rAbJ30+YQUlFS8vsmYsEIqub63O2qoJ5U5d9Ym1CnzvWx7c/afMW/fdScdGi6XPBPCDl7risY pjGMq/ieY4vIbHlslodVhsXnFgxqUD0N2c7i8NU4Y0lzp60Shz2QG9QObSwBNaQb2uwsoa2R6UTuC PNNE9nuA==; Received: from mail-dm6nam11on2050.outbound.protection.outlook.com ([40.107.223.50] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt460-007U7K-HU for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 08:07:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MHBEN02DHC5ApdyHLIuDwVHTtwgDkvsKfd1jBvutKiTnf6IYhE0ykEN5ojx5lzYOJcNzZJMyo2/Ur+TvbQuoeEG2jcXqU58ljYcYNMlkbD0Nm1cEKGLsG7EnEQ7+xSfHbj2ZFHzL9YtEzYruq6Ax87mLzudYJkq2GXiRpDvummLJSKQLh1IAqm5H/8G22Cfci6SQv3pX4wIeOdEKoAIGXFzChuy7OMrwBSMrrNOkJn+ZU4YGmYaDyGFt5UukcsA4lonmYQgaib3YF852ior1sRx9Njhxzu70P0vOYyFoLKIRXtROsHd0ieVqLdsrkEAaBMjr23AKAavJZlZk7u8Fdw== 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-SenderADCheck; bh=0z+ajz9oJTabMq/lg1C/vnSrptLSuNT9aIfqDf71ICI=; b=NzNIaYX97g6uHbN1RFGgtZAWZj87GrM33gvrvMWrGxzPXenHQJkFs8PrY5lDvllIoaFSoSGxEFmigvFyRNkz7UwN6Z318yCVLtWJ3e4/8MzJ3uV3LLleHf7V/mBzmR58wWxkZdcn7MXXUJq7sLGlm0KkpbziXDE8YIgsbKMFnzWT3GdswbjTexz+uXNWRjYoNGGQAhXuAYrU5bsZBADlmjlYlViORXjMYXTlh2mHVJna3QPecas3O9YniqC9beUM1M37GT0Y8RS6KD9zRgtgcxcYNZumBhweAvDKMy5AvOy1TxCnvs4FAF3o2UU2HR6YiXq0f6DkK6A6HRM1gDcoKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=linaro.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=0z+ajz9oJTabMq/lg1C/vnSrptLSuNT9aIfqDf71ICI=; b=M3gKXZ+L8IWDpGn1tgr0mL5A4fNQtTinYxcD7L60MdOxVvAA82Egep927P0LHvTB6YF8Uo9nTM8AEp/p91jjFhhpmaqj9ebNWArazotkyAvb8unzq7jaBtBK08UI7VBZLV4e8pdRxnpdA1htxMYD3eJ/9+EcPVkPldm+ThBi2aY= Received: from DM5PR13CA0030.namprd13.prod.outlook.com (2603:10b6:3:7b::16) by BL3PR02MB8185.namprd02.prod.outlook.com (2603:10b6:208:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Tue, 15 Jun 2021 08:06:50 +0000 Received: from DM3NAM02FT011.eop-nam02.prod.protection.outlook.com (2603:10b6:3:7b:cafe::19) by DM5PR13CA0030.outlook.office365.com (2603:10b6:3:7b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Tue, 15 Jun 2021 08:06:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none;linaro.org; 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-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT011.mail.protection.outlook.com (10.13.5.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 08:06:50 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 15 Jun 2021 01:06:43 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 15 Jun 2021 01:06:43 -0700 Received: from [10.140.6.35] (port=43350 helo=xhdsaipava40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lt45p-0002dn-UA; Tue, 15 Jun 2021 01:06:42 -0700 From: Piyush Mehta To: , , , , , CC: , , , , Piyush Mehta Subject: [PATCH 2/2] gpio: modepin: Add driver support for modepin GPIO controller Date: Tue, 15 Jun 2021 13:35:53 +0530 Message-ID: <20210615080553.2021061-3-piyush.mehta@xilinx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210615080553.2021061-1-piyush.mehta@xilinx.com> References: <20210615080553.2021061-1-piyush.mehta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6942f690-db2b-4194-9218-08d92fd487ad X-MS-TrafficTypeDiagnostic: BL3PR02MB8185: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jgk+qwwWKEYohWMQbCl1lRPzjlhZMLPpVCvLwpLkV43oQIYuqljZSCQhT1rwW7HImZmVmr2JbUD1Y5wGpdq9/SuEcctuJvpydS5o86d4k6dCityw+2JQLdeoCboLon2P0OD9Yr6WuJ4ayevzDINCAggGFrt6lTIZxyVE+Hb9D5LGnLheO5C6xd7g3H6cHqFGaEWkO39qzk53t6MUzXEI7sPLx/V6zwc0sj1ZqtdAwX5exKlV/wIQQnQkWiW07196Cz7mbIfFPVMdOY8h7gAAQb7hZFnCAzwJVLiTzxg6tcgZPyk4aoMeA62L/GPAxl8k/drCWX1kdl3qcDZ25xvHFzwmuSfzYqxVK9dqN9H/laV4sAqFujk9mCCHa5xVaR9PTQ8NMgWxFHtuCacMFlGcptgsdEh5uisvYWnd9Q0SIbF5aw+7UnlMU2H6CNtb3kJBIV9xUsv6NRLDOcBxuQlFoShGyzvAXr0smz/DPHfRXUrZy7w2QhSxlf44ILR2sSehumX+PxgJToC+zf7oclQ2mvtd+XPey3jNjbIyo+4f8ss1JVE3rBItpOAdcmCIzc/X85/sRTNzktcIHenRUFVP00j1S1rRI3FHYcaRFlTXFlzA4BF9fSI54jR8BM/Czl+WcnsUQtwwTZxsY1bw0IyBHL2hc1dEYsdPc90/OEcqyFouWJB3QRbix8aDdj9Bnud7 X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(376002)(39850400004)(396003)(136003)(36840700001)(46966006)(336012)(426003)(2616005)(6666004)(44832011)(478600001)(2906002)(186003)(54906003)(26005)(316002)(110136005)(8936002)(36906005)(7696005)(36860700001)(107886003)(4326008)(1076003)(8676002)(5660300002)(47076005)(36756003)(82310400003)(7636003)(70206006)(356005)(70586007)(9786002)(82740400003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 08:06:50.4597 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6942f690-db2b-4194-9218-08d92fd487ad 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-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT011.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR02MB8185 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_090659_415343_D41002CB X-CRM114-Status: GOOD ( 24.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch adds support for the mode pin GPIO controller. GPIO Modepin driver set and get the value and status of the PS_MODE pin, based on device-tree pin configuration. These 4-bits boot-mode pins are dedicated configurable as input/output. After the stabilization of the system, these mode pins are sampled. Signed-off-by: Piyush Mehta --- drivers/gpio/Kconfig | 12 +++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-zynqmp-modepin.c | 154 +++++++++++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 drivers/gpio/gpio-zynqmp-modepin.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 1dd0ec6..30e0dbf 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -755,6 +755,18 @@ config GPIO_ZYNQ help Say yes here to support Xilinx Zynq GPIO controller. +config GPIO_ZYNQMP_MODEPIN + tristate "ZynqMP ps-mode pin gpio configuration driver" + depends on ZYNQMP_FIRMWARE + default ZYNQMP_FIRMWARE + help + Say yes here to support the ZynqMP ps-mode pin gpio configuration + driver. + + This ps-mode pin gpio driver is based on GPIO framework, PS_MODE + is 4-bits boot mode pins. It sets and gets the status of + the ps-mode pin. Every pin can be configured as input/output. + config GPIO_LOONGSON1 tristate "Loongson1 GPIO support" depends on MACH_LOONGSON32 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index d7c81e1..62bfa73 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -182,3 +182,4 @@ obj-$(CONFIG_GPIO_XRA1403) += gpio-xra1403.o obj-$(CONFIG_GPIO_XTENSA) += gpio-xtensa.o obj-$(CONFIG_GPIO_ZEVIO) += gpio-zevio.o obj-$(CONFIG_GPIO_ZYNQ) += gpio-zynq.o +obj-$(CONFIG_GPIO_ZYNQMP_MODEPIN) += gpio-zynqmp-modepin.o diff --git a/drivers/gpio/gpio-zynqmp-modepin.c b/drivers/gpio/gpio-zynqmp-modepin.c new file mode 100644 index 0000000..27052f0 --- /dev/null +++ b/drivers/gpio/gpio-zynqmp-modepin.c @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Driver for the ps-mode pin configuration. + * + * Copyright (c) 2021 Xilinx, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MODE_PINS 4 +#define GET_OUTEN_PIN(pin) (1U << (pin)) + +/* + * modepin_gpio_get_value - Get the state of the specified pin of GPIO device + * @chip: gpio_chip instance to be worked on + * @pin: gpio pin number within the device + * + * This function reads the state of the specified pin of the GPIO device. + * + * Return: 0 if the pin is low, 1 if pin is high, -EINVAL wrong pin configured + * or error value. + */ +static int modepin_gpio_get_value(struct gpio_chip *chip, unsigned int pin) +{ + u32 out_en; + u32 regval = 0; + int ret; + + out_en = GET_OUTEN_PIN(pin); + + ret = zynqmp_pm_bootmode_read(®val); + if (ret) { + pr_err("modepin: get value err %d\n", ret); + return ret; + } + + return (out_en & (regval >> 8U)) ? 1 : 0; +} + +/* + * modepin_gpio_set_value - Modify the state of the pin with specified value + * @chip: gpio_chip instance to be worked on + * @pin: gpio pin number within the device + * @state: value used to modify the state of the specified pin + * + * Return: None. + */ +static void modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin, + int state) +{ + u32 out_en; + u32 bootpin_val = 0; + int ret; + + out_en = GET_OUTEN_PIN(pin); + state = state != 0 ? out_en : 0; + bootpin_val = (state << (8U)) | out_en; + + /* Configure bootpin value */ + ret = zynqmp_pm_bootmode_write(bootpin_val); + if (ret) + pr_err("modepin: %s failed\n", __func__); +} + +/* + * modepin_gpio_dir_in - Set the direction of the specified GPIO pin as input + * @chip: gpio_chip instance to be worked on + * @pin: gpio pin number within the device + * + * Return: 0 always + */ +static int modepin_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) +{ + return 0; +} + +/* + * modepin_gpio_dir_out - Set the direction of the specified GPIO pin as output + * @chip: gpio_chip instance to be worked on + * @pin: gpio pin number within the device + * @state: value to be written to specified pin + * + * Return: 0 always + */ +static int modepin_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, + int state) +{ + return 0; +} + +/* + * modepin_gpio_probe - Initialization method for modepin_gpio + * @pdev: platform device instance + * + * Return: 0 on success, negative error otherwise. + */ +static int modepin_gpio_probe(struct platform_device *pdev) +{ + struct gpio_chip *chip; + int status; + + chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; + + platform_set_drvdata(pdev, chip); + + /* configure the gpio chip */ + chip->base = -1; + chip->ngpio = MODE_PINS; + chip->owner = THIS_MODULE; + chip->parent = &pdev->dev; + chip->get = modepin_gpio_get_value; + chip->set = modepin_gpio_set_value; + chip->direction_input = modepin_gpio_dir_in; + chip->direction_output = modepin_gpio_dir_out; + chip->label = dev_name(&pdev->dev); + + /* modepin gpio registration */ + status = devm_gpiochip_add_data(&pdev->dev, chip, chip); + if (status) + dev_err_probe(&pdev->dev, status, + "Failed to add GPIO chip\n"); + + return status; +} + +static const struct of_device_id modepin_platform_id[] = { + { .compatible = "xlnx,zynqmp-gpio-modepin", }, + { } +}; + +static struct platform_driver modepin_platform_driver = { + .driver = { + .name = "modepin-gpio", + .of_match_table = modepin_platform_id, + }, + .probe = modepin_gpio_probe, +}; + +module_platform_driver(modepin_platform_driver); + +MODULE_AUTHOR("Piyush Mehta "); +MODULE_DESCRIPTION("ZynqMP Boot PS_MODE Configuration"); +MODULE_LICENSE("GPL v2");