Skip to contentSkip to conversation

dt/bindings: Add bindings for JC-42.4 compatible temperature sensors

PATCH In review Guenter Roeck 2 participants 5 messages Jul 5, 2016 – Jul 11, 2016

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/3 dt/bindings: Add bindings for JC-42.4 compatible temperature sensors

Provide generic bindings for all Jedec JC-42.4 compatible temperature sensor chips.

---
 Documentation/devicetree/bindings/hwmon/jc42.txt | 42 ++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/jc42.txt
Documentation/devicetree/bindings/hwmon/jc42.txt new file +42 -0
new file mode 100644
index 000000000000..07a250498fbb
@@ -0,0 +1,42 @@
+Properties for Jedec JC-42.4 compatible temperature sensors
+
+Required properties:
+- compatible: May include a device-specific string consisting of the
+	      manufacturer and the name of the chip. A list of supported
+	      chip names follows.
+	      Must include "jedec,jc-42.4-temp" for any Jedec JC-42.4
+	      compatible temperature sensor.
+
+	      Supported chip names:
+		adi,adt7408
+		atmel,at30ts00
+		atmel,at30tse004
+		onnn,cat6095
+		onnn,cat34ts02
+		maxim,max6604
+		microchip,mcp9804
+		microchip,mcp9805
+		microchip,mcp9808
+		microchip,mcp98243
+		microchip,mcp98244
+		microchip,mcp9843
+		nxp,se97
+		nxp,se98
+		st,stts2002
+		st,stts2004
+		st,stts3000
+		st,stts424
+		st,stts424e
+		idt,tse2002
+		idt,tse2004
+		idt,ts3000
+		idt,ts3001
+
+- reg: I2C address
+
+Example:
+
+temp-sensor at 1a {
+	compatible = "jedec,jc-42.4-temp";
+	reg = <0x1a>;
+};
Signature · 1 line
2.5.0
author maintainer
#1 lore raw

PATCH 2/3 hwmon: (jc42) Add support for generic JC-42.4 devicetree binding

With this change, JC-42.4 compatible temperature sensors can be configured in devicetree by providing a generic "jedec,jc-42.4-temp" binding.

---
 drivers/hwmon/jc42.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/hwmon/jc42.c +10 -0
index 9887d3224a86..374630bab137 100644
@@ -31,6 +31,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = {
@@ -537,11 +538,20 @@ static const struct i2c_device_id jc42_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, jc42_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id jc42_of_ids[] = {
+	{ .compatible = "jedec,jc-42.4-temp", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, jc42_of_ids);
+#endif
+
 static struct i2c_driver jc42_driver = {
 	.class		= I2C_CLASS_SPD,
 	.driver = {
 		.name	= "jc42",
 		.pm = JC42_DEV_PM_OPS,
+		.of_match_table = of_match_ptr(jc42_of_ids),
 	},
 	.probe		= jc42_probe,
 	.remove		= jc42_remove,
Signature · 1 line
2.5.0
author maintainer
#2 lore raw

PATCH 3/3 ARM: dts: lpc4350-hitex-eval: Fix binding for SE97

In reply to Guenter Roeck

The 'compatible = "nxp,jc42"' binding only happened to work because the Linux driver is named jc42. The driver now supports generic bindings for JC-42 compatible chips, so use the generic binding instead.

Cc Ariel D'Alessandro <[email protected]>
Cc Joachim Eastwood <[email protected]>
---
 arch/arm/boot/dts/lpc4350-hitex-eval.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/lpc4350-hitex-eval.dts +1 -1
index 6c9048d4d03c..c97cba1d26a8 100644
@@ -424,7 +424,7 @@
 
 	/* NXP SE97BTP with temperature sensor + eeprom */
 	sensor at 18 {
-		compatible = "nxp,jc42";
+		compatible = "nxp,se97", "jedec,jc-42.4-temp";
 		reg = <0x18>;
 	};
 
Signature · 1 line
2.5.0
author maintainer
#4 lore raw
Quoted 4 lines · Rob Herring
Quoted 3 lines · Guenter Roeck

Provide generic bindings for all Jedec JC-42.4 compatible temperature sensor chips.

Quoted 8 lines
Quoted 5 lines
---
  Documentation/devicetree/bindings/hwmon/jc42.txt | 42 ++++++++++++++++++++++++
  1 file changed, 42 insertions(+)

create mode 100644 Documentation/devicetree/bindings/hwmon/jc42.txt

--

Thanks!

Guenter