2007-08-27 16:04:32 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
2008-04-18 17:24:19 +00:00
|
|
|
* $Id$
|
2007-08-27 16:04:32 +00:00
|
|
|
*
|
2008-05-05 10:32:46 +00:00
|
|
|
* Copyright (C) 2007 by Björn Stenberg
|
2007-08-27 16:04:32 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-08-27 16:04:32 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2007-11-22 20:51:00 +00:00
|
|
|
#ifndef USB_CORE_H
|
|
|
|
#define USB_CORE_H
|
2007-08-27 16:04:32 +00:00
|
|
|
|
2008-02-20 22:54:26 +00:00
|
|
|
#ifndef BOOTLOADER
|
|
|
|
|
2008-03-10 21:01:03 +00:00
|
|
|
//#define USB_SERIAL
|
2008-02-20 22:54:26 +00:00
|
|
|
#define USB_STORAGE
|
|
|
|
#define USB_CHARGING_ONLY
|
2008-02-27 19:08:30 +00:00
|
|
|
#else /* BOOTLOADER */
|
2008-02-20 22:54:26 +00:00
|
|
|
#define USB_CHARGING_ONLY
|
|
|
|
#endif /* BOOTLOADER */
|
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
#include "usb_ch9.h"
|
2008-02-27 19:08:30 +00:00
|
|
|
#include "usb.h"
|
2007-08-27 16:04:32 +00:00
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
/* endpoints */
|
2008-03-06 21:25:09 +00:00
|
|
|
#define EP_CONTROL 0
|
2008-04-18 16:42:50 +00:00
|
|
|
#if CONFIG_CPU == IMX31L
|
|
|
|
#define NUM_ENDPOINTS 8
|
|
|
|
#define USBDEVBSS_ATTR DEVBSS_ATTR
|
|
|
|
#else
|
2008-04-20 16:51:09 +00:00
|
|
|
#define USBDEVBSS_ATTR IBSS_ATTR
|
2008-03-06 21:25:09 +00:00
|
|
|
#define NUM_ENDPOINTS 3
|
2008-04-18 16:42:50 +00:00
|
|
|
#endif
|
2007-11-22 20:51:00 +00:00
|
|
|
|
|
|
|
extern int usb_max_pkt_size;
|
|
|
|
|
2008-10-03 22:43:16 +00:00
|
|
|
struct usb_class_driver;
|
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
void usb_core_init(void);
|
|
|
|
void usb_core_exit(void);
|
|
|
|
void usb_core_control_request(struct usb_ctrlrequest* req);
|
2008-10-03 22:43:16 +00:00
|
|
|
void usb_core_transfer_complete(int endpoint, int dir, int status, int length);
|
2007-11-22 20:51:00 +00:00
|
|
|
void usb_core_bus_reset(void);
|
2008-02-27 19:08:30 +00:00
|
|
|
bool usb_core_exclusive_connection(void);
|
2008-03-06 21:25:09 +00:00
|
|
|
void usb_core_enable_driver(int driver,bool enabled);
|
|
|
|
bool usb_core_driver_enabled (int driver);
|
|
|
|
void usb_core_handle_transfer_completion(
|
|
|
|
struct usb_transfer_completion_event_data* event);
|
2008-04-26 19:02:16 +00:00
|
|
|
int usb_core_ack_control(struct usb_ctrlrequest* req);
|
2008-10-03 22:43:16 +00:00
|
|
|
|
|
|
|
int usb_core_request_endpoint(int dir, struct usb_class_driver *drv);
|
|
|
|
void usb_core_release_endpoint(int dir);
|
|
|
|
|
2008-03-10 20:55:24 +00:00
|
|
|
#ifdef HAVE_HOTSWAP
|
|
|
|
void usb_core_hotswap_event(int volume,bool inserted);
|
|
|
|
#endif
|
2008-06-04 18:55:58 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_USB_POWER
|
|
|
|
unsigned short usb_allowed_current(void);
|
|
|
|
#endif
|
|
|
|
|
2007-11-22 20:51:00 +00:00
|
|
|
#endif
|
|
|
|
|