adapter speed: require init script setting and centralize activation from drivers...
[fw/openocd] / src / jtag / drivers / presto.c
index 0baf561ede774c9dbd39879857df8466117806e5..2328c26b593c4eeb30087023763c864816bd5a7f 100644 (file)
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
+
+/**
+ * @file
+ * Holds driver for PRESTO programmer from ASIX.
+ * http://tools.asix.net/prg_presto.htm
+ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -674,7 +680,7 @@ static struct bitq_interface presto_bitq = {
 
 /* -------------------------------------------------------------------------- */
 
-static int presto_jtag_khz(int khz, int *jtag_speed)
+static int presto_adapter_khz(int khz, int *jtag_speed)
 {
        if (khz < 0)
        {
@@ -742,10 +748,10 @@ COMMAND_HANDLER(presto_handle_serial_command)
 static const struct command_registration presto_command_handlers[] = {
        {
                .name = "presto_serial",
-               .handler = &presto_handle_serial_command,
+               .handler = presto_handle_serial_command,
                .mode = COMMAND_CONFIG,
-               .help = "configure serial port",
-               .usage = "<devname>",
+               .help = "Configure USB serial number of Presto device.",
+               .usage = "serial_string",
        },
        COMMAND_REGISTRATION_DONE
 };
@@ -763,9 +769,6 @@ static int presto_jtag_init(void)
        }
        LOG_INFO("PRESTO open, serial number '%s'", presto->serial);
 
-       /* use JTAG speed setting from configuration file */
-       presto_jtag_speed(jtag_get_speed());
-
        bitq_interface = &presto_bitq;
        return ERROR_OK;
 }
@@ -791,7 +794,7 @@ struct jtag_interface presto_interface = {
 
        .execute_queue = bitq_execute_queue,
        .speed = presto_jtag_speed,
-       .khz = presto_jtag_khz,
+       .khz = presto_adapter_khz,
        .speed_div = presto_jtag_speed_div,
        .init = presto_jtag_init,
        .quit = presto_jtag_quit,