diff --git a/CHANGES b/CHANGES index f3e33dc..782779c 100644 --- a/CHANGES +++ b/CHANGES @@ -7,10 +7,12 @@ SVN Shorten the usage message i2cdump: Support i2c bus passed by name Shorten the usage message + Restrict the chip address to 0x03-0x77 i2cget: Support i2c bus passed by name Shorten the usage message i2cset: Support i2c bus passed by name Shorten the usage message + Restrict the chip address to 0x03-0x77 3.0.1 (2008-04-04) Drop the trailing .pl from all perl script names diff --git a/tools/i2cdump.8 b/tools/i2cdump.8 index 7802b29..246e5cd 100644 --- a/tools/i2cdump.8 +++ b/tools/i2cdump.8 @@ -45,7 +45,7 @@ scripts. At least two options must be provided to i2cdump. \fIi2cbus\fR indicates the number or name of the I2C bus to be scanned. This number should correspond to one of the busses listed by \fIi2cdetect -l\fR. \fIaddress\fR indicates the -address to be scanned on that bus, and is an integer between 0x00 and 0x7F. +address to be scanned on that bus, and is an integer between 0x03 and 0x77. .PP The \fImode\fR parameter, if specified, is one of the letters \fBb\fP, \fBw\fP, \fBs\fP, or \fBi\fP, corresponding to a read size of a single byte, a 16-bit diff --git a/tools/i2cdump.c b/tools/i2cdump.c index 36d204c..e618ee5 100644 --- a/tools/i2cdump.c +++ b/tools/i2cdump.c @@ -35,7 +35,7 @@ static void help(void) fprintf(stderr, "Usage: i2cdump [-f] [-y] [-r first-last] I2CBUS ADDRESS [MODE] [BANK [BANKREG]]\n" " I2CBUS is an integer or an I2C bus name\n" - " ADDRESS is an integer (0x00 - 0x7f)\n" + " ADDRESS is an integer (0x03 - 0x77)\n" " MODE is one of:\n" " b (byte, default)\n" " w (word)\n" @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) help(); exit(1); } - if (address < 0 || address > 0x7f) { + if (address < 0x03 || address > 0x77) { fprintf(stderr, "Error: Address out of range!\n"); help(); exit(1); diff --git a/tools/i2cget.c b/tools/i2cget.c index a8f0a60..e994f03 100644 --- a/tools/i2cget.c +++ b/tools/i2cget.c @@ -1,6 +1,6 @@ /* i2cget.c - A user-space program to read an I2C register. - Copyright (C) 2005 Jean Delvare + Copyright (C) 2005-2008 Jean Delvare Based on i2cset.c: Copyright (C) 2001-2003 Frodo Looijaard , and @@ -190,7 +190,7 @@ int main(int argc, char *argv[]) help(); address = strtol(argv[flags+2], &end, 0); - if (*end || address < 3 || address > 0x77) { + if (*end || address < 0x03 || address > 0x77) { fprintf(stderr, "Error: Chip address invalid!\n"); help(); } diff --git a/tools/i2cset.8 b/tools/i2cset.8 index eb34435..fac316f 100644 --- a/tools/i2cset.8 +++ b/tools/i2cset.8 @@ -42,7 +42,7 @@ scripts. There are four required options to i2cset. \fIi2cbus\fR indicates the number or name of the I2C bus to be scanned. This number should correspond to one of the busses listed by \fIi2cdetect -l\fR. \fIchip-address\fR specifies the -address of the chip on that bus, and is an integer between 0x00 and 0x7F. +address of the chip on that bus, and is an integer between 0x03 and 0x77. \fIdata-address\fR specifies the address on that chip to write to, and is an integer between 0x00 and 0xFF. \fIvalue\fR is the value to write to that location on the chip. diff --git a/tools/i2cset.c b/tools/i2cset.c index 72c0bed..f721b87 100644 --- a/tools/i2cset.c +++ b/tools/i2cset.c @@ -2,7 +2,7 @@ i2cset.c - A user-space program to write an I2C register. Copyright (C) 2001-2003 Frodo Looijaard , and Mark D. Studebaker - Copyright (C) 2004-2005 Jean Delvare + Copyright (C) 2004-2008 Jean Delvare This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ static void help(void) fprintf(stderr, "Usage: i2cset [-f] [-y] I2CBUS CHIP-ADDRESS DATA-ADDRESS VALUE [MODE] [MASK]\n" " I2CBUS is an integer or an I2C bus name\n" - " ADDRESS is an integer (0x00 - 0x7f)\n" + " ADDRESS is an integer (0x03 - 0x77)\n" " MODE is one of:\n" " b (byte, default)\n" " w (word)\n" @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) help(); address = strtol(argv[flags+2], &end, 0); - if (*end || address < 0 || address > 0x7f) { + if (*end || address < 0x03 || address > 0x77) { fprintf(stderr, "Error: Chip address invalid!\n"); help(); }