]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/cmd_i2c.c
cmd_i2c.c: reduced subaddress length to 3 bytes
[people/ms/u-boot.git] / common / cmd_i2c.c
index 8f0fc9e1d73a11bea1aa3ae80425dc1c2f51fcf9..7531702bf35e160380029f4fca3ec7a96c423cd1 100644 (file)
@@ -193,7 +193,7 @@ int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                for (j = 0; j < 8; j++) {
                        if (argv[2][j] == '.') {
                                alen = argv[2][j+1] - '0';
-                               if (alen > 4) {
+                               if (alen > 3) {
                                        cmd_usage(cmdtp);
                                        return 1;
                                }
@@ -287,7 +287,7 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        for (j = 0; j < 8; j++) {
                if (argv[2][j] == '.') {
                        alen = argv[2][j+1] - '0';
-                       if (alen > 4) {
+                       if (alen > 3) {
                                cmd_usage(cmdtp);
                                return 1;
                        }
@@ -315,10 +315,6 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                /*
                 * Wait for the write to complete.  The write can take
                 * up to 10mSec (we allow a little more time).
-                *
-                * On some chips, while the write is in progress, the
-                * chip doesn't respond.  This apparently isn't a
-                * universal feature so we don't take advantage of it.
                 */
 /*
  * No write delay with FRAM devices.
@@ -326,14 +322,6 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #if !defined(CONFIG_SYS_I2C_FRAM)
                udelay(11000);
 #endif
-
-#if 0
-               for (timeout = 0; timeout < 10; timeout++) {
-                       udelay(2000);
-                       if (i2c_probe(chip) == 0)
-                               break;
-               }
-#endif
        }
 
        return (0);
@@ -373,7 +361,7 @@ int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        for (j = 0; j < 8; j++) {
                if (argv[2][j] == '.') {
                        alen = argv[2][j+1] - '0';
-                       if (alen > 4) {
+                       if (alen > 3) {
                                cmd_usage(cmdtp);
                                return 1;
                        }
@@ -463,7 +451,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
                for (j = 0; j < 8; j++) {
                        if (argv[2][j] == '.') {
                                alen = argv[2][j+1] - '0';
-                               if (alen > 4) {
+                               if (alen > 3) {
                                        cmd_usage(cmdtp);
                                        return 1;
                                }
@@ -619,7 +607,7 @@ int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        for (j = 0; j < 8; j++) {
                if (argv[2][j] == '.') {
                        alen = argv[2][j+1] - '0';
-                       if (alen > 4) {
+                       if (alen > 3) {
                                cmd_usage(cmdtp);
                                return 1;
                        }