Skip to contentSkip to conversation

wireless: p54 devicetree conversion

PATCH Superseded Arnd Bergmann 5 participants 9 messages Apr 30 – May 5

Subsystems (10)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover wireless: p54 devicetree conversion

From: Arnd Bergmann <[email protected]>

This is an older patch of mine that I lost track of. We already decided a while ago that the OMAP2 platform should probably be removed entirely, and this is the only known user, but it's probably a good idea to still get the driver changes in, in case there are other out-of-tree users.

We probably don't have to worry about bisectability any more though, so the devicetree and driver changes can just get merged independently through the OMAP and wireless trees, respectively.

Arnd

v3 Link: https://lore.kernel.org/all/[email protected]/
v2 Link: https://lore.kernel.org/all/[email protected]/

Cc "Aaro Koskinen" <[email protected]>
Cc "Andreas Kemnade" <[email protected]>
Cc "Arnd Bergmann" <[email protected]>
Cc "Bartosz Golaszewski" <[email protected]>
Cc "Benoît Cousson" <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "Dmitry Torokhov" <[email protected]>
Cc "Eric Dumazet" <[email protected]>
Cc "Felipe Balbi" <[email protected]>
Cc "Jakub Kicinski" <[email protected]>
Cc "Johannes Berg" <[email protected]>
Cc "Kevin Hilman" <[email protected]>
Cc "Krzysztof Kozlowski" <[email protected]>
Cc "Linus Walleij" <[email protected]>
Cc "Paolo Abeni" <[email protected]>
Cc "Rob Herring" <[email protected]>
Cc "Roger Quadros" <[email protected]>
Cc "Tony Lindgren" <[email protected]>

Arnd Bergmann (3):
[net-next][v4] dt-bindings: net: add st,stlc4560/p54spi binding [net-next][v4] p54spi: convert to devicetree [omap][v4] ARM: dts: omap2: add stlc4560 spi-wireless node

 .../bindings/net/wireless/st,stlc4560.yaml    | 61 +++++++++++++++++
 MAINTAINERS                                   |  1 +
 arch/arm/boot/dts/ti/omap/omap2.dtsi          |  4 ++
 .../dts/ti/omap/omap2420-n8x0-common.dtsi     | 12 ++++
 arch/arm/mach-omap2/board-n8x0.c              | 18 -----
 drivers/net/wireless/intersil/p54/p54spi.c    | 66 +++++++------------
 drivers/net/wireless/intersil/p54/p54spi.h    |  3 +
 7 files changed, 103 insertions(+), 62 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml
Signature · 1 line
2.39.5
#1 lore raw

PATCH v4 1/3 dt-bindings: net: add st,stlc4560/p54spi binding

From: Arnd Bergmann <[email protected]>

The SPI version of Prism54 was sold under a couple of different names and supported by the Linux p54spi driver, but there was never a DT binding for it.

Document the four known names of this device and the properties that are sufficient for its use on the Nokia N8x0 tablet.

As I don't have this hardware or documentation for it, this is purely based on existing usage in the driver.

---
v4: renamed file to st,stlc4560, matching the primary compatible string
require st,stlc4560 string

---
 .../bindings/net/wireless/st,stlc4560.yaml    | 61 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 62 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml
Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml new file +61 -0
new file mode 100644
index 000000000000..979c8d7d859a
@@ -0,0 +1,61 @@
+# 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 <[email protected]>
+
+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:
+    oneOf:
+      - const: st,stlc4560
+      - items:
+          - enum:
+              - cnxt,3110x
+              - isil,p54spi
+              - st,stlc4550
+          - const: 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>;
+        };
+    };
MAINTAINERS +1 -0
index 86ca9297edab..67cf5ae5b652 100644
@@ -20093,6 +20093,7 @@ M:	Christian Lamparter <[email protected]>
 L:	[email protected]
 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/
 
 PACKET SOCKETS
Signature · 1 line
2.39.5
#2 lore raw

Re: [PATCH v4 1/3 net-next] dt-bindings: net: add st,stlc4560/p54spi binding

Quoted 15 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The SPI version of Prism54 was sold under a couple of different names and supported by the Linux p54spi driver, but there was never a DT binding for it.

