From: Colin Foster Date: Mon, 5 Sep 2022 16:21:29 +0000 (-0700) Subject: pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration X-Git-Tag: v6.1-rc5~277^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=68c873363a788b604914c01269f8eac9779d9dd4;p=platform%2Fkernel%2Flinux-starfive.git pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration There are a few Ocelot chips that can contain SGPIO logic, but can be controlled externally. Specifically the VSC7511, 7512, 7513, and 7514. In the externally controlled configurations these registers are not memory-mapped. Add support for these non-memory-mapped configurations. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220905162132.2943088-6-colin.foster@in-advantage.com --- diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index e56074b..2b4167a 100644 --- a/drivers/pinctrl/pinctrl-microchip-sgpio.c +++ b/drivers/pinctrl/pinctrl-microchip-sgpio.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -904,7 +905,6 @@ static int microchip_sgpio_probe(struct platform_device *pdev) struct reset_control *reset; struct sgpio_priv *priv; struct clk *clk; - u32 __iomem *regs; u32 val; struct regmap_config regmap_config = { .reg_bits = 32, @@ -937,11 +937,7 @@ static int microchip_sgpio_probe(struct platform_device *pdev) return -EINVAL; } - regs = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(regs)) - return PTR_ERR(regs); - - priv->regs = devm_regmap_init_mmio(dev, regs, ®map_config); + priv->regs = ocelot_regmap_from_resource(pdev, 0, ®map_config); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs);