mbox series

[v4,00/10] Add Actions Semi S900 pinctrl and gpio support

Message ID 20180302035045.14660-1-manivannan.sadhasivam@linaro.org
Headers show
Series Add Actions Semi S900 pinctrl and gpio support | expand

Message

Manivannan Sadhasivam March 2, 2018, 3:50 a.m. UTC
This patchset adds pinctrl and gpio support for Actions Semi S900 SoC.
Pinctrl and gpio subsystems share the common set of register range but
implemented as individual drivers for making it less complex.

Pinmux functions are only accessible for pin groups while pinconf
parameters are available for both pin groups and individual pins.

gpio-line-names has been added for the Bubblegum-96 board matching the
96Boards CE specification v1.0.

Both pinctrl and gpio drivers are verified using the Bubblegum-96 board.

This patchset depends on the clock driver which is still under review:
https://lkml.org/lkml/2018/2/9/831

There is also S500 pinctrl and gpio driver developed by Andreas Farber
independently to this patchset.
https://github.com/afaerber/linux/commits/bg96-next

If this patchseries seems to be good enough to add base OWL pinctrl and
gpio support. Then, we may decide on adding S500 support on top of this later
by reusing the pinctrl definitions from Andreas.

Thanks,
Mani

Changes in v4:

* Incorporated Andy's review for pinctrl driver
* Used _relaxed functions for pinctrl driver
* Added Andy's Reviewed-by tag for gpio driver
* Added (back) Rob's Reviewed-by tag for pinctrl bindings

Changes in v3:

* Simplified owl_gpio_set_reg() with _relaxed functions
* Added interrupt controller properties to gpio node bindings as suggested
  by Rob
* Minor code cleanups

Changes in v2:

* Implemented each GPIO bank as its own gpio-controller
* Added gpio-ranges property
* Modified pin group to follow pad names instead of register names
* Incorporated review comments from Andy
* Incorporated review comments from Andreas
* Fixed the MODULE_LICENSE with respect to SPDX tag
* Added Reviewed by tag from Rob for pinctrl binding

Manivannan Sadhasivam (10):
  dt-bindings: pinctrl: Add bindings for Actions S900 SoC
  arm64: dts: actions: Add pinctrl node for S900
  arm64: actions: Enable PINCTRL in platforms Kconfig
  pinctrl: actions: Add Actions S900 pinctrl driver
  dt-bindings: gpio: Add gpio nodes for Actions S900 SoC
  arm64: dts: actions: Add S900 gpio nodes
  arm64: dts: actions: Add gpio line names to Bubblegum-96 board
  gpio: Add gpio driver for Actions OWL S900 SoC
  MAINTAINERS: Add reviewer for ACTIONS platforms
  MAINTAINERS: Add Actions Semi S900 pinctrl and gpio entries

 .../devicetree/bindings/gpio/actions,owl-gpio.txt  |   95 +
 .../bindings/pinctrl/actions,s900-pinctrl.txt      |  178 ++
 MAINTAINERS                                        |    5 +
 arch/arm64/Kconfig.platforms                       |    1 +
 arch/arm64/boot/dts/actions/s900-bubblegum-96.dts  |  201 ++
 arch/arm64/boot/dts/actions/s900.dtsi              |   54 +
 drivers/gpio/Kconfig                               |    8 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/gpio-owl.c                            |  218 ++
 drivers/pinctrl/Kconfig                            |    1 +
 drivers/pinctrl/Makefile                           |    1 +
 drivers/pinctrl/actions/Kconfig                    |   12 +
 drivers/pinctrl/actions/Makefile                   |    2 +
 drivers/pinctrl/actions/pinctrl-owl.c              |  579 +++++
 drivers/pinctrl/actions/pinctrl-owl.h              |  142 ++
 drivers/pinctrl/actions/pinctrl-s900.c             | 2505 ++++++++++++++++++++
 16 files changed, 4003 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/actions,owl-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/actions,s900-pinctrl.txt
 create mode 100644 drivers/gpio/gpio-owl.c
 create mode 100644 drivers/pinctrl/actions/Kconfig
 create mode 100644 drivers/pinctrl/actions/Makefile
 create mode 100644 drivers/pinctrl/actions/pinctrl-owl.c
 create mode 100644 drivers/pinctrl/actions/pinctrl-owl.h
 create mode 100644 drivers/pinctrl/actions/pinctrl-s900.c

