diff mbox series

[04/15] dt_bindings: bd71828: Add clock output mode

Message ID a91eb6288331bb80b30534a31049cde508307fc0.1610110144.git.matti.vaittinen@fi.rohmeurope.com (mailing list archive)
State Not Applicable, archived
Headers show
Series Support ROHM BD71815 PMIC | expand

Commit Message

Vaittinen, Matti Jan. 8, 2021, 1:34 p.m. UTC
The BD71828 allows configuring the clk32kout pin mode to CMOS or
open-drain. Add device-tree property for specifying the preferred mode.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
---
 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Rob Herring Jan. 13, 2021, 1:52 p.m. UTC | #1
On Fri, Jan 08, 2021 at 03:34:16PM +0200, Matti Vaittinen wrote:
> The BD71828 allows configuring the clk32kout pin mode to CMOS or
> open-drain. Add device-tree property for specifying the preferred mode.
> 
> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> ---
>  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> index 3a6a1a26e2b3..cba085836bc0 100644
> --- a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> @@ -44,6 +44,13 @@ properties:
>    clock-output-names:
>      const: bd71828-32k-out
>  
> +  rohm,clkout-mode:
> +    description: clk32kout mode. Can be set to "open-drain" or "cmos".
> +    $ref: "/schemas/types.yaml#/definitions/string"
> +    enum:
> +      - open-drain
> +      - cmos
> +

I think a boolean or tristate ((0/1/not present) if you need 'leave 
default') would be better.

>    rohm,charger-sense-resistor-ohms:
>      minimum: 10000000
>      maximum: 50000000
> -- 
> 2.25.4
> 
> 
> -- 
> Matti Vaittinen, Linux device drivers
> ROHM Semiconductors, Finland SWDC
> Kiviharjunlenkki 1E
> 90220 OULU
> FINLAND
> 
> ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
> Simon says - in Latin please.
> ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
> Thanks to Simon Glass for the translation =]
Vaittinen, Matti Jan. 13, 2021, 2:52 p.m. UTC | #2
On Wed, 2021-01-13 at 07:52 -0600, Rob Herring wrote:
> On Fri, Jan 08, 2021 at 03:34:16PM +0200, Matti Vaittinen wrote:
> > The BD71828 allows configuring the clk32kout pin mode to CMOS or
> > open-drain. Add device-tree property for specifying the preferred
> > mode.
> > 
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> > ---
> >  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7
> > +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71828-
> > pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71828-
> > pmic.yaml
> > index 3a6a1a26e2b3..cba085836bc0 100644
> > --- a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> > @@ -44,6 +44,13 @@ properties:
> >    clock-output-names:
> >      const: bd71828-32k-out
> >  
> > +  rohm,clkout-mode:
> > +    description: clk32kout mode. Can be set to "open-drain" or
> > "cmos".
> > +    $ref: "/schemas/types.yaml#/definitions/string"
> > +    enum:
> > +      - open-drain
> > +      - cmos
> > +
> 
> I think a boolean or tristate ((0/1/not present) if you need 'leave 
> default') would be better.

I was thinking of boolean but I hit the exact problem of leaving the
default. (Booleans are so tempting for a lazy coder like me :] ) Do you
mean uint with allowed values of 0/1 with the tristated? I can sure do
that - but wouldn't open-drain / cmos be more descriptive?

Best Regards
	Matti Vaittinen
Rob Herring Jan. 13, 2021, 3:52 p.m. UTC | #3
On Wed, Jan 13, 2021 at 8:52 AM Matti Vaittinen
<matti.vaittinen@fi.rohmeurope.com> wrote:
>
>
> On Wed, 2021-01-13 at 07:52 -0600, Rob Herring wrote:
> > On Fri, Jan 08, 2021 at 03:34:16PM +0200, Matti Vaittinen wrote:
> > > The BD71828 allows configuring the clk32kout pin mode to CMOS or
> > > open-drain. Add device-tree property for specifying the preferred
> > > mode.
> > >
> > > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> > > ---
> > >  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7
> > > +++++++
> > >  1 file changed, 7 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71828-
> > > pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71828-
> > > pmic.yaml
> > > index 3a6a1a26e2b3..cba085836bc0 100644
> > > --- a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> > > +++ b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> > > @@ -44,6 +44,13 @@ properties:
> > >    clock-output-names:
> > >      const: bd71828-32k-out
> > >
> > > +  rohm,clkout-mode:
> > > +    description: clk32kout mode. Can be set to "open-drain" or
> > > "cmos".
> > > +    $ref: "/schemas/types.yaml#/definitions/string"
> > > +    enum:
> > > +      - open-drain
> > > +      - cmos
> > > +
> >
> > I think a boolean or tristate ((0/1/not present) if you need 'leave
> > default') would be better.
>
> I was thinking of boolean but I hit the exact problem of leaving the
> default. (Booleans are so tempting for a lazy coder like me :] ) Do you
> mean uint with allowed values of 0/1 with the tristated?

Yes.

> I can sure do
> that - but wouldn't open-drain / cmos be more descriptive?

You'd get at least half by naming it 'rohm,clkout-open-drain'. I think
anyone that knows what open-drain means will know what !open-drain
implies.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
index 3a6a1a26e2b3..cba085836bc0 100644
--- a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
@@ -44,6 +44,13 @@  properties:
   clock-output-names:
     const: bd71828-32k-out
 
+  rohm,clkout-mode:
+    description: clk32kout mode. Can be set to "open-drain" or "cmos".
+    $ref: "/schemas/types.yaml#/definitions/string"
+    enum:
+      - open-drain
+      - cmos
+
   rohm,charger-sense-resistor-ohms:
     minimum: 10000000
     maximum: 50000000