usb_audio_flow: determine usb host mode with serial driver

An additional method is supported to determine if the chameleon
should boot in the usb host mode.

Originally, if the file /etc/default/.usb_host_mode exists, the
chameleon would boot in the usb host mode by not entering into
the usb device mode.

In this patch, if there is a tty device, e.g., /dev/ttyUSB*, which
is found with the specified serial driver, ftdi_sio, the chameleon
would stay in the usb host mode no matter whether
/etc/default/.usb_host_mode exists or not.

Note that the usb host mode is required in order to run bluetooth
autotests that require bluetooth peripherals.

BUG=chromium:780367
TEST=Conduct the following tests

On Chameleon board, remove the following file.
$ rm /etc/default/.usb_host_mode

Reboot chameleon board.
Run a bluetooth autotest that requires RN-42. It should pass.
(cr) $ test_that --args "chameleon_host=$CHAMELEON_IP" $DUT_IP \
       bluetooth_AdapterPairing.mouse

Change-Id: I5ea8a252884c09a752a742dfe58290be6b46987f
Reviewed-on: https://chromium-review.googlesource.com/752603
Commit-Ready: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
1 file changed