lkml.org 
[lkml]   [2018]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 2/5] iio: gyro: add device tree support for fxas21002c
Date
This patch adds device tree support for the fxas21002c driver.

Signed-off-by: Afonso Bordado <afonsobordado@az8.co>
---
drivers/iio/gyro/fxas21002c.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/gyro/fxas21002c.c b/drivers/iio/gyro/fxas21002c.c
index 649316c26f5b..e2ce0622944b 100644
--- a/drivers/iio/gyro/fxas21002c.c
+++ b/drivers/iio/gyro/fxas21002c.c
@@ -8,7 +8,6 @@
* Datasheet: https://www.nxp.com/docs/en/data-sheet/FXAS21002.pdf
* TODO:
* ODR / Scale Support
- * Devicetree
* Scale Boost Mode
* Power management
* GPIO Reset
@@ -357,6 +356,12 @@ static int fxas21002c_probe(struct i2c_client *client,
return ret;
}

+static const struct of_device_id fxas21002c_of_ids[] = {
+ {.compatible = "fsl,fxas21002c"},
+ {}
+};
+MODULE_DEVICE_TABLE(of, fxas21002c_of_ids);
+
static const struct i2c_device_id fxas21002c_id[] = {
{"fxas21002c", ID_FXAS21002C},
{}
@@ -366,6 +371,7 @@ MODULE_DEVICE_TABLE(i2c, fxas21002c_id);
static struct i2c_driver fxas21002c_driver = {
.driver = {
.name = FXAS21002C_DRV_NAME,
+ .of_match_table = fxas21002c_of_ids,
},
.probe = fxas21002c_probe,
.id_table = fxas21002c_id,
--
2.18.0

\
 
 \ /
  Last update: 2018-09-11 17:02    [W:0.099 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site