Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

RE: USB Host Functionality

$
0
0

Both USB ch0 and ch1 can be either Device or Host.

See file:

linux-3.14/arch/arm/mach-shmobile/board-rskrza1.c

You can set the USB host/function at boot time:

--------------------------------------------------

/*

* early_usbgs()

* - This allows you to select if you want to use

*   USB gadget or not.

* - Optional: This was just an easy way to switch this for testing

*/

static int usbgs = -1;

static int __init early_usbgs(char *str)

{

usbgs = 0;

get_option(&str, &usbgs);

return 0;

}

early_param("usbgs", early_usbgs);

--------------------------------------------------

--------------------------------------------------

if (usbgs == 0) {

platform_device_register_full(&r8a66597_usb_gadget0_info); /* USB ch0 as Device */

platform_device_register_full(&r8a66597_usb_host1_info); /* USB ch1 as Host */

} else if (usbgs == 1) {

platform_device_register_full(&r8a66597_usb_host0_info); /* USB ch0 as Host */

platform_device_register_full(&r8a66597_usb_gadget1_info); /* USB ch1 as Device */

} else {

platform_device_register_full(&r8a66597_usb_host0_info); /* USB ch0 as Host */

platform_device_register_full(&r8a66597_usb_host1_info); /* USB ch1 as Host */

}

--------------------------------------------------


Viewing all articles
Browse latest Browse all 1583

Trending Articles