]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (lm75) Support configuring the sample time for various chips
authorGuenter Roeck <linux@roeck-us.net>
Thu, 8 Aug 2019 19:53:03 +0000 (12:53 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 3 Sep 2019 19:47:17 +0000 (12:47 -0700)
commitb9855f33c8ff4bbc03514ae6530929bdf126c0ce
treeb8d86305de8d004a126699cc33e163ee5de8dd7d
parentcedfa7ec8efecca54ed4d0d6d5635281464dad16
hwmon: (lm75) Support configuring the sample time for various chips

The conversion (sample) time is configurable for several chips supported
by the lm75 driver. With the necessary infrastructure in place, enable
this support for all chips using the configuration register for this
purpose.

DS1775:
Conversion time: 187.5, 375, 750, 1500 ms
Sensor resolution:  9, 10, 11, 12 bit
DS75, STDS75:
Conversion time: 150, 300, 600, 1200 ms
Sensor resolution:  9, 10, 11, 12 bit
DS7505:
Conversion time: 25, 50, 100, 200 ms
Sensor resolution:  9, 10, 11, 12 bit
MCP980[0123]:
Conversion time: 75, 150, 300, 600 ms
Sensor resolution:  9, 10, 11, 12 bit
TMP100, TMP101:
Conversion time: 75, 150, 300, 600 ms
Sensor resolution:  9, 10, 11, 12 bit
TMP75, TMP105, TMP175, TMP275:
Conversion time: 38, 75, 150, 300 ms
Sensor resolution:  9, 10, 11, 12 bit

While doing this, it became obvious that the masks and values to set
the converion (sample) time is similar for all those chips, and that
other chips with configurable sample times will need separate code anyway.
For that reason, replace the sample_set_masks and sample_clr_mask
configuration parameters with a single array and with a constant.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm75.c