2010-05-25 10:01:27 +00:00
|
|
|
/*
|
|
|
|
* i2c.c - i2c commands
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010 Eric Bénard <eric@eukrea.Com>, Eukréa Electromatique
|
|
|
|
*
|
|
|
|
* 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 the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <i2c/i2c.h>
|
|
|
|
|
2015-11-11 15:57:51 +00:00
|
|
|
static void i2c_probe_range(struct i2c_adapter *adapter, int startaddr, int stopaddr)
|
2010-05-25 10:01:27 +00:00
|
|
|
{
|
2015-11-11 15:57:51 +00:00
|
|
|
struct i2c_client client = {};
|
|
|
|
int addr;
|
|
|
|
int ret;
|
2010-05-25 10:01:27 +00:00
|
|
|
u8 reg;
|
|
|
|
|
|
|
|
client.adapter = adapter;
|
|
|
|
|
2015-11-11 15:57:51 +00:00
|
|
|
printf("probing i2c%d range 0x%02x-0x%02x: ", adapter->nr, startaddr, stopaddr);
|
2010-05-25 10:01:27 +00:00
|
|
|
for (addr = startaddr; addr <= stopaddr; addr++) {
|
|
|
|
client.addr = addr;
|
|
|
|
ret = i2c_write_reg(&client, 0x00, ®, 0);
|
|
|
|
if (ret == 0)
|
|
|
|
printf("0x%02x ", addr);
|
|
|
|
}
|
|
|
|
printf("\n");
|
2015-11-11 15:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int do_i2c_probe(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
struct i2c_adapter *adapter = NULL;
|
|
|
|
int startaddr = 0, stopaddr = 0x7f;
|
|
|
|
|
|
|
|
if (argc > 1) {
|
|
|
|
adapter = i2c_get_adapter(simple_strtoul(argv[1], NULL, 0));
|
|
|
|
if (!adapter)
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (argc > 2)
|
|
|
|
startaddr = simple_strtol(argv[2], NULL, 0);
|
|
|
|
if (argc > 3)
|
|
|
|
startaddr = simple_strtol(argv[3], NULL, 0);
|
|
|
|
|
|
|
|
|
|
|
|
if (startaddr > stopaddr)
|
|
|
|
return COMMAND_ERROR_USAGE;
|
|
|
|
|
|
|
|
if (stopaddr > 0x7F)
|
|
|
|
stopaddr = 0x7F;
|
|
|
|
|
|
|
|
if (adapter) {
|
|
|
|
i2c_probe_range(adapter, startaddr, stopaddr);
|
|
|
|
} else {
|
|
|
|
for_each_i2c_adapter(adapter)
|
|
|
|
i2c_probe_range(adapter, startaddr, stopaddr);
|
|
|
|
}
|
|
|
|
|
2010-05-25 10:01:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 08:28:42 +00:00
|
|
|
BAREBOX_CMD_HELP_START(i2c_probe)
|
|
|
|
BAREBOX_CMD_HELP_TEXT("Probe the i2c bus BUS, address range from START to END for devices.")
|
|
|
|
BAREBOX_CMD_HELP_END
|
2010-05-25 10:01:27 +00:00
|
|
|
|
|
|
|
BAREBOX_CMD_START(i2c_probe)
|
|
|
|
.cmd = do_i2c_probe,
|
commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 08:28:42 +00:00
|
|
|
BAREBOX_CMD_DESC("probe for an i2c device")
|
|
|
|
BAREBOX_CMD_OPTS("BUS START END")
|
commands: group 'help' output
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.
The old output format (plus grouping) is now available with 'help -v'.
Example:
Information commands:
?, devinfo, help, iomem, meminfo, version
Boot commands:
boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
...
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 14:14:05 +00:00
|
|
|
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
|
2010-05-25 10:01:27 +00:00
|
|
|
BAREBOX_CMD_HELP(cmd_i2c_probe_help)
|
|
|
|
BAREBOX_CMD_END
|
|
|
|
|
2011-12-21 13:18:57 +00:00
|
|
|
static int do_i2c_write(int argc, char *argv[])
|
2010-05-25 10:01:27 +00:00
|
|
|
{
|
|
|
|
struct i2c_adapter *adapter = NULL;
|
|
|
|
struct i2c_client client;
|
2012-05-11 20:17:08 +00:00
|
|
|
int addr = -1, reg = -1, count = -1, verbose = 0, ret, opt, i, bus = 0, wide = 0;
|
2010-05-25 10:01:27 +00:00
|
|
|
u8 *buf;
|
|
|
|
|
2014-07-10 14:19:54 +00:00
|
|
|
while ((opt = getopt(argc, argv, "a:b:r:vw")) > 0) {
|
2010-05-25 10:01:27 +00:00
|
|
|
switch (opt) {
|
|
|
|
case 'a':
|
|
|
|
addr = simple_strtol(optarg, NULL, 0);
|
|
|
|
break;
|
|
|
|
case 'r':
|
|
|
|
reg = simple_strtol(optarg, NULL, 0);
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
bus = simple_strtoul(optarg, NULL, 0);
|
|
|
|
break;
|
|
|
|
case 'v':
|
|
|
|
verbose = 1;
|
|
|
|
break;
|
2012-05-11 20:17:08 +00:00
|
|
|
case 'w':
|
2014-07-10 14:19:55 +00:00
|
|
|
wide = I2C_ADDR_16_BIT;
|
2012-05-11 20:17:08 +00:00
|
|
|
break;
|
2010-05-25 10:01:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
count = argc - optind;
|
|
|
|
|
|
|
|
if ((addr < 0) || (reg < 0) || (count == 0) || (addr > 0x7F))
|
|
|
|
return COMMAND_ERROR_USAGE;
|
|
|
|
|
|
|
|
adapter = i2c_get_adapter(bus);
|
|
|
|
if (!adapter) {
|
|
|
|
printf("i2c bus %d not found\n", bus);
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
client.adapter = adapter;
|
|
|
|
client.addr = addr;
|
|
|
|
|
|
|
|
buf = xmalloc(count);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
*(buf + i) = (char) simple_strtol(argv[optind+i], NULL, 16);
|
|
|
|
|
2014-07-10 14:19:55 +00:00
|
|
|
ret = i2c_write_reg(&client, reg | wide, buf, count);
|
2014-07-10 14:19:56 +00:00
|
|
|
if (ret != count) {
|
|
|
|
if (verbose)
|
|
|
|
printf("write aborted, count(%i) != writestatus(%i)\n",
|
|
|
|
count, ret);
|
2010-05-25 10:01:27 +00:00
|
|
|
goto out;
|
2014-07-10 14:19:56 +00:00
|
|
|
}
|
2010-05-25 10:01:27 +00:00
|
|
|
ret = 0;
|
|
|
|
|
|
|
|
if (verbose) {
|
2012-05-11 20:17:08 +00:00
|
|
|
printf("wrote %i bytes starting at reg 0x%04x to i2cdev 0x%02x on bus %i\n",
|
2010-05-25 10:01:27 +00:00
|
|
|
count, reg, addr, adapter->nr);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
printf("0x%02x ", *(buf + i));
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
out:
|
|
|
|
free(buf);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 08:28:42 +00:00
|
|
|
BAREBOX_CMD_HELP_START(i2c_write)
|
|
|
|
BAREBOX_CMD_HELP_TEXT("Options:")
|
|
|
|
BAREBOX_CMD_HELP_OPT ("-b BUS\t", "i2c bus number (default 0)")
|
|
|
|
BAREBOX_CMD_HELP_OPT ("-a ADDR\t", "i2c device address")
|
|
|
|
BAREBOX_CMD_HELP_OPT ("-r START", "start register")
|
|
|
|
BAREBOX_CMD_HELP_OPT ("-w\t", "use word (16 bit) wide access")
|
|
|
|
BAREBOX_CMD_HELP_OPT ("-v\t", "verbose")
|
|
|
|
BAREBOX_CMD_HELP_END
|
2010-05-25 10:01:27 +00:00
|
|
|
|
|
|
|
BAREBOX_CMD_START(i2c_write)
|
|
|
|
.cmd = do_i2c_write,
|
commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 08:28:42 +00:00
|
|
|
BAREBOX_CMD_DESC("write to an i2c device")
|
|
|
|
BAREBOX_CMD_OPTS("[-barwv] DATA...")
|
commands: group 'help' output
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.
The old output format (plus grouping) is now available with 'help -v'.
Example:
Information commands:
?, devinfo, help, iomem, meminfo, version
Boot commands:
boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
...
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 14:14:05 +00:00
|
|
|
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
|
2010-05-25 10:01:27 +00:00
|
|
|
BAREBOX_CMD_HELP(cmd_i2c_write_help)
|
|
|
|
BAREBOX_CMD_END
|
|
|
|
|
2011-12-21 13:18:57 +00:00
|
|
|
static int do_i2c_read(int argc, char *argv[])
|
2010-05-25 10:01:27 +00:00
|
|
|
{
|
|
|
|
struct i2c_adapter *adapter = NULL;
|
|
|
|
struct i2c_client client;
|
|
|
|
u8 *buf;
|
2012-05-11 20:17:08 +00:00
|
|
|
int count = -1, addr = -1, reg = -1, verbose = 0, ret, opt, bus = 0, wide = 0;
|
2010-05-25 10:01:27 +00:00
|
|
|
|
2014-07-10 14:19:54 +00:00
|
|
|
while ((opt = getopt(argc, argv, "a:b:c:r:vw")) > 0) {
|
2010-05-25 10:01:27 +00:00
|
|
|
switch (opt) {
|
|
|
|
case 'a':
|
|
|
|
addr = simple_strtol(optarg, NULL, 0);
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
count = simple_strtoul(optarg, NULL, 0);
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
bus = simple_strtoul(optarg, NULL, 0);
|
|
|
|
break;
|
|
|
|
case 'r':
|
|
|
|
reg = simple_strtol(optarg, NULL, 0);
|
|
|
|
break;
|
|
|
|
case 'v':
|
|
|
|
verbose = 1;
|
|
|
|
break;
|
2012-05-11 20:17:08 +00:00
|
|
|
case 'w':
|
2014-07-10 14:19:55 +00:00
|
|
|
wide = I2C_ADDR_16_BIT;
|
2012-05-11 20:17:08 +00:00
|
|
|
break;
|
2010-05-25 10:01:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-11 15:42:18 +00:00
|
|
|
if ((addr < 0) || (reg < 0) || (count < 1) || (addr > 0x7F))
|
2010-05-25 10:01:27 +00:00
|
|
|
return COMMAND_ERROR_USAGE;
|
|
|
|
|
|
|
|
adapter = i2c_get_adapter(bus);
|
|
|
|
if (!adapter) {
|
|
|
|
printf("i2c bus %d not found\n", bus);
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
client.adapter = adapter;
|
|
|
|
client.addr = addr;
|
|
|
|
|
|
|
|
buf = xmalloc(count);
|
2014-07-10 14:19:55 +00:00
|
|
|
ret = i2c_read_reg(&client, reg | wide, buf, count);
|
2010-05-25 10:01:27 +00:00
|
|
|
if (ret == count) {
|
|
|
|
int i;
|
|
|
|
if (verbose)
|
2012-05-11 20:17:08 +00:00
|
|
|
printf("read %i bytes starting at reg 0x%04x from i2cdev 0x%02x on bus %i\n",
|
2010-05-25 10:01:27 +00:00
|
|
|
count, reg, addr, adapter->nr);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
printf("0x%02x ", *(buf + i));
|
|
|
|
printf("\n");
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(buf);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 08:28:42 +00:00
|
|
|
BAREBOX_CMD_HELP_START(i2c_read)
|
|
|
|
BAREBOX_CMD_HELP_TEXT("Options:")
|
|
|
|
BAREBOX_CMD_HELP_OPT("-b BUS\t", "i2c bus number (default 0)")
|
|
|
|
BAREBOX_CMD_HELP_OPT("-a ADDR\t", "i2c device address")
|
|
|
|
BAREBOX_CMD_HELP_OPT("-r START", "start register")
|
|
|
|
BAREBOX_CMD_HELP_OPT("-w\t", "use word (16 bit) wide access")
|
|
|
|
BAREBOX_CMD_HELP_OPT("-c COUNT", "byte count")
|
|
|
|
BAREBOX_CMD_HELP_OPT("-v\t", "verbose")
|
|
|
|
BAREBOX_CMD_HELP_END
|
|
|
|
|
2010-05-25 10:01:27 +00:00
|
|
|
|
|
|
|
BAREBOX_CMD_START(i2c_read)
|
|
|
|
.cmd = do_i2c_read,
|
commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 08:28:42 +00:00
|
|
|
BAREBOX_CMD_DESC("read from an i2c device")
|
|
|
|
BAREBOX_CMD_OPTS("[-bacrwv] DATA...")
|
commands: group 'help' output
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.
The old output format (plus grouping) is now available with 'help -v'.
Example:
Information commands:
?, devinfo, help, iomem, meminfo, version
Boot commands:
boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
...
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 14:14:05 +00:00
|
|
|
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
|
2010-05-25 10:01:27 +00:00
|
|
|
BAREBOX_CMD_HELP(cmd_i2c_read_help)
|
|
|
|
BAREBOX_CMD_END
|