From: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
"robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] hwmon: (ina238) Add support for INA780
Date: Wed, 27 Aug 2025 23:28:38 +0000 [thread overview]
Message-ID: <d371f4c2-d328-49ca-a3f3-b23b1fee68ee@alliedtelesis.co.nz> (raw)
In-Reply-To: <4381440d-cd92-40df-bf4b-53ba629abc0c@roeck-us.net>
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@alliedtelesis.co.nz>
> 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
next prev parent reply other threads:[~2025-08-27 23:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 3:05 [PATCH v2 0/2] hwmon: " Chris Packham
2025-08-08 3:05 ` [PATCH v2 1/2] dt-bindings: hwmon: ti,ina2xx: Add INA780 device Chris Packham
2025-08-08 15:52 ` Conor Dooley
2025-08-08 3:05 ` [PATCH v2 2/2] hwmon: (ina238) Add support for INA780 Chris Packham
2025-08-27 16:04 ` Guenter Roeck
2025-08-27 23:28 ` Chris Packham [this message]
2025-08-28 12:09 ` Guenter Roeck
2025-08-28 20:28 ` Guenter Roeck
2025-08-28 21:22 ` Chris Packham
2025-08-28 21:52 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d371f4c2-d328-49ca-a3f3-b23b1fee68ee@alliedtelesis.co.nz \
--to=chris.packham@alliedtelesis.co.nz \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jdelvare@suse.com \
--cc=krzk+dt@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®