mbox series

[v7,00/22] pinctrl: add BCM63XX pincontrol support

Message ID 20210315114214.3096-1-noltari@gmail.com (mailing list archive)
Headers show
Series pinctrl: add BCM63XX pincontrol support | expand

Message

Álvaro Fernández Rojas March 15, 2021, 11:41 a.m. UTC
First of all, I've based this on the patches sent by Jonas Gorski back in
2016:
https://www.spinics.net/lists/linux-gpio/msg15983.html
http://patchwork.ozlabs.org/project/linux-gpio/patch/1471604025-21575-2-git-send-email-jonas.gorski@gmail.com/

I've tried to address all coments from Linus Walleij, but I know that
this may still need some other modifications

This patchset adds appropriate binding documentation and drivers for
pin controller cores found in the BCM63XX MIPS SoCs currently supported.

While the GPIO part is always the same, the pinmux part varies quite a
lot between different SoCs. Sometimes they have defined groups which
can be muxed into different functions, sometimes each function has a
different group. Sometimes you can mux individual pins. Often it is a
combination of single pins and groups.

Some core versions require the GPIO direction to be set according to the
function, most do not. Sometimes the mux register(s) contain bits for
unrelated other functions.

v7: introduce changes suggested by Rob Herring.
v6: introduce changes suggested by Rob Herring and Andy Shevchenko.
v5: introduce changes suggested by Andy Shevchenko.
v4: fix gpiochip_irqchip_add_domain(), remove IRQ Kconfig selections and add
 missing of_node_put().
v3: introduce new files for shared code and add more changes suggested by
 Linus Walleij. Also add a new patch needed for properly parsing gpio-ranges.
v2: introduce changes suggested by Linus Walleij and remove interrupts
 - In order to use GPIO_REGMAP, the need to get gpio_chip from gpio_regmap
 and use it for pinctrl_add_gpio_range() and gpio_chip.direction_input()
 and gpio_chip.direction_output().

Álvaro Fernández Rojas (22):
  gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP
  gpio: regmap: set gpio_chip of_node
  dt-bindings: add BCM63XX GPIO binding documentation
  pinctrl: bcm: add bcm63xx base code
  dt-bindings: add BCM6328 pincontroller binding documentation
  dt-bindings: add BCM6328 GPIO sysctl binding documentation
  pinctrl: add a pincontrol driver for BCM6328
  dt-bindings: add BCM6358 pincontroller binding documentation
  dt-bindings: add BCM6358 GPIO sysctl binding documentation
  pinctrl: add a pincontrol driver for BCM6358
  dt-bindings: add BCM6362 pincontroller binding documentation
  dt-bindings: add BCM6362 GPIO sysctl binding documentation
  pinctrl: add a pincontrol driver for BCM6362
  dt-bindings: add BCM6368 pincontroller binding documentation
  dt-bindings: add BCM6368 GPIO sysctl binding documentation
  pinctrl: add a pincontrol driver for BCM6368
  dt-bindings: add BCM63268 pincontroller binding documentation
  dt-bindings: add BCM63268 GPIO sysctl binding documentation
  pinctrl: add a pincontrol driver for BCM63268
  dt-bindings: add BCM6318 pincontroller binding documentation
  dt-bindings: add BCM6318 GPIO sysctl binding documentation
  pinctrl: add a pincontrol driver for BCM6318

 .../bindings/gpio/brcm,bcm63xx-gpio.yaml      |  83 +++
 .../mfd/brcm,bcm6318-gpio-sysctl.yaml         | 179 +++++
 .../mfd/brcm,bcm63268-gpio-sysctl.yaml        | 196 ++++++
 .../mfd/brcm,bcm6328-gpio-sysctl.yaml         | 164 +++++
 .../mfd/brcm,bcm6358-gpio-sysctl.yaml         | 132 ++++
 .../mfd/brcm,bcm6362-gpio-sysctl.yaml         | 238 +++++++
 .../mfd/brcm,bcm6368-gpio-sysctl.yaml         | 248 +++++++
 .../pinctrl/brcm,bcm6318-pinctrl.yaml         | 148 ++++
 .../pinctrl/brcm,bcm63268-pinctrl.yaml        | 169 +++++
 .../pinctrl/brcm,bcm6328-pinctrl.yaml         | 132 ++++
 .../pinctrl/brcm,bcm6358-pinctrl.yaml         |  98 +++
 .../pinctrl/brcm,bcm6362-pinctrl.yaml         | 211 ++++++
 .../pinctrl/brcm,bcm6368-pinctrl.yaml         | 222 ++++++
 drivers/gpio/gpio-regmap.c                    |   2 +
 drivers/pinctrl/bcm/Kconfig                   |  55 ++
 drivers/pinctrl/bcm/Makefile                  |   7 +
 drivers/pinctrl/bcm/pinctrl-bcm6318.c         | 498 ++++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm63268.c        | 643 ++++++++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6328.c         | 404 +++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6358.c         | 369 ++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6362.c         | 617 +++++++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6368.c         | 523 ++++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm63xx.c         | 113 +++
 drivers/pinctrl/bcm/pinctrl-bcm63xx.h         |  43 ++
 include/linux/gpio/driver.h                   |   9 +
 include/linux/gpio/regmap.h                   |   4 +
 26 files changed, 5507 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6318-gpio-sysctl.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm63268-gpio-sysctl.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6328-gpio-sysctl.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6358-gpio-sysctl.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6362-gpio-sysctl.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6368-gpio-sysctl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6318-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm63268-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6358-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6362-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6368-pinctrl.yaml
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6318.c
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm63268.c
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6328.c
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6358.c
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6362.c
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6368.c
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm63xx.c
 create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm63xx.h

Comments

Linus Walleij March 16, 2021, 10:13 a.m. UTC | #1
On Mon, Mar 15, 2021 at 12:42 PM Álvaro Fernández Rojas
<noltari@gmail.com> wrote:

> v7: introduce changes suggested by Rob Herring.

If Rob is happy with the bindings like this (GPIO as parallel node rathern
than subnode) I am ready to merge this.

As long as the bindings are OK I am pretty sure any remaining nits can
be fixed in-tree.

Yours,
Linus Walleij
Álvaro Fernández Rojas March 17, 2021, 11:20 a.m. UTC | #2
Hi Linus,

> El 16 mar 2021, a las 11:13, Linus Walleij <linus.walleij@linaro.org> escribió:
> 
> On Mon, Mar 15, 2021 at 12:42 PM Álvaro Fernández Rojas
> <noltari@gmail.com> wrote:
> 
>> v7: introduce changes suggested by Rob Herring.
> 
> If Rob is happy with the bindings like this (GPIO as parallel node rathern
> than subnode) I am ready to merge this.

I appreciate that, but I’m having a hard time in understanding what Rob wants and since there are no examples available on most of the stuff he’s requesting this is really frustrating...

> 
> As long as the bindings are OK I am pretty sure any remaining nits can
> be fixed in-tree.
> 
> Yours,
> Linus Walleij

Best regards,
Álvaro.
Linus Walleij March 20, 2021, 11:38 a.m. UTC | #3
On Wed, Mar 17, 2021 at 12:20 PM Álvaro Fernández Rojas
<noltari@gmail.com> wrote:

> I appreciate that, but I’m having a hard time in understanding what
> Rob wants and since there are no examples available on most of the
> stuff he’s requesting this is really frustrating...

I am sorry that the situation can be stressful.

This is not Rob's fault, at least it's also mine.

The real problem we have is lack of hardware people
reviewing hardware descriptions, to put it simple.
As reviewers we get a bit confused, then we try to make
a mind map of the hardware as most driver developers do,
but as we are not chip designers we will make
mistakes and get confused and there will be a bit
of back-and-forth and inconsistencies.

The bindings have very high ambitions (to describe all
hardware) but it's a bit like food: the less you know
about how it's produced, the better the taste.
In fact it is a best effort and involves a bit of guesswork
and group effort and you are part of the group effort
now :)

Yours,
Linus Walleij