summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-ocelot.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2022-04-20 21:19:26 +0200
committerLinus Walleij <linus.walleij@linaro.org>2022-04-29 00:38:47 +0200
commit453200af8a85ca023afb7f3518d85456b70ace11 (patch)
treedda7401a0b75a438383bdf7e77a307ed4bf80f5c /drivers/pinctrl/pinctrl-ocelot.c
parentdt-bindings: pinctrl: ocelot: add reset property (diff)
downloadlinux-453200af8a85ca023afb7f3518d85456b70ace11.tar.xz
linux-453200af8a85ca023afb7f3518d85456b70ace11.zip
pinctrl: ocelot: add optional shared reset
On the LAN9668 there is a shared reset line which affects GPIO, SGPIO and the switch core. Add support for this shared reset line. Signed-off-by: Michael Walle <michael@walle.cc> Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com> Link: https://lore.kernel.org/r/20220420191926.3411830-3-michael@walle.cc Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-ocelot.c')
-rw-r--r--drivers/pinctrl/pinctrl-ocelot.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index 1bdced67464b..843704fa8625 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -19,6 +19,7 @@
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
+#include <linux/reset.h>
#include <linux/slab.h>
#include "core.h"
@@ -1912,6 +1913,7 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ocelot_pinctrl *info;
+ struct reset_control *reset;
struct regmap *pincfg;
void __iomem *base;
int ret;
@@ -1927,6 +1929,12 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev)
info->desc = (struct pinctrl_desc *)device_get_match_data(dev);
+ reset = devm_reset_control_get_optional_shared(dev, "switch");
+ if (IS_ERR(reset))
+ return dev_err_probe(dev, PTR_ERR(reset),
+ "Failed to get reset\n");
+ reset_control_reset(reset);
+
base = devm_ioremap_resource(dev,
platform_get_resource(pdev, IORESOURCE_MEM, 0));
if (IS_ERR(base))