* [PATCH] iio: accel: da280: Add support for the DA217 accelerometer
@ 2023-06-13 9:43 Hans de Goede
2023-06-17 19:59 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2023-06-13 9:43 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hans de Goede, Lars-Peter Clausen, linux-iio, Juno Computers USA
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>
---
Note no Closes: for the Reported-by since this was reported by private email
---
drivers/iio/accel/da280.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/accel/da280.c b/drivers/iio/accel/da280.c
index 38a7d811610e..a49c4f95fe7d 100644
--- a/drivers/iio/accel/da280.c
+++ b/drivers/iio/accel/da280.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * IIO driver for the MiraMEMS DA280 3-axis accelerometer and
+ * IIO driver for the MiraMEMS DA217 and DA280 3-axis accelerometer and
* IIO driver for the MiraMEMS DA226 2-axis accelerometer
*
* Copyright (c) 2016 Hans de Goede <hdegoede@redhat.com>
@@ -23,7 +23,7 @@
#define DA280_MODE_ENABLE 0x1e
#define DA280_MODE_DISABLE 0x9e
-enum da280_chipset { da226, da280 };
+enum da280_chipset { da217, da226, da280 };
/*
* a value of + or -4096 corresponds to + or - 1G
@@ -134,7 +134,10 @@ static int da280_probe(struct i2c_client *client)
chip = id->driver_data;
}
- if (chip == da226) {
+ if (chip == da217) {
+ indio_dev->name = "da217";
+ indio_dev->num_channels = 3;
+ } else if (chip == da226) {
indio_dev->name = "da226";
indio_dev->num_channels = 2;
} else {
@@ -166,12 +169,14 @@ static int da280_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(da280_pm_ops, da280_suspend, da280_resume);
static const struct acpi_device_id da280_acpi_match[] = {
+ {"NSA2513", da217},
{"MIRAACC", da280},
{},
};
MODULE_DEVICE_TABLE(acpi, da280_acpi_match);
static const struct i2c_device_id da280_i2c_id[] = {
+ { "da217", da217 },
{ "da226", da226 },
{ "da280", da280 },
{}
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] iio: accel: da280: Add support for the DA217 accelerometer
2023-06-13 9:43 [PATCH] iio: accel: da280: Add support for the DA217 accelerometer Hans de Goede
@ 2023-06-17 19:59 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2023-06-17 19:59 UTC (permalink / raw)
To: Hans de Goede; +Cc: Lars-Peter Clausen, linux-iio, Juno Computers USA
On Tue, 13 Jun 2023 11:43:46 +0200
Hans de Goede <hdegoede@redhat.com> wrote:
> 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>
Applied to the togreg branch of iio.git and pushed out as testing.
Note this has missed the coming merge window so will be for the next
cycle.
Jonathan
> ---
> Note no Closes: for the Reported-by since this was reported by private email
> ---
> drivers/iio/accel/da280.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/accel/da280.c b/drivers/iio/accel/da280.c
> index 38a7d811610e..a49c4f95fe7d 100644
> --- a/drivers/iio/accel/da280.c
> +++ b/drivers/iio/accel/da280.c
> @@ -1,6 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0-only
> /*
> - * IIO driver for the MiraMEMS DA280 3-axis accelerometer and
> + * IIO driver for the MiraMEMS DA217 and DA280 3-axis accelerometer and
> * IIO driver for the MiraMEMS DA226 2-axis accelerometer
> *
> * Copyright (c) 2016 Hans de Goede <hdegoede@redhat.com>
> @@ -23,7 +23,7 @@
> #define DA280_MODE_ENABLE 0x1e
> #define DA280_MODE_DISABLE 0x9e
>
> -enum da280_chipset { da226, da280 };
> +enum da280_chipset { da217, da226, da280 };
>
> /*
> * a value of + or -4096 corresponds to + or - 1G
> @@ -134,7 +134,10 @@ static int da280_probe(struct i2c_client *client)
> chip = id->driver_data;
> }
>
> - if (chip == da226) {
> + if (chip == da217) {
> + indio_dev->name = "da217";
> + indio_dev->num_channels = 3;
> + } else if (chip == da226) {
> indio_dev->name = "da226";
> indio_dev->num_channels = 2;
> } else {
> @@ -166,12 +169,14 @@ static int da280_resume(struct device *dev)
> static DEFINE_SIMPLE_DEV_PM_OPS(da280_pm_ops, da280_suspend, da280_resume);
>
> static const struct acpi_device_id da280_acpi_match[] = {
> + {"NSA2513", da217},
> {"MIRAACC", da280},
> {},
> };
> MODULE_DEVICE_TABLE(acpi, da280_acpi_match);
>
> static const struct i2c_device_id da280_i2c_id[] = {
> + { "da217", da217 },
> { "da226", da226 },
> { "da280", da280 },
> {}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-17 19:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13 9:43 [PATCH] iio: accel: da280: Add support for the DA217 accelerometer Hans de Goede
2023-06-17 19:59 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox