OSDN Git Service

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)
commit7db0db3f6cced88af881520dd993c5b0044a7760
treeb8d86305de8d004a126699cc33e163ee5de8dd7d
parent4a2d78822fdf1556dfbbfaedd71182fe5b562194
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