mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:02:20 +00:00
0eed6fc3d2
Add support for manipulating the internal heater of sht4x devices. Enabling the heater removes condensed water from the sensor surface which disturbs the relative humidity measurements. The heater can operate at three heating levels (20, 110 or 200 milliwatts). Also, two heating durations may be selected (0.1 or 1s). Once the heating time elapses the heater is automatically switched off. Changes since v3: * struct sht4x_data: add heating_complete timestamp * struct sht4x_data: add data_pending flag * heater_enable_store: return -EINVAL if input != 1 * heater_enable_store: check for data->heating_complete and update it * heater_enable_store: set data_pending flag after heating request * sht4x_read_values: msleep if heating in progress * sht4x_read_values: dont send measurement request if data_pending * heater_enable attr: make it RW * Documentation: update info about heater_enable attr Changes since v2: * heater_enable_store: remove unnecessary if * Documentation: remove incorrect info about turning off the heater * be more specific in the patch description Changes since v1: * explain the use case of the new attributes set * heater_enable attr: make it write-only * heater_enable_store: define cmd as u8 instead of u8* * heater_enable_store: remove unreachable data path * heater_enable_store: remove unnecessary lock * heater_enable_store: call i2c_master_send only if status==true * define attributes as DEVICE_ATTR_* instead of SENSOR_DEVICE_ATTR_* Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com> Message-ID: <20240930205346.2147-1-apokusinski01@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
60 lines
1.8 KiB
ReStructuredText
60 lines
1.8 KiB
ReStructuredText
.. SPDX-License-Identifier: GPL-2.0
|
|
|
|
Kernel driver sht4x
|
|
===================
|
|
|
|
Supported Chips:
|
|
|
|
* Sensirion SHT4X
|
|
|
|
Prefix: 'sht4x'
|
|
|
|
Addresses scanned: None
|
|
|
|
Datasheet:
|
|
|
|
English: https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/2_Humidity_Sensors/Datasheets/Sensirion_Humidity_Sensors_SHT4x_Datasheet.pdf
|
|
|
|
Author: Navin Sankar Velliangiri <navin@linumiz.com>
|
|
|
|
|
|
Description
|
|
-----------
|
|
|
|
This driver implements support for the Sensirion SHT4x chip, a humidity
|
|
and temperature sensor. Temperature is measured in degree celsius, relative
|
|
humidity is expressed as a percentage. In sysfs interface, all values are
|
|
scaled by 1000, i.e. the value for 31.5 degrees celsius is 31500.
|
|
|
|
Usage Notes
|
|
-----------
|
|
|
|
The device communicates with the I2C protocol. Sensors can have the I2C
|
|
address 0x44. See Documentation/i2c/instantiating-devices.rst for methods
|
|
to instantiate the device.
|
|
|
|
Sysfs entries
|
|
-------------
|
|
|
|
=============== ============================================
|
|
temp1_input Measured temperature in millidegrees Celsius
|
|
humidity1_input Measured humidity in %H
|
|
update_interval The minimum interval for polling the sensor,
|
|
in milliseconds. Writable. Must be at least
|
|
2000.
|
|
heater_power The requested heater power, in milliwatts.
|
|
Available values: 20, 110, 200 (default: 200).
|
|
heater_time The requested operating time of the heater,
|
|
in milliseconds.
|
|
Available values: 100, 1000 (default 1000).
|
|
heater_enable Enable the heater with the selected power
|
|
and for the selected time in order to remove
|
|
condensed water from the sensor surface. The
|
|
heater cannot be manually turned off once
|
|
enabled (it will automatically turn off
|
|
after completing its operation).
|
|
|
|
- 0: turned off (read-only value)
|
|
- 1: turn on
|
|
=============== ============================================
|