diff mbox series

[v4,2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer

Message ID 20240611160821.13941-2-kauschluss@disroot.org (mailing list archive)
State Changes Requested
Headers show
Series [v4,1/2] iio: accel: st_accel: add support for LIS2DS12 | expand

Commit Message

Kaustabh Chakraborty June 11, 2024, 4:05 p.m. UTC
Add compatible for LIS2DS12 accelerometer by STMicroelectronics.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
---
 Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
 1 file changed, 1 insertion(+)

Comments

Conor Dooley June 11, 2024, 6:17 p.m. UTC | #1
On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:
> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.

I can see that! Your commit message should mention why this device
is not compatible with existing variants.

Thanks,
Conor.

> 
> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
> ---
>  Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> index fff7e3d83a02..71c1ee33a393 100644
> --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> @@ -26,6 +26,7 @@ properties:
>            - st,lis2dw12
>            - st,lis2hh12
>            - st,lis2dh12-accel
> +          - st,lis2ds12
>            - st,lis302dl
>            - st,lis331dl-accel
>            - st,lis331dlh-accel
> -- 
> 2.45.1
> 
>
Kaustabh Chakraborty June 15, 2024, 9:46 a.m. UTC | #2
On 2024-06-11 18:17, Conor Dooley wrote:
> On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:
>> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.
> 
> I can see that! Your commit message should mention why this device
> is not compatible with existing variants.

Sure, is adding the WhoAmI value enough? Or do I also have to
explain the different registers and sensor settings.

> 
> Thanks,
> Conor.
> 
>> 
>> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
>> ---
>>  Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
>> index fff7e3d83a02..71c1ee33a393 100644
>> --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
>> +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
>> @@ -26,6 +26,7 @@ properties:
>>            - st,lis2dw12
>>            - st,lis2hh12
>>            - st,lis2dh12-accel
>> +          - st,lis2ds12
>>            - st,lis302dl
>>            - st,lis331dl-accel
>>            - st,lis331dlh-accel
>> -- 
>> 2.45.1
>> 
>>
Conor Dooley June 15, 2024, 12:11 p.m. UTC | #3
On Sat, Jun 15, 2024 at 09:46:59AM +0000, Kaustabh Chakraborty wrote:
> On 2024-06-11 18:17, Conor Dooley wrote:
> > On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:
> >> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.
> > 
> > I can see that! Your commit message should mention why this device
> > is not compatible with existing variants.
> 
> Sure, is adding the WhoAmI value enough? Or do I also have to
> explain the different registers and sensor settings.

The whoami isn't sufficient, but if there's registers that behave
differently etc, please mention those.

Thanks,
Conor.
Jonathan Cameron June 15, 2024, 1:49 p.m. UTC | #4
On Sat, 15 Jun 2024 09:46:59 +0000
Kaustabh Chakraborty <kauschluss@disroot.org> wrote:

> On 2024-06-11 18:17, Conor Dooley wrote:
> > On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:  
> >> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.  
> > 
> > I can see that! Your commit message should mention why this device
> > is not compatible with existing variants.  
> 
> Sure, is adding the WhoAmI value enough? Or do I also have to
> explain the different registers and sensor settings.
> 
Who ami is not enough, but a statement along the lines of
"The register interface is not compatible with existing parts, for
example addresses and contents of numerous registers are different"

With whatever the actual differences are.

> > 
> > Thanks,
> > Conor.
> >   
> >> 
> >> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
> >> ---
> >>  Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
> >>  1 file changed, 1 insertion(+)
> >> 
> >> diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> >> index fff7e3d83a02..71c1ee33a393 100644
> >> --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> >> +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
> >> @@ -26,6 +26,7 @@ properties:
> >>            - st,lis2dw12
> >>            - st,lis2hh12
> >>            - st,lis2dh12-accel
> >> +          - st,lis2ds12
> >>            - st,lis302dl
> >>            - st,lis331dl-accel
> >>            - st,lis331dlh-accel
> >> -- 
> >> 2.45.1
> >> 
> >>  
>
Jonathan Cameron June 15, 2024, 5:56 p.m. UTC | #5
On Sat, 15 Jun 2024 13:11:04 +0100
Conor Dooley <conor@kernel.org> wrote:

> On Sat, Jun 15, 2024 at 09:46:59AM +0000, Kaustabh Chakraborty wrote:
> > On 2024-06-11 18:17, Conor Dooley wrote:  
> > > On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:  
> > >> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.  
> > > 
> > > I can see that! Your commit message should mention why this device
> > > is not compatible with existing variants.  
> > 
> > Sure, is adding the WhoAmI value enough? Or do I also have to
> > explain the different registers and sensor settings.  
> 
> The whoami isn't sufficient, but if there's registers that behave
> differently etc, please mention those.
> 

Or (mostly putting this for future reference of anyone reading this)
undiscoverable things like different scale factors for channels.

> Thanks,
> Conor.
Kaustabh Chakraborty June 18, 2024, 12:21 p.m. UTC | #6
On 2024-06-15 13:49, Jonathan Cameron wrote:
> On Sat, 15 Jun 2024 09:46:59 +0000
> Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
> 
>> On 2024-06-11 18:17, Conor Dooley wrote:
>> > On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:  
>> >> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.  
>> > 
>> > I can see that! Your commit message should mention why this device
>> > is not compatible with existing variants.  
>> 
>> Sure, is adding the WhoAmI value enough? Or do I also have to
>> explain the different registers and sensor settings.
>> 
> Who ami is not enough, but a statement along the lines of
> "The register interface is not compatible with existing parts, for
> example addresses and contents of numerous registers are different"
> 
> With whatever the actual differences are.

"LIS2DS12 is an accelerometer by STMicroelectronics. It is identifiable by
its WhoAmI value 0x43.

Its register interface is not compatible with existing parts. For example: 

- The full-scale values are present in register 0x20, in bits 2 and 3
  (mask 0x0c).

- The full-scale values 2G, 4G, 8G, and 16G correspond to the register
  values 0x00, 0x02, 0x03, 0x01 respectively.

Add the compatible string without any fallback."

Is this good enough?

> 
>> > 
>> > Thanks,
>> > Conor.
>> >   
>> >> 
>> >> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
>> >> ---
>> >>  Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
>> >>  1 file changed, 1 insertion(+)
>> >> 
>> >> diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
>> >> index fff7e3d83a02..71c1ee33a393 100644
>> >> --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
>> >> +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
>> >> @@ -26,6 +26,7 @@ properties:
>> >>            - st,lis2dw12
>> >>            - st,lis2hh12
>> >>            - st,lis2dh12-accel
>> >> +          - st,lis2ds12
>> >>            - st,lis302dl
>> >>            - st,lis331dl-accel
>> >>            - st,lis331dlh-accel
>> >> -- 
>> >> 2.45.1
>> >> 
>> >>  
>>
Conor Dooley June 18, 2024, 5:38 p.m. UTC | #7
On Tue, Jun 18, 2024 at 12:21:17PM +0000, Kaustabh Chakraborty wrote:
> On 2024-06-15 13:49, Jonathan Cameron wrote:
> > On Sat, 15 Jun 2024 09:46:59 +0000
> > Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
> > 
> >> On 2024-06-11 18:17, Conor Dooley wrote:
> >> > On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:  
> >> >> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.  
> >> > 
> >> > I can see that! Your commit message should mention why this device
> >> > is not compatible with existing variants.  
> >> 
> >> Sure, is adding the WhoAmI value enough? Or do I also have to
> >> explain the different registers and sensor settings.
> >> 
> > Who ami is not enough, but a statement along the lines of
> > "The register interface is not compatible with existing parts, for
> > example addresses and contents of numerous registers are different"
> > 
> > With whatever the actual differences are.
> 
> "LIS2DS12 is an accelerometer by STMicroelectronics. It is identifiable by
> its WhoAmI value 0x43.
> 
> Its register interface is not compatible with existing parts. For example: 
> 
> - The full-scale values are present in register 0x20, in bits 2 and 3
>   (mask 0x0c).
> 
> - The full-scale values 2G, 4G, 8G, and 16G correspond to the register
>   values 0x00, 0x02, 0x03, 0x01 respectively.
> 
> Add the compatible string without any fallback."
> 
> Is this good enough?

I don't know the other devices, so please highlight how the examples you
give here are different to the existing ones please.
Kaustabh Chakraborty June 20, 2024, 4:42 p.m. UTC | #8
On 2024-06-18 17:38, Conor Dooley wrote:
> On Tue, Jun 18, 2024 at 12:21:17PM +0000, Kaustabh Chakraborty wrote:
>> On 2024-06-15 13:49, Jonathan Cameron wrote:
>> > On Sat, 15 Jun 2024 09:46:59 +0000
>> > Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
>> > 
>> >> On 2024-06-11 18:17, Conor Dooley wrote:
>> >> > On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:  
>> >> >> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.  
>> >> > 
>> >> > I can see that! Your commit message should mention why this device
>> >> > is not compatible with existing variants.  
>> >> 
>> >> Sure, is adding the WhoAmI value enough? Or do I also have to
>> >> explain the different registers and sensor settings.
>> >> 
>> > Who ami is not enough, but a statement along the lines of
>> > "The register interface is not compatible with existing parts, for
>> > example addresses and contents of numerous registers are different"
>> > 
>> > With whatever the actual differences are.
>> 
>> "LIS2DS12 is an accelerometer by STMicroelectronics. It is identifiable by
>> its WhoAmI value 0x43.
>> 
>> Its register interface is not compatible with existing parts. For example: 
>> 
>> - The full-scale values are present in register 0x20, in bits 2 and 3
>>   (mask 0x0c).
>> 
>> - The full-scale values 2G, 4G, 8G, and 16G correspond to the register
>>   values 0x00, 0x02, 0x03, 0x01 respectively.
>> 
>> Add the compatible string without any fallback."
>> 
>> Is this good enough?
> 
> I don't know the other devices, so please highlight how the examples you
> give here are different to the existing ones please.

Are these acceptable?

- The full-scale values are present in register 0x20, in bits 2 and 3
  (mask 0x0c).
  Most other supported sensors have the register address set to 0x21,
  0x23, 0x24, or 0x25.
  There is one sensor setting though (bearing WhoAmI 0x3b) which has
  it's address set to 0x20, but the mask is set to 0x20, not 0x0c.

- The full-scale values 2G, 4G, 8G, and 16G correspond to the register
  values 0x00, 0x02, 0x03, 0x01 respectively.
  None of the sensor settings have the value 0x01 associated with 16G.
Conor Dooley June 21, 2024, 2:21 p.m. UTC | #9
On Thu, Jun 20, 2024 at 04:42:39PM +0000, Kaustabh Chakraborty wrote:
> On 2024-06-18 17:38, Conor Dooley wrote:
> > On Tue, Jun 18, 2024 at 12:21:17PM +0000, Kaustabh Chakraborty wrote:
> >> On 2024-06-15 13:49, Jonathan Cameron wrote:
> >> > On Sat, 15 Jun 2024 09:46:59 +0000
> >> > Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
> >> > 
> >> >> On 2024-06-11 18:17, Conor Dooley wrote:
> >> >> > On Tue, Jun 11, 2024 at 09:35:53PM +0530, Kaustabh Chakraborty wrote:  
> >> >> >> Add compatible for LIS2DS12 accelerometer by STMicroelectronics.  
> >> >> > 
> >> >> > I can see that! Your commit message should mention why this device
> >> >> > is not compatible with existing variants.  
> >> >> 
> >> >> Sure, is adding the WhoAmI value enough? Or do I also have to
> >> >> explain the different registers and sensor settings.
> >> >> 
> >> > Who ami is not enough, but a statement along the lines of
> >> > "The register interface is not compatible with existing parts, for
> >> > example addresses and contents of numerous registers are different"
> >> > 
> >> > With whatever the actual differences are.
> >> 
> >> "LIS2DS12 is an accelerometer by STMicroelectronics. It is identifiable by
> >> its WhoAmI value 0x43.
> >> 
> >> Its register interface is not compatible with existing parts. For example: 
> >> 
> >> - The full-scale values are present in register 0x20, in bits 2 and 3
> >>   (mask 0x0c).
> >> 
> >> - The full-scale values 2G, 4G, 8G, and 16G correspond to the register
> >>   values 0x00, 0x02, 0x03, 0x01 respectively.
> >> 
> >> Add the compatible string without any fallback."
> >> 
> >> Is this good enough?
> > 
> > I don't know the other devices, so please highlight how the examples you
> > give here are different to the existing ones please.
> 
> Are these acceptable?
> 
> - The full-scale values are present in register 0x20, in bits 2 and 3
>   (mask 0x0c).
>   Most other supported sensors have the register address set to 0x21,
>   0x23, 0x24, or 0x25.
>   There is one sensor setting though (bearing WhoAmI 0x3b) which has
>   it's address set to 0x20, but the mask is set to 0x20, not 0x0c.
> 
> - The full-scale values 2G, 4G, 8G, and 16G correspond to the register
>   values 0x00, 0x02, 0x03, 0x01 respectively.
>   None of the sensor settings have the value 0x01 associated with 16G.

Yeah, that sounds good to me. Thanks for the updates.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
index fff7e3d83a02..71c1ee33a393 100644
--- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
+++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
@@ -26,6 +26,7 @@  properties:
           - st,lis2dw12
           - st,lis2hh12
           - st,lis2dh12-accel
+          - st,lis2ds12
           - st,lis302dl
           - st,lis331dl-accel
           - st,lis331dlh-accel