1
2
3
4
5
6
7
8
9
10#ifndef __MUSB_LINUX_PLATFORM_ARCH_H__
11#define __MUSB_LINUX_PLATFORM_ARCH_H__
12
13#include <linux/io.h>
14
15#define musb_ep_select(_mbase, _epnum) musb->io.ep_select((_mbase), (_epnum))
16
17
18
19
20
21
22
23
24
25
26
27
28struct musb_io {
29 u32 (*ep_offset)(u8 epnum, u16 offset);
30 void (*ep_select)(void __iomem *mbase, u8 epnum);
31 u32 (*fifo_offset)(u8 epnum);
32 void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
33 void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
34 u32 (*busctl_offset)(u8 epnum, u16 offset);
35 u16 (*get_toggle)(struct musb_qh *qh, int is_out);
36 u16 (*set_toggle)(struct musb_qh *qh, int is_out, struct urb *urb);
37};
38
39
40extern u8 (*musb_readb)(void __iomem *addr, u32 offset);
41extern void (*musb_writeb)(void __iomem *addr, u32 offset, u8 data);
42extern u8 (*musb_clearb)(void __iomem *addr, u32 offset);
43extern u16 (*musb_readw)(void __iomem *addr, u32 offset);
44extern void (*musb_writew)(void __iomem *addr, u32 offset, u16 data);
45extern u16 (*musb_clearw)(void __iomem *addr, u32 offset);
46extern u32 musb_readl(void __iomem *addr, u32 offset);
47extern void musb_writel(void __iomem *addr, u32 offset, u32 data);
48
49#endif
50