Skip to contentSkip to conversation

rtc: ds3232: add temperature support

PATCH Applied Kirill Esipov 2 participants 2 messages Jun 28, 2017 – Jul 5, 2017 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 rtc: ds3232: add temperature support

DS3232/DS3234 has the temperature registers with a resolution of 0.25 degree celsius. This enables to get the value through hwmon.

	# cat /sys/class/hwmon/hwmon0/temp1_input
	37250
---
 drivers/rtc/Kconfig      |   8 ++++
 drivers/rtc/rtc-ds3232.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 127 insertions(+)
drivers/rtc/Kconfig +8 -0
index 8d3b95728326..ba87c419a2d4 100644
@@ -791,6 +791,14 @@ config RTC_DRV_DS3232
 	  This driver can also be built as a module.  If so, the module
 	  will be called rtc-ds3232.
 
+config RTC_DRV_DS3232_HWMON
+	bool "HWMON support for Dallas/Maxim DS3232/DS3234"
+	depends on RTC_DRV_DS3232 && HWMON && !(RTC_DRV_DS3232=y && HWMON=m)
+	default y
+	help
+	  Say Y here if you want to expose temperature sensor data on
+	  rtc-ds3232
+
 config RTC_DRV_PCF2127
 	tristate "NXP PCF2127"
 	depends on RTC_I2C_AND_SPI
drivers/rtc/rtc-ds3232.c +119 -0

143 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw
Quoted 12 lines · Kirill Esipov

DS3232/DS3234 has the temperature registers with a resolution of 0.25 degree celsius. This enables to get the value through hwmon.

	# cat /sys/class/hwmon/hwmon0/temp1_input
	37250
---
 drivers/rtc/Kconfig      |   8 ++++
 drivers/rtc/rtc-ds3232.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 127 insertions(+)

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com