Skip to contentSkip to conversation

wlcore/wl12xx: spi: add wifi support to cm-t335

PATCH In review Uri Mashiach 8 participants 24 messages Dec 30, 2015 – Jan 29, 2016 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v4 cover wlcore/wl12xx: spi: add wifi support to cm-t335

Add DT support for WLS1271 SPI driver.
Add power operation function to the WLS1271 SPI driver.

Uri Mashiach (3):
wlcore/wl12xx: spi: add power operation function wlcore/wl12xx: spi: add device tree support wlcore/wl12xx: spi: add wifi support to cm-t335

 .../bindings/net/wireless/ti,wlcore,spi.txt        | 36 +++++++++
 arch/arm/boot/dts/am335x-cm-t335.dts               | 55 ++++++++++++++
 drivers/net/wireless/ti/wlcore/Kconfig             |  2 +-
 drivers/net/wireless/ti/wlcore/spi.c               | 86 +++++++++++++++++++++-
 4 files changed, 174 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
Signature · 1 line
2.5.0
#1 lore raw

PATCH v4 1/3 wlcore/wl12xx: spi: add power operation function

The power function uses a consumer regulator access to update the WiFi enable GPIO value.

---
v1 -> v2: oops fix was removed to a separate fix. v2 -> v3: no changes
v3 -> v4: update devm_regulator_get() error handling.

 drivers/net/wireless/ti/wlcore/spi.c | 39 ++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
drivers/net/wireless/ti/wlcore/spi.c +39 -0
index 44f059f..dec1512 100644
@@ -30,6 +30,7 @@
 #include <linux/spi/spi.h>
 #include <linux/wl12xx.h>
 #include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
 
 #include "wlcore.h"
 #include "wl12xx_80211.h"
@@ -81,6 +82,7 @@
 struct wl12xx_spi_glue {
 	struct device *dev;
 	struct platform_device *core;
+	struct regulator *reg; /* Power regulator */
 };
 
 static void wl12xx_spi_reset(struct device *child)
@@ -318,11 +320,40 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr,
 	return 0;
 }
 
+/**
+ * wl12xx_spi_set_power - power on/off the wl12xx unit
+ * @child: wl12xx device handle.
+ * @enable: true/false to power on/off the unit.
+ *
+ * use the WiFi enable regulator to enable/disable the WiFi unit.
+ */
+static int wl12xx_spi_set_power(struct device *child, bool enable)
+{
+	int ret = 0;
+	struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent);
+
+	WARN_ON(!glue->reg);
+
+	/* Update regulator state */
+	if (enable) {
+		ret = regulator_enable(glue->reg);
+		if (ret)
+			dev_err(child, "Power enable failure\n");
+	} else {
+		ret =  regulator_disable(glue->reg);
+		if (ret)
+			dev_err(child, "Power disable failure\n");
+	}
+
+	return ret;
+}
+
 static struct wl1271_if_operations spi_ops = {
 	.read		= wl12xx_spi_raw_read,
 	.write		= wl12xx_spi_raw_write,
 	.reset		= wl12xx_spi_reset,
 	.init		= wl12xx_spi_init,
+	.power		= wl12xx_spi_set_power,
 	.set_block_size = NULL,
 };
 
@@ -353,6 +384,14 @@ static int wl1271_probe(struct spi_device *spi)
 	 * comes from the board-peripherals file */
 	spi->bits_per_word = 32;
 
