Re: [PATCH 04/14] wifi: ath10k: snoc: support powering on the device via pwrseq
From: Dmitry Baryshkov <hidden>
Date: 2026-01-02 15:10:03
Also in:
linux-arm-msm, linux-bluetooth, linux-pm, linux-wireless, lkml
On Fri, 2 Jan 2026 at 13:07, Bartosz Golaszewski [off-list ref] wrote:
On Wed, Dec 31, 2025 at 12:36 AM Dmitry Baryshkov [off-list ref] wrote:quoted
The WCN39xx family of WiFi/BT chips incorporates a simple PMU, spreading voltages over internal rails. Implement support for using powersequencer for this family of ATH10k devices in addition to using regulators. Signed-off-by: Dmitry Baryshkov <redacted> ---[snip]quoted
static void ath10k_snoc_wlan_disable(struct ath10k *ar)@@ -1762,7 +1779,27 @@ static int ath10k_snoc_probe(struct platform_device *pdev) goto err_release_resource; } - ar_snoc->num_vregs = ARRAY_SIZE(ath10k_regulators); + /* + * Backwards compatibility, ignore the defer error from pwrseq, if it + * should be used, we will get an error from regulator get. + */Can you elaborate on this? I'm not exactly following. I suppose you mean the regulator_get() will return -EPROBE_DEFER? One of the supplies exposed by the PMU?
Yes. devm_pwrseq_get() can return -EPROBE_DEFER in two cases: - it is not supposed to be used - it is supposed to be used, but the driver hasn't probed yet. There is no simple way to distinguish between these two cases, but: - if it is not supposed to be used, then regulator_bulk_get() will return all regulators as expected, continuing the probe - if it is supposed to be used, but wasn't probed yet, we will get -EPROBE_DEFER from regulator_bulk_get() too. I can write that in a comment, if you think that it makes the code more obvious.
Bartquoted
+ ar_snoc->pwrseq = devm_pwrseq_get(&pdev->dev, "wlan"); + if (IS_ERR(ar_snoc->pwrseq)) { + ret = PTR_ERR(ar_snoc->pwrseq); + ar_snoc->pwrseq = NULL; + if (ret != -EPROBE_DEFER) + goto err_free_irq; + + ar_snoc->num_vregs = ARRAY_SIZE(ath10k_regulators); + } else { + /* + * The first regulator (vdd-0.8-cx-mx) is used to power on part + * of the SoC rather than the PMU on WCN399x, the rest are + * handled via pwrseq. + */ + ar_snoc->num_vregs = 1; + } +
-- With best wishes Dmitry