diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2018-07-13 13:50:44 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2018-07-15 11:18:15 +0200 |
commit | ef89f4b96a2ab8dc1a0a3815d9365240e4c3c06b (patch) | |
tree | 26b29d7acb81a9ebf594b5480528a9eab89a425a /drivers/iio/accel/adxl345_i2c.c | |
parent | iio: imu: st_lsm6dsx: add error logs to st_lsm6dsx_read_fifo() (diff) | |
download | linux-ef89f4b96a2ab8dc1a0a3815d9365240e4c3c06b.tar.xz linux-ef89f4b96a2ab8dc1a0a3815d9365240e4c3c06b.zip |
iio: adxl345: Add support for the ADXL375
The ADXL375 is fully register map compatible to the ADXL345 (including the
device ID register returning the same value ...).
The only difference is the resolution of the acceleration sensor. The
ADXL375 can measure up to +-200g of acceleration.
Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL375.PDF
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/adxl345_i2c.c')
-rw-r--r-- | drivers/iio/accel/adxl345_i2c.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c index 05e1ec49700c..785c89de91e7 100644 --- a/drivers/iio/accel/adxl345_i2c.c +++ b/drivers/iio/accel/adxl345_i2c.c @@ -34,7 +34,8 @@ static int adxl345_i2c_probe(struct i2c_client *client, return PTR_ERR(regmap); } - return adxl345_core_probe(&client->dev, regmap, id ? id->name : NULL); + return adxl345_core_probe(&client->dev, regmap, id->driver_data, + id ? id->name : NULL); } static int adxl345_i2c_remove(struct i2c_client *client) @@ -43,7 +44,8 @@ static int adxl345_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id adxl345_i2c_id[] = { - { "adxl345", 0 }, + { "adxl345", ADXL345 }, + { "adxl375", ADXL375 }, { } }; @@ -51,6 +53,7 @@ MODULE_DEVICE_TABLE(i2c, adxl345_i2c_id); static const struct of_device_id adxl345_of_match[] = { { .compatible = "adi,adxl345" }, + { .compatible = "adi,adxl375" }, { }, }; |