Skip to contentSkip to conversation

iio: st_sensors: remap SMO8840 to LIS2DH12

PATCH Applied Wen-chien Jesse Sung 3 participants 3 messages Feb 24, 2020 – Mar 1, 2020 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: st_sensors: remap SMO8840 to LIS2DH12

According to ST, the HID is for LIS2DH12.

---
 drivers/iio/accel/st_accel_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/st_accel_i2c.c +1 -1
index 633955d764cc..849cf74153c4 100644
@@ -110,7 +110,7 @@ MODULE_DEVICE_TABLE(of, st_accel_of_match);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id st_accel_acpi_match[] = {
-	{"SMO8840", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
+	{"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME},
 	{"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
 	{ },
 };
Signature · 1 line
2.20.1
Tested-by Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 3 lines · Wen-chien Jesse Sung

According to ST, the HID is for LIS2DH12.

I added the original "SMO8840" entry since I did not have any docs I just copied the "SMO8A90" entry. Looking at the driver the only difference seems to be that the LNG2DM only has 8 bits accuracy where as the LIS2DH12 has 12 bits. I can confirm that this patch works on my Lenovo Ideapad Miix 320, for which the original patch was submitted, and that I indeed get 12 bits of accuracy with this patch.

So this patch is:

Regards,

Hans

Quoted 18 lines
---
  drivers/iio/accel/st_accel_i2c.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/st_accel_i2c.c +1 -1
index 633955d764cc..849cf74153c4 100644
@@ -110,7 +110,7 @@ MODULE_DEVICE_TABLE(of, st_accel_of_match);
 
  #ifdef CONFIG_ACPI
  static const struct acpi_device_id st_accel_acpi_match[] = {
-	{"SMO8840", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
+	{"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME},
  	{"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
  	{ },
  };
maintainer Applied
#2 lore raw
Quoted 15 lines · On Mon, 24 Feb 2020 20:23:28 +0100 Hans de Goede <[email protected]> wrote:

Hi,

Quoted 3 lines · Wen-chien Jesse Sung

According to ST, the HID is for LIS2DH12.

I added the original "SMO8840" entry since I did not have any docs I just copied the "SMO8A90" entry. Looking at the driver the only difference seems to be that the LNG2DM only has 8 bits accuracy where as the LIS2DH12 has 12 bits. I can confirm that this patch works on my Lenovo Ideapad Miix 320, for which the original patch was submitted, and that I indeed get 12 bits of accuracy with this patch.

Quoted 5 lines

So this patch is:

Applied to the fixes-togreg branch of iio.git with fixes and stable tags added.

Whilst it isn't vital this gets backported, it seems unlikely to do any harm.

Thanks,

Jonathan

Quoted 26 lines

Regards,

Hans

Quoted 18 lines
---
  drivers/iio/accel/st_accel_i2c.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/st_accel_i2c.c +1 -1
index 633955d764cc..849cf74153c4 100644
@@ -110,7 +110,7 @@ MODULE_DEVICE_TABLE(of, st_accel_of_match);
 
  #ifdef CONFIG_ACPI
  static const struct acpi_device_id st_accel_acpi_match[] = {
-	{"SMO8840", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
+	{"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME},
  	{"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
  	{ },
  };