2 * cmd_softswitch.c - set the softswitch for bf60x
4 * Copyright (c) 2012 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
11 #include <asm/blackfin.h>
12 #include <asm/soft_switch.h>
14 int do_softswitch(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
16 int switchaddr, value, pin, port;
21 if (strcmp(argv[2], "GPA") == 0)
23 else if (strcmp(argv[2], "GPB") == 0)
28 switchaddr = simple_strtoul(argv[1], NULL, 16);
29 pin = simple_strtoul(argv[3], NULL, 16);
30 value = simple_strtoul(argv[4], NULL, 16);
32 config_switch_bit(switchaddr, port, (1 << pin), IO_PORT_OUTPUT, value);
38 softswitch_output, 5, 1, do_softswitch,
39 "switchaddr GPA/GPB pin_offset value",