Re: [PATCH v5 2/4] Bluetooth: hci_qca: Add support for QTI Bluetooth chip wcn6855

From: Johan Hovold
Date: Wed Feb 22 2023 - 03:04:03 EST


On Wed, Feb 08, 2023 at 08:09:14PM -0600, Steev Klimaszewski wrote:
> Added regulators,GPIOs and changes required to power on/off wcn6855.
> Added support for firmware download for wcn6855.
>
> Signed-off-by: Steev Klimaszewski <steev@xxxxxxxx>
> ---

> drivers/bluetooth/btqca.c | 9 ++++++-
> drivers/bluetooth/btqca.h | 10 ++++++++
> drivers/bluetooth/hci_qca.c | 50 ++++++++++++++++++++++++++++---------
> 3 files changed, 56 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
> index c9064d34d830..2f9d8bd27c38 100644
> --- a/drivers/bluetooth/btqca.c
> +++ b/drivers/bluetooth/btqca.c

> +static const struct qca_device_data qca_soc_data_wcn6855 = {
> + .soc_type = QCA_WCN6855,
> + .vregs = (struct qca_vreg []) {
> + { "vddio", 5000 },
> + { "vddbtcxmx", 126000 },
> + { "vddrfacmn", 12500 },
> + { "vddrfa0p8", 102000 },
> + { "vddrfa1p7", 302000 },
> + { "vddrfa1p2", 257000 },
> + },
> + .num_vregs = 6,
> + .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES,
> +};
> +
> static void qca_power_shutdown(struct hci_uart *hu)
> {
> struct qca_serdev *qcadev;

As I just mentioned IRC, you forgot to update qca_power_shutdown() here
so the regulators are currently never disabled (e.g. when closing the
device or on module unload).

> @@ -2047,7 +2066,8 @@ static int qca_serdev_probe(struct serdev_device *serdev)
>
> if (data &&
> (qca_is_wcn399x(data->soc_type) ||
> - qca_is_wcn6750(data->soc_type))) {
> + qca_is_wcn6750(data->soc_type) ||
> + qca_is_wcn6855(data->soc_type))) {
> qcadev->btsoc_type = data->soc_type;
> qcadev->bt_power = devm_kzalloc(&serdev->dev,
> sizeof(struct qca_power),

> @@ -2150,7 +2174,8 @@ static void qca_serdev_remove(struct serdev_device *serdev)
> struct qca_power *power = qcadev->bt_power;
>
> if ((qca_is_wcn399x(qcadev->btsoc_type) ||
> - qca_is_wcn6750(qcadev->btsoc_type)) &&
> + qca_is_wcn6750(qcadev->btsoc_type) ||
> + qca_is_wcn6855(qcadev->btsoc_type)) &&
> power->vregs_on)
> qca_power_shutdown(&qcadev->serdev_hu);
> else if (qcadev->susclk)

Johan