Skip to content

Commit 59dfa75

Browse files
Eric Tremblaygroeck
authored andcommitted
hwmon: Add driver for Texas Instruments TMP512/513 sensor chips.
TI's TMP512/513 are I2C/SMBus system monitor chips. These chips monitor the supply voltage, supply current, power consumption and provide one local and up to three (TMP513) remote temperature sensors. It has been tested using a TI TMP513 development kit (TMP513EVM) Signed-off-by: Eric Tremblay <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 17fe298 commit 59dfa75

File tree

6 files changed

+894
-0
lines changed

6 files changed

+894
-0
lines changed

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Hardware Monitoring Kernel Drivers
155155
tmp108
156156
tmp401
157157
tmp421
158+
tmp513
158159
tps40422
159160
twl4030-madc-hwmon
160161
ucd9000

Documentation/hwmon/tmp513.rst

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

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16385,6 +16385,13 @@ S: Maintained
1638516385
F: Documentation/hwmon/tmp401.rst
1638616386
F: drivers/hwmon/tmp401.c
1638716387

16388+
TMP513 HARDWARE MONITOR DRIVER
16389+
M: Eric Tremblay <[email protected]>
16390+
16391+
S: Maintained
16392+
F: Documentation/hwmon/tmp513.rst
16393+
F: drivers/hwmon/tmp513.c
16394+
1638816395
TMPFS (SHMEM FILESYSTEM)
1638916396
M: Hugh Dickins <[email protected]>
1639016397

drivers/hwmon/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,16 @@ config SENSORS_TMP421
17351735
This driver can also be built as a module. If so, the module
17361736
will be called tmp421.
17371737

1738+
config SENSORS_TMP513
1739+
tristate "Texas Instruments TMP513 and compatibles"
1740+
depends on I2C
1741+
help
1742+
If you say yes here you get support for Texas Instruments TMP512,
1743+
and TMP513 temperature and power supply sensor chips.
1744+
1745+
This driver can also be built as a module. If so, the module
1746+
will be called tmp513.
1747+
17381748
config SENSORS_VEXPRESS
17391749
tristate "Versatile Express"
17401750
depends on VEXPRESS_CONFIG

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ obj-$(CONFIG_SENSORS_TMP103) += tmp103.o
169169
obj-$(CONFIG_SENSORS_TMP108) += tmp108.o
170170
obj-$(CONFIG_SENSORS_TMP401) += tmp401.o
171171
obj-$(CONFIG_SENSORS_TMP421) += tmp421.o
172+
obj-$(CONFIG_SENSORS_TMP513) += tmp513.o
172173
obj-$(CONFIG_SENSORS_VEXPRESS) += vexpress-hwmon.o
173174
obj-$(CONFIG_SENSORS_VIA_CPUTEMP)+= via-cputemp.o
174175
obj-$(CONFIG_SENSORS_VIA686A) += via686a.o

0 commit comments

Comments
 (0)