diff mbox series

[v2,3/8] dt-bindings: iio: sx9324: Add precharge resistor setting

Message ID 20220322062504.1019504-4-gwendal@chromium.org (mailing list archive)
State Superseded
Headers show
Series Add settings for precharge and internal resistor | expand

Commit Message

Gwendal Grignou March 22, 2022, 6:24 a.m. UTC
Allow configure the resistance used during precharge.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
Changes since v1:
- Suffix field with kOhms unit.

 .../bindings/iio/proximity/semtech,sx9324.yaml           | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Stephen Boyd March 22, 2022, 6:51 a.m. UTC | #1
Quoting Gwendal Grignou (2022-03-21 23:24:59)
> Allow configure the resistance used during precharge.
>
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
> Changes since v1:
> - Suffix field with kOhms unit.
>
>  .../bindings/iio/proximity/semtech,sx9324.yaml           | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
> index b8a6ee16854ff..8fbea71823e76 100644
> --- a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
> +++ b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
> @@ -126,6 +126,14 @@ properties:
>        UINT_MAX (4294967295) represents infinite. Other values
>        represent 1-1/N.
>
> +  semtech,input-precharge-resistor-kohms:

What didn't work about using ohms? I think the goal was to use a
standard unit and then scale it up in the binding and in the driver so
that we didn't have to have a $ref below.

> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    default: 4
> +    description:
> +      Pre-charge input resistance in kOhm.
> +    minimum: 0
> +    maximum: 30
> +
>  required:
>    - compatible
>    - reg
> @@ -157,5 +165,6 @@ examples:
>          semtech,ph01-proxraw-strength = <2>;
>          semtech,ph23-proxraw-strength = <2>;
>          semtech,avg-pos-strength = <64>;
> +        semtech,input-precharge-resistor-kohms = <2>;
>        };
>      };
> --
> 2.35.1.894.gb6a874cedc-goog
>
Gwendal Grignou March 25, 2022, 10:01 p.m. UTC | #2
On Mon, Mar 21, 2022 at 11:51 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Gwendal Grignou (2022-03-21 23:24:59)
> > Allow configure the resistance used during precharge.
> >
> > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> > ---
> > Changes since v1:
> > - Suffix field with kOhms unit.
> >
> >  .../bindings/iio/proximity/semtech,sx9324.yaml           | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
> > index b8a6ee16854ff..8fbea71823e76 100644
> > --- a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
> > +++ b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
> > @@ -126,6 +126,14 @@ properties:
> >        UINT_MAX (4294967295) represents infinite. Other values
> >        represent 1-1/N.
> >
> > +  semtech,input-precharge-resistor-kohms:
>
> What didn't work about using ohms? I think the goal was to use a
> standard unit and then scale it up in the binding and in the driver so
> that we didn't have to have a $ref below.
You're right, it is better as it is defined in
dtschema/schemas/property-units.yaml from
https://github.com/devicetree-org/dt-schema.git
I used kOhms as it already used in the device tree (by
bindings/regulator/qcom-labibb-regulator.yaml), but in retrospect,
this example should not be followed.
A v3 is coming soon.

Gwendal.

>
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    default: 4
> > +    description:
> > +      Pre-charge input resistance in kOhm.
> > +    minimum: 0
> > +    maximum: 30
> > +
> >  required:
> >    - compatible
> >    - reg
> > @@ -157,5 +165,6 @@ examples:
> >          semtech,ph01-proxraw-strength = <2>;
> >          semtech,ph23-proxraw-strength = <2>;
> >          semtech,avg-pos-strength = <64>;
> > +        semtech,input-precharge-resistor-kohms = <2>;
> >        };
> >      };
> > --
> > 2.35.1.894.gb6a874cedc-goog
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
index b8a6ee16854ff..8fbea71823e76 100644
--- a/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
+++ b/Documentation/devicetree/bindings/iio/proximity/semtech,sx9324.yaml
@@ -126,6 +126,14 @@  properties:
       UINT_MAX (4294967295) represents infinite. Other values
       represent 1-1/N.
 
+  semtech,input-precharge-resistor-kohms:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 4
+    description:
+      Pre-charge input resistance in kOhm.
+    minimum: 0
+    maximum: 30
+
 required:
   - compatible
   - reg
@@ -157,5 +165,6 @@  examples:
         semtech,ph01-proxraw-strength = <2>;
         semtech,ph23-proxraw-strength = <2>;
         semtech,avg-pos-strength = <64>;
+        semtech,input-precharge-resistor-kohms = <2>;
       };
     };