* [PATCH RFC v1 0/2] pinctrl: ocelot: add shared reset
@ 2022-03-13 15:46 Michael Walle
2022-03-13 15:46 ` [PATCH RFC v1 1/2] dt-bindings: pinctrl: ocelot: add reset property Michael Walle
2022-03-13 15:46 ` [PATCH RFC v1 2/2] pinctrl: ocelot: add optional shared reset Michael Walle
0 siblings, 2 replies; 4+ messages in thread
From: Michael Walle @ 2022-03-13 15:46 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Philipp Zabel,
Alexandre Belloni, Lars Povlsen
Cc: linux-gpio, devicetree, linux-kernel, Horatiu Vultur, Michael Walle
On LAN966x SoCs, there is an internal reset which is used to reset the
switch core. But this will also reset the GPIO and the SGPIO. Thus add
support for this shared reset line.
Marked as RFC because it depends on
https://lore.kernel.org/linux-devicetree/20220313152924.61931-1-michael@walle.cc/
Michael Walle (2):
dt-bindings: pinctrl: ocelot: add reset property
pinctrl: ocelot: add optional shared reset
.../devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml | 8 ++++++++
drivers/pinctrl/pinctrl-ocelot.c | 9 +++++++++
2 files changed, 17 insertions(+)
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH RFC v1 1/2] dt-bindings: pinctrl: ocelot: add reset property
2022-03-13 15:46 [PATCH RFC v1 0/2] pinctrl: ocelot: add shared reset Michael Walle
@ 2022-03-13 15:46 ` Michael Walle
2022-03-23 17:54 ` Rob Herring
2022-03-13 15:46 ` [PATCH RFC v1 2/2] pinctrl: ocelot: add optional shared reset Michael Walle
1 sibling, 1 reply; 4+ messages in thread
From: Michael Walle @ 2022-03-13 15:46 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Philipp Zabel,
Alexandre Belloni, Lars Povlsen
Cc: linux-gpio, devicetree, linux-kernel, Horatiu Vultur, Michael Walle
On the LAN966x SoC the GPIO controller will be resetted together with
the SGPIO and the switch core. Add a phandle to register the shared
reset line.
Signed-off-by: Michael Walle <michael@walle.cc>
---
.../devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml
index 40148aef4ecf..cc9e14a214b1 100644
--- a/Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml
@@ -42,6 +42,14 @@ properties:
"#interrupt-cells":
const: 2
+ resets:
+ maxItems: 1
+
+ reset-names:
+ description: Optional shared switch reset.
+ items:
+ - const: switch
+
required:
- compatible
- reg
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH RFC v1 1/2] dt-bindings: pinctrl: ocelot: add reset property
2022-03-13 15:46 ` [PATCH RFC v1 1/2] dt-bindings: pinctrl: ocelot: add reset property Michael Walle
@ 2022-03-23 17:54 ` Rob Herring
0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2022-03-23 17:54 UTC (permalink / raw)
To: Michael Walle
Cc: linux-kernel, linux-gpio, Lars Povlsen, devicetree,
Linus Walleij, Rob Herring, Krzysztof Kozlowski, Horatiu Vultur,
Alexandre Belloni, Philipp Zabel
On Sun, 13 Mar 2022 16:46:39 +0100, Michael Walle wrote:
> On the LAN966x SoC the GPIO controller will be resetted together with
> the SGPIO and the switch core. Add a phandle to register the shared
> reset line.
>
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
> .../devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH RFC v1 2/2] pinctrl: ocelot: add optional shared reset
2022-03-13 15:46 [PATCH RFC v1 0/2] pinctrl: ocelot: add shared reset Michael Walle
2022-03-13 15:46 ` [PATCH RFC v1 1/2] dt-bindings: pinctrl: ocelot: add reset property Michael Walle
@ 2022-03-13 15:46 ` Michael Walle
1 sibling, 0 replies; 4+ messages in thread
From: Michael Walle @ 2022-03-13 15:46 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Philipp Zabel,
Alexandre Belloni, Lars Povlsen
Cc: linux-gpio, devicetree, linux-kernel, Horatiu Vultur, Michael Walle
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>
---
drivers/pinctrl/pinctrl-ocelot.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index 35b213de1af8..d78716533393 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"
@@ -1906,6 +1907,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;
@@ -1921,6 +1923,13 @@ 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)) {
+ dev_err(dev, "Failed to get reset\n");
+ return PTR_ERR(reset);
+ }
+ reset_control_reset(reset);
+
base = devm_ioremap_resource(dev,
platform_get_resource(pdev, IORESOURCE_MEM, 0));
if (IS_ERR(base))
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-23 17:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-13 15:46 [PATCH RFC v1 0/2] pinctrl: ocelot: add shared reset Michael Walle
2022-03-13 15:46 ` [PATCH RFC v1 1/2] dt-bindings: pinctrl: ocelot: add reset property Michael Walle
2022-03-23 17:54 ` Rob Herring
2022-03-13 15:46 ` [PATCH RFC v1 2/2] pinctrl: ocelot: add optional shared reset Michael Walle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).