mbox series

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

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

Message

Álvaro Fernández Rojas March 24, 2021, 8:19 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.

v9: introduce changes suggested by Rob Herring and Andy Shevchenko.
v8: introduce changes suggested by Rob Herring.
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: improve BCM6345 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,bcm6345-gpio.txt       |  46 --
 .../bindings/gpio/brcm,bcm6345-gpio.yaml      |  86 +++
 .../mfd/brcm,bcm6318-gpio-sysctl.yaml         | 177 +++++
 .../mfd/brcm,bcm63268-gpio-sysctl.yaml        | 194 ++++++
 .../mfd/brcm,bcm6328-gpio-sysctl.yaml         | 162 +++++
 .../mfd/brcm,bcm6358-gpio-sysctl.yaml         | 130 ++++
 .../mfd/brcm,bcm6362-gpio-sysctl.yaml         | 236 +++++++
 .../mfd/brcm,bcm6368-gpio-sysctl.yaml         | 246 +++++++
 .../pinctrl/brcm,bcm6318-pinctrl.yaml         | 143 ++++
 .../pinctrl/brcm,bcm63268-pinctrl.yaml        | 164 +++++
 .../pinctrl/brcm,bcm6328-pinctrl.yaml         | 127 ++++
 .../pinctrl/brcm,bcm6358-pinctrl.yaml         |  93 +++
 .../pinctrl/brcm,bcm6362-pinctrl.yaml         | 206 ++++++
 .../pinctrl/brcm,bcm6368-pinctrl.yaml         | 217 ++++++
 drivers/gpio/gpio-regmap.c                    |   5 +
 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         | 109 +++
 drivers/pinctrl/bcm/pinctrl-bcm63xx.h         |  43 ++
 include/linux/gpio/driver.h                   |   9 +
 include/linux/gpio/regmap.h                   |   4 +
 27 files changed, 5467 insertions(+), 46 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/brcm,bcm6345-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 29, 2021, 10:19 a.m. UTC | #1
On Wed, Mar 24, 2021 at 9:19 AM Álvaro Fernández Rojas
<noltari@gmail.com> wrote:

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

I have applied and pushed the v9 patch series with all the ACKs
to the "devel" branch so the build servers can churn at it! Later
today I will integrate it into linux-next.

Any remaining issues can certainly be fixed in-tree.

Thanks for your perseverance in cleaning up these SoCs!!

Now, what about a patch set for the IRQ support? :)

Yours,
Linus Walleij
Álvaro Fernández Rojas March 30, 2021, 8:57 a.m. UTC | #2
Hi Linus,

El 29/03/2021 a las 12:19, Linus Walleij escribió:
> On Wed, Mar 24, 2021 at 9:19 AM Álvaro Fernández Rojas
> <noltari@gmail.com> wrote:
> 
>> This patchset adds appropriate binding documentation and drivers for
>> pin controller cores found in the BCM63XX MIPS SoCs currently supported.
> 
> I have applied and pushed the v9 patch series with all the ACKs
> to the "devel" branch so the build servers can churn at it! Later
> today I will integrate it into linux-next.
> 
> Any remaining issues can certainly be fixed in-tree.
> 
> Thanks for your perseverance in cleaning up these SoCs!!

Many thanks for your support! :D

> 
> Now, what about a patch set for the IRQ support? :)

If you could give me some guidance on that matter it would be much 
appreciated, because your comments [1] are now outdated since I switched 
to GPIO_REGMAP
[1] 
http://patchwork.ozlabs.org/project/linux-gpio/patch/20210225164216.21124-3-noltari@gmail.com/

> 
> Yours,
> Linus Walleij
> 

Best regards,
Álvaro.
Linus Walleij April 8, 2021, 1:55 p.m. UTC | #3
On Tue, Mar 30, 2021 at 10:57 AM Álvaro Fernández Rojas
<noltari@gmail.com> wrote:

> > Now, what about a patch set for the IRQ support? :)
>
> If you could give me some guidance on that matter it would be much
> appreciated, because your comments [1] are now outdated since I switched
> to GPIO_REGMAP
> [1]
> http://patchwork.ozlabs.org/project/linux-gpio/patch/20210225164216.21124-3-noltari@gmail.com/

I think it mostly holds: GPIOLIB_IRQCHIP should always be used if there
is a reasonably straight-forward interrupts whether cascaded or hierarchical.
Very few exceptions there. If there is one IRQ line per GPIO
line, the hierarchical support should be used as outlined. GPIO_REGMAP
should be mostly (famous last words) orthogonal.

Yours,
Linus Walleij