All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Linux I2C <linux-i2c@vger.kernel.org>
Cc: Wolfram Sang <wsa@kernel.org>
Subject: [PATCH 2/7] i2cget: Document the support of I2C block reads
Date: Tue, 8 Jun 2021 17:29:23 +0200	[thread overview]
Message-ID: <20210608172923.0d3f9296@endymion> (raw)
In-Reply-To: <20210608172338.0cf520a1@endymion>

Mention I2C block read support in the i2cget(8) manual page, together
with an example.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 tools/i2cget.8 |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

--- i2c-tools.orig/tools/i2cget.8	2021-06-08 16:49:54.910097286 +0200
+++ i2c-tools/tools/i2cget.8	2021-06-08 16:56:26.416459188 +0200
@@ -1,4 +1,4 @@
-.TH I2CGET 8 "October 2017"
+.TH I2CGET 8 "June 2021"
 .SH "NAME"
 i2cget \- read from I2C/SMBus chip registers
 
@@ -9,7 +9,7 @@ i2cget \- read from I2C/SMBus chip regis
 .RB [ -a ]
 .I i2cbus
 .I chip-address
-.RI [ "data-address " [ mode ]]
+.RI [ "data-address " [ "mode " [ length ]]]
 .br
 .B i2cget
 .B -V
@@ -49,9 +49,11 @@ an integer between 0x00 and 0xFF. If omi
 will be read (if that makes sense for the considered chip).
 .PP
 The \fImode\fR parameter, if specified, is one of the letters \fBb\fP,
-\fBw\fP or \fBc\fP, corresponding to a read byte data, a read word data or a
-write byte/read byte transaction, respectively. A \fBp\fP can also be appended
-to the \fImode\fR parameter to enable PEC. If the \fImode\fR parameter is omitted,
+\fBw\fP, \fBc\fP, or \fBi\fP, corresponding to a read byte data, a read
+word data, a write byte/read byte, or a read I2C block transaction,
+respectively. A \fBp\fP can also be appended to the \fImode\fR parameter to
+enable PEC, except for I2C block transactions. If the \fImode\fR
+parameter is omitted,
 i2cget defaults to a read byte data transaction, unless \fIdata-address\fR is
 also omitted, in which case the default (and only valid) transaction is a
 single read byte.
@@ -112,6 +114,14 @@ concerns raised above still stand, howev
 equivalent, so this is the only way to read data from a large EEPROM if your
 master isn't fully I2C capable. With a fully I2C capable master, you would
 use \fIi2ctransfer\fR to achieve the same in a safe and faster way.
+.PP
+Read the first 8 bytes of an EEPROM device at 7-bit address 0x50
+on bus 4 (i2c-4):
+.nf
+.RS
+# i2cget -y 4 0x50 0x00 i 8
+.RE
+.fi
 
 .SH BUGS
 To report bugs or send fixes, please write to the Linux I2C mailing list

-- 
Jean Delvare
SUSE L3 Support

  parent reply	other threads:[~2021-06-08 15:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 15:23 [PATCH 0/7] Rework block read support among i2cget and i2cdump Jean Delvare
2021-06-08 15:28 ` [PATCH 1/7] i2cget: Add support for I2C block data Jean Delvare
2021-06-27 10:11   ` Wolfram Sang
2021-07-12  9:36     ` Jean Delvare
2021-06-08 15:29 ` Jean Delvare [this message]
2021-06-08 15:29 ` [PATCH 3/7] i2cget: Add support for SMBus block read Jean Delvare
2021-06-08 15:30 ` [PATCH 4/7] i2cdump: Remove dead code Jean Delvare
2021-06-08 15:30 ` [PATCH 5/7] i2cdump: Add range support with mode i (I2C block) Jean Delvare
2021-06-08 15:31 ` [PATCH 6/7] i2cdump: Deprecate SMBus block mode Jean Delvare
2021-06-08 15:32 ` [PATCH 7/7] i2cdump: Remove support for " Jean Delvare
2021-06-26 15:30 ` [PATCH 0/7] Rework block read support among i2cget and i2cdump Wolfram Sang
2021-07-12  9:58   ` Jean Delvare
2021-07-19 15:19     ` Wolfram Sang
2021-06-27 10:27 ` Wolfram Sang
2021-07-13  8:21   ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210608172923.0d3f9296@endymion \
    --to=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.