Commit 024f5d4f authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: accel: adxl345: Set driver_data for OF enumeration

In order to enable this driver on mode platforms, assign driver_data
field in the OF device ID table.

While at it, make sure that device type is not 0 which may be wrongly
interpreted by device property APIs in the future.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20220222090009.2060-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 01676b0f
......@@ -9,8 +9,8 @@
#define _ADXL345_H_
enum adxl345_device_type {
ADXL345,
ADXL375,
ADXL345 = 1,
ADXL375 = 2,
};
int adxl345_core_probe(struct device *dev, struct regmap *regmap,
......
......@@ -44,8 +44,8 @@ static const struct i2c_device_id adxl345_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, adxl345_i2c_id);
static const struct of_device_id adxl345_of_match[] = {
{ .compatible = "adi,adxl345" },
{ .compatible = "adi,adxl375" },
{ .compatible = "adi,adxl345", .data = (const void *)ADXL345 },
{ .compatible = "adi,adxl375", .data = (const void *)ADXL375 },
{ },
};
......
......@@ -46,8 +46,8 @@ static const struct spi_device_id adxl345_spi_id[] = {
MODULE_DEVICE_TABLE(spi, adxl345_spi_id);
static const struct of_device_id adxl345_of_match[] = {
{ .compatible = "adi,adxl345" },
{ .compatible = "adi,adxl375" },
{ .compatible = "adi,adxl345", .data = (const void *)ADXL345 },
{ .compatible = "adi,adxl375", .data = (const void *)ADXL375 },
{ },
};
......
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