mbox series

[v2,00/12] pinctrl: add BCM63XX pincontrol support

Message ID 20210302191613.29476-1-noltari@gmail.com
Headers show
Series pinctrl: add BCM63XX pincontrol support | expand

Message

Álvaro Fernández Rojas March 2, 2021, 7:16 p.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.

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 (12):
  Documentation: add BCM6328 pincontroller binding documentation
  pinctrl: add a pincontrol driver for BCM6328
  Documentation: add BCM6358 pincontroller binding documentation
  pinctrl: add a pincontrol driver for BCM6358
  Documentation: add BCM6362 pincontroller binding documentation
  pinctrl: add a pincontrol driver for BCM6362
  Documentation: add BCM6368 pincontroller binding documentation
  pinctrl: add a pincontrol driver for BCM6368
  Documentation: add BCM63268 pincontroller binding documentation
  pinctrl: add a pincontrol driver for BCM63268
  Documentation: add BCM6318 pincontroller binding documentation
  pinctrl: add a pincontrol driver for BCM6318

 .../pinctrl/brcm,bcm6318-pinctrl.yaml         | 161 ++++
 .../pinctrl/brcm,bcm63268-pinctrl.yaml        | 182 +++++
 .../pinctrl/brcm,bcm6328-pinctrl.yaml         | 145 ++++
 .../pinctrl/brcm,bcm6358-pinctrl.yaml         | 111 +++
 .../pinctrl/brcm,bcm6362-pinctrl.yaml         | 224 ++++++
 .../pinctrl/brcm,bcm6368-pinctrl.yaml         | 235 ++++++
 drivers/pinctrl/bcm/Kconfig                   |  68 ++
 drivers/pinctrl/bcm/Makefile                  |   6 +
 drivers/pinctrl/bcm/pinctrl-bcm6318.c         | 574 ++++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm63268.c        | 726 ++++++++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6328.c         | 481 ++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6358.c         | 429 +++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6362.c         | 699 +++++++++++++++++
 drivers/pinctrl/bcm/pinctrl-bcm6368.c         | 587 ++++++++++++++
 14 files changed, 4628 insertions(+)
 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

Comments

Linus Walleij March 3, 2021, 9:29 a.m. UTC | #1
On Tue, Mar 2, 2021 at 8:16 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote:

> 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().


Looking so much better don't you think? :)

If you also get rid of the exposed struct using DT gpio-ranges we are
done I think, just need some DT review slack for the DT maintainers
for the bindings.

Yours,
Linus Walleij
Álvaro Fernández Rojas March 3, 2021, 9:32 a.m. UTC | #2
Hi Linus,

> El 3 mar 2021, a las 10:29, Linus Walleij <linus.walleij@linaro.org> escribió:

> 

> On Tue, Mar 2, 2021 at 8:16 PM Álvaro Fernández Rojas <noltari@gmail.com> wrote:

> 

>> 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().

> 

> Looking so much better don't you think? :)


Yeah :)

> 

> If you also get rid of the exposed struct using DT gpio-ranges we are

> done I think, just need some DT review slack for the DT maintainers

> for the bindings.


I’m already preparing v3 series, introducing shared base code and simplifying everything :).

> 

> Yours,

> Linus Walleij


Best regards,
Álvaro.