Document the four known names of this device and the properties that are sufficient for its use on the Nokia N8x0 tablet.

As I don't have this hardware or documentation for it, this is purely based on existing usage in the driver.

Quoted 9 lines

---
v4: renamed file to st,stlc4560, matching the primary compatible string
require st,stlc4560 string

---
 .../bindings/net/wireless/st,stlc4560.yaml    | 61 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 62 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml: $id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename
$id: http://devicetree.org/schemas/net/wireless/st,stlc45xx.yaml
file: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml

doc reference errors (make refcheckdocs):
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml
MAINTAINERS: Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml

See https://patchwork.kernel.org/project/devicetree/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#3 lore raw

Re: [PATCH v4 1/3 net-next] dt-bindings: net: add st,stlc4560/p54spi binding

Quoted 13 lines · Rob Herring (Arm)
Quoted 5 lines · Arnd Bergmann
 .../bindings/net/wireless/st,stlc4560.yaml    | 61 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 62 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

$id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename

Review

Quoted 2 lines
(quoted diff) +0 -0
 	 $id: http://devicetree.org/schemas/net/wireless/st,stlc45xx.yaml
 	file: 

Thanks for the report, I've fixed it now for v5, to adjust for the renamed file.

Arnd

#4 lore raw

PATCH v4 2/3 p54spi: convert to devicetree

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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.

---
v4:
- make gpio line optional again
- fix EPROBE_DEFER handling
- match only st,stlc4560 compatible value, with binding change

v3:
- rebase an older patch

---
 arch/arm/mach-omap2/board-n8x0.c           | 18 ------
 drivers/net/wireless/intersil/p54/p54spi.c | 66 ++++++++--------------
 drivers/net/wireless/intersil/p54/p54spi.h |  3 +
 3 files changed, 25 insertions(+), 62 deletions(-)
arch/arm/mach-omap2/board-n8x0.c +0 -18
index 969265d5d5c6..d9acd32c5457 100644
@@ -20,7 +20,6 @@
 #include <linux/spi/spi.h>
 #include <linux/usb/musb.h>
 #include <linux/mmc/host.h>
-#include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/mmc-omap.h>
 #include <linux/mfd/menelaus.h>
 
@@ -106,21 +105,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)
 
 /*
@@ -524,7 +508,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;
 }
drivers/net/wireless/intersil/p54/p54spi.c +22 -44

130 lines not on this page · raw message

drivers/net/wireless/intersil/p54/p54spi.h +3 -0
index e5619a13fd61..118785cc635a 100644
@@ -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 */
Signature · 1 line
2.39.5
maintainer Reviewed-by on v4 2/3
#5 lore raw

Re: [PATCH v4 2/3 net-next] p54spi: convert to devicetree

Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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.

Quoted 5 lines

Convert this to the gpio descriptor interface and DT based probing to improve this and simplify the code at the same time.

Yours,
Linus Walleij

#6 lore raw

PATCH v4 3/3 ARM: dts: omap2: add stlc4560 spi-wireless node

In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Converted from the platform_device creation in board-n8x0.c.

---
 arch/arm/boot/dts/ti/omap/omap2.dtsi                |  4 ++++
 arch/arm/boot/dts/ti/omap/omap2420-n8x0-common.dtsi | 12 ++++++++++++
 2 files changed, 16 insertions(+)
arch/arm/boot/dts/ti/omap/omap2.dtsi +4 -0
index afabb36a8ac1..fdc1790adf43 100644
@@ -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>;
arch/arm/boot/dts/ti/omap/omap2420-n8x0-common.dtsi +12 -0
index 63b0b4921e4e..fe9dd8bbfc85 100644
@@ -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 */
+	};
+};
Signature · 1 line
2.39.5
maintainer Reviewed-by on v4 3/3
#7 lore raw

Re: [PATCH v4 3/3 omap] ARM: dts: omap2: add stlc4560 spi-wireless node

Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Converted from the platform_device creation in board-n8x0.c.

---

maintainer Reviewed-by on v4 3/3
#8 lore raw

Re: [PATCH v4 3/3 omap] ARM: dts: omap2: add stlc4560 spi-wireless node

In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Converted from the platform_device creation in board-n8x0.c.

Yours,
Linus Walleij