Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
musb_core.h File Reference
#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 "musb_debug.h"
#include "musb_dma.h"
#include "musb_io.h"
#include "musb_regs.h"
#include "musb_gadget.h"
#include <linux/usb/hcd.h>
#include "musb_host.h"

Go to the source code of this file.

Data Structures

struct  musb_platform_ops
 
struct  musb_hw_ep
 
struct  musb_csr_regs
 
struct  musb_context_registers
 
struct  musb
 

Macros

#define MUSB_HWVERS_MAJOR(x)   ((x >> 10) & 0x1f)
 
#define MUSB_HWVERS_MINOR(x)   (x & 0x3ff)
 
#define MUSB_HWVERS_RC   0x8000
 
#define MUSB_HWVERS_1300   0x52C
 
#define MUSB_HWVERS_1400   0x590
 
#define MUSB_HWVERS_1800   0x720
 
#define MUSB_HWVERS_1900   0x784
 
#define MUSB_HWVERS_2000   0x800
 
#define is_peripheral_active(m)   (!(m)->is_host)
 
#define is_host_active(m)   ((m)->is_host)
 
#define MUSB_C_NUM_EPS   ((u8)16)
 
#define MUSB_MAX_END0_PACKET   ((u16)MUSB_EP0_FIFOSIZE)
 
#define OTG_TIME_A_WAIT_VRISE   100 /* msec (max) */
 
#define OTG_TIME_A_WAIT_BCON   1100 /* min 1 second */
 
#define OTG_TIME_A_AIDL_BDIS   200 /* min 200 msec */
 
#define OTG_TIME_B_ASE0_BRST   100 /* min 3.125 ms */
 
#define musb_ep_select(_mbase, _epnum)   musb_writeb((_mbase), MUSB_INDEX, (_epnum))
 
#define MUSB_EP_OFFSET   MUSB_INDEXED_OFFSET
 
#define MUSB_HST_MODE(_musb)   { (_musb)->is_host = true; }
 
#define MUSB_DEV_MODE(_musb)   { (_musb)->is_host = false; }
 
#define test_devctl_hst_mode(_x)   (musb_readb((_x)->mregs, MUSB_DEVCTL)&MUSB_DEVCTL_HM)
 
#define MUSB_MODE(musb)   ((musb)->is_host ? "Host" : "Peripheral")
 
#define MUSB_PORT_STAT_RESUME   (1 << 31)
 
#define control_ep   endpoints
 
#define VBUSERR_RETRY_COUNT   3
 
#define can_bulk_split(musb, type)   (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split)
 
#define can_bulk_combine(musb, type)   (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine)
 

Enumerations

enum  musb_h_ep0_state
 
enum  musb_g_ep0_state
 

Functions

irqreturn_t musb_g_ep0_irq (struct musb *)
 
void musb_g_tx (struct musb *, u8)
 
void musb_g_rx (struct musb *, u8)
 
void musb_g_reset (struct musb *)
 
void musb_g_suspend (struct musb *)
 
void musb_g_resume (struct musb *)
 
void musb_g_wakeup (struct musb *)
 
void musb_g_disconnect (struct musb *)
 
irqreturn_t musb_h_ep0_irq (struct musb *)
 
void musb_host_tx (struct musb *, u8)
 
void musb_host_rx (struct musb *, u8)
 
enum musb_h_ep0_state __attribute__ ((packed))
 
void musb_start (struct musb *musb)
 
void musb_stop (struct musb *musb)
 
int musb_get_id (struct device *dev, gfp_t gfp_mask)
 
void musb_put_id (struct device *dev, int id)
 
void musb_write_fifo (struct musb_hw_ep *ep, u16 len, const u8 *src)
 
void musb_read_fifo (struct musb_hw_ep *ep, u16 len, u8 *dst)
 
void musb_load_testpacket (struct musb *)
 
irqreturn_t musb_interrupt (struct musb *)
 
void musb_hnp_stop (struct musb *musb)
 

Variables

 MUSB_EP0_IDLE
 
 MUSB_EP0_START
 
 MUSB_EP0_IN
 
 MUSB_EP0_OUT
 
 MUSB_EP0_STATUS
 
 MUSB_EP0_STAGE_IDLE
 
 MUSB_EP0_STAGE_SETUP
 
 MUSB_EP0_STAGE_TX
 
 MUSB_EP0_STAGE_RX
 
 MUSB_EP0_STAGE_STATUSIN
 
 MUSB_EP0_STAGE_STATUSOUT
 
 MUSB_EP0_STAGE_ACKWAIT
 
struct musb_platform_ops __attribute__
 
const char musb_driver_name []
 

Macro Definition Documentation

#define can_bulk_combine (   musb,
  type 
)    (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine)

Definition at line 395 of file musb_core.h.

#define can_bulk_split (   musb,
  type 
)    (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split)

Definition at line 391 of file musb_core.h.

#define control_ep   endpoints

Definition at line 364 of file musb_core.h.

#define is_host_active (   m)    ((m)->is_host)

Definition at line 78 of file musb_core.h.

#define is_peripheral_active (   m)    (!(m)->is_host)

Definition at line 77 of file musb_core.h.

#define MUSB_C_NUM_EPS   ((u8)16)

Definition at line 105 of file musb_core.h.

#define MUSB_DEV_MODE (   _musb)    { (_musb)->is_host = false; }

Definition at line 180 of file musb_core.h.

#define MUSB_EP_OFFSET   MUSB_INDEXED_OFFSET

Definition at line 173 of file musb_core.h.

#define musb_ep_select (   _mbase,
  _epnum 
)    musb_writeb((_mbase), MUSB_INDEX, (_epnum))

