Re: [PATCH v2] rtc: rtc-ds1307: add temperature sensor support for ds3231

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/22/2016 09:57 AM, Akinobu Mita wrote:
DS3231 has the temperature registers with a resolution of 0.25
degree celsius.  This enables to get the value through hwmon.

	# cat /sys/class/i2c-adapter/i2c-2/2-0068/hwmon/hwmon0/temp1_input
	21000

Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Cc: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx>
Cc: rtc-linux@xxxxxxxxxxxxxxxx
Cc: Jean Delvare <jdelvare@xxxxxxxx>
Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
Cc: lm-sensors@xxxxxxxxxxxxxx
---
* v2
- convert to use hwmon framework, suggested by Alexandre Belloni

  drivers/rtc/rtc-ds1307.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 122 insertions(+)

diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c

Something else, on top of my previous comments.

+#if IS_ENABLED(CONFIG_HWMON)

I don't think this will work as intended. It will fail if the ds1307 driver
is built into the kernel but hwmon is built as module.

Check configurations such as BE2NET_HWMON or NET_DSA_HWMON for ideas
on how to handle this problem.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux