Skip to content

Commit baf927a

Browse files
HoratiuVulturLinus Walleij
authored andcommitted
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. Acked-by: Steen Hegelund <Steen.Hegelund@microchip.com> Reviewed-by: Colin Foster <colin.foster@in-advantage.com> Fixes: 2afbbab ("pinctrl: microchip-sgpio: update to support regmap") Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220131085201.307031-1-horatiu.vultur@microchip.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 3a52869 commit baf927a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/pinctrl/pinctrl-microchip-sgpio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ static inline int sgpio_addr_to_pin(struct sgpio_priv *priv, int port, int bit)
137137

138138
static inline u32 sgpio_get_addr(struct sgpio_priv *priv, u32 rno, u32 off)
139139
{
140-
return priv->properties->regoff[rno] + off;
140+
return (priv->properties->regoff[rno] + off) *
141+
regmap_get_reg_stride(priv->regs);
141142
}
142143

143144
static u32 sgpio_readl(struct sgpio_priv *priv, u32 rno, u32 off)

0 commit comments

Comments
 (0)