Skip to contentSkip to conversation

iio: mma8452: add DT support

PATCH Applied Martin Fuzzey 2 participants 2 messages Jul 11, 2014 – Jul 13, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: mma8452: add DT support

Allow the mma8452 to be described in the device tree.

Since no device specific binding attributes exist the trivial I2C binding is sufficient to describe the compatible string.

---
 .../devicetree/bindings/i2c/trivial-devices.txt    |    1 +
 drivers/iio/accel/mma8452.c                        |    6 ++++++
 2 files changed, 7 insertions(+)
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 -0
index b1cb341..1705f36 100644
@@ -34,6 +34,7 @@ epson,rx8581		I2C-BUS INTERFACE REAL TIME CLOCK MODULE
 fsl,mag3110		MAG3110: Xtrinsic High Accuracy, 3D Magnetometer
 fsl,mc13892		MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
 fsl,mma8450		MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
+fsl,mma8452		MMA8452Q: 3-axis 12-bit / 8-bit Digital Accelerometer
 fsl,mpr121		MPR121: Proximity Capacitive Touch Sensor Controller
 fsl,sgtl5000		SGTL5000: Ultra Low-Power Audio Codec
 gmt,g751		G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
drivers/iio/accel/mma8452.c +6 -0
index 61eba5a..6804c2e 100644
@@ -428,9 +428,15 @@ static const struct i2c_device_id mma8452_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, mma8452_id);
 
+static const struct of_device_id mma8452_dt_ids[] = {
+	{ .compatible = "fsl,mma8452" },
+	{ }
+};
+
 static struct i2c_driver mma8452_driver = {
 	.driver = {
 		.name	= "mma8452",
+		.of_match_table = of_match_ptr(mma8452_dt_ids),
 		.pm	= MMA8452_PM_OPS,
 	},
 	.probe = mma8452_probe,
maintainer Applied
#1 lore raw
Quoted 6 lines · Martin Fuzzey

Allow the mma8452 to be described in the device tree.

Since no device specific binding attributes exist the trivial I2C binding is sufficient to describe the compatible string.

Applied to the togreg branch of iio.git

Thanks,

Quoted 43 lines
---
  .../devicetree/bindings/i2c/trivial-devices.txt    |    1 +
  drivers/iio/accel/mma8452.c                        |    6 ++++++
  2 files changed, 7 insertions(+)
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 -0
index b1cb341..1705f36 100644
@@ -34,6 +34,7 @@ epson,rx8581		I2C-BUS INTERFACE REAL TIME CLOCK MODULE
  fsl,mag3110		MAG3110: Xtrinsic High Accuracy, 3D Magnetometer
  fsl,mc13892		MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
  fsl,mma8450		MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
+fsl,mma8452		MMA8452Q: 3-axis 12-bit / 8-bit Digital Accelerometer
  fsl,mpr121		MPR121: Proximity Capacitive Touch Sensor Controller
  fsl,sgtl5000		SGTL5000: Ultra Low-Power Audio Codec
  gmt,g751		G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
drivers/iio/accel/mma8452.c +6 -1
index 61eba5a..6804c2e 100644
@@ -428,9 +428,15 @@ static const struct i2c_device_id mma8452_id[] = {
  };
  MODULE_DEVICE_TABLE(i2c, mma8452_id);
 
+static const struct of_device_id mma8452_dt_ids[] = {
+	{ .compatible = "fsl,mma8452" },
+	{ }
+};
+
  static struct i2c_driver mma8452_driver = {
  	.driver = {
  		.name	= "mma8452",
+		.of_match_table = of_match_ptr(mma8452_dt_ids),
  		.pm	= MMA8452_PM_OPS,
  	},
  	.probe = mma8452_probe,
 
--

To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html