Skip to contentSkip to conversation

wl1251: remove ti,power-gpio for sdio mode

PATCH In review H. Nikolaus Schaller 3 participants 5 messages Jan 26, 2020 – Feb 12, 2020

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

v3 cover wl1251: remove ti,power-gpio for sdio mode

* rebased on wireless-drivers-next-2020-01-26

PATCH V2 2019-12-17 19:07:02:
* use just "wl1251: " as title prefix - by Kalle Valo <[email protected]>
* fix error handling: we still have to check for wl->irq returning -EPROBE_DEFER

PATCH V1 2019-11-24 11:35:48:
The driver has been updated to use the mmc/sdio core which does full power control. So we do no longer need the power control gipo.

Note that it is still needed for the SPI based interface (N900).

Suggested by: Ulf Hansson <[email protected]>
Tested by: H. Nikolaus Schaller <[email protected]> # OpenPandora 600MHz

H. Nikolaus Schaller (2):
DTS: bindings: wl1251: mark ti,power-gpio as optional
wl1251: remove ti,power-gpio for SDIO mode

 .../bindings/net/wireless/ti,wl1251.txt       |  3 +-
 drivers/net/wireless/ti/wl1251/sdio.c         | 32 ++-----------------
 2 files changed, 4 insertions(+), 31 deletions(-)
Signature · 1 line
2.23.0
#4 lore raw

PATCH v3 2/2 wl1251: remove ti,power-gpio for SDIO mode

Remove handling of this property from code.

Note that wl->power_gpio is still needed in
the header file for SPI mode (N900).

Suggested by: Ulf Hansson <[email protected]>

---
 drivers/net/wireless/ti/wl1251/sdio.c | 32 ++-------------------------
 1 file changed, 2 insertions(+), 30 deletions(-)
drivers/net/wireless/ti/wl1251/sdio.c +2 -30
index 94569cd695c8..c9a4e9a43400 100644
@@ -15,9 +15,7 @@
 #include <linux/wl12xx.h>
 #include <linux/irq.h>
 #include <linux/pm_runtime.h>
-#include <linux/gpio.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 
 #include "wl1251.h"
@@ -160,15 +158,6 @@ static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable)
 	int ret;
 
 	if (enable) {
-		/*
-		 * Power is controlled by runtime PM, but we still call board
-		 * callback in case it wants to do any additional setup,
-		 * for example enabling clock buffer for the module.
-		 */
-		if (gpio_is_valid(wl->power_gpio))
-			gpio_set_value(wl->power_gpio, true);
-
-
 		ret = pm_runtime_get_sync(&func->dev);
 		if (ret < 0) {
 			pm_runtime_put_sync(&func->dev);
@@ -186,9 +175,6 @@ static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable)
 		ret = pm_runtime_put_sync(&func->dev);
 		if (ret < 0)
 			goto out;
-
-		if (gpio_is_valid(wl->power_gpio))
-			gpio_set_value(wl->power_gpio, false);
 	}
 
 out:
@@ -241,31 +227,17 @@ static int wl1251_sdio_probe(struct sdio_func *func,
 
 	wl1251_board_data = wl1251_get_platform_data();
 	if (!IS_ERR(wl1251_board_data)) {
-		wl->power_gpio = wl1251_board_data->power_gpio;
 		wl->irq = wl1251_board_data->irq;
 		wl->use_eeprom = wl1251_board_data->use_eeprom;
 	} else if (np) {
-		wl->use_eeprom = of_property_read_bool(np,
-						       "ti,wl1251-has-eeprom");
-		wl->power_gpio = of_get_named_gpio(np, "ti,power-gpio", 0);
+		wl->use_eeprom = of_property_read_bool(np, "ti,wl1251-has-eeprom");
 		wl->irq = of_irq_get(np, 0);
-
-		if (wl->power_gpio == -EPROBE_DEFER ||
-		    wl->irq == -EPROBE_DEFER) {
+		if (wl->irq == -EPROBE_DEFER) {
 			ret = -EPROBE_DEFER;
 			goto disable;
 		}
 	}
 
-	if (gpio_is_valid(wl->power_gpio)) {
-		ret = devm_gpio_request(&func->dev, wl->power_gpio,
-								"wl1251 power");
-		if (ret) {
-			wl1251_error("Failed to request gpio: %d\n", ret);
-			goto disable;
-		}
-	}
-
 	if (wl->irq) {
 		irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
 		ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
Signature · 1 line
2.23.0
#1 lore raw

PATCH v3 1/2 DTS: bindings: wl1251: mark ti,power-gpio as optional

In reply to H. Nikolaus Schaller

It is now only useful for SPI interface. Power control of SDIO mode is done through mmc core.

Suggested by: Ulf Hansson <[email protected]>

---
 Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt +2 -1
index f38950560982..88fd28d15eac 100644
@@ -9,11 +9,12 @@ Required properties:
 - spi-max-frequency : Maximum SPI clocking speed of device in Hz
 - interrupts :        Should contain interrupt line
 - vio-supply :        phandle to regulator providing VIO
-- ti,power-gpio :     GPIO connected to chip's PMEN pin
 
 Optional properties:
 - ti,wl1251-has-eeprom : boolean, the wl1251 has an eeprom connected, which
                          provides configuration data (calibration, MAC, ...)
+- ti,power-gpio :	 GPIO connected to chip's PMEN pin if operated in
+			 SPI mode
 - Please consult Documentation/devicetree/bindings/spi/spi-bus.txt
   for optional SPI connection related properties,
 
Signature · 1 line
2.23.0
maintainer
#2 lore raw

Re: [PATCH v3 1/2] DTS: bindings: wl1251: mark ti,power-gpio as optional

Quoted 9 lines · H. Nikolaus Schaller

It is now only useful for SPI interface. Power control of SDIO mode is done through mmc core.

Suggested by: Ulf Hansson <[email protected]>

---
 Documentation/devicetree/bindings/net/wireless/ti,wl1251.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply.

If a tag was not added on purpose, please state why and what changed.

#3 lore raw

Re: [PATCH v3 1/2] DTS: bindings: wl1251: mark ti, power-gpio as optional

In reply to H. Nikolaus Schaller
Quoted 5 lines · H. Nikolaus Schaller

It is now only useful for SPI interface. Power control of SDIO mode is done through mmc core.

Suggested by: Ulf Hansson <[email protected]>

2 patches applied to wireless-drivers-next.git, thanks.

57f0a29c3e08 DTS: bindings: wl1251: mark ti,power-gpio as optional 346bdd8e979d wl1251: remove ti,power-gpio for SDIO mode

Signature · 3 lines
https://patchwork.kernel.org/patch/11351957/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches