Commit 68c87336 authored by Colin Foster's avatar Colin Foster Committed by Lee Jones

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: default avatarColin Foster <colin.foster@in-advantage.com>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarLee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20220905162132.2943088-6-colin.foster@in-advantage.com
parent 2f65923c
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/gpio/driver.h> #include <linux/gpio/driver.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/mfd/ocelot.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pinctrl/pinmux.h> #include <linux/pinctrl/pinmux.h>
...@@ -904,7 +905,6 @@ static int microchip_sgpio_probe(struct platform_device *pdev) ...@@ -904,7 +905,6 @@ static int microchip_sgpio_probe(struct platform_device *pdev)
struct reset_control *reset; struct reset_control *reset;
struct sgpio_priv *priv; struct sgpio_priv *priv;
struct clk *clk; struct clk *clk;
u32 __iomem *regs;
u32 val; u32 val;
struct regmap_config regmap_config = { struct regmap_config regmap_config = {
.reg_bits = 32, .reg_bits = 32,
...@@ -937,11 +937,7 @@ static int microchip_sgpio_probe(struct platform_device *pdev) ...@@ -937,11 +937,7 @@ static int microchip_sgpio_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
regs = devm_platform_ioremap_resource(pdev, 0); priv->regs = ocelot_regmap_from_resource(pdev, 0, &regmap_config);
if (IS_ERR(regs))
return PTR_ERR(regs);
priv->regs = devm_regmap_init_mmio(dev, regs, &regmap_config);
if (IS_ERR(priv->regs)) if (IS_ERR(priv->regs))
return PTR_ERR(priv->regs); return PTR_ERR(priv->regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment