Message ID | 20220817054321.6519-10-farbere@amazon.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | Variety of fixes and new features for mr75203 driver | expand |
On Wed, Aug 17, 2022 at 05:43:14AM +0000, Eliav Farber wrote: > vm-pre-scalar-ch# is a per channel optional parameter that can be > used to normalzie the voltage output results. > > Signed-off-by: Eliav Farber <farbere@amazon.com> > --- > .../devicetree/bindings/hwmon/moortec,mr75203.yaml | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml > index 6111b5069b3c..e2a55001eefc 100644 > --- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml > +++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml > @@ -56,6 +56,12 @@ properties: > A value of 0 means that the entire VM sensor is nou used. > $ref: /schemas/types.yaml#definitions/uint8-array > > + vm-pre-scalar-ch#: Is that how such properties are implemented ? Seems to me that results in a lot of decode complexity. Why not use an array property like the other properties ? Guenter > + description: > + vm-active-channels defines the pre-scalar per channel value > + used to normalzie the voltage output results. > + $ref: /schemas/types.yaml#definitions/uint32 > + > required: > - compatible > - reg > @@ -68,6 +74,7 @@ additionalProperties: > - intel,vm-map > - reset-control-skip > - vm-active-channels > + - vm-pre-scalar-ch# > > examples: > - | > @@ -82,5 +89,6 @@ examples: > clocks = <&osc0>; > resets = <&rcu0 0x40 7>; > vm-active-channels = [08 10 02]; > + vm-pre-scalar-ch5 = <2>; > #thermal-sensor-cells = <1>; > };
On 8/18/2022 11:11 PM, Guenter Roeck wrote: > Is that how such properties are implemented ? Seems to me that > results in a lot of decode complexity. > > Why not use an array property like the other properties ? Each VM has up to 16 inputs and there might be more than one VM. Assuming an example of 2 VMs, and channels 5 and 6 in first VM have pre- scalar of 2, while channel 2 in the second VM has pre-scalar of 3 and channel 11 has pre-scalar of 2, the alternative was to do something like this: vm-pre-scalar-0=[01 01 01 01 01 02 02 01 01 01 01 01 01 01 01 01]; vm-pre-scalar-1=[01 01 03 01 01 01 01 01 01 01 01 02 01 01 01 01]; Most of the inputs are 01, which are anyway the default. I don't see a difference in decoding complexity between the different approaches but if you prefer this I'll modify my patches.
diff --git a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml index 6111b5069b3c..e2a55001eefc 100644 --- a/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml +++ b/Documentation/devicetree/bindings/hwmon/moortec,mr75203.yaml @@ -56,6 +56,12 @@ properties: A value of 0 means that the entire VM sensor is nou used. $ref: /schemas/types.yaml#definitions/uint8-array + vm-pre-scalar-ch#: + description: + vm-active-channels defines the pre-scalar per channel value + used to normalzie the voltage output results. + $ref: /schemas/types.yaml#definitions/uint32 + required: - compatible - reg @@ -68,6 +74,7 @@ additionalProperties: - intel,vm-map - reset-control-skip - vm-active-channels + - vm-pre-scalar-ch# examples: - | @@ -82,5 +89,6 @@ examples: clocks = <&osc0>; resets = <&rcu0 0x40 7>; vm-active-channels = [08 10 02]; + vm-pre-scalar-ch5 = <2>; #thermal-sensor-cells = <1>; };
vm-pre-scalar-ch# is a per channel optional parameter that can be used to normalzie the voltage output results. Signed-off-by: Eliav Farber <farbere@amazon.com> --- .../devicetree/bindings/hwmon/moortec,mr75203.yaml | 8 ++++++++ 1 file changed, 8 insertions(+)