i2ctransfer: Print modifier flags in PRINT_HEADER
PATCH 1/1 i2ctransfer: Print modifier flags in PRINT_HEADER
Print the optional message modifier flags when printing the message header. For example:
i2ctransfer -v -y 3 pr1@0x33 itr1@0x33
msg 0: addr 0x33, read, len 1, emit STOP, buf 0x10
msg 1: addr 0x33, read, len 1, ignore NACK, toggle read/write bit, buf 0x10If no optional flag is set, the output is unchanged.
Signed-off-by Benoît Monin <[email protected]>
--- tools/i2ctransfer.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
tools/i2ctransfer.c +20 -0
@@ -123,6 +123,26 @@ static void print_msgs(struct i2c_msg *msgs, __u32 nmsgs, unsigned int flags)fprintf (output,"%u" , len); else fprintf(output, "TBD"); +#ifdef I2C_M_IGNORE_NAK +if (msgs[i].flags &I2C_M_IGNORE_NAK ) +fprintf (output,", ignore NACK" ); +#endif +#ifdef I2C_M_NO_RD_ACK +if (msgs[i].flags &I2C_M_NO_RD_ACK ) +fprintf (output,", no master ACK/NACK bit" ); +#endif +#ifdef I2C_M_STOP +if (msgs[i].flags &I2C_M_STOP ) +fprintf (output,", emit STOP" ); +#endif +#ifdef I2C_M_NOSTART +if (msgs[i].flags &I2C_M_NOSTART ) +fprintf (output,", skip repeated start" ); +#endif +#ifdef I2C_M_REV_DIR_ADDR +if (msgs[i].flags &I2C_M_REV_DIR_ADDR ) +fprintf (output,", toggle read/write bit" ); +#endif }if (len && print_buf) {
---
base-commit: 5852f5375eea6ca9dabf31f4772cb8b8ecc905d8
change-id: 20260706-print-header-flags-e841fc4398ed
Best regards,
Signature · 3 lines
Benoît Monin, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Wolfram Sang
AppliedQuoted 10 lines · Benoît Monin
Print the optional message modifier flags when printing the message header. For example:
i2ctransfer -v -y 3 pr1@0x33 itr1@0x33 msg 0: addr 0x33, read, len 1, emit STOP, buf 0x10 msg 1: addr 0x33, read, len 1, ignore NACK, toggle read/write bit, buf 0x10If no optional flag is set, the output is unchanged.
Signed-off-by Benoît Monin <[email protected]>
Applied, thanks!