Skip to content

Commit bf1bb26

Browse files
AndreyLalaevgroeck
authored andcommitted
hwmon: add driver for HTU31
Add base support for HTU31 temperature and humidity sensor. Besides temperature and humidity values, the driver also exports a 24-bit heater control to sysfs and serial number to debugfs. Signed-off-by: Andrei Lalaev <[email protected]> Link: https://lore.kernel.org/r/[email protected] [groeck: Fixed continuation line alignment] Signed-off-by: Guenter Roeck <[email protected]>
1 parent fb36a0b commit bf1bb26

File tree

6 files changed

+406
-0
lines changed

6 files changed

+406
-0
lines changed

Documentation/hwmon/htu31.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.. SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
Kernel driver HTU31
4+
====================
5+
6+
Supported chips:
7+
8+
* Measurement Specialties HTU31
9+
10+
Prefix: 'htu31'
11+
12+
Addresses scanned: -
13+
14+
Datasheet: Publicly available from https://www.te.com/en/product-CAT-HSC0007.html
15+
16+
Author:
17+
18+
- Andrei Lalaev <[email protected]>
19+
20+
Description
21+
-----------
22+
23+
HTU31 is a humidity and temperature sensor.
24+
25+
Supported temperature range is from -40 to 125 degrees Celsius.
26+
27+
Communication with the device is performed via I2C protocol. Sensor's default address
28+
is 0x40.
29+
30+
sysfs-Interface
31+
---------------
32+
33+
=================== =================
34+
temp1_input: temperature input
35+
humidity1_input: humidity input
36+
heater_enable: heater control
37+
=================== =================

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Hardware Monitoring Kernel Drivers
8686
hih6130
8787
hp-wmi-sensors
8888
hs3001
89+
htu31
8990
ibmaem
9091
ibm-cffps
9192
ibmpowernv

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10690,6 +10690,12 @@ W: http://www.st.com/
1069010690
F: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml
1069110691
F: drivers/iio/humidity/hts221*
1069210692

10693+
HTU31 Hardware Temperature and Humidity Sensor
10694+
M: Andrei Lalaev <[email protected]>
10695+
10696+
S: Maintained
10697+
F: drivers/hwmon/htu31.c
10698+
1069310699
HUAWEI ETHERNET DRIVER
1069410700
M: Cai Huoqing <[email protected]>
1069510701

drivers/hwmon/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,17 @@ config SENSORS_HS3001
799799
This driver can also be built as a module. If so, the module
800800
will be called hs3001.
801801

802+
config SENSORS_HTU31
803+
tristate "Measurement Specialties HTU31 humidity and temperature sensor"
804+
depends on I2C
805+
select CRC8
806+
help
807+
If you say yes here you get support for the HTU31 humidity
808+
and temperature sensors.
809+
810+
This driver can also be built as a module. If so, the module
811+
will be called htu31.
812+
802813
config SENSORS_IBMAEM
803814
tristate "IBM Active Energy Manager temperature/power sensors and control"
804815
select IPMI_SI

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ obj-$(CONFIG_SENSORS_GPIO_FAN) += gpio-fan.o
9292
obj-$(CONFIG_SENSORS_GXP_FAN_CTRL) += gxp-fan-ctrl.o
9393
obj-$(CONFIG_SENSORS_HIH6130) += hih6130.o
9494
obj-$(CONFIG_SENSORS_HS3001) += hs3001.o
95+
obj-$(CONFIG_SENSORS_HTU31) += htu31.o
9596
obj-$(CONFIG_SENSORS_ULTRA45) += ultra45_env.o
9697
obj-$(CONFIG_SENSORS_I5500) += i5500_temp.o
9798
obj-$(CONFIG_SENSORS_I5K_AMB) += i5k_amb.o

0 commit comments

Comments
 (0)