From patchwork Tue Apr 4 08:23:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13199290 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AD8CC761AF for ; Tue, 4 Apr 2023 08:28:21 +0000 (UTC) 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=0dg8LPoqU9G/548ESOXCI7dEORS4VDElbJwMaD0AAao=; b=S85RCK7y9ZRVPZ bM+8lqABIjOoBucL0qkNSMVCgUPBa5Ew2mUIHUxyWNedxvW2nhJ5m9mvZgT4mwwSJwTqEdAEb+aNN TC+FnMKNMmIRyfyKEi7MFbD0qiXP3GN2bmFoS51qA3YXZ2NbbsANirPY7kYRc1KZDPkjikxnMgUfI lasRLKuIqh61RXexmXioSriVHtRN5vmXk7HIeMSSNsxAlr1AijiUkg3se5K2SCy5nw686Ivi6J70R Qc3XbTePMBKWw/JLBhHG1XQ4an4QMiUP6DFEojRnaK7bbfI0+Y270NavNmvtQG9/nHcjyOpOYXGQn ozWn/Lpo/GmHAPC0WalQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjbyM-000SyX-1i; Tue, 04 Apr 2023 08:24:58 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjbxm-000SpY-0g for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 08:24:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F48663000; Tue, 4 Apr 2023 08:24:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1045C433A1; Tue, 4 Apr 2023 08:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680596657; bh=Wu9Q5YNgmAzpnEFBnOoyRUEdHAWjUx5xpzv1twk34q8=; h=From:To:List-Id:Cc:Subject:Date:In-Reply-To:References:From; b=AM3ydbcoEuF6wt0hUYzZ8HqTTkMrRla/MaZzFAP1WR1tOmbrUd7cd6xUrj8bsh8SV zLwegJU9XVHxfjfd96C7OcMHffCfPvWQZLLCUPmoRgaxS0rXZeWIZudweg2EUKCw3y MaaAnSdzM2ECpcwdJtbPgNyaSPEHFimuQxKDn5OhA7WbZ8EQkvDe4zwgwWAACCS44/ zhliv1LqCbx4cAXdhmNwS0Wy6LWMaNLIffcULq5/BIoK+jfQWPsFcIw34FDrJIWR1B psbm/muVnWCauyEq/jNYPfL6DOzP5dCLd0sdGuDPxonWy0y7cvRChIO1QGpIAt7/Dv EHOua9Tuk5CXw== From: Arnd Bergmann To: Tony Lindgren Cc: soc@kernel.org, Arnd Bergmann , "Aaro Koskinen" , "Bartosz Golaszewski" , =?utf-8?q?Beno=C3=AEt_Cousson?= , Christian Lamparter , "David S. Miller" , "Dmitry Torokhov" , "Eric Dumazet" , "Felipe Balbi" , "Jakub Kicinski" , "Johannes Berg" , "Krzysztof Kozlowski" , "Linus Walleij" , "Paolo Abeni" , "Rob Herring" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, Christian Lamparter Subject: [PATCH v2 1/3] dt-bindings: net: add st,stlc45xx Date: Tue, 4 Apr 2023 10:23:59 +0200 Message-Id: <20230404082401.1087835-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230404082401.1087835-1-arnd@kernel.org> References: <20230404082401.1087835-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_012429_065549_9EAB28FD X-CRM114-Status: GOOD ( 14.86 ) 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 From: Arnd Bergmann Link: https://lore.kernel.org/all/e8dc9acb-6f85-e0a9-a145-d101ca6da201@gmail.com/ Acked-by: Christian Lamparter Signed-off-by: Arnd Bergmann --- .../bindings/net/wireless/st,stlc45xx.yaml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml diff --git a/Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml b/Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml new file mode 100644 index 000000000000..99f13d8d3816 --- /dev/null +++ b/Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/wireless/st,stlc45xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ST/Intersil/Conexant stlc45xx/p54spi/cx3110x SPI wireless device + +maintainers: + - Christian Lamparter + +description: + The SPI variant of the Intersil Prism54 wireless device was sold + under a variety of names, including Conexant CX3110x and + ST Microelectronics STLC5460. + +allOf: + - $ref: ieee80211.yaml# + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + enum: + - cnxt,3110x + - isil,p54spi + - st,stlc4550 + - st,stlc4560 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + powerdown-gpios: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +unevaluatedProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + wifi@0 { + compatible = "st,stlc4560"; + reg = <0>; + spi-max-frequency = <48000000>; + interrupts-extended = <&gpio 23>; + powerdown-gpios = <&gpio 1>; + }; + }; From patchwork Tue Apr 4 08:24:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13199289 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E844C6FD1D for ; Tue, 4 Apr 2023 08:28:20 +0000 (UTC) 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=8ZoiJbORdCMWKdhY5cSWC8A9pjcWlZgChjBpwNRSSVg=; b=fh3Z8/F4Lgb0yU iH5D62BIAIMX85PpX/oK6HvsU2j0Y3wT3I1pa3cJCn+DA2b1LmxWH350EsbuIk2meAdvVXc5OnxKi +oQ9jQUBTgIHAWQoUyNsfPCbqvLygQDHJwHiIXapktmJLjz9we5M6DAD+bY0UJ246gJUGSTP5SSRx 0ZHc3KInkV3NZZFfDfzIgj700dk6bbazfGxLTv7hw3w9/2OUv6GyWcNpf265E4XvT1CoyNptQLK2V x3AQ2jGbK78YueSobCvXQGwEMpo8Kvtw/LSHsoOVZ1Xe1RNmcO9l/FaA/zWSJTHP5lbmtnmMJezWY 2xN5AkB1+VometfLQbBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjbyK-000SxP-31; Tue, 04 Apr 2023 08:24:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjbxq-000Spz-11 for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 08:24:53 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D36A863009; Tue, 4 Apr 2023 08:24:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5276FC433D2; Tue, 4 Apr 2023 08:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680596663; bh=Jx5bvjrSNpzL7FAJ0vFM7n8T6kg58By1narMR8bQMcI=; h=From:To:List-Id:Cc:Subject:Date:In-Reply-To:References:From; b=Vlpp8/o5jbSpwOhzro/2OUcugQ6BJ3HLIkiEzefoeA+6yrtMBNJXqubbdSKt0yyCh IF37wNje1EPIR8zA0WzZ24p35vIhIWJ1wbo7V3fl9spRq7SZw6pdpaoHcz25b/MAYd 8BziiO4iVla68ernU21LsVc0Oy2rGV1ZUPHfqHyzOu6jA7lCiP1aRxEKP30IccQNMs 6+TF6rmamywTb77+/rE6x/wtR+KOaX0nRBbpE5zf+l32wHeM1myjWxl78HG113gVBd wLBuTXKE34mtjFdOfKqCbJIoJCOCUvuziKKdcfk2QYOepdd9Kb4RDPZ/GH8l5SbsLE nl+jKQTYn4bCg== From: Arnd Bergmann To: Tony Lindgren Cc: soc@kernel.org, Arnd Bergmann , "Aaro Koskinen" , "Bartosz Golaszewski" , =?utf-8?q?Beno=C3=AEt_Cousson?= , Christian Lamparter , "David S. Miller" , "Dmitry Torokhov" , "Eric Dumazet" , "Felipe Balbi" , "Jakub Kicinski" , "Johannes Berg" , "Krzysztof Kozlowski" , "Linus Walleij" , "Paolo Abeni" , "Rob Herring" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v2 2/3] ARM: dts: omap2: add stlc4560 spi-wireless node Date: Tue, 4 Apr 2023 10:24:00 +0200 Message-Id: <20230404082401.1087835-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230404082401.1087835-1-arnd@kernel.org> References: <20230404082401.1087835-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_012431_071945_5519D2E3 X-CRM114-Status: GOOD ( 12.46 ) 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 From: Arnd Bergmann Converted from the platform_device creation in board-n8x0.c. Link: https://lore.kernel.org/all/20230314163201.955689-1-arnd@kernel.org/ Signed-off-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/omap2.dtsi | 4 ++++ arch/arm/boot/dts/omap2420-n8x0-common.dtsi | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index afabb36a8ac1..fdc1790adf43 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi @@ -129,6 +129,8 @@ i2c2: i2c@48072000 { }; mcspi1: spi@48098000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "ti,omap2-mcspi"; ti,hwmods = "mcspi1"; reg = <0x48098000 0x100>; @@ -140,6 +142,8 @@ mcspi1: spi@48098000 { }; mcspi2: spi@4809a000 { + #address-cells = <1>; + #size-cells = <0>; compatible = "ti,omap2-mcspi"; ti,hwmods = "mcspi2"; reg = <0x4809a000 0x100>; diff --git a/arch/arm/boot/dts/omap2420-n8x0-common.dtsi b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi index 63b0b4921e4e..fe9dd8bbfc85 100644 --- a/arch/arm/boot/dts/omap2420-n8x0-common.dtsi +++ b/arch/arm/boot/dts/omap2420-n8x0-common.dtsi @@ -109,3 +109,15 @@ partition@5 { }; }; }; + +&mcspi2 { + status = "okay"; + + wifi@0 { + reg = <0>; + compatible = "st,stlc4560"; + spi-max-frequency = <48000000>; + interrupts-extended = <&gpio3 23 IRQ_TYPE_EDGE_RISING>; + powerdown-gpios = <&gpio4 1 GPIO_ACTIVE_LOW>; /* gpio 97 */ + }; +}; From patchwork Tue Apr 4 08:24:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13199291 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AA7EC761A6 for ; Tue, 4 Apr 2023 08:28:24 +0000 (UTC) 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=i8cJRgpEFq2Gelwhi5A49Wr8TXmpEorgT4K71xAETgc=; b=xiUTmB4YnRRQRa jiL1nv629D8xBPgvXBi8auRmLRjmoGsxQ+qSOhx5f3IMgIr4R/z6GWlxEyXN3pqNG8D+ehQkB8N1F BP9OshAAP7iQeHkbpc2+CWbkUL9naIJ+UZldagprCcIaYwmv2CQfRdKllFRxi2M5vTMF9OGdf9GwZ yVJIEpxre2dL/Ti1oT3QpO7uFv2Cs2Uwwbrot2BlT5WWhcayaa7clOILBeDn8WJDXCRdR6Tr0Yk9E +8YdXpQn6Sq2yO3GIwR/V6zlw7/sGJCmTaV7t38mQ5kKa+OgGnnxCUNmN9lE5VfhZGFNl/EhmyJte yxvb8cpXTgLxQaOKi4xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjbyO-000Szk-1D; Tue, 04 Apr 2023 08:25:00 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjbxt-000SrK-2u for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 08:24:53 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 71B1662FFD; Tue, 4 Apr 2023 08:24:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B73FCC4339B; Tue, 4 Apr 2023 08:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680596668; bh=DzupnWeoOGy+Q0S7UaV26wirxq+rNaq4TIQ6ayzWeSU=; h=From:To:List-Id:Cc:Subject:Date:In-Reply-To:References:From; b=q1DOI4MOxSTdRpKNPiEQEY+GekqHAOqM6PRZNB9jvo27I8+Nef7zkloNTAQgR2tk/ hZolTQBu/q/CSnPJMYwrgURmVPg/3YhLqlO9Cod44xtN637b1VgMJ5FNkw0VmQ4kKE gmUNZwOQJR/PpEOl8nY4VT3FaDYpxJ6cCfv2QpD1tsOutzkJBOZmhOOUVbmpXJDzKJ 29OYUnU8uo+gjfEzFENoc8DDd77k8oNbJ0Ew+DAp2y8R8vMEJZYAN9rY30R4AqhgX9 h2QgWreeJ5rdEraJbl/kthdn8cqtWRi3INiyux3NkcXiSJ/d82BE9BX0WfsiFXBPmK 4qvPphjRmFXsA== From: Arnd Bergmann To: Tony Lindgren Cc: soc@kernel.org, Arnd Bergmann , "Aaro Koskinen" , "Bartosz Golaszewski" , =?utf-8?q?Beno=C3=AEt_Cousson?= , Christian Lamparter , "David S. Miller" , "Dmitry Torokhov" , "Eric Dumazet" , "Felipe Balbi" , "Jakub Kicinski" , "Johannes Berg" , "Krzysztof Kozlowski" , "Linus Walleij" , "Paolo Abeni" , "Rob Herring" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, Christian Lamparter Subject: [PATCH v2 3/3] p54spi: convert to devicetree Date: Tue, 4 Apr 2023 10:24:01 +0200 Message-Id: <20230404082401.1087835-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230404082401.1087835-1-arnd@kernel.org> References: <20230404082401.1087835-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_012431_103571_513D40F2 X-CRM114-Status: GOOD ( 27.02 ) 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 From: Arnd Bergmann The Prism54 SPI driver hardcodes GPIO numbers and expects users to pass them as module parameters, apparently a relic from its life as a staging driver. This works because there is only one user, the Nokia N8x0 tablet. Convert this to the gpio descriptor interface and DT based probing to improve this and simplify the code at the same time. Acked-by: Christian Lamparter Signed-off-by: Arnd Bergmann --- MAINTAINERS | 1 + arch/arm/mach-omap2/board-n8x0.c | 18 ------ drivers/net/wireless/intersil/p54/p54spi.c | 71 ++++++++-------------- drivers/net/wireless/intersil/p54/p54spi.h | 3 + 4 files changed, 30 insertions(+), 63 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4f57deee1a08..9b08dcea913a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15793,6 +15793,7 @@ M: Christian Lamparter L: linux-wireless@vger.kernel.org S: Maintained W: https://wireless.wiki.kernel.org/en/users/Drivers/p54 +F: Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml F: drivers/net/wireless/intersil/p54/ PACKET SOCKETS diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 3353b0a923d9..6a2949f50653 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -142,21 +141,6 @@ static void __init n8x0_usb_init(void) {} #endif /*CONFIG_USB_MUSB_TUSB6010 */ - -static struct omap2_mcspi_device_config p54spi_mcspi_config = { - .turbo_mode = 0, -}; - -static struct spi_board_info n800_spi_board_info[] __initdata = { - { - .modalias = "p54spi", - .bus_num = 2, - .chip_select = 0, - .max_speed_hz = 48000000, - .controller_data = &p54spi_mcspi_config, - }, -}; - #if defined(CONFIG_MENELAUS) && IS_ENABLED(CONFIG_MMC_OMAP) /* @@ -585,7 +569,5 @@ omap_late_initcall(n8x0_late_initcall); void * __init n8x0_legacy_init(void) { board_check_revision(); - spi_register_board_info(n800_spi_board_info, - ARRAY_SIZE(n800_spi_board_info)); return &mmc1_data; } diff --git a/drivers/net/wireless/intersil/p54/p54spi.c b/drivers/net/wireless/intersil/p54/p54spi.c index 19152fd449ba..130b36f9eec0 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.c +++ b/drivers/net/wireless/intersil/p54/p54spi.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include #include -#include +#include #include #include "p54spi.h" @@ -29,19 +30,6 @@ MODULE_FIRMWARE("3826.arm"); -/* gpios should be handled in board files and provided via platform data, - * but because it's currently impossible for p54spi to have a header file - * in include/linux, let's use module paramaters for now - */ - -static int p54spi_gpio_power = 97; -module_param(p54spi_gpio_power, int, 0444); -MODULE_PARM_DESC(p54spi_gpio_power, "gpio number for power line"); - -static int p54spi_gpio_irq = 87; -module_param(p54spi_gpio_irq, int, 0444); -MODULE_PARM_DESC(p54spi_gpio_irq, "gpio number for irq line"); - static void p54spi_spi_read(struct p54s_priv *priv, u8 address, void *buf, size_t len) { @@ -261,14 +249,14 @@ static int p54spi_upload_firmware(struct ieee80211_hw *dev) static void p54spi_power_off(struct p54s_priv *priv) { - disable_irq(gpio_to_irq(p54spi_gpio_irq)); - gpio_set_value(p54spi_gpio_power, 0); + disable_irq(priv->irq); + gpiod_set_value(priv->gpiodown_power, 1); } static void p54spi_power_on(struct p54s_priv *priv) { - gpio_set_value(p54spi_gpio_power, 1); - enable_irq(gpio_to_irq(p54spi_gpio_irq)); + gpiod_set_value(priv->gpio_powerdown, 0); + enable_irq(priv->irq); /* need to wait a while before device can be accessed, the length * is just a guess @@ -607,32 +595,20 @@ static int p54spi_probe(struct spi_device *spi) goto err_free; } - ret = gpio_request(p54spi_gpio_power, "p54spi power"); - if (ret < 0) { - dev_err(&priv->spi->dev, "power GPIO request failed: %d", ret); + priv->gpio_powerdown = gpiod_get(&spi->dev, "powerdown", GPIOD_OUT_HIGH); + if (IS_ERR(priv->gpio_powerdown)) { + ret = PTR_ERR(priv->gpio_powerdown); + dev_err(&priv->spi->dev, "powerdown GPIO request failed: %d", ret); goto err_free; } - ret = gpio_request(p54spi_gpio_irq, "p54spi irq"); - if (ret < 0) { - dev_err(&priv->spi->dev, "irq GPIO request failed: %d", ret); - goto err_free_gpio_power; - } - - gpio_direction_output(p54spi_gpio_power, 0); - gpio_direction_input(p54spi_gpio_irq); - - ret = request_irq(gpio_to_irq(p54spi_gpio_irq), - p54spi_interrupt, 0, "p54spi", - priv->spi); + ret = request_irq(spi->irq, p54spi_interrupt, 0, "p54spi", priv->spi); if (ret < 0) { dev_err(&priv->spi->dev, "request_irq() failed"); - goto err_free_gpio_irq; + goto err_free_gpio_power; } - irq_set_irq_type(gpio_to_irq(p54spi_gpio_irq), IRQ_TYPE_EDGE_RISING); - - disable_irq(gpio_to_irq(p54spi_gpio_irq)); + disable_irq(priv->irq); INIT_WORK(&priv->work, p54spi_work); init_completion(&priv->fw_comp); @@ -660,11 +636,9 @@ static int p54spi_probe(struct spi_device *spi) err_free_common: release_firmware(priv->firmware); - free_irq(gpio_to_irq(p54spi_gpio_irq), spi); -err_free_gpio_irq: - gpio_free(p54spi_gpio_irq); + free_irq(priv->irq, spi); err_free_gpio_power: - gpio_free(p54spi_gpio_power); + gpiod_put(priv->gpio_powerdown); err_free: p54_free_common(priv->hw); return ret; @@ -676,10 +650,8 @@ static void p54spi_remove(struct spi_device *spi) p54_unregister_common(priv->hw); - free_irq(gpio_to_irq(p54spi_gpio_irq), spi); - - gpio_free(p54spi_gpio_power); - gpio_free(p54spi_gpio_irq); + free_irq(priv->irq, spi); + gpiod_put(priv->gpio_powerdown); release_firmware(priv->firmware); mutex_destroy(&priv->mutex); @@ -687,10 +659,19 @@ static void p54spi_remove(struct spi_device *spi) p54_free_common(priv->hw); } +struct of_device_id p54spi_of_ids[] = { + { .compatible = "cnxt,3110x", }, + { .compatible = "isil,p54spi", }, + { .compatible = "st,stlc4550", }, + { .compatible = "st,stlc4560", }, + { }, +}; +MODULE_DEVICE_TABLE(of, p54spi_of_ids); static struct spi_driver p54spi_driver = { .driver = { .name = "p54spi", + .of_match_table = p54spi_of_ids, }, .probe = p54spi_probe, diff --git a/drivers/net/wireless/intersil/p54/p54spi.h b/drivers/net/wireless/intersil/p54/p54spi.h index e5619a13fd61..118785cc635a 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.h +++ b/drivers/net/wireless/intersil/p54/p54spi.h @@ -107,6 +107,9 @@ struct p54s_priv { enum fw_state fw_state; const struct firmware *firmware; + + struct gpio_desc *gpio_powerdown; + int irq; }; #endif /* P54SPI_H */