* [PATCH] power: sequencing: qcom-wcn: don't request BT enable GPIOs for wcn7850
@ 2024-07-02 11:41 Bartosz Golaszewski
2024-07-02 11:42 ` Dmitry Baryshkov
0 siblings, 1 reply; 4+ messages in thread
From: Bartosz Golaszewski @ 2024-07-02 11:41 UTC (permalink / raw)
To: Dmitry Baryshkov, Krzysztof Kozlowski, Amit Pundir
Cc: linux-pm, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Due to having many existing users of wcn7850 in the kernel, conversion
of the hci_qca driver to using pwrseq exclusively must be done
carefully. Right now, the Bluetooth driver requests and controls the BT
enable GPIO and so the PMU pwrseq driver must not do it or we will run
into problems depending on the probe ordering.
Add a flag that tells the driver not to request the BT-enable GPIO. We
will remove it once the conversion of the Bluetooth driver is complete.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/power/sequencing/pwrseq-qcom-wcn.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/power/sequencing/pwrseq-qcom-wcn.c b/drivers/power/sequencing/pwrseq-qcom-wcn.c
index 42dacfda745e..68bcd6ec4269 100644
--- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
+++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
@@ -22,6 +22,7 @@ struct pwrseq_qcom_wcn_pdata {
size_t num_vregs;
unsigned int pwup_delay_ms;
unsigned int gpio_enable_delay_ms;
+ bool no_bt_gpio;
};
struct pwrseq_qcom_wcn_ctx {
@@ -212,6 +213,11 @@ static const struct pwrseq_qcom_wcn_pdata pwrseq_wcn7850_of_data = {
.vregs = pwrseq_wcn7850_vregs,
.num_vregs = ARRAY_SIZE(pwrseq_wcn7850_vregs),
.pwup_delay_ms = 50,
+ /*
+ * FIXME: Remove it once the entire hci_qca driver is converted to
+ * using the power sequencer.
+ */
+ .no_bt_gpio = true,
};
static int pwrseq_qcom_wcn_match(struct pwrseq_device *pwrseq,
@@ -277,10 +283,13 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev)
return dev_err_probe(dev, ret,
"Failed to get all regulators\n");
- ctx->bt_gpio = devm_gpiod_get_optional(dev, "bt-enable", GPIOD_OUT_LOW);
- if (IS_ERR(ctx->bt_gpio))
- return dev_err_probe(dev, PTR_ERR(ctx->bt_gpio),
- "Failed to get the Bluetooth enable GPIO\n");
+ if (!ctx->pdata->no_bt_gpio) {
+ ctx->bt_gpio = devm_gpiod_get_optional(dev, "bt-enable",
+ GPIOD_OUT_LOW);
+ if (IS_ERR(ctx->bt_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->bt_gpio),
+ "Failed to get the Bluetooth enable GPIO\n");
+ }
ctx->wlan_gpio = devm_gpiod_get_optional(dev, "wlan-enable",
GPIOD_OUT_LOW);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] power: sequencing: qcom-wcn: don't request BT enable GPIOs for wcn7850
2024-07-02 11:41 [PATCH] power: sequencing: qcom-wcn: don't request BT enable GPIOs for wcn7850 Bartosz Golaszewski
@ 2024-07-02 11:42 ` Dmitry Baryshkov
2024-07-02 11:48 ` Bartosz Golaszewski
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Baryshkov @ 2024-07-02 11:42 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Krzysztof Kozlowski, Amit Pundir, linux-pm, linux-kernel,
Bartosz Golaszewski
On Tue, 2 Jul 2024 at 14:41, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> Due to having many existing users of wcn7850 in the kernel, conversion
> of the hci_qca driver to using pwrseq exclusively must be done
> carefully. Right now, the Bluetooth driver requests and controls the BT
> enable GPIO and so the PMU pwrseq driver must not do it or we will run
> into problems depending on the probe ordering.
>
> Add a flag that tells the driver not to request the BT-enable GPIO. We
> will remove it once the conversion of the Bluetooth driver is complete.
This will not prevent the pinctrl conflict if both PMU and BT devices
declare pinctrl for the BT_EN pin.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> drivers/power/sequencing/pwrseq-qcom-wcn.c | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] power: sequencing: qcom-wcn: don't request BT enable GPIOs for wcn7850
2024-07-02 11:42 ` Dmitry Baryshkov
@ 2024-07-02 11:48 ` Bartosz Golaszewski
2024-07-02 13:08 ` Dmitry Baryshkov
0 siblings, 1 reply; 4+ messages in thread
From: Bartosz Golaszewski @ 2024-07-02 11:48 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Krzysztof Kozlowski, Amit Pundir, linux-pm, linux-kernel,
Bartosz Golaszewski
On Tue, Jul 2, 2024 at 1:42 PM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> On Tue, 2 Jul 2024 at 14:41, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > Due to having many existing users of wcn7850 in the kernel, conversion
> > of the hci_qca driver to using pwrseq exclusively must be done
> > carefully. Right now, the Bluetooth driver requests and controls the BT
> > enable GPIO and so the PMU pwrseq driver must not do it or we will run
> > into problems depending on the probe ordering.
> >
> > Add a flag that tells the driver not to request the BT-enable GPIO. We
> > will remove it once the conversion of the Bluetooth driver is complete.
>
> This will not prevent the pinctrl conflict if both PMU and BT devices
> declare pinctrl for the BT_EN pin.
>
Hmm... So maybe we'll need to modify the BT driver after all. Should
we see if we have the enable-gpios property in hci_qca and - if not -
try to use the power sequencer? Or prioritize the sequencer first and
if it doesn't match, then fall-back to the current mode of operation?
Bart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] power: sequencing: qcom-wcn: don't request BT enable GPIOs for wcn7850
2024-07-02 11:48 ` Bartosz Golaszewski
@ 2024-07-02 13:08 ` Dmitry Baryshkov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2024-07-02 13:08 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Krzysztof Kozlowski, Amit Pundir, linux-pm, linux-kernel,
Bartosz Golaszewski
On Tue, 2 Jul 2024 at 14:48, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Tue, Jul 2, 2024 at 1:42 PM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
> >
> > On Tue, 2 Jul 2024 at 14:41, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > Due to having many existing users of wcn7850 in the kernel, conversion
> > > of the hci_qca driver to using pwrseq exclusively must be done
> > > carefully. Right now, the Bluetooth driver requests and controls the BT
> > > enable GPIO and so the PMU pwrseq driver must not do it or we will run
> > > into problems depending on the probe ordering.
> > >
> > > Add a flag that tells the driver not to request the BT-enable GPIO. We
> > > will remove it once the conversion of the Bluetooth driver is complete.
> >
> > This will not prevent the pinctrl conflict if both PMU and BT devices
> > declare pinctrl for the BT_EN pin.
> >
>
> Hmm... So maybe we'll need to modify the BT driver after all. Should
> we see if we have the enable-gpios property in hci_qca and - if not -
> try to use the power sequencer? Or prioritize the sequencer first and
> if it doesn't match, then fall-back to the current mode of operation?
I'd say, try powerseq first, then fallback to enable-gpio.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-02 13:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 11:41 [PATCH] power: sequencing: qcom-wcn: don't request BT enable GPIOs for wcn7850 Bartosz Golaszewski
2024-07-02 11:42 ` Dmitry Baryshkov
2024-07-02 11:48 ` Bartosz Golaszewski
2024-07-02 13:08 ` Dmitry Baryshkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.