Remove 'sb' and 'sbc' console commands

The functionality of these commands can be fully covered by 'i2cxfer'
command. Remove them to save code size.

BUG=None
TEST=Build all boards. Pass all tests.
BRANCH=None

Change-Id: I3f57e797530b17cff17b50feec80436ad7872409
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169510
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Vic Yang
2013-09-16 02:07:38 +08:00
committed by chrome-internal-fetch
parent 1b66740546
commit a2c962b7f6

View File

@@ -5,11 +5,9 @@
* Smart battery driver.
*/
#include "console.h"
#include "host_command.h"
#include "smart_battery.h"
#include "timer.h"
#include "util.h"
test_mockable int sbc_read(int cmd, int *param)
{
@@ -302,82 +300,6 @@ test_mockable int battery_device_chemistry(char *device_chemistry, int buf_size)
SB_DEVICE_CHEMISTRY, device_chemistry, buf_size);
}
/*****************************************************************************/
/* Console commands */
/* Usage:sb reg [value]
* sb 0x14 // read desired charging current
* sb 0x15 // read desired charging voltage
* sb 0x3 // read battery mode
* sb 0x3 0xe001 // set battery mode to 0xe001
*/
static int command_sb(int argc, char **argv)
{
int rv;
int cmd, d;
char *e;
if (argc < 2)
return EC_ERROR_PARAM_COUNT;
cmd = strtoi(argv[1], &e, 0);
if (*e)
return EC_ERROR_PARAM2;
if (argc > 2) {
d = strtoi(argv[2], &e, 0);
if (*e)
return EC_ERROR_PARAM3;
return sb_write(cmd, d);
}
rv = sb_read(cmd, &d);
if (rv)
return rv;
ccprintf("0x%04x (%d)\n", d, d);
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(sb, command_sb,
"reg [value]",
"Read/write smart battery registers",
NULL);
static int command_sbc(int argc, char **argv)
{
int rv;
int cmd, d;
char *e;
if (argc < 2)
return EC_ERROR_PARAM_COUNT;
cmd = strtoi(argv[1], &e, 0);
if (*e)
return EC_ERROR_PARAM2;
if (argc > 2) {
d = strtoi(argv[2], &e, 0);
if (*e)
return EC_ERROR_PARAM3;
return sbc_write(cmd, d);
}
rv = sbc_read(cmd, &d);
if (rv)
return rv;
ccprintf("0x%04x (%d)\n", d, d);
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(sbc, command_sbc,
"reg [value]",
"Read/write smart battery controller registers",
NULL);
/*****************************************************************************/
/* Smart battery pass-through
*/