i3c: Add HDR API support
authorFrank Li <Frank.Li@nxp.com>
Thu, 6 Nov 2025 17:36:00 +0000 (12:36 -0500)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 28 Nov 2025 23:39:07 +0000 (00:39 +0100)
commit256a21743d911f94ce92fe28f793cd586f3860b2
tree4e0bda02fa7a51ea94b0dad752b73a2efff778a0
parentde53ad6ca49e5d73bba72d24b49ec5d40f33ee01
i3c: Add HDR API support

Rename struct i3c_priv_xfer to struct i3c_xfer, since private xfer in the
I3C spec refers only to SDR transfers. Ref: i3c spec ver1.2, section 3,
Technical Overview.

i3c_xfer will be used for both SDR and HDR.

Rename enum i3c_hdr_mode to i3c_xfer_mode. Previous definition need match
CCC GET_CAP1 bit position. Use 31 as SDR transfer mode.

Add i3c_device_do_xfers() with an xfer mode argument, while keeping
i3c_device_do_priv_xfers() as a wrapper that calls i3c_device_do_xfers()
with I3C_SDR for backward compatibility.

Introduce a 'cmd' field in struct i3c_xfer as an anonymous union with
'rnw', since HDR mode uses read/write commands instead of the SDR address
bit.

Add .i3c_xfers() callback for master controllers. If not implemented, fall
back to SDR with .priv_xfers(). The .priv_xfers() API can be removed once
all controllers switch to .i3c_xfers().

Add 'mode_mask' bitmask to advertise controller capability.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251106-i3c_ddr-v11-1-33a6a66ed095@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/device.c
drivers/i3c/internals.h
drivers/i3c/master.c
include/linux/i3c/device.h
include/linux/i3c/master.h