diff options
author | Ofir Bitton <obitton@habana.ai> | 2021-10-12 19:52:46 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2021-12-26 07:59:05 +0100 |
commit | 3eb7754ff43827294bebcb2760969e9dc2283027 (patch) | |
tree | ed489d8f45ae5eaefd55018ebccb585bcaf67a5a /drivers/misc/habanalabs/include | |
parent | habanalabs: make hdev creation code more readable (diff) | |
download | linux-3eb7754ff43827294bebcb2760969e9dc2283027.tar.xz linux-3eb7754ff43827294bebcb2760969e9dc2283027.zip |
habanalabs: debugfs support for larger I2C transactions
I2C debugfs support is limited to 1 byte. We extend functionality
to more than 1 byte by using one of the pad fields as a length.
No backward compatibility issues as new F/W versions will treat 0
length as a 1 byte length transaction.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/include')
-rw-r--r-- | drivers/misc/habanalabs/include/common/cpucp_if.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/include/common/cpucp_if.h b/drivers/misc/habanalabs/include/common/cpucp_if.h index 5e19c763f3f0..078fb4bd0316 100644 --- a/drivers/misc/habanalabs/include/common/cpucp_if.h +++ b/drivers/misc/habanalabs/include/common/cpucp_if.h @@ -493,7 +493,14 @@ struct cpucp_packet { __u8 i2c_bus; __u8 i2c_addr; __u8 i2c_reg; - __u8 pad; /* unused */ + /* + * In legacy implemetations, i2c_len was not present, + * was unused and just added as pad. + * So if i2c_len is 0, it is treated as legacy + * and r/w 1 Byte, else if i2c_len is specified, + * its treated as new multibyte r/w support. + */ + __u8 i2c_len; }; struct {/* For PLL info fetch */ |