+	glue->reg = devm_regulator_get(&spi->dev, "vwlan");
+	if (PTR_ERR(glue->reg) == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
+	if (IS_ERR(glue->reg)) {
+		dev_err(glue->dev, "can't get regulator\n");
+		return PTR_ERR(glue->reg);
+	}
+
 	ret = spi_setup(spi);
 	if (ret < 0) {
 		dev_err(glue->dev, "spi_setup failed\n");
Signature · 1 line
2.5.0
#2 lore raw

PATCH v4 1/3 wlcore/wl12xx: spi: add power operation function

Hi,

Quoted 4 lines · Uri Mashiach

The power function uses a consumer regulator access to update the WiFi enable GPIO value.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160109/46270873/attachment-0001.sig>

#5 lore raw

PATCH v4 1/3 wlcore/wl12xx: spi: add power operation function

In reply to Uri Mashiach
Quoted 8 lines

The power function uses a consumer regulator access to update the WiFi enable GPIO value.

Thanks, 2 patches applied to wireless-drivers-next.git:

4c1ce07bcf62 wlcore/wl12xx: spi: add power operation function 04654c386145 wlcore/wl12xx: spi: add device tree support

Kalle Valo

A message that is not in the archive (sent off-list or not yet received): 1451482533-8624-2-git-send-email-uri.mashiach-UTxiZqZC01RS1MOuV/[email protected]

#7 lore raw

Re: [v4,1/3] wlcore/wl12xx: spi: add power operation function

Quoted 8 lines

The power function uses a consumer regulator access to update the WiFi enable GPIO value.

Thanks, 2 patches applied to wireless-drivers-next.git:

4c1ce07bcf62 wlcore/wl12xx: spi: add power operation function 04654c386145 wlcore/wl12xx: spi: add device tree support

Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

Re: [v4,1/3] wlcore/wl12xx: spi: add power operation function

In reply to Uri Mashiach
Quoted 8 lines

The power function uses a consumer regulator access to update the WiFi enable GPIO value.

Thanks, 2 patches applied to wireless-drivers-next.git:

4c1ce07bcf62 wlcore/wl12xx: spi: add power operation function 04654c386145 wlcore/wl12xx: spi: add device tree support

Kalle Valo

#9 lore raw

PATCH v4 2/3 wlcore/wl12xx: spi: add device tree support

In reply to Uri Mashiach

Add DT support for the wl1271 SPI WiFi.

Add documentation file for the wl1271 SPI WiFi.

---
v1 -> v2: update interrupt documentation.
replace interrupts and interrupt-parent with interrupts-extended.
IRQ parameters retrieved from spi_device instead of DT.
remove redundant #ifdef CONFIG_OF
v2 -> v3: Add MODULE_DEVICE_TABLE.
Remove #ifdef CONFIG_OF.
Make the Kconfig symbol to depend on OF.
Replace irqd_get_trigger_type() with irq_get_trigger_type().
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. (revert v2 modification).
According to Rob Herring and Documentation/devicetree/bindings/interrupt-controller/interrupts.txt, interrupts-extended should only be used when a device has multiple interrupt parents.

 .../bindings/net/wireless/ti,wlcore,spi.txt        | 36 +++++++++++++++++
 drivers/net/wireless/ti/wlcore/Kconfig             |  2 +-
 drivers/net/wireless/ti/wlcore/spi.c               | 47 ++++++++++++++++++++--
 3 files changed, 80 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt
Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt new file +36 -0
new file mode 100644
index 0000000..9180724
@@ -0,0 +1,36 @@
+* Texas Instruments wl1271 wireless lan controller
+
+The wl1271 chip can be connected via SPI or via SDIO. This
+document describes the binding for the SPI connected chip.
+
+Required properties:
+- compatible :          Should be "ti,wl1271"
+- reg :                 Chip select address of device
+- spi-max-frequency :   Maximum SPI clocking speed of device in Hz
+- ref-clock-frequency : Reference clock frequency
+- interrupt-parent, interrupts :
+                        Should contain parameters for 1 interrupt line.
+                        Interrupt parameters: parent, line number, type.
+- vwlan-supply :        Point the node of the regulator that powers/enable the wl1271 chip
+
+Optional properties:
+- clock-xtal :          boolean, clock is generated from XTAL
+
+- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt
+  for optional SPI connection related properties,
+
+Examples:
+
+&spi1 {
+	wl1271 at 1 {
+		compatible = "ti,wl1271";
+
+		reg = <1>;
+		spi-max-frequency = <48000000>;
+		clock-xtal;
+		ref-clock-frequency = <38400000>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
+		vwlan-supply = <&vwlan_fixed>;
+	};
+};
drivers/net/wireless/ti/wlcore/Kconfig +1 -1
index 7c09954..5918080 100644
@@ -13,7 +13,7 @@ config WLCORE
 
 config WLCORE_SPI
 	tristate "TI wlcore SPI support"
-	depends on WLCORE && SPI_MASTER
+	depends on WLCORE && SPI_MASTER && OF
 	select CRC7
 	---help---
 	  This module adds support for the SPI interface of adapters using
drivers/net/wireless/ti/wlcore/spi.c +43 -4

86 lines not on this page · raw message

Signature · 1 line
2.5.0
#10 lore raw

PATCH v4 2/3 wlcore/wl12xx: spi: add device tree support

Hi,

Quoted 6 lines · Uri Mashiach

Add DT support for the wl1271 SPI WiFi.

Add documentation file for the wl1271 SPI WiFi.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160109/9774d81e/attachment.sig>

#11 lore raw

PATCH v4 2/3 wlcore/wl12xx: spi: add device tree support

Quoted 5 lines · Sebastian Reichel

Hi,

Quoted 2 lines · Uri Mashiach

Add DT support for the wl1271 SPI WiFi.

Quoted 7 lines
Quoted 4 lines

Add documentation file for the wl1271 SPI WiFi.

Thanks.--
regards,
-grygorii

#13 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

In reply to Uri Mashiach

Device tree modifications:
- Pinmux for SPI0 and WiFi GPIOs.
- SPI0 node with wlcore as a child node.

---
v1 -> v2: Replace interrupts and interrupt-parent with interrupts-extended.
v2 -> v3: Move the pinctrl-0 = <&wifi_pins> to the wlcore node.
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. (revert v2 modification).
According to Rob Herring and Documentation/devicetree/bindings/interrupt-controller/interrupts.txt, interrupts-extended should only be used when a device has multiple interrupt parents.

 arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
arch/arm/boot/dts/am335x-cm-t335.dts +55 -0
index 42e9b66..65f1099 100644
@@ -11,6 +11,7 @@
 /dts-v1/;
 
 #include "am33xx.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
 	model = "CompuLab CM-T335";
@@ -40,6 +41,15 @@
 		regulator-max-microvolt = <3300000>;
 	};
 
+	/* Regulator for WiFi */
+	vwlan_fixed: fixedregulator at 2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vwlan_fixed";
+		gpio = <&gpio0 20 GPIO_ACTIVE_HIGH>; /* gpio0_20 */
+		enable-active-high;
+		regulator-boot-off;
+	};
+
 	backlight {
 		compatible = "pwm-backlight";
 		pwms = <&ecap0 0 50000 0>;
@@ -223,6 +233,21 @@
 		>;
 	};
 
+	spi0_pins: pinmux_spi0_pins {
+		pinctrl-single,pins = <
+			/* spi0_sclk.spi0_sclk */
+			AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE0)
+			/* spi0_d0.spi0_d0 */
+			AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0)
+			/* spi0_d1.spi0_d1 */
+			AM33XX_IOPAD(0x958, PIN_INPUT | MUX_MODE0)
+			/* spi0_cs0.spi0_cs0 */
+			AM33XX_IOPAD(0x95C, PIN_OUTPUT | MUX_MODE0)
+			/* spi0_cs1.spi0_cs1 */
+			AM33XX_IOPAD(0x960, PIN_OUTPUT | MUX_MODE0)
+		>;
+	};
+
 	/* wl1271 bluetooth */
 	bluetooth_pins: pinmux_bluetooth_pins {
 		pinctrl-single,pins = <
@@ -230,6 +255,16 @@
 			AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLUP | MUX_MODE7)
 		>;
 	};
+
+	/* wl1271 WiFi */
+	wifi_pins: pinmux_wifi_pins {
+		pinctrl-single,pins = <
+			/* EMU1.gpio3_8 - WiFi IRQ */
+			AM33XX_IOPAD(0x9e8, PIN_INPUT_PULLUP | MUX_MODE7)
+			/* XDMA_EVENT_INTR1.gpio0_20 - WiFi enable */
+			AM33XX_IOPAD(0x9b4, PIN_OUTPUT | MUX_MODE7)
+		>;
+	};
 };
 
 &uart0 {
@@ -394,3 +429,23 @@ status = "okay";
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins>;
 };
