pinctrl: microchip-sgpio: Fix support for regmap
Subsystems (2)
PATCH v2 1/1 pinctrl: microchip-sgpio: Fix support for regmap
Initially the driver accessed the registers using u32 __iomem but then in the blamed commit it changed it to use regmap. The problem is that now the offset of the registers is not calculated anymore at word offset but at byte offset. Therefore make sure to multiply the offset with word size.
---v1->v2:
- use regmap_get_reg_stride() instead of regmap_config.reg_stride
--- drivers/pinctrl/pinctrl-microchip-sgpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-microchip-sgpio.c +2 -1
@@ -137,7 +137,8 @@ static inline int sgpio_addr_to_pin(struct sgpio_priv *priv, int port, int bit)static inline u32 sgpio_get_addr (struct sgpio_priv *priv,u32 rno,u32 off) { -return priv->properties->regoff[rno] + off; +return (priv->properties->regoff[rno] + off) * +regmap_get_reg_stride (priv->regs); }static u32 sgpio_readl (struct sgpio_priv *priv,u32 rno,u32 off)
Signature · 1 line
2.33.0
Quoted 10 lines · Horatiu Vultur
Initially the driver accessed the registers using u32
__iomembut then in the blamed commit it changed it to use regmap. The problem is that now the offset of the registers is not calculated anymore at word offset but at byte offset. Therefore make sure to multiply the offset with word size.Acked-by Steen Hegelund <[email protected]>Reviewed-by Colin Foster <[email protected]>Fixes 2afbbab45c261a ("pinctrl: microchip-sgpio: update to support regmap")Signed-off-by Horatiu Vultur <[email protected]>
LGTM,
Quoted 24 lines
---
v1->v2:
- useregmap_get_reg_stride()instead of regmap_config.reg_stride--- drivers/pinctrl/pinctrl-microchip-sgpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/pinctrl/pinctrl-microchip-sgpio.c +2
-2@@ -137,7 +137,8 @@ static inline int sgpio_addr_to_pin(struct sgpio_priv *priv, int port, int bit)static inline u32 sgpio_get_addr (struct sgpio_priv *priv,u32 rno,u32 off) { -return priv->properties->regoff[rno] + off; +return (priv->properties->regoff[rno] + off) * +regmap_get_reg_stride (priv->regs); }static u32 sgpio_readl (struct sgpio_priv *priv,u32 rno,u32 off) --2.33.0
Signature · 7 lines
With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 9 lines · Horatiu Vultur
Initially the driver accessed the registers using u32
__iomembut then in the blamed commit it changed it to use regmap. The problem is that now the offset of the registers is not calculated anymore at word offset but at byte offset. Therefore make sure to multiply the offset with word size.Acked-by Steen Hegelund <[email protected]>Reviewed-by Colin Foster <[email protected]>Fixes 2afbbab45c261a ("pinctrl: microchip-sgpio: update to support regmap")Signed-off-by Horatiu Vultur <[email protected]>
Patch applied for fixes.
I didn't get last weeks fixes to Torvalds this weekend because linux-next wasn't being compiled, will send the lot with this on top this week.
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel