Message ID | 20190917105902.445-2-m.felsch@pengutronix.de |
---|---|
State | Changes Requested, archived |
Headers | show |
Series | Add DA9062 GPIO support | expand |
Context | Check | Description |
---|---|---|
robh/checkpatch | success |
On 17 September 2019 11:59, Marco Felsch wrote: > Add gpio device documentation to make the da9062 gpios available for > users. > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> > --- > .../devicetree/bindings/gpio/gpio-da9062.txt | 26 +++++++++++++++++++ > .../devicetree/bindings/mfd/da9062.txt | 3 +++ > 2 files changed, 29 insertions(+) > create mode 100644 Documentation/devicetree/bindings/gpio/gpio-da9062.txt > > diff --git a/Documentation/devicetree/bindings/gpio/gpio-da9062.txt > b/Documentation/devicetree/bindings/gpio/gpio-da9062.txt > new file mode 100644 > index 000000000000..b0f9236a7176 > --- /dev/null > +++ b/Documentation/devicetree/bindings/gpio/gpio-da9062.txt > @@ -0,0 +1,26 @@ > +GPIO driver for DA9062 Power management IC (PMIC) > + > +Device has 5 GPIO pins which can be configured as GPIO as well as the > +special IO functions. > + > +Required properties: > +------------------- > +- compatible : Should be "dlg,da9062-gpio". > +- gpio-controller : Marks the device node as a gpio controller. > +- #gpio-cells : Should be two. The first cell is the pin number and the > + second cell is used to specify the gpio polarity. > + > +See Documentation/devicetree/bindings/gpio/gpio.txt for further information > on > +GPIO bindings. As mentioned for your other patch set where the regulator driver makes use of GPIOs for control, I think here you should probably have pinctrl to define alternate functions of each GPIO. It seems that mostly pinctrl drivers support GPIO functionality rather than the other way, so maybe that's the direction to go in? Maybe Linus has some input on this too. > + > +Example: > +-------- > + pmic@58 { > + ... > + pmic_gpio: gpio { > + compatible = "dlg,da9062-gpio"; > + gpio-controller; > + #gpio-cells = <2>; > + }; > + ... > + }; > diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt > b/Documentation/devicetree/bindings/mfd/da9062.txt > index edca653a5777..eec69c4f0697 100644 > --- a/Documentation/devicetree/bindings/mfd/da9062.txt > +++ b/Documentation/devicetree/bindings/mfd/da9062.txt > @@ -13,6 +13,7 @@ da9062-rtc : : Real-Time Clock > da9062-onkey : : On Key > da9062-watchdog : : Watchdog Timer > da9062-thermal : : Thermal > +da9062-gpio : : GPIOs > > The DA9061 PMIC consists of: > > @@ -76,6 +77,8 @@ Sub-nodes: > > - thermal : See ../thermal/da9062-thermal.txt > > +- gpio : See ../gpio/gpio-da9062.txt > + > Example: > > pmic0: da9062@58 { > -- > 2.20.1
On Tue, Sep 24, 2019 at 12:53 PM Adam Thomson <Adam.Thomson.Opensource@diasemi.com> wrote: > As mentioned for your other patch set where the regulator driver makes use of > GPIOs for control, I think here you should probably have pinctrl to define > alternate functions of each GPIO. It seems that mostly pinctrl drivers support > GPIO functionality rather than the other way, so maybe that's the direction > to go in? Maybe Linus has some input on this too. Usually the both functions can coexist but the simplest if often to put them in the same driver. drivers/pinctrl/pinctrl-stmfx.c Documentation/devicetree/bindings/pinctrl/pinctrl-stmfx.txt is a recent slow bus driver doing this. Yours, Linus Walleij
diff --git a/Documentation/devicetree/bindings/gpio/gpio-da9062.txt b/Documentation/devicetree/bindings/gpio/gpio-da9062.txt new file mode 100644 index 000000000000..b0f9236a7176 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-da9062.txt @@ -0,0 +1,26 @@ +GPIO driver for DA9062 Power management IC (PMIC) + +Device has 5 GPIO pins which can be configured as GPIO as well as the +special IO functions. + +Required properties: +------------------- +- compatible : Should be "dlg,da9062-gpio". +- gpio-controller : Marks the device node as a gpio controller. +- #gpio-cells : Should be two. The first cell is the pin number and the + second cell is used to specify the gpio polarity. + +See Documentation/devicetree/bindings/gpio/gpio.txt for further information on +GPIO bindings. + +Example: +-------- + pmic@58 { + ... + pmic_gpio: gpio { + compatible = "dlg,da9062-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; + ... + }; diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt b/Documentation/devicetree/bindings/mfd/da9062.txt index edca653a5777..eec69c4f0697 100644 --- a/Documentation/devicetree/bindings/mfd/da9062.txt +++ b/Documentation/devicetree/bindings/mfd/da9062.txt @@ -13,6 +13,7 @@ da9062-rtc : : Real-Time Clock da9062-onkey : : On Key da9062-watchdog : : Watchdog Timer da9062-thermal : : Thermal +da9062-gpio : : GPIOs The DA9061 PMIC consists of: @@ -76,6 +77,8 @@ Sub-nodes: - thermal : See ../thermal/da9062-thermal.txt +- gpio : See ../gpio/gpio-da9062.txt + Example: pmic0: da9062@58 {
Add gpio device documentation to make the da9062 gpios available for users. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> --- .../devicetree/bindings/gpio/gpio-da9062.txt | 26 +++++++++++++++++++ .../devicetree/bindings/mfd/da9062.txt | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-da9062.txt