+
+&spi0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pins>;
+	ti,pindir-d0-out-d1-in = <1>;
+	/* WLS1271 WiFi */
+	wlcore: wlcore at 1 {
+		compatible = "ti,wl1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_pins>;
+		reg = <1>;
+		spi-max-frequency = <48000000>;
+		clock-xtal;
+		ref-clock-frequency = <38400000>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
+		vwlan-supply = <&vwlan_fixed>;
+	};
+};
Signature · 1 line
2.5.0
#14 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

Quoted 13 lines · Uri Mashiach

Device tree modifications:
- Pinmux for SPI0 and WiFi GPIOs.
- SPI0 node with wlcore as a child node.

---
v1 -> v2: Replace interrupts and interrupt-parent with interrupts-extended.
v2 -> v3: Move the pinctrl-0 = <&wifi_pins> to the wlcore node.
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. (revert v2 modification).
According to Rob Herring and Documentation/devicetree/bindings/interrupt-controller/interrupts.txt, interrupts-extended should only be used when a device has multiple interrupt parents.

Quoted 2 lines
 arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

To what tree should this patch go? My wireless-drivers-next tree doesn't even have this file.

https://patchwork.kernel.org/patch/7933441/

Signature · 1 line
Kalle Valo
#15 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

Hi Kalle Valo,

Quoted 15 lines · Kalle Valo
Quoted 13 lines · Uri Mashiach

Device tree modifications:
- Pinmux for SPI0 and WiFi GPIOs.
- SPI0 node with wlcore as a child node.

---
v1 -> v2: Replace interrupts and interrupt-parent with interrupts-extended.
v2 -> v3: Move the pinctrl-0 = <&wifi_pins> to the wlcore node.
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. (revert v2 modification).
According to Rob Herring and Documentation/devicetree/bindings/interrupt-controller/interrupts.txt,
interrupts-extended should only be used when a device has multiple interrupt parents.

Quoted 5 lines
Quoted 2 lines
  arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
  1 file changed, 55 insertions(+)

To what tree should this patch go? My wireless-drivers-next tree doesn't even have this file.

Should be applied into omap-for-v4.x/dt

Quoted 3 lines

https://patchwork.kernel.org/patch/7933441/

Signature · 2 lines
Thanks,
Uri
#16 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

In reply to Kalle Valo

Hi Kalle Valo,

Quoted 9 lines · Kalle Valo
Quoted 7 lines · Uri Mashiach

Device tree modifications:
- Pinmux for SPI0 and WiFi GPIOs.
- SPI0 node with wlcore as a child node.

---

Uri, please document the dependencies next time. Thanks!

Quoted 11 lines
Quoted 8 lines

v1 -> v2: Replace interrupts and interrupt-parent with interrupts-extended.
v2 -> v3: Move the pinctrl-0 = <&wifi_pins> to the wlcore node.
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. (revert v2 modification).
According to Rob Herring and Documentation/devicetree/bindings/interrupt-controller/interrupts.txt, interrupts-extended should only be used when a device has multiple interrupt parents.

 arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

To what tree should this patch go? My wireless-drivers-next tree doesn't even have this file.

Right. It will hit the mainline during this merge window through Tony's and arm-soc trees.

Do you think it will be sensible if you take 1/3 and 2/3 patches and Tony will take the 3/3 (there is no code dependency between first two and the last one), or we can just wait till arm-soc hits the mainline, so you will have the needed code?

Quoted 3 lines

https://patchwork.kernel.org/patch/7933441/

Signature · 2 lines
Regards,
Igor.
#17 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

Quoted 27 lines · Igor Grinberg

Hi Kalle Valo,

Quoted 9 lines · Kalle Valo
Quoted 7 lines · Uri Mashiach

Device tree modifications:
- Pinmux for SPI0 and WiFi GPIOs.
- SPI0 node with wlcore as a child node.

---

Uri, please document the dependencies next time. Thanks!

Quoted 11 lines
Quoted 8 lines

