Skip to contentSkip to conversation

w1: ds2482: add device tree probe support

PATCH In review Hector Palacios 2 participants 2 messages Mar 25, 2013 – Mar 29, 2013

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

PATCH 1/1 w1: ds2482: add device tree probe support

It adds device tree probe support for ds2482 driver.

---
 .../devicetree/bindings/i2c/trivial-devices.txt    |    1 +
 drivers/w1/masters/ds2482.c                        |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/i2c/trivial-devices.txt +1 -0
index 446859f..c16882b 100644
@@ -36,6 +36,7 @@ fsl,mma8450		MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
 fsl,mpr121		MPR121: Proximity Capacitive Touch Sensor Controller
 fsl,sgtl5000		SGTL5000: Ultra Low-Power Audio Codec
 maxim,ds1050		5 Bit Programmable, Pulse-Width Modulator
+maxim,ds2482		i2c to w1-master bridge(s)
 maxim,max1237		Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
 maxim,max6625		9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface
 mc,rv3029c2		Real Time Clock Module with I2C-Bus
drivers/w1/masters/ds2482.c +8 -1
index 6429b9e..a93e431 100644
@@ -19,6 +19,7 @@
 #include <linux/i2c.h>
 #include <linux/delay.h>
 #include <asm/delay.h>
+#include <linux/of_device.h>
 
 #include "../w1.h"
 #include "../w1_int.h"
@@ -85,7 +86,6 @@ static int ds2482_probe(struct i2c_client *client,
 			const struct i2c_device_id *id);
 static int ds2482_remove(struct i2c_client *client);
 
-
 /**
  * Driver data (common to all clients)
  */
@@ -94,10 +94,17 @@ static const struct i2c_device_id ds2482_id[] = {
 	{ }
 };
 
+static const struct of_device_id ds2482_dt_ids[] = {
+	{ .compatible = "maxim,ds2482" },
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, ds2482_dt_ids);
+
 static struct i2c_driver ds2482_driver = {
 	.driver = {
 		.owner	= THIS_MODULE,
 		.name	= "ds2482",
+		.of_match_table = ds2482_dt_ids,
 	},
 	.probe		= ds2482_probe,
 	.remove		= ds2482_remove,
Signature · 1 line
1.7.9.5