Skip to contentSkip to conversation

hwmon: (sht15) Add device tree support

PATCH Superseded Marco Franchi 2 participants 2 messages Feb 15, 2017 1 message not in the archive

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 2/2 hwmon: (sht15) Add device tree support

Allow the driver to work with device tree support.

Based on initial patch submission from Peter Fox.

Tested on a imx7d-sdb board connected to a SHT15 board via Mikro Bus.

---
Changes since v2:
- Propagate the real error code when of_get_named_gpio() fails
- Do not print error on EPROBE_DEFER case
- Changed the sht15_probe_dt function comments to be compatible with the returns values

 Documentation/devicetree/bindings/hwmon/sht15.txt | 25 +++++++++
 drivers/hwmon/sht15.c                             | 68 +++++++++++++++++++++--
 2 files changed, 89 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/sht15.txt
Documentation/devicetree/bindings/hwmon/sht15.txt new file +25 -0
new file mode 100644
index 0000000..ddbc5a9
@@ -0,0 +1,25 @@
+Sensirion SHT15 Humidity and Temperature Sensor
+
+Required properties:
+
+ - "compatible": must be "sensirion,sht15".
+ - "data-gpios": GPIO connected to the data line.
+ - "clk-gpios": GPIO connected to the clock line.
+ - "vcc-supply": regulator that drives the VCC pin.
+
+Optional properties:
+
+ - "checksum": boolean property that when present enables the CRC validation of the readings.
+ - "no-otp-reload": boolean property that when present indicates not to reload from OTP.
+ - "low-resolution": boolean property that when present indicates that the device operates in
+		low-resolution mode.
+Example:
+
+	temp_humid_sensor: sht15 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_sensor>;
+		compatible = "sensirion,sht15";
+		clk-gpios = <&gpio4 12 0>;
+		data-gpios = <&gpio4 13 0>;
+		vcc-supply = <&reg_sht15>;
+	};
drivers/hwmon/sht15.c +64 -4

93 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH v3 1/2 dt: Add vendor prefix for Sensirion

In reply to a message not in the archive

Sensirion is a sensor manufacturer, providing relative humidity sensors, temperature sensor and flow sensor solutions.

---
Changes since v2:
- none

 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 7a98c33..43e1799 100644
@@ -263,6 +263,7 @@ sbs	Smart Battery System
 schindler	Schindler
 seagate	Seagate Technology PLC
 semtech	Semtech Corporation
+sensirion	Sensirion AG
 sgx	SGX Sensortech
 sharp	Sharp Corporation
 si-en	Si-En Technology Ltd.
Signature · 1 line
2.7.4