Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: da280: Add support for the DA217 accelerometer

The DA217 accelerometer is another DA280 compatible accelerometer,
add its device-ids to the da280 driver.

Reported-by: Juno Computers USA <usa@junocomputers.com>
Tested-by: Juno Computers USA <usa@junocomputers.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230613094346.162551-1-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Hans de Goede and committed by
Jonathan Cameron
3d936dfe 111e1abd

+8 -3
+8 -3
drivers/iio/accel/da280.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * IIO driver for the MiraMEMS DA280 3-axis accelerometer and 3 + * IIO driver for the MiraMEMS DA217 and DA280 3-axis accelerometer and 4 4 * IIO driver for the MiraMEMS DA226 2-axis accelerometer 5 5 * 6 6 * Copyright (c) 2016 Hans de Goede <hdegoede@redhat.com> ··· 23 23 #define DA280_MODE_ENABLE 0x1e 24 24 #define DA280_MODE_DISABLE 0x9e 25 25 26 - enum da280_chipset { da226, da280 }; 26 + enum da280_chipset { da217, da226, da280 }; 27 27 28 28 /* 29 29 * a value of + or -4096 corresponds to + or - 1G ··· 134 134 chip = id->driver_data; 135 135 } 136 136 137 - if (chip == da226) { 137 + if (chip == da217) { 138 + indio_dev->name = "da217"; 139 + indio_dev->num_channels = 3; 140 + } else if (chip == da226) { 138 141 indio_dev->name = "da226"; 139 142 indio_dev->num_channels = 2; 140 143 } else { ··· 169 166 static DEFINE_SIMPLE_DEV_PM_OPS(da280_pm_ops, da280_suspend, da280_resume); 170 167 171 168 static const struct acpi_device_id da280_acpi_match[] = { 169 + {"NSA2513", da217}, 172 170 {"MIRAACC", da280}, 173 171 {}, 174 172 }; 175 173 MODULE_DEVICE_TABLE(acpi, da280_acpi_match); 176 174 177 175 static const struct i2c_device_id da280_i2c_id[] = { 176 + { "da217", da217 }, 178 177 { "da226", da226 }, 179 178 { "da280", da280 }, 180 179 {}