aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel/st_accel_spi.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-01-05 14:32:33 +0100
committerJonathan Cameron <jic23@kernel.org>2017-01-10 19:54:16 +0000
commit762227721fe6225be5b6d233ef681aea5871f5f3 (patch)
treef11f6ede41262ccde95a1012aa2b7d8c28873145 /drivers/iio/accel/st_accel_spi.c
parentstaging: iio: ad7606: replace range/range_available with corresponding scale (diff)
downloadlinux-dev-762227721fe6225be5b6d233ef681aea5871f5f3.tar.xz
linux-dev-762227721fe6225be5b6d233ef681aea5871f5f3.zip
iio: accel: st_accel: handle deprecated bindings
The earlier deployed LIS3LV02DL driver had already defined a few DT bindings that need to be supported by the new more generic driver and listed as compatible but deprecated bindings in the documentation. After this we can start to activate the new driver with the old systems where applicable. As part of this enablement: make us depend on the old drivers not being in use so we don't get a kernel with two competing drivers. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/accel/st_accel_spi.c')
-rw-r--r--drivers/iio/accel/st_accel_spi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c
index c25ac50d4600..29a15f27a51b 100644
--- a/drivers/iio/accel/st_accel_spi.c
+++ b/drivers/iio/accel/st_accel_spi.c
@@ -65,9 +65,18 @@ static const struct spi_device_id st_accel_id_table[] = {
};
MODULE_DEVICE_TABLE(spi, st_accel_id_table);
+#ifdef CONFIG_OF
+static const struct of_device_id lis302dl_spi_dt_ids[] = {
+ { .compatible = "st,lis302dl-spi" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, lis302dl_spi_dt_ids);
+#endif
+
static struct spi_driver st_accel_driver = {
.driver = {
.name = "st-accel-spi",
+ .of_match_table = of_match_ptr(lis302dl_spi_dt_ids),
},
.probe = st_accel_spi_probe,
.remove = st_accel_spi_remove,