Commit 06777c56 authored by Hans de Goede's avatar Hans de Goede Committed by Jonathan Cameron

iio: accel: mxc6255 add support for the mxc6225

The mxc6225 is fully compatible with the existing mxc6255 driver,
add support for it.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent ede63aaf
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define MXC6255_REG_YOUT 0x01 #define MXC6255_REG_YOUT 0x01
#define MXC6255_REG_CHIP_ID 0x08 #define MXC6255_REG_CHIP_ID 0x08
#define MXC6225_CHIP_ID 0xe5
#define MXC6255_CHIP_ID 0x05 #define MXC6255_CHIP_ID 0x05
/* /*
...@@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client, ...@@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client,
return ret; return ret;
} }
if (chip_id != MXC6255_CHIP_ID) { switch (chip_id) {
case MXC6225_CHIP_ID:
case MXC6255_CHIP_ID:
break;
default:
dev_err(&client->dev, "Invalid chip id %x\n", chip_id); dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
return -ENODEV; return -ENODEV;
} }
...@@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client, ...@@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client,
} }
static const struct acpi_device_id mxc6255_acpi_match[] = { static const struct acpi_device_id mxc6255_acpi_match[] = {
{"MXC6225", 0},
{"MXC6255", 0}, {"MXC6255", 0},
{ } { }
}; };
MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match); MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
static const struct i2c_device_id mxc6255_id[] = { static const struct i2c_device_id mxc6255_id[] = {
{"mxc6225", 0},
{"mxc6255", 0}, {"mxc6255", 0},
{ } { }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment