@@ -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,
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(-)