* [PATCH v4 1/2] iio: accel: st_accel: add support for LIS2DS12
@ 2024-06-11 16:05 Kaustabh Chakraborty
2024-06-11 16:05 ` [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer Kaustabh Chakraborty
0 siblings, 1 reply; 11+ messages in thread
From: Kaustabh Chakraborty @ 2024-06-11 16:05 UTC (permalink / raw)
To: linux-iio, jic23, denis.ciocca
Cc: devicetree, linus.walleij, robh+dt, kauschluss
Define sensor settings for LIS2DS12 by STMicroelectronics (WhoAmI 0x43)
and add support in the I2C and SPI drivers.
Datasheet: https://www.st.com/resource/en/datasheet/lis2ds12.pdf
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
Changes in v4:
- add compatible string to documentation
- correct register addresses and settings
v3: https://lore.kernel.org/linux-iio/20240601192914.141906-1-kauschluss@disroot.org/
Changes in v3:
- fix code formatting
v2: https://lore.kernel.org/linux-iio/20240601183233.118397-1-kauschluss@disroot.org/
Changes in v2:
- add SPI support
- link datasheet in commit description
v1: https://lore.kernel.org/linux-iio/20240526083302.87172-1-kauschluss@disroot.org/
---
drivers/iio/accel/st_accel.h | 1 +
drivers/iio/accel/st_accel_core.c | 81 +++++++++++++++++++++++++++++++
drivers/iio/accel/st_accel_i2c.c | 5 ++
drivers/iio/accel/st_accel_spi.c | 5 ++
4 files changed, 92 insertions(+)
diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h
index e7525615712b..2659f536cef6 100644
--- a/drivers/iio/accel/st_accel.h
+++ b/drivers/iio/accel/st_accel.h
@@ -35,6 +35,7 @@
#define LIS3DHH_ACCEL_DEV_NAME "lis3dhh"
#define LIS3DE_ACCEL_DEV_NAME "lis3de"
#define LIS2DE12_ACCEL_DEV_NAME "lis2de12"
+#define LIS2DS12_ACCEL_DEV_NAME "lis2ds12"
#define LIS2HH12_ACCEL_DEV_NAME "lis2hh12"
#define LIS302DL_ACCEL_DEV_NAME "lis302dl"
#define LSM303C_ACCEL_DEV_NAME "lsm303c_accel"
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index d2104e14e255..0e371efbda70 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -925,6 +925,87 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
.multi_read_bit = true,
.bootime = 2,
},
+ {
+ .wai = 0x43,
+ .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
+ .sensors_supported = {
+ [0] = LIS2DS12_ACCEL_DEV_NAME,
+ },
+ .ch = (struct iio_chan_spec *)st_accel_16bit_channels,
+ .odr = {
+ .addr = 0x20,
+ .mask = 0xf0,
+ .odr_avl = {
+ { .hz = 10, .value = 0x01, },
+ { .hz = 50, .value = 0x02, },
+ { .hz = 100, .value = 0x03, },
+ { .hz = 200, .value = 0x04, },
+ { .hz = 400, .value = 0x05, },
+ { .hz = 800, .value = 0x06, },
+ },
+ },
+ .pw = {
+ .addr = 0x20,
+ .mask = 0xf0,
+ .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
+ },
+ .enable_axis = {
+ .addr = ST_SENSORS_DEFAULT_AXIS_ADDR,
+ .mask = ST_SENSORS_DEFAULT_AXIS_MASK,
+ },
+ .fs = {
+ .addr = 0x20,
+ .mask = 0x0c,
+ .fs_avl = {
+ [0] = {
+ .num = ST_ACCEL_FS_AVL_2G,
+ .value = 0x00,
+ .gain = IIO_G_TO_M_S_2(61),
+ },
+ [1] = {
+ .num = ST_ACCEL_FS_AVL_4G,
+ .value = 0x02,
+ .gain = IIO_G_TO_M_S_2(122),
+ },
+ [2] = {
+ .num = ST_ACCEL_FS_AVL_8G,
+ .value = 0x03,
+ .gain = IIO_G_TO_M_S_2(244),
+ },
+ [3] = {
+ .num = ST_ACCEL_FS_AVL_16G,
+ .value = 0x01,
+ .gain = IIO_G_TO_M_S_2(488),
+ },
+ },
+ },
+ .bdu = {
+ .addr = 0x20,
+ .mask = 0x01,
+ },
+ .drdy_irq = {
+ .int1 = {
+ .addr = 0x23,
+ .mask = 0x01,
+ },
+ .int2 = {
+ .addr = 0x24,
+ .mask = 0x01,
+ },
+ .addr_ihl = 0x22,
+ .mask_ihl = 0x02,
+ .stat_drdy = {
+ .addr = ST_SENSORS_DEFAULT_STAT_ADDR,
+ .mask = 0x01,
+ },
+ },
+ .sim = {
+ .addr = 0x21,
+ .value = BIT(0),
+ },
+ .multi_read_bit = true,
+ .bootime = 2,
+ },
{
.wai = 0x41,
.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index fd3749871121..329a4d6fb2ec 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -102,6 +102,10 @@ static const struct of_device_id st_accel_of_match[] = {
.compatible = "st,lis2de12",
.data = LIS2DE12_ACCEL_DEV_NAME,
},
+ {
+ .compatible = "st,lis2ds12",
+ .data = LIS2DS12_ACCEL_DEV_NAME,
+ },
{
.compatible = "st,lis2hh12",
.data = LIS2HH12_ACCEL_DEV_NAME,
@@ -154,6 +158,7 @@ static const struct i2c_device_id st_accel_id_table[] = {
{ LIS2DW12_ACCEL_DEV_NAME },
{ LIS3DE_ACCEL_DEV_NAME },
{ LIS2DE12_ACCEL_DEV_NAME },
+ { LIS2DS12_ACCEL_DEV_NAME },
{ LIS2HH12_ACCEL_DEV_NAME },
{ LIS302DL_ACCEL_DEV_NAME },
{ LSM303C_ACCEL_DEV_NAME },
diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c
index f72a24f45322..825adab37105 100644
--- a/drivers/iio/accel/st_accel_spi.c
+++ b/drivers/iio/accel/st_accel_spi.c
@@ -64,6 +64,10 @@ static const struct of_device_id st_accel_of_match[] = {
.compatible = "st,lis2dh12-accel",
.data = LIS2DH12_ACCEL_DEV_NAME,
},
+ {
+ .compatible = "st,lis2ds12",
+ .data = LIS2DS12_ACCEL_DEV_NAME,
+ },
{
.compatible = "st,lis3l02dq",
.data = LIS3L02DQ_ACCEL_DEV_NAME,
@@ -151,6 +155,7 @@ static const struct spi_device_id st_accel_id_table[] = {
{ LSM330_ACCEL_DEV_NAME },
{ LSM303AGR_ACCEL_DEV_NAME },
{ LIS2DH12_ACCEL_DEV_NAME },
+ { LIS2DS12_ACCEL_DEV_NAME },
{ LIS3L02DQ_ACCEL_DEV_NAME },
{ LNG2DM_ACCEL_DEV_NAME },
{ H3LIS331DL_ACCEL_DEV_NAME },
--
2.45.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-11 16:05 [PATCH v4 1/2] iio: accel: st_accel: add support for LIS2DS12 Kaustabh Chakraborty
@ 2024-06-11 16:05 ` Kaustabh Chakraborty
2024-06-11 18:17 ` Conor Dooley
0 siblings, 1 reply; 11+ messages in thread
From: Kaustabh Chakraborty @ 2024-06-11 16:05 UTC (permalink / raw)
To: linux-iio, jic23, denis.ciocca
Cc: devicetree, linus.walleij, robh+dt, kauschluss
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(+)
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-11 16:05 ` [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer Kaustabh Chakraborty
@ 2024-06-11 18:17 ` Conor Dooley
2024-06-15 9:46 ` Kaustabh Chakraborty
0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2024-06-11 18:17 UTC (permalink / raw)
To: Kaustabh Chakraborty
Cc: linux-iio, jic23, denis.ciocca, devicetree, linus.walleij,
robh+dt
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
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
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-11 18:17 ` Conor Dooley
@ 2024-06-15 9:46 ` Kaustabh Chakraborty
2024-06-15 12:11 ` Conor Dooley
2024-06-15 13:49 ` Jonathan Cameron
0 siblings, 2 replies; 11+ messages in thread
From: Kaustabh Chakraborty @ 2024-06-15 9:46 UTC (permalink / raw)
To: Conor Dooley
Cc: linux-iio, jic23, denis.ciocca, devicetree, linus.walleij,
robh+dt, kauschluss
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
>>
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-15 9:46 ` Kaustabh Chakraborty
@ 2024-06-15 12:11 ` Conor Dooley
2024-06-15 17:56 ` Jonathan Cameron
2024-06-15 13:49 ` Jonathan Cameron
1 sibling, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2024-06-15 12:11 UTC (permalink / raw)
To: Kaustabh Chakraborty
Cc: linux-iio, jic23, denis.ciocca, devicetree, linus.walleij,
robh+dt
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-15 9:46 ` Kaustabh Chakraborty
2024-06-15 12:11 ` Conor Dooley
@ 2024-06-15 13:49 ` Jonathan Cameron
2024-06-18 12:21 ` Kaustabh Chakraborty
1 sibling, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2024-06-15 13:49 UTC (permalink / raw)
To: Kaustabh Chakraborty
Cc: Conor Dooley, linux-iio, denis.ciocca, devicetree, linus.walleij,
robh+dt
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
> >>
> >>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-15 12:11 ` Conor Dooley
@ 2024-06-15 17:56 ` Jonathan Cameron
0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2024-06-15 17:56 UTC (permalink / raw)
To: Conor Dooley
Cc: Kaustabh Chakraborty, linux-iio, denis.ciocca, devicetree,
linus.walleij, robh+dt
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-15 13:49 ` Jonathan Cameron
@ 2024-06-18 12:21 ` Kaustabh Chakraborty
2024-06-18 17:38 ` Conor Dooley
0 siblings, 1 reply; 11+ messages in thread
From: Kaustabh Chakraborty @ 2024-06-18 12:21 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Conor Dooley, linux-iio, denis.ciocca, devicetree, linus.walleij,
robh+dt, kauschluss
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
>> >>
>> >>
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-18 12:21 ` Kaustabh Chakraborty
@ 2024-06-18 17:38 ` Conor Dooley
2024-06-20 16:42 ` Kaustabh Chakraborty
0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2024-06-18 17:38 UTC (permalink / raw)
To: Kaustabh Chakraborty
Cc: Jonathan Cameron, linux-iio, denis.ciocca, devicetree,
linus.walleij, robh+dt
[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-18 17:38 ` Conor Dooley
@ 2024-06-20 16:42 ` Kaustabh Chakraborty
2024-06-21 14:21 ` Conor Dooley
0 siblings, 1 reply; 11+ messages in thread
From: Kaustabh Chakraborty @ 2024-06-20 16:42 UTC (permalink / raw)
To: Conor Dooley
Cc: Jonathan Cameron, linux-iio, denis.ciocca, devicetree,
linus.walleij, robh+dt, kauschluss
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer
2024-06-20 16:42 ` Kaustabh Chakraborty
@ 2024-06-21 14:21 ` Conor Dooley
0 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2024-06-21 14:21 UTC (permalink / raw)
To: Kaustabh Chakraborty
Cc: Jonathan Cameron, linux-iio, denis.ciocca, devicetree,
linus.walleij, robh+dt
[-- Attachment #1: Type: text/plain, Size: 2447 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-06-21 14:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-11 16:05 [PATCH v4 1/2] iio: accel: st_accel: add support for LIS2DS12 Kaustabh Chakraborty
2024-06-11 16:05 ` [PATCH v4 2/2] dt-bindings: iio: st-sensors: add LIS2DS12 accelerometer Kaustabh Chakraborty
2024-06-11 18:17 ` Conor Dooley
2024-06-15 9:46 ` Kaustabh Chakraborty
2024-06-15 12:11 ` Conor Dooley
2024-06-15 17:56 ` Jonathan Cameron
2024-06-15 13:49 ` Jonathan Cameron
2024-06-18 12:21 ` Kaustabh Chakraborty
2024-06-18 17:38 ` Conor Dooley
2024-06-20 16:42 ` Kaustabh Chakraborty
2024-06-21 14:21 ` Conor Dooley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).