Definition at line 171 of file musb_core.h.

#define MUSB_HST_MODE (   _musb)    { (_musb)->is_host = true; }

Definition at line 178 of file musb_core.h.

#define MUSB_HWVERS_1300   0x52C

Definition at line 58 of file musb_core.h.

#define MUSB_HWVERS_1400   0x590

Definition at line 59 of file musb_core.h.

#define MUSB_HWVERS_1800   0x720

Definition at line 60 of file musb_core.h.

#define MUSB_HWVERS_1900   0x784

Definition at line 61 of file musb_core.h.

#define MUSB_HWVERS_2000   0x800

Definition at line 62 of file musb_core.h.

#define MUSB_HWVERS_MAJOR (   x)    ((x >> 10) & 0x1f)

Definition at line 55 of file musb_core.h.

#define MUSB_HWVERS_MINOR (   x)    (x & 0x3ff)

Definition at line 56 of file musb_core.h.

#define MUSB_HWVERS_RC   0x8000

Definition at line 57 of file musb_core.h.

#define MUSB_MAX_END0_PACKET   ((u16)MUSB_EP0_FIFOSIZE)

Definition at line 109 of file musb_core.h.

#define MUSB_MODE (   musb)    ((musb)->is_host ? "Host" : "Peripheral")

Definition at line 186 of file musb_core.h.

#define MUSB_PORT_STAT_RESUME   (1 << 31)

Definition at line 317 of file musb_core.h.

#define OTG_TIME_A_AIDL_BDIS   200 /* min 200 msec */

Definition at line 138 of file musb_core.h.

#define OTG_TIME_A_WAIT_BCON   1100 /* min 1 second */

Definition at line 137 of file musb_core.h.

#define OTG_TIME_A_WAIT_VRISE   100 /* msec (max) */

Definition at line 136 of file musb_core.h.

#define OTG_TIME_B_ASE0_BRST   100 /* min 3.125 ms */

Definition at line 139 of file musb_core.h.

#define test_devctl_hst_mode (   _x)    (musb_readb((_x)->mregs, MUSB_DEVCTL)&MUSB_DEVCTL_HM)

Definition at line 183 of file musb_core.h.

#define VBUSERR_RETRY_COUNT   3

Definition at line 366 of file musb_core.h.

Enumeration Type Documentation

Definition at line 122 of file musb_core.h.

Definition at line 113 of file musb_core.h.

Function Documentation

enum musb_h_ep0_state __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

void musb_g_disconnect ( struct musb )

Definition at line 2127 of file musb_gadget.c.

irqreturn_t musb_g_ep0_irq ( struct musb )

Definition at line 664 of file musb_gadget_ep0.c.

void musb_g_reset ( struct musb )

Definition at line 2171 of file musb_gadget.c.

void musb_g_resume ( struct musb )

Definition at line 2069 of file musb_gadget.c.

void musb_g_rx ( struct musb ,
u8   
)

Definition at line 908 of file musb_gadget.c.

void musb_g_suspend ( struct musb )

Definition at line 2091 of file musb_gadget.c.

void musb_g_tx ( struct musb ,
u8   
)

Definition at line 492 of file musb_gadget.c.

void musb_g_wakeup ( struct musb )

Definition at line 2121 of file musb_gadget.c.

int musb_get_id ( struct device dev,
gfp_t  gfp_mask 
)

Definition at line 136 of file musb_core.c.

irqreturn_t musb_h_ep0_irq ( struct musb )

Definition at line 1062 of file musb_host.c.

void musb_hnp_stop ( struct musb musb)

Definition at line 420 of file musb_core.c.

void musb_host_rx ( struct musb ,
u8   
)

Definition at line 1521 of file musb_host.c.

void musb_host_tx ( struct musb ,
u8   
)

Definition at line 1200 of file musb_host.c.

irqreturn_t musb_interrupt ( struct musb )

Definition at line 1560 of file musb_core.c.

void musb_load_testpacket ( struct musb )

Definition at line 374 of file musb_core.c.

void musb_put_id ( struct device dev,
int  id 
)

Definition at line 157 of file musb_core.c.

void musb_read_fifo ( struct musb_hw_ep ep,
u16  len,
u8 dst 
)

Definition at line 414 of file am35x.c.

void musb_start ( struct musb musb)

Definition at line 939 of file musb_core.c.

void musb_stop ( struct musb musb)

Definition at line 1006 of file musb_core.c.

void musb_write_fifo ( struct musb_hw_ep ep,
u16  len,
const u8 src 
)

Definition at line 39 of file blackfin.c.

Variable Documentation

const char musb_driver_name[]

Definition at line 118 of file musb_core.c.

MUSB_EP0_IDLE

Definition at line 120 of file musb_core.h.

MUSB_EP0_IN

Definition at line 120 of file musb_core.h.

MUSB_EP0_OUT

Definition at line 120 of file musb_core.h.

MUSB_EP0_STAGE_ACKWAIT

Definition at line 131 of file musb_core.h.

MUSB_EP0_STAGE_IDLE

Definition at line 131 of file musb_core.h.

MUSB_EP0_STAGE_RX

Definition at line 131 of file musb_core.h.

MUSB_EP0_STAGE_SETUP

Definition at line 131 of file musb_core.h.

MUSB_EP0_STAGE_STATUSIN

Definition at line 131 of file musb_core.h.

MUSB_EP0_STAGE_STATUSOUT

Definition at line 131 of file musb_core.h.

MUSB_EP0_STAGE_TX

Definition at line 131 of file musb_core.h.

MUSB_EP0_START

Definition at line 120 of file musb_core.h.

MUSB_EP0_STATUS

Definition at line 120 of file musb_core.h.