summaryrefslogtreecommitdiff
path: root/Documentation/hwmon/tsc1641.rst
blob: 425e25f7a7d157a07005e17db7cbd1b12a896010 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.. SPDX-License-Identifier: GPL-2.0-only

Kernel driver tsc1641
=====================

Supported chips:

  * ST TSC1641

    Prefix: 'tsc1641'

    Addresses scanned: -

    Datasheet:
	https://www.st.com/resource/en/datasheet/tsc1641.pdf

Author:
	- Igor Reznichenko <igor@reznichenko.net>


Description
-----------

The TSC1641 is a high-precision current, voltage, power, and temperature
monitoring analog front-end (AFE). It monitors bidirectional current into a
shunt resistor and load voltage up to 60 V in a synchronized way. Digital bus
interface is I2C/SMbus. The TSC1641 allows the assertion of several alerts
regarding the voltage, current, power and temperature.

Usage Notes
-----------

The TSC1641 driver requires the value of the external shunt resistor to
correctly compute current and power measurements. The resistor value, in
micro-ohms, should be provided either through the device tree property
"shunt-resistor-micro-ohms" or via writable sysfs attribute "shunt_resistor".
Please refer to the Documentation/devicetree/bindings/hwmon/st,tsc1641.yaml
for bindings if the device tree is used.

Supported range of shunt resistor values is from 100 uOhm to 655.35 mOhm, in
10 uOhm steps.
When selecting the value keep in mind device maximum DC power measurement is
1600W. See datasheet p.22 for ST recommendations on selecting shunt value.

If the shunt resistor value is not specified in the device tree, the driver
initializes it to 1000 uOhm by default. Users may configure the correct shunt
resistor value at runtime by writing to the "shunt_resistor" sysfs attribute.

The driver only supports continuous operating mode.
Measurement ranges:

================ ===============================================================
Current          Bidirectional, dependent on shunt
Bus voltage      0-60V
Maximum DC power 1600W
Temperature      -40C to +125C
================ ===============================================================

Sysfs entries
-------------

==================== ===========================================================
in0_input            bus voltage (mV)
in0_max              bus voltage max alarm limit (mV)
in0_max_alarm        bus voltage max alarm limit exceeded
in0_min              bus voltage min alarm limit (mV)
in0_min_alarm        bus voltage min alarm limit exceeded

curr1_input          current measurement (mA)
curr1_max            current max alarm limit (mA)
curr1_max_alarm      current max alarm limit exceeded
curr1_min            current min alarm limit (mA)
curr1_min_alarm      current min alarm limit exceeded

power1_input         power measurement (uW)
power1_max           power max alarm limit (uW)
power1_max_alarm     power max alarm limit exceeded

shunt_resistor       shunt resistor value (uOhms)

temp1_input          temperature measurement (mdegC)
temp1_max            temperature max alarm limit (mdegC)
temp1_max_alarm      temperature max alarm limit exceeded

update_interval      data conversion time (1 - 33ms), longer conversion time
                     corresponds to higher effective resolution in bits
==================== ===========================================================