Skip to content

Commit 339bca4

Browse files
jbrun3tgroeck
authored andcommitted
hwmon: (pmbus/tps25990) Add initial support
Add initial support for the Texas Instruments TPS25990 eFuse. This adds the basic PMBUS telemetry support for the device. From Karol Przybylski: The tps25990_read_word_data function contains a block of unreachable code caused by the syntactic structure in the PMBUS_VIRT_READ_IIN_MAX case. Specifically, the return TPS25990_READ_IIN_PEAK; statement immediately exits the function, making the next lines unreachable. This patch removes the return statement, leaving the expected handling. Discovered in coverity: CID 1602227 Tested-by: Vaishnav Achath <[email protected]> Signed-off-by: Jerome Brunet <[email protected]> [groeck: Adjust to MODULE_IMPORT_NS API change] [[email protected]: Fix unreachable code in tps25990_read_word_data] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 83bed3c commit 339bca4

File tree

6 files changed

+604
-0
lines changed

6 files changed

+604
-0
lines changed

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ Hardware Monitoring Kernel Drivers
236236
tmp464
237237
tmp513
238238
tps23861
239+
tps25990
239240
tps40422
240241
tps53679
241242
tps546d24

Documentation/hwmon/tps25990.rst

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Kernel driver tps25990
4+
======================
5+
6+
Supported chips:
7+
8+
* TI TPS25990
9+
10+
Prefix: 'tps25990'
11+
12+
* Datasheet
13+
14+
Publicly available at Texas Instruments website: https://www.ti.com/lit/gpn/tps25990
15+
16+
Author:
17+
18+
Jerome Brunet <[email protected]>
19+
20+
Description
21+
-----------
22+
23+
This driver implements support for TI TPS25990 eFuse.
24+
This is an integrated, high-current circuit protection and power
25+
management device with PMBUS interface
26+
27+
Device compliant with:
28+
29+
- PMBus rev 1.3 interface.
30+
31+
Device supports direct format for reading input voltages,
32+
output voltage, input current, input power and temperature.
33+
34+
Due to the specificities of the chip, all history reset attributes
35+
are tied together. Resetting the history of a sensor, resets the
36+
history of all the sensors.
37+
38+
The driver exports the following attributes via the 'sysfs' files
39+
for input current:
40+
41+
**curr1_average**
42+
43+
**curr1_crit**
44+
45+
**curr1_crit_alarm**
46+
47+
**curr1_highest**
48+
49+
**curr1_input**
50+
51+
**curr1_label**
52+
53+
**curr1_max**
54+
55+
**curr1_max_alarm**
56+
57+
**curr1_reset_history**
58+
59+
The driver provides the following attributes for main input voltage:
60+
61+
**in1_average**
62+
63+
**in1_crit**
64+
65+
**in1_crit_alarm**
66+
67+
**in1_highest**
68+
69+
**in1_input**
70+
71+
**in1_label**
72+
73+
**in1_lcrit**
74+
75+
**in1_lcrit_alarm**
76+
77+
**in1_lowest**
78+
79+
**in1_max**
80+
81+
**in1_max_alarm**
82+
83+
**in1_min**
84+
85+
**in1_min_alarm**
86+
87+
**in1_reset_history**
88+
89+
The driver provides the following attributes for auxiliary input voltage:
90+
91+
**in2_input**
92+
93+
**in2_label**
94+
95+
The driver provides the following attributes for output voltage:
96+
97+
**in3_average**
98+
99+
**in3_input**
100+
101+
**in3_label**
102+
103+
**in3_lowest**
104+
105+
**in3_min**
106+
107+
**in3_min_alarm**
108+
109+
**in3_reset_history**
110+
111+
The driver provides the following attributes for input power:
112+
113+
**power1_alarm**
114+
115+
**power1_average**
116+
117+
**power1_input**
118+
119+
**power1_input_highest**
120+
121+
**power1_label**
122+
123+
**power1_max**
124+
125+
**power1_reset_history**
126+
127+
The driver provides the following attributes for temperature:
128+
129+
**temp1_average**
130+
131+
**temp1_crit**
132+
133+
**temp1_crit_alarm**
134+
135+
**temp1_highest**
136+
137+
**temp1_input**
138+
139+
**temp1_max**
140+
141+
**temp1_max_alarm**
142+
143+
**temp1_reset_history**
144+
145+
The driver provides the following attributes for sampling:
146+
147+
**samples**

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23218,6 +23218,8 @@ M: Jerome Brunet <[email protected]>
2321823218
2321923219
S: Maintained
2322023220
F: Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
23221+
F: Documentation/hwmon/tps25990.rst
23222+
F: drivers/hwmon/pmbus/tps25990.c
2322123223

2322223224
TEXAS INSTRUMENTS TPS23861 PoE PSE DRIVER
2322323225
M: Robert Marko <[email protected]>

drivers/hwmon/pmbus/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,23 @@ config SENSORS_TDA38640_REGULATOR
510510
If you say yes here you get regulator support for Infineon
511511
TDA38640 as regulator.
512512

513+
config SENSORS_TPS25990
514+
tristate "TI TPS25990"
515+
help
516+
If you say yes here you get hardware monitoring support for TI
517+
TPS25990.
518+
519+
This driver can also be built as a module. If so, the module will
520+
be called tps25990.
521+
522+
config SENSORS_TPS25990_REGULATOR
523+
bool "Regulator support for TPS25990 and compatibles"
524+
depends on SENSORS_TPS25990 && REGULATOR
525+
default SENSORS_TPS25990
526+
help
527+
If you say yes here you get regulator support for Texas Instruments
528+
TPS25990.
529+
513530
config SENSORS_TPS40422
514531
tristate "TI TPS40422"
515532
help

drivers/hwmon/pmbus/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ obj-$(CONFIG_SENSORS_PXE1610) += pxe1610.o
5151
obj-$(CONFIG_SENSORS_Q54SJ108A2) += q54sj108a2.o
5252
obj-$(CONFIG_SENSORS_STPDDC60) += stpddc60.o
5353
obj-$(CONFIG_SENSORS_TDA38640) += tda38640.o
54+
obj-$(CONFIG_SENSORS_TPS25990) += tps25990.o
5455
obj-$(CONFIG_SENSORS_TPS40422) += tps40422.o
5556
obj-$(CONFIG_SENSORS_TPS53679) += tps53679.o
5657
obj-$(CONFIG_SENSORS_TPS546D24) += tps546d24.o

0 commit comments

Comments
 (0)