2024-05-27 11:00:19

by Michal Simek

[permalink] [raw]
Subject: [PATCH] pinctrl: pinctrl-zynqmp: Use pin numbers stored in pin descriptor

From: Swati Agarwal <[email protected]>

Use pin numbers stored in the pin descriptors instead of index value while
creating the pin groups. Pin Id's are not same as Index values for Xilinx
Versal platform, so use the pin values from descriptor which works for both
ZynqMP and Versal platforms.

Signed-off-by: Swati Agarwal <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
---

drivers/pinctrl/pinctrl-zynqmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-zynqmp.c b/drivers/pinctrl/pinctrl-zynqmp.c
index 5c46b7d7ebcb..1ea0353767b7 100644
--- a/drivers/pinctrl/pinctrl-zynqmp.c
+++ b/drivers/pinctrl/pinctrl-zynqmp.c
@@ -718,7 +718,7 @@ static int zynqmp_pinctrl_prepare_group_pins(struct device *dev,
int ret;

for (pin = 0; pin < zynqmp_desc.npins; pin++) {
- ret = zynqmp_pinctrl_create_pin_groups(dev, groups, pin);
+ ret = zynqmp_pinctrl_create_pin_groups(dev, groups, zynqmp_desc.pins[pin].number);
if (ret)
return ret;
}
--
2.40.1



2024-05-29 07:36:27

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: pinctrl-zynqmp: Use pin numbers stored in pin descriptor

On Mon, May 27, 2024 at 12:57 PM Michal Simek <[email protected]> wrote:

> From: Swati Agarwal <[email protected]>
>
> Use pin numbers stored in the pin descriptors instead of index value while
> creating the pin groups. Pin Id's are not same as Index values for Xilinx
> Versal platform, so use the pin values from descriptor which works for both
> ZynqMP and Versal platforms.
>
> Signed-off-by: Swati Agarwal <[email protected]>
> Signed-off-by: Michal Simek <[email protected]>

Patch applied!

Yours,
Linus Walleij