Add support for Texas Instruments TMP464 and TMP468 temperature sensor
ICs.
TI's TMP464 is an I2C temperature sensor chip. This chip is
similar to TI's TMP421 chip, but with 16bit-wide registers (instead
of 8bit-wide registers). The chip has one local sensor and four
remote sensors. TMP468 is similar to TMP464 but has one local and
eight remote sensors.
Originally-from: Agathe Porte <agathe.porte@xxxxxxxxx>
Cc: Agathe Porte <agathe.porte@xxxxxxxxx>
Cc: Krzysztof Adamski <krzysztof.adamski@xxxxxxxxx>
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
v3:
- Added support for TMP468
- Added support for various limits, temperature hysteresis, alarm attributes,
and update interval
- Use regmap instead of local caching
- Use static chip configuration
- Unlock check if needed when loading driver, and lock it when unloading it
- Call tmp464_init_client() before calling tmp464_probe_from_dt()
since the latter changes registers, which requires the chip to be
unlocked.
- Restore configuration register when unloading driver
- ti,n-factor is optional, so don't fail if the property is not present
Notes:
- Tested with real TMP468. Module tested for TMP464.
- I was not able to test with a system supporting devicetree;
especially negative values for "ti,n-factor" need testing
(and I wonder if of_property_read_s8() would be needed to
support this properly).