[PATCH v8 0/2] gpio: gpio-cascade: add generic GPIO cascade

From: Mauri Sandberg
Date: Tue Oct 26 2021 - 15:16:23 EST


Hello everyone!

I am sending what I am hoping to be the final version of the patch set and
having kernel support for my router is one step closer.
I want to thank Drew, Linus, Andy and others for their patient review and
testing work over the different iterations.

The changes in this one compared to v7 are cosmetic consisting of
- rearrange members of struct gpio_chip
- fix typoes and one instance of split lines in function declaration
- added Reviewed-by tags in appropriate commit messages

Thanks,
Mauri

rangediff v7 -> v8:

1: 0fa5e65443fb ! 1: 33008c379a28 dt-bindings: gpio-cascade: add documentation
@@ Commit message

Signed-off-by: Mauri Sandberg <maukka@xxxxxxxxxxxx>
Reviewed-by: Rob Herring <robh@xxxxxxxxxx>
+ Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
---
+ v7 -> v8:
+ - added Reviewed-by tag by Linus
+ v6 -> v7:
+ - no changes
v5 -> v6:
- added Reviewed-by tag by Rob
v4 -> v5:
2: c2237aca3364 ! 2: fc23ea48ba52 gpio: gpio-cascade: add generic GPIO cascade
@@ Commit message
possible to add support for output direction, too.

Signed-off-by: Mauri Sandberg <maukka@xxxxxxxxxxxx>
+ Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
+ Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
---
+ v7 -> v8:
+ - rearrange members in struct gpio_cascade
+ - cosmetic changes in file header and in one function declaration
+ - added Reviewed-by tags by Linus and Andy
v6 -> v7:
- In Kconfig add info about module name
- adhere to new convention that allows lines longer than 80 chars
@@ drivers/gpio/gpio-cascade.c (new)
+ * | | .
+ * \|---- Cascaded GPIO line n
+ *
-+ * A gpio-mux is being used to select, which cascaded line is being
++ * A multiplexer is being used to select, which cascaded line is being
+ * addressed at any given time.
+ *
+ * At the moment only input mode is supported due to lack of means for
+ * testing output functionality. At least theoretically output should be
-+ * possible with an open drain constructions.
++ * possible with open drain constructions.
+ */
+
+#include <linux/module.h>
@@ drivers/gpio/gpio-cascade.c (new)
+#include <linux/gpio/driver.h>
+
+struct gpio_cascade {
-+ struct device *parent;
+ struct gpio_chip gpio_chip;
++ struct device *parent;
+ struct mux_control *mux_control;
+ struct gpio_desc *upstream_line;
+};
@@ drivers/gpio/gpio-cascade.c (new)
+ return container_of(gc, struct gpio_cascade, gpio_chip);
+}
+
-+static int gpio_cascade_get_direction(struct gpio_chip *gc,
-+ unsigned int offset)
++static int gpio_cascade_get_direction(struct gpio_chip *gc, unsigned int offset)
+{
+ return GPIO_LINE_DIRECTION_IN;
+}

Mauri Sandberg (2):
dt-bindings: gpio-cascade: add documentation
gpio: gpio-cascade: add generic GPIO cascade

.../bindings/gpio/gpio-cascade.yaml | 103 +++++++++++++++
drivers/gpio/Kconfig | 15 +++
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-cascade.c | 117 ++++++++++++++++++
4 files changed, 236 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-cascade.yaml
create mode 100644 drivers/gpio/gpio-cascade.c


base-commit: f4a20dfac88c06c9b529a41ff4cf9acba8f3fdff
--
2.25.1