summaryrefslogtreecommitdiff
path: root/drivers/hwmon/sht3x.c
AgeCommit message (Collapse)Author
2019-02-18hwmon: (sht3x) Use permission specific SENSOR[_DEVICE]_ATTR variantsGuenter Roeck
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readability, and to reduce the chance of inconsistencies. Also replace any remaining S_<PERMS> in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-01-12hwmon: (sht3x) wait predefined limits loading complete before accessEmiliano Ingrassia
An sht3x sensor include limits register which contains temperature and humidity limit values. After a reset, pre-defined values are loaded into that register. During the probe function, the driver reads the limits register. However, if the reads are made too early, and the bus is clocked at high frequencies (e.g. 100 kHz or more), the loading could be not completed and the sensor returns a NACK which causes the probe to fail. A delay of at least 500 us before the first read solves this issue. Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-07-31hwmon: (sht3x) set initial jiffies to last_updateMatt Ranostay
Handling the wraparound requires the data->last_update to be set to an initial jiffies value. Otherwise on 32-bit systems you will not be able to request a reading till the 5 minute jiffies rollover happens. Cc: Guenter Roeck <linux@roeck-us.net> Cc: David Frey <david.frey@sensirion.com> Signed-off-by: Matt Ranostay <mranostay@gmail.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Fixes: 7c84f7f80d6fc ("hwmon: add support for Sensirion SHT3x sensors") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-07-16hwmon: (sht3x) add humidity heater element controlMatt Ranostay
The enables control of the SHT31 sensors heating element that can turned on to remove excess humidity. Cc: Guenter Roeck <linux@roeck-us.net> Cc: David Frey <david.frey@sensirion.com> Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-06-27hwmon: add support for Sensirion SHT3x sensorsDavid Frey
This driver implements support for the Sensirion SHT3x-DIS chip, a humidity and temperature sensor. Temperature is measured in degrees celsius, relative humidity is expressed as a percentage. In the sysfs interface, all values are scaled by 1000, i.e. the value for 31.5 degrees celsius is 31500. Signed-off-by: Pascal Sachs <pascal.sachs@sensirion.com> [groeck: Fixed 'Variable length array is used' gcc warning] Signed-off-by: Guenter Roeck <linux@roeck-us.net>