Skip to content

Commit

Permalink
power: sequencing: qcom-wcn: set the wlan-enable GPIO to output
Browse files Browse the repository at this point in the history
Commit a9aaf1f ("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: a9aaf1f ("power: sequencing: request the WLAN enable GPIO as-is")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
  • Loading branch information
Bartosz Golaszewski committed Aug 31, 2024
1 parent 5be63fc commit d8b7620
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/power/sequencing/pwrseq-qcom-wcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit d8b7620

Please sign in to comment.