linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: sequencing: qcom-wcn: set the wlan-enable GPIO to output
@ 2024-08-23 11:55 Bartosz Golaszewski
  2024-08-24  6:19 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-08-23 11:55 UTC (permalink / raw)
  To: Neil Armstrong, Stephan Gerhold
  Cc: linux-pm, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Commit a9aaf1ff88a8 ("power: sequencing: request the WLAN enable GPIO
as-is") broke WLAN on boards on which the wlan-enable GPIO enabling the
wifi module isn't in output mode by default. We need to set direction to
output while retaining the value that was already set to keep the ath
module on if it's already started.

Fixes: a9aaf1ff88a8 ("power: sequencing: request the WLAN enable GPIO as-is")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/power/sequencing/pwrseq-qcom-wcn.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/power/sequencing/pwrseq-qcom-wcn.c b/drivers/power/sequencing/pwrseq-qcom-wcn.c
index d786cbf1b2cd..700879474abf 100644
--- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
+++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
@@ -288,6 +288,13 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev)
 		return dev_err_probe(dev, PTR_ERR(ctx->wlan_gpio),
 				     "Failed to get the WLAN enable GPIO\n");
 
+	/*
+	 * Set direction to output but keep the current value in order to not
+	 * disable the WLAN module accidentally if it's already powered on.
+	 */
+	gpiod_direction_output(ctx->wlan_gpio,
+			       gpiod_get_value_cansleep(ctx->wlan_gpio));
+
 	ctx->clk = devm_clk_get_optional(dev, NULL);
 	if (IS_ERR(ctx->clk))
 		return dev_err_probe(dev, PTR_ERR(ctx->clk),
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: sequencing: qcom-wcn: set the wlan-enable GPIO to output
  2024-08-23 11:55 [PATCH] power: sequencing: qcom-wcn: set the wlan-enable GPIO to output Bartosz Golaszewski
@ 2024-08-24  6:19 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-08-24  6:19 UTC (permalink / raw)
  To: Neil Armstrong, Stephan Gerhold, Bartosz Golaszewski
  Cc: Bartosz Golaszewski, linux-pm, linux-kernel

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Fri, 23 Aug 2024 13:55:00 +0200, Bartosz Golaszewski wrote:
> Commit a9aaf1ff88a8 ("power: sequencing: request the WLAN enable GPIO
> as-is") broke WLAN on boards on which the wlan-enable GPIO enabling the
> wifi module isn't in output mode by default. We need to set direction to
> output while retaining the value that was already set to keep the ath
> module on if it's already started.
> 
> 
> [...]

I'll be OoO next week and don't want to leave it broken in next so I'm
applying it fast.

[1/1] power: sequencing: qcom-wcn: set the wlan-enable GPIO to output
      commit: 06802616488c980a63084e53f401cfc8a65672a7

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-24  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 11:55 [PATCH] power: sequencing: qcom-wcn: set the wlan-enable GPIO to output Bartosz Golaszewski
2024-08-24  6:19 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).