minix/drivers/usbd/base/earm/usbd_earm.c
Kees Jongenburger ed3391fd23 arm:adding the usbd source code.
Change-Id: Ia3c50a8c5e11bf20100354de266913112cc236f9

http://gerrit.minix3.org/#/c/2689/
2014-07-28 17:05:38 +02:00

59 lines
1.4 KiB
C
Executable file

/*
* EARM USBD setup
*/
#include <minix/board.h>
#include <minix/syslib.h>
#include <usb/hcd_platforms.h>
#include <usb/usb_common.h>
#include <usb/usbd_interface.h>
/*===========================================================================*
* usbd_init_hcd *
*===========================================================================*/
int
usbd_init_hcd(void)
{
/* More specific platform type than just EARM */
static struct machine platform;
DEBUG_DUMP;
if (sys_getmachine(&platform)) {
USB_MSG("Getting machine type, failed");
return EXIT_FAILURE;
}
if (BOARD_IS_BB(platform.board_id)) {
USB_MSG("Using AM335x driver");
return musb_am335x_init();
} else {
USB_MSG("Only AM335x driver available");
return EXIT_FAILURE;
}
}
/*===========================================================================*
* usbd_deinit_hcd *
*===========================================================================*/
void
usbd_deinit_hcd(void)
{
/* More specific platform type than just EARM */
static struct machine platform;
DEBUG_DUMP;
if (sys_getmachine(&platform)) {
USB_MSG("Getting machine type, failed");
return;
}
if (BOARD_IS_BB(platform.board_id))
musb_am335x_deinit();
else
USB_MSG("Only AM335x driver available");
}