Skip to contentSkip to conversation

i2c: Update i2c_msg documentation to clarify write

PATCH In review Viswanath 3 participants 7 messages Feb 15, 2025 – Jul 14, 2025

Subsystems (2)
lore
Share & tools
lore

Viswanath

author
#0 lore raw

PATCH 1/2 i2c: Update i2c_msg documentation to clarify write

Update I2C_M_RD Documentation to clarify that not setting it signals a i2c_write

---
 include/uapi/linux/i2c.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/uapi/linux/i2c.h +2 -1
index 92326ebde350..fa8a35881ce1 100644
@@ -21,7 +21,8 @@
  *
  * @flags:
  *   Supported by all adapters:
- *   %I2C_M_RD: read data (from slave to master). Guaranteed to be 0x0001!
+ *   %I2C_M_RD: read data (from slave to master). Guaranteed to be 0x0001! If
+ *   not set, the action is taken to be write data (from slave to master)
  *
  *   Optional:
  *   %I2C_M_DMA_SAFE: the buffer of this message is DMA safe. Makes only sense
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/2 i2c: Fix grammatical errors in i2c_msg documentation

Fix the following grammar mistakes:
Makes only sense in -> Makes sense only in may have changed those standard protocol behaviors -> may alter the expected behavior
No functional changes.

---
 include/uapi/linux/i2c.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/uapi/linux/i2c.h +3 -3
index fa8a35881ce1..28f327366d16 100644
@@ -25,8 +25,8 @@
  *   not set, the action is taken to be write data (from slave to master)
  *
  *   Optional:
- *   %I2C_M_DMA_SAFE: the buffer of this message is DMA safe. Makes only sense
- *     in kernelspace, because userspace buffers are copied anyway
+ *   %I2C_M_DMA_SAFE: the buffer of this message is DMA safe. Makes sense only
+ *	in kernelspace, because userspace buffers are copied anyway
  *
  *   Only if I2C_FUNC_10BIT_ADDR is set:
  *   %I2C_M_TEN: this is a 10 bit chip address
@@ -67,7 +67,7 @@
  * @i2c_msg transaction segment, beginning with a (repeated) START.
  *
  * Alternatively, when the adapter supports %I2C_FUNC_PROTOCOL_MANGLING then
- * passing certain @flags may have changed those standard protocol behaviors.
+ * passing certain @flags may alter the expected behavior.
  * Those flags are only for use with broken/nonconforming slaves, and with
  * adapters which are known to support the specific mangling options they need.
  */
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 2/2] i2c: Fix grammatical errors in i2c_msg documentation

Quoted 4 lines · Viswanath

Fix the following grammar mistakes:
Makes only sense in -> Makes sense only in may have changed those standard protocol behaviors -> may alter the expected behavior

I like changing "have changed those" to "alter the" but I don't think changing "standard" to "expected" is correct.

Quoted 1 line

No functional changes.

No need to say this because it's obvious.

regards,
dan carpenter

#4 lore raw

PATCH v3 1/1 i2c: Fix grammatical errors in i2c_msg documentation

Fix the following grammatical errors in i2c_msg documentation:
1. Makes only sense in → Makes sense only in
2. may have changed those standard protocol behaviors → may alter the standard protocol behavior

---
No changes since v2 but updated to v3 because of the time elapsed.

 include/uapi/linux/i2c.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/i2c.h +2 -2
index 92326ebde350..aa751389de07 100644
@@ -24,7 +24,7 @@
  *   %I2C_M_RD: read data (from slave to master). Guaranteed to be 0x0001!
  *
  *   Optional:
- *   %I2C_M_DMA_SAFE: the buffer of this message is DMA safe. Makes only sense
+ *   %I2C_M_DMA_SAFE: the buffer of this message is DMA safe. Makes sense only
  *     in kernelspace, because userspace buffers are copied anyway
  *
  *   Only if I2C_FUNC_10BIT_ADDR is set:
@@ -66,7 +66,7 @@
  * @i2c_msg transaction segment, beginning with a (repeated) START.
  *
  * Alternatively, when the adapter supports %I2C_FUNC_PROTOCOL_MANGLING then
- * passing certain @flags may have changed those standard protocol behaviors.
+ * passing certain @flags may alter the standard protocol behavior.
  * Those flags are only for use with broken/nonconforming slaves, and with
  * adapters which are known to support the specific mangling options they need.
  */
Signature · 1 line
2.49.0
#5 lore raw

Re: [PATCH v3] i2c: Fix grammatical errors in i2c_msg documentation

Quoted 8 lines · I Viswanath

Fix the following grammatical errors in i2c_msg documentation:
1. Makes only sense in → Makes sense only in
2. may have changed those standard protocol behaviors → may alter the standard protocol behavior

---
No changes since v2 but updated to v3 because of the time elapsed.

I think you have messaged the wrong people as Dan and the kernel-janitors list are not maintainers for the code you have touched no one could take your patch.

Instead the following people maintain it:

$ ./scripts/get_maintainer.pl --no-rolestats -f include/uapi/linux/i2c.h
Wolfram Sang <[email protected]>
[email protected]
[email protected]

Also see the [relevant section][0] in the Submitting Patches document.

Cheers,
Chris

[0]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#select-the-recipients-for-your-patch

#6 lore raw
In reply to Viswanath
Quoted 2 lines · Viswanath

Update I2C_M_RD Documentation to clarify that not setting it signals a i2c_write

Period on the end of the sentence.

Quoted 2 lines

Hi, there isn't a kernel-janitors tree. This has to be sent to:

$ ./scripts/get_maintainer.pl -f include/uapi/linux/i2c.h
Wolfram Sang <[email protected]> (maintainer:I2C SUBSYSTEM)
[email protected] (open list:I2C SUBSYSTEM)
[email protected] (open list)

regards,
dan carpenter