drivers/parport: Group adapter commands

Use a command group 'parport' with subcommands instead of individual
commands with 'parport_' prefix.

The old commands are still available for backward compatibility but
marked as deprecated.

Change-Id: I4cb7096a8ba8d6cd7a6dc970862cd73c32b5c0a2
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6385
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink
2021-07-30 17:39:11 +02:00
committed by Antonio Borneo
parent 38f94a2677
commit fbbf63f659
3 changed files with 51 additions and 16 deletions

View File

@@ -473,9 +473,9 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command)
return ERROR_OK;
}
static const struct command_registration parport_command_handlers[] = {
static const struct command_registration parport_subcommand_handlers[] = {
{
.name = "parport_port",
.name = "port",
.handler = parport_handle_parport_port_command,
.mode = COMMAND_CONFIG,
.help = "Display the address of the I/O port (e.g. 0x378) "
@@ -484,7 +484,7 @@ static const struct command_registration parport_command_handlers[] = {
.usage = "[port_number]",
},
{
.name = "parport_cable",
.name = "cable",
.handler = parport_handle_parport_cable_command,
.mode = COMMAND_CONFIG,
.help = "Set the layout of the parallel port cable "
@@ -493,7 +493,7 @@ static const struct command_registration parport_command_handlers[] = {
.usage = "[layout]",
},
{
.name = "parport_write_on_exit",
.name = "write_on_exit",
.handler = parport_handle_write_on_exit_command,
.mode = COMMAND_CONFIG,
.help = "Configure the parallel driver to write "
@@ -501,7 +501,7 @@ static const struct command_registration parport_command_handlers[] = {
.usage = "('on'|'off')",
},
{
.name = "parport_toggling_time",
.name = "toggling_time",
.handler = parport_handle_parport_toggling_time_command,
.mode = COMMAND_CONFIG,
.help = "Displays or assigns how many nanoseconds it "
@@ -511,6 +511,17 @@ static const struct command_registration parport_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
static const struct command_registration parport_command_handlers[] = {
{
.name = "parport",
.mode = COMMAND_ANY,
.help = "perform parport management",
.chain = parport_subcommand_handlers,
.usage = "",
},
COMMAND_REGISTRATION_DONE
};
static struct jtag_interface parport_interface = {
.supported = DEBUG_CAP_TMS_SEQ,
.execute_queue = bitbang_execute_queue,