Thread (24 messages) 24 messages, 4 authors, 2025-10-24

Re: [PATCH v6 2/5] i3c: master: svc: Replace bool rnw with union for HDR support

From: Frank Li <Frank.li@nxp.com>
Date: 2025-10-23 15:21:48
Also in: imx, linux-i3c, linux-iio, lkml

On Thu, Oct 23, 2025 at 11:26:37AM +0300, Andy Shevchenko wrote:
On Tue, Oct 14, 2025 at 12:40:01PM -0400, Frank Li wrote:
quoted
Replace the bool rnw field with a union in preparation for adding HDR
support. HDR uses a cmd field instead of the rnw bit to indicate read or
write direction.

Add helper function svc_cmd_is_read() to check transfer direction.

Add a local variable 'rnw' in svc_i3c_master_priv_xfers() to avoid
repeatedly accessing xfers[i].rnw.

No functional change.
...
quoted
 struct svc_i3c_cmd {
 	u8 addr;
-	bool rnw;
+	union {
+		bool rnw;
+		u8 cmd;
+		u32 rnw_cmd;
+	};
Same Q, what is the selector?
Choose by transfer mode in callbeck i3c_xfers(..., mode).
quoted
 	u8 *in;
 	const void *out;
 	unsigned int len;
quoted
 }
quoted
+static bool svc_cmd_is_read(u32 rnw_cmd, u32 type)
+{
+	return rnw_cmd;
+}
Useless?
Just prepare for HDR support.  HDR mode is difference method to check read
or write.

Frank
--
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help