summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2021-07-13 10:16:41 +0200
committerJean Delvare <jdelvare@suse.de>2021-07-13 10:16:41 +0200
commit55888f5f001275c22126b3c419f8f8388016356a (patch)
treedcb2a71687aef73dfbeda4e3c83a80c91eaed613
parent6b9849376307e91084fc6c871e96d3d209386035 (diff)
downloadi2c-tools-git-55888f5f001275c22126b3c419f8f8388016356a.tar.gz
i2cdump: Deprecate SMBus block mode
i2cget is a better fit for this mode. Having it in i2cdump requires special-casing in various places, which makes the code harder to read and maintain. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
-rw-r--r--tools/i2cdump.813
-rw-r--r--tools/i2cdump.c4
2 files changed, 7 insertions, 10 deletions
diff --git a/tools/i2cdump.8 b/tools/i2cdump.8
index 95a9861..3014890 100644
--- a/tools/i2cdump.8
+++ b/tools/i2cdump.8
@@ -106,21 +106,16 @@ confirmation:
# i2cdump -r 0x00-0x3f 1 0x2d
.RE
.fi
-.PP
-Dump the registers of the SMBus device at address 0x69 on bus 0 (i2c-0),
-using one SMBus block read transaction with error checking enabled, after
-user confirmation:
-.nf
-.RS
-# i2cdump 0 0x69 sp
-.RE
-.fi
.SH BUGS
To report bugs or send fixes, please write to the Linux I2C mailing list
<linux-i2c@vger.kernel.org> with Cc to the current maintainer:
Jean Delvare <jdelvare@suse.de>.
+SMBus block mode is deprecated and will be removed in a future version
+of this tool.
+Please use \fIi2cget\fR instead.
+
.SH SEE ALSO
i2cdetect(8), i2cget(8), i2cset(8), i2ctransfer(8), isadump(8)
diff --git a/tools/i2cdump.c b/tools/i2cdump.c
index 4637089..b638c3d 100644
--- a/tools/i2cdump.c
+++ b/tools/i2cdump.c
@@ -43,7 +43,7 @@ static void help(void)
" b (byte, default)\n"
" w (word)\n"
" W (word on even register addresses)\n"
- " s (SMBus block)\n"
+ " s (SMBus block, deprecated)\n"
" i (I2C block)\n"
" c (consecutive byte)\n"
" Append p for SMBus PEC\n");
@@ -181,6 +181,8 @@ int main(int argc, char *argv[])
even = 1;
} else if (!strncmp(argv[flags+3], "s", 1)) {
size = I2C_SMBUS_BLOCK_DATA;
+ fprintf(stderr,
+ "SMBus block mode is deprecated, please use i2cget instead\n");
pec = argv[flags+3][1] == 'p';
} else if (!strncmp(argv[flags+3], "c", 1)) {
size = I2C_SMBUS_BYTE;