2022-04-08 18:32:19

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: input: Add bindings for Awinic AW8695 haptics

On 08/04/2022 13:53, Luca Weiss wrote:
> Add a document describing the bindings for the AW8695 LRA Haptic Driver.

(...)

> + reset-gpios:
> + maxItems: 1
> + description: GPIO connected to RSTN pin (active high)
> +
> + awinic,f0-preset:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Default value for the f0 of LRA
> +
> + awinic,f0-coefficient:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Coefficient between actual f0 and the value in the registers
> +
> + awinic,f0-calibration-percent:
> + maxItems: 1
> + description: Limit of f0 deviation from awinic,f0-preset
> +
> + awinic,drive-level:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Level of drive waveform in normal driving
> +
> + awinic,f0-detection-play-time:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Drive waveform play times in the first period in the f0 detection

Use standard unit suffixes for known units (e.g. time).

> +
> + awinic,f0-detection-wait-time:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Waveform wait times in the f0 detection

Ditto.

> +
> + awinic,f0-detection-repeat:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Repeat times in the f0 detection
> +
> + awinic,f0-detection-trace:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Drive waveform play times in the second period and later in the f0 detection
> +
> + awinic,boost-debug:
> + $ref: /schemas/types.yaml#/definitions/uint8-array
> + minItems: 3
> + maxItems: 3
> + description: Values for BSTDBG1-3 registers

Do not encode device programming model (registers) into the binding. You
need to define it as a property related to hardware itself, not its
registers (e.g. boost value in mV).

> +
> + awinic,tset:
> + $ref: /schemas/types.yaml#/definitions/uint8
> + description: Value for TSET register

Ditto.

> +
> + awinic,r-spare:
> + $ref: /schemas/types.yaml#/definitions/uint8
> + description: Value for R_SPARE register

Ditto.


Best regards,
Krzysztof


2022-04-11 20:19:16

by Luca Weiss

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: input: Add bindings for Awinic AW8695 haptics

Hi Krzysztof,

thanks for the review, replies are inline!

On Fri Apr 8, 2022 at 5:05 PM CEST, Krzysztof Kozlowski wrote:
> On 08/04/2022 13:53, Luca Weiss wrote:
> > Add a document describing the bindings for the AW8695 LRA Haptic Driver.
>
> (...)
>
> > + reset-gpios:
> > + maxItems: 1
> > + description: GPIO connected to RSTN pin (active high)
> > +
> > + awinic,f0-preset:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Default value for the f0 of LRA
> > +
> > + awinic,f0-coefficient:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Coefficient between actual f0 and the value in the registers
> > +
> > + awinic,f0-calibration-percent:
> > + maxItems: 1
> > + description: Limit of f0 deviation from awinic,f0-preset
> > +
> > + awinic,drive-level:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Level of drive waveform in normal driving
> > +
> > + awinic,f0-detection-play-time:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Drive waveform play times in the first period in the f0 detection
>
> Use standard unit suffixes for known units (e.g. time).

While the datasheet doesn't mention any time unit, the value is used to
calculate the f0_trace_ms variable (which is milliseconds) but the
result also depends on the awinic,f0-preset value, so it's not a raw
time value.

>
> > +
> > + awinic,f0-detection-wait-time:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Waveform wait times in the f0 detection
>
> Ditto.
>
> > +
> > + awinic,f0-detection-repeat:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Repeat times in the f0 detection
> > +
> > + awinic,f0-detection-trace:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Drive waveform play times in the second period and later in the f0 detection
> > +
> > + awinic,boost-debug:
> > + $ref: /schemas/types.yaml#/definitions/uint8-array
> > + minItems: 3
> > + maxItems: 3
> > + description: Values for BSTDBG1-3 registers
>
> Do not encode device programming model (registers) into the binding. You
> need to define it as a property related to hardware itself, not its
> registers (e.g. boost value in mV).

Unfortunately I couldn't figure the meaning for this and the two values
below.

The datasheet doesn't mention these registers at all and the downstream
driver doesn't do anything meaningful with them (other than setting them)
nor has any comment to indicate what they do.
In the datasheet there's only BSTDBG4 mentioned where bits [5:1] mean
PVDD output voltage setting so for these registers it could really be
anthing :(

Maybe someone with more knowledge about LRAs might be able to decipher
what tset and r_spare is at least? I unfortunately didn't manage.

Regards
Luca

>
> > +
> > + awinic,tset:
> > + $ref: /schemas/types.yaml#/definitions/uint8
> > + description: Value for TSET register
>
> Ditto.
>
> > +
> > + awinic,r-spare:
> > + $ref: /schemas/types.yaml#/definitions/uint8
> > + description: Value for R_SPARE register
>
> Ditto.
>
>
> Best regards,
> Krzysztof

2022-04-12 04:20:41

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: input: Add bindings for Awinic AW8695 haptics

On 11/04/2022 10:15, Luca Weiss wrote:

(...)

>>> + awinic,f0-detection-play-time:
>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>> + description: Drive waveform play times in the first period in the f0 detection
>>
>> Use standard unit suffixes for known units (e.g. time).
>
> While the datasheet doesn't mention any time unit, the value is used to
> calculate the f0_trace_ms variable (which is milliseconds) but the
> result also depends on the awinic,f0-preset value, so it's not a raw
> time value.

I see, ok.

>
>>
>>> +
>>> + awinic,f0-detection-wait-time:
>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>> + description: Waveform wait times in the f0 detection
>>
>> Ditto.
>>
>>> +
>>> + awinic,f0-detection-repeat:
>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>> + description: Repeat times in the f0 detection
>>> +
>>> + awinic,f0-detection-trace:
>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>> + description: Drive waveform play times in the second period and later in the f0 detection
>>> +
>>> + awinic,boost-debug:
>>> + $ref: /schemas/types.yaml#/definitions/uint8-array
>>> + minItems: 3
>>> + maxItems: 3
>>> + description: Values for BSTDBG1-3 registers
>>
>> Do not encode device programming model (registers) into the binding. You
>> need to define it as a property related to hardware itself, not its
>> registers (e.g. boost value in mV).
>
> Unfortunately I couldn't figure the meaning for this and the two values
> below.
>
> The datasheet doesn't mention these registers at all and the downstream
> driver doesn't do anything meaningful with them (other than setting them)
> nor has any comment to indicate what they do.
> In the datasheet there's only BSTDBG4 mentioned where bits [5:1] mean
> PVDD output voltage setting so for these registers it could really be
> anthing :(
>
> Maybe someone with more knowledge about LRAs might be able to decipher
> what tset and r_spare is at least? I unfortunately didn't manage.

Do you have to define them in such case in DT? Maybe it should be part
of driver?

Best regards,
Krzysztof