#ifndef __MUSB_CORE_H__
#define __MUSB_CORE_H__
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/device.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb.h>
#include <linux/usb/otg.h>
#include <linux/usb/musb.h>
#include <linux/phy/phy.h>
#include <linux/workqueue.h>
struct musb;
struct musb_hw_ep;
struct musb_ep;
struct musb_qh;
#define MUSB_HWVERS_MAJOR(x) …
#define MUSB_HWVERS_MINOR(x) …
#define MUSB_HWVERS_RC …
#define MUSB_HWVERS_1300 …
#define MUSB_HWVERS_1400 …
#define MUSB_HWVERS_1800 …
#define MUSB_HWVERS_1900 …
#define MUSB_HWVERS_2000 …
#include "musb_debug.h"
#include "musb_dma.h"
#include "musb_io.h"
#include "musb_gadget.h"
#include <linux/usb/hcd.h>
#include "musb_host.h"
#define is_peripheral_active(m) …
#define is_host_active(m) …
#ifndef MUSB_C_NUM_EPS
#define MUSB_C_NUM_EPS …
#endif
#ifndef MUSB_MAX_END0_PACKET
#define MUSB_MAX_END0_PACKET …
#endif
enum musb_h_ep0_state { … } __attribute__ ((packed));
enum musb_g_ep0_state { … } __attribute__ ((packed));
#define OTG_TIME_A_WAIT_VRISE …
#define OTG_TIME_A_WAIT_BCON …
#define OTG_TIME_A_AIDL_BDIS …
#define OTG_TIME_B_ASE0_BRST …
#define MUSB_HST_MODE(_musb) …
#define MUSB_DEV_MODE(_musb) …
#define test_devctl_hst_mode(_x) …
#define MUSB_MODE(musb) …
struct musb_io;
struct musb_platform_ops { … };
struct musb_hw_ep { … };
static inline struct musb_request *next_in_request(struct musb_hw_ep *hw_ep)
{ … }
static inline struct musb_request *next_out_request(struct musb_hw_ep *hw_ep)
{ … }
struct musb_csr_regs { … };
struct musb_context_registers { … };
struct musb { … };
#include "musb_regs.h"
static inline struct musb *gadget_to_musb(struct usb_gadget *g)
{ … }
static inline char *musb_ep_xfertype_string(u8 type)
{ … }
static inline int musb_read_fifosize(struct musb *musb,
struct musb_hw_ep *hw_ep, u8 epnum)
{ … }
static inline void musb_configure_ep0(struct musb *musb)
{ … }
extern const char musb_driver_name[];
extern void musb_stop(struct musb *musb);
extern void musb_start(struct musb *musb);
extern void musb_write_fifo(struct musb_hw_ep *ep, u16 len, const u8 *src);
extern void musb_read_fifo(struct musb_hw_ep *ep, u16 len, u8 *dst);
extern int musb_set_host(struct musb *musb);
extern int musb_set_peripheral(struct musb *musb);
extern void musb_load_testpacket(struct musb *);
extern irqreturn_t musb_interrupt(struct musb *);
extern void musb_hnp_stop(struct musb *musb);
int musb_queue_resume_work(struct musb *musb,
int (*callback)(struct musb *musb, void *data),
void *data);
static inline void musb_platform_set_vbus(struct musb *musb, int is_on)
{ … }
static inline void musb_platform_enable(struct musb *musb)
{ … }
static inline void musb_platform_disable(struct musb *musb)
{ … }
static inline int musb_platform_set_mode(struct musb *musb, u8 mode)
{ … }
static inline void musb_platform_try_idle(struct musb *musb,
unsigned long timeout)
{ … }
static inline int musb_platform_recover(struct musb *musb)
{ … }
static inline int musb_platform_get_vbus_status(struct musb *musb)
{ … }
static inline int musb_platform_init(struct musb *musb)
{ … }
static inline int musb_platform_exit(struct musb *musb)
{ … }
static inline void musb_platform_pre_root_reset_end(struct musb *musb)
{ … }
static inline void musb_platform_post_root_reset_end(struct musb *musb)
{ … }
static inline void musb_platform_clear_ep_rxintr(struct musb *musb, int epnum)
{ … }
static inline void musb_set_state(struct musb *musb,
enum usb_otg_state otg_state)
{ … }
static inline enum usb_otg_state musb_get_state(struct musb *musb)
{ … }
static inline const char *musb_otg_state_string(struct musb *musb)
{ … }
extern enum musb_mode musb_get_mode(struct device *dev);
#endif