Skip to contentSkip to conversation

dt-bindings: iio: humidity: add bindings for HDC100x sensors

PATCH Superseded Michael Stecklein 2 participants 4 messages Jun 12, 2017 – Jun 18, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dt-bindings: iio: humidity: add bindings for HDC100x sensors

Add the bindings for the family of HDC100x sensors.

---
 .../devicetree/bindings/iio/humidity/hdc100x.txt         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/humidity/hdc100x.txt
Documentation/devicetree/bindings/iio/humidity/hdc100x.txt new file +16 -0
new file mode 100644
index 0000000..6f272fa
@@ -0,0 +1,16 @@
+* HDC100x temperature + humidity sensors
+
+Required properties:
+  - compatible: Should contain one of the following:
+	ti,hdc100x
+	ti,hdc1010
+	ti,hdc1050
+	ti,hdc1080
+  - reg: i2c address of the sensor
+
+Example:
+
+hdc100x@40 {
+	compatible = "ti,hdc100x";
+	reg = <0x40>;
+};
Signature · 6 lines
2.7.4

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

PATCH 2/3 iio: humidity: hdc100x: document compatible HDC10xx devices

Include datasheet links, add i2c_device_id entries, and update kconfig help for compatible HDC10xx devices: HDC1000, HDC1008, HDC1010, HDC1050, and HDC1080.

---
 drivers/iio/humidity/Kconfig   | 3 ++-
 drivers/iio/humidity/hdc100x.c | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/iio/humidity/Kconfig +2 -1
index 14b9ce4..2c0fc9a 100644
@@ -31,7 +31,8 @@ config HDC100X
 	select IIO_TRIGGERED_BUFFER
 	help
 	  Say yes here to build support for the Texas Instruments
-	  HDC1000 and HDC1008 relative humidity and temperature sensors.
+	  HDC1000, HDC1008, HDC1010, HDC1050, and HDC1080 relative
+	  humidity and temperature sensors.
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called hdc100x.
drivers/iio/humidity/hdc100x.c +9 -0
index aa17115..0e5962f 100644
@@ -13,6 +13,12 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
+ * Datasheets:
+ * http://www.ti.com/product/HDC1000/datasheet
+ * http://www.ti.com/product/HDC1008/datasheet
+ * http://www.ti.com/product/HDC1010/datasheet
+ * http://www.ti.com/product/HDC1050/datasheet
+ * http://www.ti.com/product/HDC1080/datasheet
  */
 
 #include <linux/delay.h>
@@ -414,6 +420,9 @@ static int hdc100x_remove(struct i2c_client *client)
 
 static const struct i2c_device_id hdc100x_id[] = {
 	{ "hdc100x", 0 },
+	{ "hdc1010", 0 },
+	{ "hdc1050", 0 },
+	{ "hdc1080", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, hdc100x_id);
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/3 iio: humidity: hdc100x: add match table and device id's

In reply to Michael Stecklein

Add of_match_table and point it to a list of compatible device tree device id's.

---
 drivers/iio/humidity/hdc100x.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/iio/humidity/hdc100x.c +10 -0
index 0e5962f..659d7da 100644
@@ -427,9 +427,19 @@ static const struct i2c_device_id hdc100x_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, hdc100x_id);
 
+static const struct of_device_id hdc100x_dt_ids[] = {
+	{ .compatible = "ti,hdc100x" },
+	{ .compatible = "ti,hdc1010" },
+	{ .compatible = "ti,hdc1050" },
+	{ .compatible = "ti,hdc1080" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, hdc100x_dt_ids);
+
 static struct i2c_driver hdc100x_driver = {
 	.driver = {
 		.name	= "hdc100x",
+		.of_match_table = of_match_ptr(hdc100x_dt_ids),
 	},
 	.probe = hdc100x_probe,
 	.remove = hdc100x_remove,
Signature · 1 line
2.7.4
maintainer
#3 lore raw
In reply to Michael Stecklein
Quoted 14 lines · Michael Stecklein

Add the bindings for the family of HDC100x sensors.

---
 .../devicetree/bindings/iio/humidity/hdc100x.txt         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/humidity/hdc100x.txt
Documentation/devicetree/bindings/iio/humidity/hdc100x.txt new file +0 -0
new file mode 100644
index 0000000..6f272fa

Documentation/devicetree/bindings/iio/humidity/hdc100x.txt line 5

Quoted 5 lines
Documentation/devicetree/bindings/iio/humidity/hdc100x.txt new file +5 -0
@@ -0,0 +1,16 @@
+* HDC100x temperature + humidity sensors
+
+Required properties:
+  - compatible: Should contain one of the following:
+	ti,hdc100x

No wildcards in compatible strings please.

Quoted 14 lines
Documentation/devicetree/bindings/iio/humidity/hdc100x.txt new file +11 -0
+	ti,hdc1010
+	ti,hdc1050
+	ti,hdc1080
+  - reg: i2c address of the sensor
+
+Example:
+
+hdc100x@40 {
+	compatible = "ti,hdc100x";
+	reg = <0x40>;
+};
Signature · 1 line
2.7.4