From patchwork Wed Oct 7 10:19:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 288891 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 A9351C4727E for ; Wed, 7 Oct 2020 10:21:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 499A320782 for ; Wed, 7 Oct 2020 10:21:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="MBUpT2Jq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728160AbgJGKUx (ORCPT ); Wed, 7 Oct 2020 06:20:53 -0400 Received: from mail-bn8nam12on2066.outbound.protection.outlook.com ([40.107.237.66]:19424 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728045AbgJGKUm (ORCPT ); Wed, 7 Oct 2020 06:20:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4QYaIxgJ6swNs/R17nKh4kTfXET9cwoXJRSjwfQ64r3LQz0Pd3jrO7o5VUgXHS8W/QZGRLdEHtg2oDRR2ghVfV/9x/ZzAfad4TnblISzL2cs7PVlOaNEuRl8+IrnNWlFKMd/FMJONk2sHk8evVRKjHbnrUgRUOvV1kYqmuAGGIZbha69IEHwyrJZ3kCIFje+4G62tP12L760yJSDUi10uBGWtm6UlFN2VHnZYulQmBvoLG1sGFBs+JZO0b0rXtQBNr5Go/nzG8lxtsoRjLGwzqStw1oVMLZV6RK+9hec6ClCPV2HT1/anKyqaJWx5lsTsWh7hYq/6QmajkBqTiubw== 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=YshTyCVlBSg6TtTEsaosnE6qGyRXW/hXTsignDLHlCU=; b=niQolFoUEKr6mmF3q8rg1d+2qFyfi9IWiqVeFbXLk8v1jmvN72oacxbAWJQLE1mqEzZ/lGQdw3M9ra/9BPQwPfEZYwkocF6BaxgvkXP/gxg/izN0Gau4EP41TqNErBzFwrCEmVy4Uc8ghtQn1giLCLZv8dpqC28f6hvpckMefJYYok1zmrclXU2wpjcs8SL8JOFfsLNEHXnT9mwnGA1CokDQHaAhkwVQWr0Sm3Y4ZGagIJc1OMr+E937MMfgHF1Bqd6j0mZkIsEDlIuSPqxGeeF5v0eve29cLndJv0bt5gAK7HXs0/VHsqx3iATA03OODeyfYx4iDMi+Jg38gO/F+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YshTyCVlBSg6TtTEsaosnE6qGyRXW/hXTsignDLHlCU=; b=MBUpT2JqjISYbtbR4z1LtJC3g+IYJk5gl27SR9iggQ3rTn022bAfn1wvcIF0ighE6iqVGdI9Tqp16IrN56HO19XWhpnmh5EJmT0cvWRwMAljnwExayBLhCWPN5ve6+6LFTYRr1QHZaWtgrD6nsH4M+8SQ87fAiS8kmFwxrT2F68= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SA0PR11MB4670.namprd11.prod.outlook.com (2603:10b6:806:9a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23; Wed, 7 Oct 2020 10:20:14 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::4f5:fbe5:44a7:cb8a]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::4f5:fbe5:44a7:cb8a%5]) with mapi id 15.20.3433.044; Wed, 7 Oct 2020 10:20:14 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 6/7] dt-bindings: staging: wfx: silabs,wfx yaml conversion Date: Wed, 7 Oct 2020 12:19:42 +0200 Message-Id: <20201007101943.749898-7-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201007101943.749898-1-Jerome.Pouiller@silabs.com> References: <20201007101943.749898-1-Jerome.Pouiller@silabs.com> X-Originating-IP: [82.67.86.106] X-ClientProxiedBy: PR0P264CA0111.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::27) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.home (82.67.86.106) by PR0P264CA0111.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23 via Frontend Transport; Wed, 7 Oct 2020 10:20:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f5ea77c-ae14-4f7d-c5f1-08d86aaa9454 X-MS-TrafficTypeDiagnostic: SA0PR11MB4670: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eQyR7Se3WNQfSO1gdE4OXMEpGosB0UB7BRYqWzZ5FamY/6xLTr0ZLWTCY6DaS9xrXLiZMckLPPNS7tdRkXKs+0D2qaLwXpi/OBKjaFnJWVEPxs/k9TlnxdCv+CF88VozLi1XUylj+8t+pv7ylYvvjtkboAqieM0O4z4sJvJwz5E7zauEcYFbIufEjSTU3CS5Nzelxg/utH7lw5/XxDdXjiGOBGfsp+K8BHmuwamLyZApoEJYfZojFrjhJMij5c1kHbgDVpkb1v5heohZ0VaVACysc0QLC17fZKEHfZXUZ0QG1LBRA4smF2KV1mkBL4O9awQ7S9zZWaEcO2IljqqDegImckwhO+Api8uY1Mn6rwf7/vkN82/uJrMMnVRCyz0bW0UagAfY9MI0YQ5UayBLcQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39850400004)(346002)(136003)(376002)(366004)(396003)(66556008)(66476007)(6486002)(66946007)(966005)(316002)(54906003)(4326008)(478600001)(2906002)(1076003)(5660300002)(186003)(8936002)(8676002)(16526019)(52116002)(83380400001)(26005)(6506007)(66574015)(2616005)(86362001)(956004)(83080400001)(107886003)(8886007)(36756003)(6666004)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: RX0FrWJytR/5fWqldBQPinH3d9X5/vZEryGLMGOsYJzBwowdYxlyO7GfJ6VlKt/E/o24SFoas8SaC/Al0JIrcxv93fvheD8haVtK2GMdNXo0+DT8KHvdy59lYfOEQcx41wwj+leGslOyjeMbI3pMvT6/gCGo6MqsFQvWEy4p7sPu8erE36o+isl/F6K5CLyd9kDLAojTvt5iCbI+wzPKIk0e1Cnnt4nnEGn9QK/a8AQZPRkfAgMPp9KQTZiNO7sWzccO0aPFVsscAnHcnfKFSQEtdeGS+kMdSO+CUuKQTEU67mQMp8OguY8nEI9rcaY2353dohKJFJV1DjVOLthA9heit0406FDZe5GPlqdStQIeZiycpTWzqCUGdGZTFz3T+S+K9WOaGx0muE+cv+NOYPy00/wjvy4er6jWqPbeBNcpeVmmUQvyskXF1kWGeKOD8wYNl9vlkW+vd5r7bd6Fogtrr1Q5WaVnDO4zlQmnwVL7AlDqSdfETHasc03sAxSFD0D7xq+Ii9kFbnc7VU/OTWvSdWRGTgBFbtZki/AwHN+C2zZ+gPPegGHQgf8th/7FP06pZy7eZRSjJ3IcoxlQFMmw1CgehplS9IP6GKoVwT8+W/U2Qcrlm9gEI9+UpgBZ0XwYN6vB3IJTIRokT9XiRg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f5ea77c-ae14-4f7d-c5f1-08d86aaa9454 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 10:20:14.0192 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u6702Q+lI4pVzTksHIs/DjSvbrkRDyQQjRkrL7uIfDYHejcRNTOQWo4Pt9QR8EESMbSQapLI748itwOfTfMN6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4670 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The device can be connected on SPI or on SDIO. The original file described the two options separately. So, most of the file had to be rewritten in order to match with the Yaml requirements. Some device requirements are still written in the comments since they cannot been expressed with the current scheme (e.g. reg must be set to 1 with SDIO, interrupt is mandatory with SPI, reset-gpio in SPI is replaced by mmc-pwrseq in SDIO, etc...). The examples provided have also been reworked in order to make dt_binding_check happy. Finally, also fix typo in the name of the file (siliabs instead of silabs) Signed-off-by: Jérôme Pouiller --- .../bindings/net/wireless/silabs,wfx.yaml | 125 ++++++++++++++++++ .../bindings/net/wireless/siliabs,wfx.txt | 96 -------------- 2 files changed, 125 insertions(+), 96 deletions(-) create mode 100644 drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml delete mode 100644 drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt diff --git a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml new file mode 100644 index 000000000000..43b5630c0407 --- /dev/null +++ b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml @@ -0,0 +1,125 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (c) 2020, Silicon Laboratories, Inc. +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/net/wireless/silabs,wfx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Silicon Labs WFxxx devicetree bindings + +maintainers: + - Jérôme Pouiller + +description: + The WFxxx chip series can be connected via SPI or via SDIO. + + For SDIO':' + + The driver is able to detect a WFxxx chip on SDIO bus by matching its Vendor + ID and Product ID. However, driver will only provide limited features in + this case. Thus declaring WFxxx chip in device tree is recommended (and may + become mandatory in the future). + + In addition, it is recommended to declare a mmc-pwrseq on SDIO host above + WFx. Without it, you may encounter issues with warm boot. The mmc-pwrseq + should be compatible with mmc-pwrseq-simple. Please consult + Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt for more + information. + + For SPI':' + + In add of the properties below, please consult + Documentation/devicetree/bindings/spi/spi-controller.yaml for optional SPI + related properties. + + Note that in add of the properties below, the WFx driver also supports + `mac-address` and `local-mac-address` as described in + Documentation/devicetree/bindings/net/ethernet.txt + +properties: + compatible: + const: silabs,wf200 + reg: + description: + When used on SDIO bus, must be set to 1. When used on SPI bus, it is + the chip select address of the device as defined in the SPI devices + bindings. + maxItems: 1 + spi-max-frequency: + description: (SPI only) Maximum SPI clocking speed of device in Hz. + maxItems: 1 + interrupts: + description: The interrupt line. Triggers IRQ_TYPE_LEVEL_HIGH and + IRQ_TYPE_EDGE_RISING are both supported by the chip and the driver. When + SPI is used, this property is required. When SDIO is used, the "in-band" + interrupt provided by the SDIO bus is used unless an interrupt is defined + in the Device Tree. + maxItems: 1 + reset-gpios: + description: (SPI only) Phandle of gpio that will be used to reset chip + during probe. Without this property, you may encounter issues with warm + boot. (For legacy purpose, the gpio in inverted when compatible == + "silabs,wfx-spi") + + For SDIO, the reset gpio should declared using a mmc-pwrseq. + maxItems: 1 + wakeup-gpios: + description: Phandle of gpio that will be used to wake-up chip. Without this + property, driver will disable most of power saving features. + maxItems: 1 + config-file: + description: Use an alternative file as PDS. Default is `wf200.pds`. Only + necessary for development/debug purpose. + maxItems: 1 + +required: + - compatible + - reg + +examples: + - | + #include + #include + + spi0 { + #address-cells = <1>; + #size-cells = <0>; + + wfx@0 { + compatible = "silabs,wf200"; + pinctrl-names = "default"; + pinctrl-0 = <&wfx_irq &wfx_gpios>; + reg = <0>; + interrupts-extended = <&gpio 16 IRQ_TYPE_EDGE_RISING>; + wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + spi-max-frequency = <42000000>; + }; + }; + + - | + #include + #include + + wfx_pwrseq: wfx_pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + pinctrl-0 = <&wfx_reset>; + reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + mmc0 { + mmc-pwrseq = <&wfx_pwrseq>; + #address-cells = <1>; + #size-cells = <0>; + + mmc@1 { + compatible = "silabs,wf200"; + pinctrl-names = "default"; + pinctrl-0 = <&wfx_wakeup>; + reg = <1>; + wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + }; +... diff --git a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt deleted file mode 100644 index db8d06fc4baa..000000000000 --- a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt +++ /dev/null @@ -1,96 +0,0 @@ -The WFxxx chip series can be connected via SPI or via SDIO. - -SPI ---- - -You have to declare the WFxxx chip in your device tree. - -Required properties: - - compatible: Should be "silabs,wf200" - - reg: Chip select address of device - - spi-max-frequency: Maximum SPI clocking speed of device in Hz - - interrupts-extended: Should contain interrupt line (interrupt-parent + - interrupt can also been used). Trigger should be `IRQ_TYPE_EDGE_RISING`. - -Optional properties: - - reset-gpios: phandle of gpio that will be used to reset chip during probe. - Without this property, you may encounter issues with warm boot. - (Legacy: when compatible == "silabs,wfx-spi", the gpio is inverted.) - -Please consult Documentation/devicetree/bindings/spi/spi-bus.txt for optional -SPI connection related properties, - -Example: - -&spi1 { - wfx { - compatible = "silabs,wf200"; - pinctrl-names = "default"; - pinctrl-0 = <&wfx_irq &wfx_gpios>; - interrupts-extended = <&gpio 16 IRQ_TYPE_EDGE_RISING>; - wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - reg = <0>; - spi-max-frequency = <42000000>; - }; -}; - - -SDIO ----- - -The driver is able to detect a WFxxx chip on SDIO bus by matching its Vendor ID -and Product ID. However, driver will only provide limited features in this -case. Thus declaring WFxxx chip in device tree is strongly recommended (and may -become mandatory in the future). - -Required properties: - - compatible: Should be "silabs,wf200" - - reg: Should be 1 - -In addition, it is recommended to declare a mmc-pwrseq on SDIO host above WFx. -Without it, you may encounter issues with warm boot. mmc-pwrseq should be -compatible with mmc-pwrseq-simple. Please consult -Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt for more -information. - -Example: - -/ { - wfx_pwrseq: wfx_pwrseq { - compatible = "mmc-pwrseq-simple"; - pinctrl-names = "default"; - pinctrl-0 = <&wfx_reset>; - reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; -}; - -&mmc1 { - mmc-pwrseq = <&wfx_pwrseq>; - #address-size = <1>; - #size = <0>; - - mmc@1 { - compatible = "silabs,wf200"; - reg = <1>; - pinctrl-names = "default"; - pinctrl-0 = <&wfx_wakeup>; - wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; - }; -}; - -Note that #address-size and #size shoud already be defined in node mmc1, but it -is rarely the case. - -Common properties ------------------ - -Some properties are recognized either by SPI and SDIO versions: - - wakeup-gpios: phandle of gpio that will be used to wake-up chip. Without - this property, driver will disable most of power saving features. - - config-file: Use an alternative file as PDS. Default is `wf200.pds`. Only - necessary for development/debug purpose. - -WFx driver also supports `mac-address` and `local-mac-address` as described in -Documentation/devicetree/bindings/net/ethernet.txt -