^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) Kernel driver tmp513
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Texas Instruments TMP512
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Prefix: 'tmp512'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Datasheet: https://www.ti.com/lit/ds/symlink/tmp512.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Texas Instruments TMP513
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Prefix: 'tmp513'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Datasheet: https://www.ti.com/lit/ds/symlink/tmp513.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Authors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Eric Tremblay <etremblay@distech-controls.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) This driver implements support for Texas Instruments TMP512, and TMP513.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) The TMP512 (dual-channel) and TMP513 (triple-channel) are system monitors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) that include remote sensors, a local temperature sensor, and a high-side current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) shunt monitor. These system monitors have the capability of measuring remote
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) temperatures, on-chip temperatures, and system voltage/power/current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) consumption.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) The temperatures are measured in degrees Celsius with a range of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) -40 to + 125 degrees with a resolution of 0.0625 degree C.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) For hysteresis value, only the first channel is writable. Writing to it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) will affect all other values since each channels are sharing the same
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) hysteresis value. The hysteresis is in degrees Celsius with a range of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 0 to 127.5 degrees with a resolution of 0.5 degree.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) The driver exports the temperature values via the following sysfs files:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) **temp[1-4]_input**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) **temp[1-4]_crit**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) **temp[1-4]_crit_alarm**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) **temp[1-4]_crit_hyst**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) The driver read the shunt voltage from the chip and convert it to current.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) The readable range depends on the "ti,pga-gain" property (default to 8) and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) shunt resistor value. The value resolution will be equal to 10uV/Rshunt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) The driver exports the shunt currents values via the following sysFs files:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) **curr1_input**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) **curr1_lcrit**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) **curr1_lcrit_alarm**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) **curr1_crit**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) **curr1_crit_alarm**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) The bus voltage range is read from the chip with a resolution of 4mV. The chip
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) can be configurable in two different range (32V or 16V) using the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) ti,bus-range-microvolt property in the devicetree.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) The driver exports the bus voltage values via the following sysFs files:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) **in0_input**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) **in0_lcrit**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) **in0_lcrit_alarm**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) **in0_crit**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) **in0_crit_alarm**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) The bus power and bus currents range and resolution depends on the calibration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) register value. Those values are calculate by the hardware using those
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) formulas:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) Current = (ShuntVoltage * CalibrationRegister) / 4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) Power = (Current * BusVoltage) / 5000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) The driver exports the bus current and bus power values via the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) sysFs files:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) **curr2_input**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) **power1_input**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) **power1_crit**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) **power1_crit_alarm**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) The calibration process follow the procedure of the datasheet (without overflow)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) and depend on the shunt resistor value and the pga_gain value.