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

Frank Li Frank.li at nxp.com
Thu Oct 23 08:21:37 PDT 2025


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:
> > 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.
>
> ...
>
> >  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).

>
> >  	u8 *in;
> >  	const void *out;
> >  	unsigned int len;
>
> >  }
>
> > +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
>
>



More information about the linux-i3c mailing list