Re: [PATCH v2 1/2] dt-bindings: iio: tyhx,hx9023s: Add performance tuning configuration

From: Krzysztof Kozlowski
Date: Thu Sep 26 2024 - 02:54:02 EST


On Thu, Sep 26, 2024 at 12:40:17AM +0800, Yasin Lee wrote:
> When hardware design introduces significant sensor data noise,
> performance can be improved by adjusting register settings.
>
> Signed-off-by: Yasin Lee <yasin.lee.x@xxxxxxxxx>
> ---
> .../bindings/iio/proximity/tyhx,hx9023s.yaml | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml b/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml
> index 64ce8bc8bd36..0673c40472bd 100644
> --- a/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml
> +++ b/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml
> @@ -28,6 +28,18 @@ properties:
>
> vdd-supply: true
>
> + tyhx,performance-tuning:
> + description:
> + Optional, When hardware design introduces significant sensor data noise,
> + performance can be improved by adjusting register settings, including
> + but not limited to sample integration time and average sample count.
> + Performance tuning parameters represented as register address-value pairs.
> + The array consists of 8-bit values, where each pair represents a register
> + address followed by the value to be written to that register.
> + $ref: /schemas/types.yaml#/definitions/uint8-array

I think you wanted here in such case uint8-matrix with one dimension set
to two and other 256 or whatever.

I also wonder why do allow any register to be tuned. To me "tuning"
sounds like improving or tweaking the configuration, so for example I
would not expect to change some control-like registers, e.g. interrupts,
enable/disable, reset etc.


> + minItems: 2
> + maxItems: 512
> +
> "#address-cells":
> const: 1
>
> @@ -65,6 +77,13 @@ examples:
> interrupt-parent = <&pio>;
> interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
> vdd-supply = <&pp1800_prox>;
> + tyhx,performance-tuning = [00 00

This above is clearing entirely the GLOBAL_CTRL0 register, which is not
tuning.

You are basically avoiding hardware description as properties in DT and
just dump a blob.


Best regards,
Krzysztof