-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Linus Walleij March 2, 2018, 1:10 p.m. UTC | #1
On Fri, Mar 2, 2018 at 4:50 AM, Manivannan Sadhasivam
<manivannan.sadhasivam@linaro.org> wrote:

> Add pinctrl bindings for Actions Semi S900 SoC

>

> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

> Reviewed-by: Rob Herring <robh@kernel.org>


Patch applied.

These bindings are definately good looking and finalized,
so no point in keeping iterating them, good work!

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij March 2, 2018, 1:11 p.m. UTC | #2
On Fri, Mar 2, 2018 at 4:50 AM, Manivannan Sadhasivam
<manivannan.sadhasivam@linaro.org> wrote:

> Add pinctrl nodes for Actions Semi S900 SoC

>

> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>


Reviewed-by: Linus Walleij <linus.walleij@linaro.org>


Please funnel this patch through the ARM SoC
tree.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij March 2, 2018, 1:12 p.m. UTC | #3
On Fri, Mar 2, 2018 at 4:50 AM, Manivannan Sadhasivam
<manivannan.sadhasivam@linaro.org> wrote:

> Select PINCTRL for Actions Semi SoCs

>

> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>


Reviewed-by: Linus Walleij <linus.walleij@linaro.org>


Please funnel this patch through the ARM SoC tree.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij March 2, 2018, 1:23 p.m. UTC | #4
On Fri, Mar 2, 2018 at 4:50 AM, Manivannan Sadhasivam
<manivannan.sadhasivam@linaro.org> wrote:

> Since I'll be working on improving support for ACTIONS platforms, adding

> myself as the reviewer.

>

> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>


Andreas it would be great of I can have your ACK on this so I
can merge the new pinctrl drivers and maintainer changes
through the pinctrl tree.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Manivannan Sadhasivam March 2, 2018, 5:56 p.m. UTC | #5
Hi Linus,

On Fri, Mar 02, 2018 at 02:21:37PM +0100, Linus Walleij wrote:
> On Fri, Mar 2, 2018 at 4:50 AM, Manivannan Sadhasivam

> <manivannan.sadhasivam@linaro.org> wrote:

> 

> > Add pinctrl driver for Actions Semi S900 SoC. The driver supports

> > pinctrl, pinmux and pinconf functionalities through a range of registers

> > common to both gpio driver and pinctrl driver.

> >

> > Pinmux functionality is available only for the pin groups while the

> > pinconf functionality is available for both pin groups and individual

> > pins.

> >

> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

> 

> Seems like this is pretty much finished.

> 

> Let's see if you can collect some ACKs before we apply it.

> 


Andreas is at Embedded World conference. I hope once he is
back, he will have a look at this patchset.

> Now just minor things remain.

> 

> Random chosen example:

> 

> > +static unsigned int lvds_e_drv_pads[] = {

> > +       LVDS_EEP,

> > +       LVDS_EEN,

> > +       LVDS_EDP,

> > +       LVDS_EDN,

> > +       LVDS_ECP,

> > +       LVDS_ECN,

> > +       LVDS_EBP,

> > +       LVDS_EBN,

> > +};

> > +

> > +static unsigned int sd0_d3_d0_drv_pads[] = {

> > +       SD0_D3,

> > +       SD0_D2,

> > +       SD0_D1,

> > +       SD0_D0,

> > +};

> 

> People (e.g. Torvalds) sometimes get upset with files with too many lines

> in them. This file has a lot of lines. A lot of pin control drivers try to cut

> down the lines with macros, and you do it in some places too,

> would you consider to see if you can cut down these tables with

> macros?

> 

> S900_PADS(LVDS_EEP, LVDS_EEN, LVDS_EDP, LVDS_EDN,

>                     LVDS_ECP, LVDS_ECN, LVDS_EBP, LVDS_EBN);

> S900_PADS(SD0_D3, SD0_D2, SD0_D1, SD0_D0);

> 


I don't think it would be efficient to use macros here. However, I can
align the pads and func definitions in a single line. This will also
save a considerable amount of space.

Thanks,
Mani

> Would be so much more compact.

> 

> It's not the biggest problem though.

> 

> Yours,

> Linus Walleij

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html