diff mbox series

spmi: msm: correct mac_channels for v5 controllers

Message ID 20240624022333.2380607-1-caleb.connolly@linaro.org
State New
Headers show
Series spmi: msm: correct mac_channels for v5 controllers | expand

Commit Message

Caleb Connolly June 24, 2024, 2:23 a.m. UTC
Commit ee1d8aa5ecf7 ("spmi: msm: support controller version 7") broke
support for channels > 128 on v5 controllers, resulting in some
peripherals (like the power button / pon) working but others (like
gpios) reading bogus data.

Correct max_channels for v5 controllers.

Fixes: ee1d8aa5ecf7 ("spmi: msm: support controller version 7")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 drivers/spmi/spmi-msm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Neil Armstrong June 24, 2024, 8:18 a.m. UTC | #1
On 24/06/2024 04:23, Caleb Connolly wrote:
> Commit ee1d8aa5ecf7 ("spmi: msm: support controller version 7") broke
> support for channels > 128 on v5 controllers, resulting in some
> peripherals (like the power button / pon) working but others (like
> gpios) reading bogus data.
> 
> Correct max_channels for v5 controllers.
> 
> Fixes: ee1d8aa5ecf7 ("spmi: msm: support controller version 7")
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>   drivers/spmi/spmi-msm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spmi/spmi-msm.c b/drivers/spmi/spmi-msm.c
> index 58c676423f40..49aad439648f 100644
> --- a/drivers/spmi/spmi-msm.c
> +++ b/drivers/spmi/spmi-msm.c
> @@ -270,9 +270,9 @@ static int msm_spmi_probe(struct udevice *dev)
>   		priv->max_channels = SPMI_MAX_CHANNELS;
>   	} else if (hw_ver < PMIC_ARB_VERSION_V7_MIN) {
>   		priv->arb_ver = V5;
>   		priv->arb_chnl = core_addr + APID_MAP_OFFSET_V5;
> -		priv->max_channels = SPMI_MAX_CHANNELS;
> +		priv->max_channels = SPMI_MAX_CHANNELS_V5;
>   		priv->spmi_cnfg = dev_read_addr_name(dev, "cnfg");
>   	} else {
>   		/* TOFIX: handle second bus */
>   		priv->arb_ver = V7;

Thanks for spotting this...

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Neil
diff mbox series

Patch

diff --git a/drivers/spmi/spmi-msm.c b/drivers/spmi/spmi-msm.c
index 58c676423f40..49aad439648f 100644
--- a/drivers/spmi/spmi-msm.c
+++ b/drivers/spmi/spmi-msm.c
@@ -270,9 +270,9 @@  static int msm_spmi_probe(struct udevice *dev)
 		priv->max_channels = SPMI_MAX_CHANNELS;
 	} else if (hw_ver < PMIC_ARB_VERSION_V7_MIN) {
 		priv->arb_ver = V5;
 		priv->arb_chnl = core_addr + APID_MAP_OFFSET_V5;
-		priv->max_channels = SPMI_MAX_CHANNELS;
+		priv->max_channels = SPMI_MAX_CHANNELS_V5;
 		priv->spmi_cnfg = dev_read_addr_name(dev, "cnfg");
 	} else {
 		/* TOFIX: handle second bus */
 		priv->arb_ver = V7;