v1 -> v2: Replace interrupts and interrupt-parent with interrupts-extended.
v2 -> v3: Move the pinctrl-0 = <&wifi_pins> to the wlcore node.
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. (revert v2 modification).
According to Rob Herring and Documentation/devicetree/bindings/interrupt-controller/interrupts.txt, interrupts-extended should only be used when a device has multiple interrupt parents.

 arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

To what tree should this patch go? My wireless-drivers-next tree doesn't even have this file.

Quoted 7 lines

Right. It will hit the mainline during this merge window through Tony's and arm-soc trees.

Do you think it will be sensible if you take 1/3 and 2/3 patches and Tony will take the 3/3 (there is no code dependency between first two and the last one), or we can just wait till arm-soc hits the mainline, so you will have the needed code?

Yeah I'll pick the dts changes separately after the merge window as there is no dependency to the driver changes.

Regards,

Tony

#18 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

Quoted 9 lines · Tony Lindgren
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
 arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

To what tree should this patch go? My wireless-drivers-next tree doesn't even have this file.

Right. It will hit the mainline during this merge window through Tony's and arm-soc trees.

Quoted 7 lines
Quoted 4 lines

Do you think it will be sensible if you take 1/3 and 2/3 patches and Tony will take the 3/3 (there is no code dependency between first two and the last one), or we can just wait till arm-soc hits the mainline, so you will have the needed code?

Yeah I'll pick the dts changes separately after the merge window as there is no dependency to the driver changes.

Ok, I'll then take patches 1 and 2 once the merge window opens.

Signature · 1 line
Kalle Valo
#19 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

Quoted 16 lines · Kalle Valo
Quoted 14 lines · Tony Lindgren
Quoted 13 lines
Quoted 5 lines
Quoted 2 lines
  arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
  1 file changed, 55 insertions(+)

To what tree should this patch go? My wireless-drivers-next tree doesn't even have this file.

Right. It will hit the mainline during this merge window through Tony's and arm-soc trees.

Do you think it will be sensible if you take 1/3 and 2/3 patches and Tony will take the 3/3 (there is no code dependency between first two and the last one), or we can just wait till arm-soc hits the mainline, so you will have the needed code?

Quoted 4 lines
Quoted 2 lines

Yeah I'll pick the dts changes separately after the merge window as there is no dependency to the driver changes.

Ok, I'll then take patches 1 and 2 once the merge window opens.

I guess it is semantics, but the merge window is open right now so you probably mean to say after the merge window closes, ie. when 4.5-rc1 is ready.

Regards,
Arend

#20 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

Quoted 11 lines · Arend van Spriel
Quoted 6 lines · Kalle Valo
Quoted 2 lines · Tony Lindgren

Yeah I'll pick the dts changes separately after the merge window as there is no dependency to the driver changes.

Ok, I'll then take patches 1 and 2 once the merge window opens.

I guess it is semantics, but the merge window is open right now so you probably mean to say after the merge window closes, ie. when 4.5-rc1 is ready.

Exactly. Sorry, I suck in multitasking :)

Signature · 1 line
Kalle Valo
#21 lore raw

PATCH v4 3/3 wlcore/wl12xx: spi: add wifi support to cm-t335

In reply to Tony Lindgren
Quoted 31 lines · Tony Lindgren
Quoted 30 lines · Igor Grinberg

Hi Kalle Valo,

Quoted 9 lines · Kalle Valo
Quoted 7 lines · Uri Mashiach

Device tree modifications:
- Pinmux for SPI0 and WiFi GPIOs.
- SPI0 node with wlcore as a child node.

---

Uri, please document the dependencies next time. Thanks!

Quoted 11 lines
Quoted 8 lines

v1 -> v2: Replace interrupts and interrupt-parent with interrupts-extended.
v2 -> v3: Move the pinctrl-0 = <&wifi_pins> to the wlcore node.
v3 -> v4: replace interrupts-extended with interrupts and interrupt-parent. (revert v2 modification).
According to Rob Herring and Documentation/devicetree/bindings/interrupt-controller/interrupts.txt, interrupts-extended should only be used when a device has multiple interrupt parents.

 arch/arm/boot/dts/am335x-cm-t335.dts | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

