hwmon: new driver for ST stts751 thermal sensor
Subsystems (2)
PATCH v6 1/2 hwmon: new driver for ST stts751 thermal sensor
This patch adds a HWMON driver for ST Microelectronics STTS751 temperature sensors.
Changes since V3:
- fix sysfs_notify() filename
- simplify error exit path in stts751_update_temp(): kill useless goto
- fix set function were racy due to lock incorrectly placed
- use msecs_to_jiffies instead of manual calculation
- fix jiffies and msecs were mixed up
- don't mark cache as good unless reads really succeded to fill up it
- when updating therm, hyst keeps relative value rather than abs value
- don't should in dev_dbg when chip is detected
- don't ever generate two uevents
- clarify clear-on-read behaviour of status reg alarm flags
- simplify mDEG to HW conversion function
- fix chip stops due to incorrect resolution configuration
- fix incorrectly reading negative numbers from HW
Changes since V4:
- fix continuation lines (style, remove uncecessary, ..)
- shorten a unnecessary verbose dev_warn() message
- fix set_interval() exitpath didn't return error
- change uncecesary neg-logic
- change file symbolic permissions with octal
- move chip revision test in probe(), change dev_notice() in dev_dbg()
- use "return 0" on success (non functional change)
- add further checks in i2c detect function
- fix i2c detect function read wrong reg while checking for manufacturer ID
Changes since V5:
- fix mixed usage of i2c dev and hwmon dev for logging functions
- avoid max/min alert log spam
Thanks-to: LABBE Corentin [for suggestions]
Thanks-to: Guenter Roeck [for suggestion and discussions]
--- drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/stts751.c | 834 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 845 insertions(+) create mode 100644 drivers/hwmon/stts751.c
drivers/hwmon/Kconfig +10 -0
@@ -1448,6 +1448,16 @@ config SENSORS_SCH5636 This driver can also be built as a module. If so, the module will be called sch5636. +config SENSORS_STTS751 + tristate "ST Microelectronics STTS751" + depends on I2C + help + If you say yes here you get support for STTS751 + temperature sensor chips. + + This driver can also be built as a module. If so, the module + will be called stts751. + config SENSORS_SMM665 tristate "Summit Microelectronics SMM665" depends on I2C
drivers/hwmon/Makefile +1 -0
@@ -147,6 +147,7 @@ obj-$(CONFIG_SENSORS_SMM665) += smm665.o obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o +obj-$(CONFIG_SENSORS_STTS751) += stts751.o obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o obj-$(CONFIG_SENSORS_TC74) += tc74.o obj-$(CONFIG_SENSORS_THMC50) += thmc50.o
drivers/hwmon/stts751.c new file +834 -0
834 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v6 2/2 DT: add binding documentation for STTS751
--- Documentation/devicetree/bindings/hwmon/stts751.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/stts751.txt
Documentation/devicetree/bindings/hwmon/stts751.txt new file +15 -0
@@ -0,0 +1,15 @@ +* STTS751 thermometer. + +Required node properties: +- compatible: "stts751" +- reg: I2C bus address of the device + +Optional properties: +- smbus-timeout-disable: when set, the smbus timeout function will be disabled + +Example stts751 node: + +temp-sensor { + compatible = "stts751"; + reg = <0x48>; +}
Signature · 1 line
2.7.4
Re: [PATCH v6 2/2] DT: add binding documentation for STTS751
Quoted 4 lines · Andrea Merello
Signed-off-by Andrea Merello <[email protected]>Cc Rob Herring <[email protected]>Cc Mark Rutland <[email protected]>---
Applied to hwmon-next.
Guenter
Quoted 26 lines
Documentation/devicetree/bindings/hwmon/stts751.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/stts751.txtDocumentation/devicetree/bindings/hwmon/stts751.txt new file +15
-0@@ -0,0 +1,15 @@ +* STTS751 thermometer. + +Required node properties: +- compatible: "stts751" +- reg: I2C bus address of the device + +Optional properties: +- smbus-timeout-disable: when set, the smbus timeout function will be disabled + +Example stts751 node: + +temp-sensor { + compatible = "stts751"; + reg = <0x48>; +}
Quoted 33 lines · Andrea Merello
This patch adds a HWMON driver for ST Microelectronics STTS751 temperature sensors.
Changes since V3:
- fixsysfs_notify()filename
- simplify error exit path instts751_update_temp(): kill useless goto
- fix set function were racy due to lock incorrectly placed
- usemsecs_to_jiffiesinstead of manual calculation
- fix jiffies and msecs were mixed up
- don't mark cache as good unless reads really succeded to fill up it
- when updating therm, hyst keeps relative value rather than abs value
- don't should indev_dbgwhen chip is detected
- don't ever generate two uevents
- clarify clear-on-read behaviour of status reg alarm flags
- simplify mDEG to HW conversion function
- fix chip stops due to incorrect resolution configuration
- fix incorrectly reading negative numbers from HWChanges since V4:
- fix continuation lines (style, remove uncecessary, ..)
- shorten a unnecessary verbosedev_warn()message
- fixset_interval()exitpath didn't return error
- change uncecesary neg-logic
- change file symbolic permissions with octal
- move chip revision test inprobe(), changedev_notice()indev_dbg()
- use "return 0" on success (non functional change)
- add further checks in i2c detect function
- fix i2c detect function read wrong reg while checking for manufacturer IDChanges since V5:
- fix mixed usage of i2c dev and hwmon dev for logging functions
- avoid max/min alert log spam
Quoted 6 lines
Thanks-to: LABBE Corentin [for suggestions]
Thanks-to: Guenter Roeck [for suggestion and discussions]Signed-off-by Andrea Merello <[email protected]>Cc LABBE Corentin <[email protected]>Cc Guenter Roeck <[email protected]>Cc Jean Delvare <[email protected]>
Applied to hwmon-next.
Guenter