summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorLukasz Czerwinski <l.czerwinski@samsung.com>2013-06-17 15:49:49 +0200
committerMarek Szyprowski <m.szyprowski@samsung.com>2014-05-15 07:19:32 +0200
commit4efd30c214e0b491444273a66238b989aa5bf0b7 (patch)
tree7b0e89a4635758cb14a3b1dd20ed665771e305eb /drivers/iio
parent03b0853a3963a89a203dfb414d8562aa5ac86f31 (diff)
downloadlinux-3.10-4efd30c214e0b491444273a66238b989aa5bf0b7.tar.gz
linux-3.10-4efd30c214e0b491444273a66238b989aa5bf0b7.tar.bz2
linux-3.10-4efd30c214e0b491444273a66238b989aa5bf0b7.zip
iio: st_gyro: Add DT bindings
Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/gyro/st_gyro.h11
-rw-r--r--drivers/iio/gyro/st_gyro_i2c.c14
-rw-r--r--drivers/iio/gyro/st_gyro_spi.c14
3 files changed, 34 insertions, 5 deletions
diff --git a/drivers/iio/gyro/st_gyro.h b/drivers/iio/gyro/st_gyro.h
index 25ee236b1bb..7fdfa8f167b 100644
--- a/drivers/iio/gyro/st_gyro.h
+++ b/drivers/iio/gyro/st_gyro.h
@@ -15,12 +15,13 @@
#include <linux/iio/common/st_sensors.h>
#define L3G4200D_GYRO_DEV_NAME "l3g4200d"
-#define LSM330D_GYRO_DEV_NAME "lsm330d_gyro"
-#define LSM330DL_GYRO_DEV_NAME "lsm330dl_gyro"
-#define LSM330DLC_GYRO_DEV_NAME "lsm330dlc_gyro"
+#define LSM330D_GYRO_DEV_NAME "lsm330d-gyro"
+#define LSM330DL_GYRO_DEV_NAME "lsm330dl-gyro"
+#define LSM330DLC_GYRO_DEV_NAME "lsm330dlc-gyro"
#define L3GD20_GYRO_DEV_NAME "l3gd20"
-#define L3G4IS_GYRO_DEV_NAME "l3g4is_ui"
-#define LSM330_GYRO_DEV_NAME "lsm330_gyro"
+#define L3GD20H_GYRO_DEV_NAME "l3gd20h"
+#define L3G4IS_GYRO_DEV_NAME "l3g4is-ui"
+#define LSM330_GYRO_DEV_NAME "lsm330-gyro"
int st_gyro_common_probe(struct iio_dev *indio_dev);
void st_gyro_common_remove(struct iio_dev *indio_dev);
diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c
index c1755ce2da3..97fd245400f 100644
--- a/drivers/iio/gyro/st_gyro_i2c.c
+++ b/drivers/iio/gyro/st_gyro_i2c.c
@@ -67,10 +67,24 @@ static const struct i2c_device_id st_gyro_id_table[] = {
};
MODULE_DEVICE_TABLE(i2c, st_gyro_id_table);
+#ifdef CONFIG_OF
+static struct of_device_id st_gyro_dt_match[] = {
+ { .compatible = "st,l3g4200d" },
+ { .compatible = "st,lsm330d-gyro" },
+ { .compatible = "st,lsm330dl-gyro" },
+ { .compatible = "st,lsm330dlc-gyro" },
+ { .compatible = "st,l3gd20" },
+ { .compatible = "st,l3gd20h" },
+ { .compatible = "st,l3g4is-ui" },
+ { .compatible = "st,lsm330-gyro" },
+};
+#endif
+
static struct i2c_driver st_gyro_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "st-gyro-i2c",
+ .of_match_table = of_match_ptr(st_gyro_dt_match),
},
.probe = st_gyro_i2c_probe,
.remove = st_gyro_i2c_remove,
diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c
index b37fc9e0770..b1e03cfc2ef 100644
--- a/drivers/iio/gyro/st_gyro_spi.c
+++ b/drivers/iio/gyro/st_gyro_spi.c
@@ -66,10 +66,24 @@ static const struct spi_device_id st_gyro_id_table[] = {
};
MODULE_DEVICE_TABLE(spi, st_gyro_id_table);
+#ifdef CONFIG_OF
+static struct of_device_id st_gyro_dt_match[] = {
+ { .compatible = "st,l3g4200d" },
+ { .compatible = "st,lsm330d-gyro" },
+ { .compatible = "st,lsm330dl-gyro" },
+ { .compatible = "st,lsm330dlc-gyro" },
+ { .compatible = "st,l3gd20" },
+ { .compatible = "st,l3gd20h" },
+ { .compatible = "st,l3g4is-ui" },
+ { .compatible = "st,lsm330-gyro" },
+};
+#endif
+
static struct spi_driver st_gyro_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "st-gyro-spi",
+ .of_match_table = of_match_ptr(st_gyro_dt_match),
},
.probe = st_gyro_spi_probe,
.remove = st_gyro_spi_remove,