To what tree should this patch go? My wireless-drivers-next tree doesn't even have this file.

Right. It will hit the mainline during this merge window through Tony's and arm-soc trees.

Quoted 7 lines
Quoted 4 lines

Do you think it will be sensible if you take 1/3 and 2/3 patches and Tony will take the 3/3 (there is no code dependency between first two and the last one), or we can just wait till arm-soc hits the mainline, so you will have the needed code?

Yeah I'll pick the dts changes separately after the merge window as there is no dependency to the driver changes.

Applying patch 3/3 into omap-for-v4.6/dt thanks.

Tony

#22 lore raw

PATCH 1/1 ARM: dts: N950: Add wlan support

In reply to Uri Mashiach

Add support for the wl1271 wlan chip. As far as I can see N9 uses the same chip with the same enable and irq gpio, but they use the mmc interface instead of the spi interface.

---
Hi,

I got working Wifi on Nokia N950 with this patch and the following patches from Uri Mashiach (using 4.4-rc8 as base):

* wlcore/wl12xx: spi: add power operation function
* wlcore/wl12xx: spi: add device tree support
* wlcore/wl12xx: spi: fix oops on firmware load

-- Sebastian

---
 arch/arm/boot/dts/omap3-n950-n9.dtsi | 15 +++++++++++++++
 arch/arm/boot/dts/omap3-n950.dts     | 29 +++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
arch/arm/boot/dts/omap3-n950-n9.dtsi +15 -0
index e9ee1df0e467..655deb99010a 100644
@@ -31,6 +31,14 @@
 		startup-delay-us = <150>;
 		enable-active-high;
 	};
+
+	vwlan_fixed: fixedregulator@2 {
+		compatible = "regulator-fixed";
+		regulator-name = "VWLAN";
+		gpio = <&gpio2 3 GPIO_ACTIVE_HIGH>; /* gpio 35 */
+		enable-active-high;
+		regulator-boot-off;
+	};
 };
 
 &omap3_pmx_core {
@@ -44,6 +52,13 @@
 			0x132 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3 */
 		>;
 	};
+
+	wlan_pins: pinmux_wlan_pins {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x207c, PIN_OUTPUT | MUX_MODE4) /* gpio 35 - wlan enable */
+			OMAP3_CORE1_IOPAD(0x208a, PIN_INPUT | MUX_MODE4) /* gpio 42 - wlan irq */
+		>;
+	};
 };
 
 &i2c1 {
arch/arm/boot/dts/omap3-n950.dts +29 -0
index 0885b34d5d7d..e5967262f28b 100644
@@ -17,6 +17,17 @@
 	compatible = "nokia,omap3-n950", "ti,omap36xx", "ti,omap3";
 };
 
+&omap3_pmx_core {
+	spi4_pins: pinmux_spi4_pins {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x218c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mcspi4_clk */
+			OMAP3_CORE1_IOPAD(0x2190, PIN_OUTPUT | MUX_MODE1) /* mcspi4_simo */
+			OMAP3_CORE1_IOPAD(0x2192, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mcspi4_somi */
+			OMAP3_CORE1_IOPAD(0x2196, PIN_OUTPUT | MUX_MODE1) /* mcspi4_cs0 */
+		>;
+	};
+};
+
 &i2c2 {
 	smia_1: camera@10 {
 		compatible = "nokia,smia";
@@ -53,3 +64,21 @@
 		};
 	};
 };
+
+&mcspi4 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi4_pins>;
+
+	wlcore: wlcore@0 {
+		compatible = "ti,wl1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wlan_pins>;
+		reg = <0>;
+		spi-max-frequency = <48000000>;
+		clock-xtal;
+		ref-clock-frequency = <38400000>;
+		interrupts-extended = <&gpio2 10 IRQ_TYPE_LEVEL_HIGH>; /* gpio 42 */
+		vwlan-supply = <&vwlan_fixed>;
+	};
+};
Signature · 1 line
2.6.4