Re: [PATCH v2 2/2] hwmon: (ina238) Add support for INA780

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gunter,

On 28/08/2025 04:04, Guenter Roeck wrote:
> Chis,
>
> On Fri, Aug 08, 2025 at 03:05:10PM +1200, Chris Packham wrote:
>> Add support for the TI INA780 Digital Power Monitor. The INA780 uses
>> EZShunt(tm) technology, which means there are fixed LSB conversions for
>> a number of fields rather than needing to be calibrated.
>>
>> Signed-off-by: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx>
> Please send me a register dump for the chip so I can add unit test code
> for its support by the driver.

Sure. I used the following script to dump the registers

cat <<EOF | while read addr len; do printf "%2x: " $addr; i2cget -y -f 1 
0x40 $addr i $len; done
0x0 2
0x1 2
0x5 2
0x6 2
0x7 2
0x8 3
0x9 5
0xa 5
0xb 2
0xc 2
0xd 2
0xe 3
0xf 2
0x10 2
0x11 2
0x3e 2
EOF

On an unconfigured INA780A with no load just after reset

  0: 0x00 0x30
  1: 0xfb 0x68
  5: 0x00 0x00
  6: 0x0b 0x00
  7: 0x00 0x00
  8: 0x00 0x00 0x00
  9: 0x00 0x00 0x00 0x00 0x00
  a: 0xff 0xff 0xff 0xff 0x5b
  b: 0x00 0x03
  c: 0x7f 0xff
  d: 0x80 0x00
  e: 0x7f 0xff 0xff
  f: 0x00 0x00
10: 0x7f 0xf0
11: 0xff 0xff
3e: 0x54 0x49

On a INA780A with no load

  0: 0x00 0x30
  1: 0xfb 0x6a
  5: 0x00 0x00
  6: 0x0b 0x00
  7: 0x00 0x00
  8: 0x00 0x00 0x00
  9: 0x00 0x00 0x00 0x00 0x00
  a: 0xff 0xff 0xff 0xff 0xd8
  b: 0x20 0x03
  c: 0x7f 0xff
  d: 0x80 0x00
  e: 0x7f 0xff 0xff
  f: 0x00 0x00
10: 0x7f 0xf0
11: 0xff 0xff
3e: 0x54 0x49

corresponding lm-sensors output

ina780-i2c-1-40
Adapter: i2c-0-mux (chan_id 0)
in0:           0.00 V  (min =  +0.00 V, max = +102.40 V)
temp1:        +22.0 C  (high = +255.9 C)
power1:        0.00 W  (max =   2.06 kW)
energy1:       0.00 J
curr1:         0.00 A  (min = -78.64 A, max = +78.64

On a INA780A with 10V, 4A load

  0: 0x00 0x30
  1: 0xfb 0x6a
  5: 0x0d 0x75
  6: 0x0b 0x20
  7: 0x06 0x5f
  8: 0x01 0x57 0x0a
  9: 0x00 0x00 0x03 0x94 0xcd
  a: 0x00 0x00 0x11 0x4b 0xaa
  b: 0x20 0x03
  c: 0x7f 0xff
  d: 0x80 0x00
  e: 0x7f 0xff 0xff
  f: 0x00 0x00
10: 0x7f 0xf0
11: 0xff 0xff
3e: 0x54 0x49

corresponding lm-sensors output

ina780-i2c-1-40
Adapter: i2c-0-mux (chan_id 0)
in0:          10.77 V  (min =  +0.00 V, max = +102.40 V)
temp1:        +22.2 C  (high = +255.9 C)
power1:       42.06 mW (max =   2.06 kW)
energy1:       2.80 J
curr1:         3.91 A  (min = -78.64 A, max = +78.64 A)

And for good measure a word-wise dump (same config and load as above)

[root@linuxbox ~]# i2cdump -y -f 1 0x40 w
      0,8  1,9  2,a  3,b  4,c  5,d  6,e  7,f
00: 3000 6afb ffff ffff ffff 760d 300b 5a06
08: 5501 0000 0000 0320 ff7f 0080 ff7f 0000
10: f07f ffff ffff ffff ffff ffff ffff ffff
18: ffff ffff ffff ffff ffff ffff ffff ffff
20: ffff ffff ffff ffff ffff ffff ffff ffff
28: ffff ffff ffff ffff ffff ffff ffff ffff
30: ffff ffff ffff ffff ffff 0000 ffff ffff
38: ffff ffff ffff ffff ffff ffff 4954 6227
40: 3000 6afb ffff ffff ffff 760d 300b 5a06
48: 5501 0000 0000 0320 ff7f 0080 ff7f 0000
50: f07f ffff ffff ffff ffff ffff ffff ffff
58: ffff ffff ffff ffff ffff ffff ffff ffff
60: ffff ffff ffff ffff ffff ffff ffff ffff
68: ffff ffff ffff ffff ffff ffff ffff ffff
70: ffff ffff ffff ffff ffff 0000 ffff ffff
78: ffff ffff ffff ffff ffff ffff 4954 6227
80: 3000 6afb ffff ffff ffff 760d 300b 5a06
88: 5501 0000 0000 0320 ff7f 0080 ff7f 0000
90: f07f ffff ffff ffff ffff ffff ffff ffff
98: ffff ffff ffff ffff ffff ffff ffff ffff
a0: ffff ffff ffff ffff ffff ffff ffff ffff
a8: ffff ffff ffff ffff ffff ffff ffff ffff
b0: ffff ffff ffff ffff ffff 0000 ffff ffff
b8: ffff ffff ffff ffff ffff ffff 4954 6227
c0: 3000 6afb ffff ffff ffff 760d 300b 5a06
c8: 5501 0000 0000 0320 ff7f 0080 ff7f 0000
d0: f07f ffff ffff ffff ffff ffff ffff ffff
d8: ffff ffff ffff ffff ffff ffff ffff ffff
e0: ffff ffff ffff ffff ffff ffff ffff ffff
e8: ffff ffff ffff ffff ffff ffff ffff ffff
f0: ffff ffff ffff ffff ffff 0000 ffff ffff
f8: ffff ffff ffff ffff ffff ffff 4954 6227




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux