From: Guenter Roeck Date: Sat, 23 Jan 2016 00:55:09 +0000 Subject: Re: [lm-sensors] [PATCH v2] rtc: rtc-ds1307: add temperature sensor support for ds3231 Message-Id: <56A2CF6D.9040300@roeck-us.net> List-Id: References: <1453485441-11667-1-git-send-email-akinobu.mita@gmail.com> In-Reply-To: <1453485441-11667-1-git-send-email-akinobu.mita@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Akinobu Mita , rtc-linux@googlegroups.com Cc: Alessandro Zummo , Alexandre Belloni , Jean Delvare , lm-sensors@lm-sensors.org 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 > Cc: Alessandro Zummo > Cc: Alexandre Belloni > Cc: rtc-linux@googlegroups.com > Cc: Jean Delvare > Cc: Guenter Roeck > Cc: lm-sensors@lm-sensors.org > --- > * 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@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors