xpp: revert USB "clear_halt" change and better overrides.

Why:
 * Doing "clear_halt" is normally the right thing to do on startup.
 * The original observed problem is better fixed via USB bios settings.
 * Defaulting to no "clear_halt" cause more problems on other platform
   combinations (hardware/kernel).

The change:
 * We now reverted to do "clear_halt" by default.
 * The XTALK_OPTIONS may now contain either "use-clear-halt" (the default)
   or "no-use-clear-halt" to override for debugging/testing.

Original commit: ca7c04e9cb

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
This commit is contained in:
Oron Peled 2014-08-17 17:07:19 +03:00 committed by Tzafrir Cohen
parent d4537e46ce
commit 9aee76a3a5
1 changed files with 7 additions and 1 deletions

View File

@ -67,6 +67,8 @@ static void xusb_init();
* variable of that name. Existing options:
*
* - "use-clear-halt" -- force USB "clear_halt" operation during
* device initialization (this is the default)
* - "no-use-clear-halt" -- force no USB "clear_halt" operation during
* device initialization
* - "no-lock" -- prevent using global sempahore to serialize libusb
* initialization. Previously done via "XUSB_NOLOCK"
@ -888,7 +890,7 @@ static void xusb_init()
}
/* XTALK option handling */
static int use_clear_halt = 0;
static int use_clear_halt = 1;
static int libusb_no_lock = 0;
static int xtalk_one_option(const char *option_string)
@ -897,6 +899,10 @@ static int xtalk_one_option(const char *option_string)
use_clear_halt = 1;
return 0;
}
if (strcmp(option_string, "no-use-clear-halt") == 0) {
use_clear_halt = 0;
return 0;
}
if (strcmp(option_string, "no-lock") == 0) {
libusb_no_lock = 1;
return 0;