hwmon: (max31827) Add custom attribute for resolution
authorDaniel Matyas <daniel.matyas@analog.com>
Tue, 31 Oct 2023 18:21:57 +0000 (20:21 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 11 Dec 2023 14:42:58 +0000 (06:42 -0800)
commit29a9ac6414abd634e7f460a250b70a452d9a04b9
tree1c21f26532c296844bcfdf7323763abcd3b22730
parent64176bde4645686590bb0e5efcbcd18497ee4389
hwmon: (max31827) Add custom attribute for resolution

Added custom channel-specific (temp1) attribute for resolution. The wait
time for a conversion in one-shot mode (enable = 0) depends on the
resolution.

When resolution is 12-bit, the conversion time is 140ms, but the minimum
update_interval is 125ms. Handled this problem by waiting an additional
15ms (125ms + 15ms = 140ms).

Added 'mask' parameter to the shutdown_write() function. Now it can
either write or update bits, depending on the value of mask. This is
needed, because for alarms a write is necessary, but for resolution only
the resolution bits should be updated.

Signed-off-by: Daniel Matyas <daniel.matyas@analog.com>
Link: https://lore.kernel.org/r/20231031182158.124608-5-daniel.matyas@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/max31827.rst
drivers/hwmon/max31827.c