diff options
author | Tony Lindgren <tony@atomide.com> | 2014-11-24 14:05:01 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-25 09:47:06 -0500 |
commit | cc92f6818f6e771d02ab5025262760d1a21aae95 (patch) | |
tree | 773f10563ad8884bb4c3a64ef0936e6b899b6697 | |
parent | 9d506fc6d2cdafdec5ce605036f5eeec9fd59657 (diff) |
usb: musb: Populate new IO functions for blackfin
Populate new IO functions for blackfin
Cc: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/musb/blackfin.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index f23ce40b4d64..ed1524a40642 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -33,6 +33,41 @@ struct bfin_glue { | |||
33 | }; | 33 | }; |
34 | #define glue_to_musb(g) platform_get_drvdata(g->musb) | 34 | #define glue_to_musb(g) platform_get_drvdata(g->musb) |
35 | 35 | ||
36 | static u32 bfin_fifo_offset(u8 epnum) | ||
37 | { | ||
38 | return USB_OFFSET(USB_EP0_FIFO) + (epnum * 8); | ||
39 | } | ||
40 | |||
41 | static u8 bfin_readb(const void __iomem *addr, unsigned offset) | ||
42 | { | ||
43 | return (u8)(bfin_read16(addr + offset)); | ||
44 | } | ||
45 | |||
46 | static u16 bfin_readw(const void __iomem *addr, unsigned offset) | ||
47 | { | ||
48 | return bfin_read16(addr + offset); | ||
49 | } | ||
50 | |||
51 | static u32 bfin_readl(const void __iomem *addr, unsigned offset) | ||
52 | { | ||
53 | return (u32)(bfin_read16(addr + offset)); | ||
54 | } | ||
55 | |||
56 | static void bfin_writeb(void __iomem *addr, unsigned offset, u8 data) | ||
57 | { | ||
58 | bfin_write16(addr + offset, (u16)data); | ||
59 | } | ||
60 | |||
61 | static void bfin_writew(void __iomem *addr, unsigned offset, u16 data) | ||
62 | { | ||
63 | bfin_write16(addr + offset, data); | ||
64 | } | ||
65 | |||
66 | static void binf_writel(void __iomem *addr, unsigned offset, u32 data) | ||
67 | { | ||
68 | bfin_write16(addr + offset, (u16)data); | ||
69 | } | ||
70 | |||
36 | /* | 71 | /* |
37 | * Load an endpoint's FIFO | 72 | * Load an endpoint's FIFO |
38 | */ | 73 | */ |
@@ -433,6 +468,14 @@ static const struct musb_platform_ops bfin_ops = { | |||
433 | .init = bfin_musb_init, | 468 | .init = bfin_musb_init, |
434 | .exit = bfin_musb_exit, | 469 | .exit = bfin_musb_exit, |
435 | 470 | ||
471 | .readb = bfin_readb, | ||
472 | .writeb = bfin_writeb, | ||
473 | .readw = bfin_readw, | ||
474 | .writew = bfin_writew, | ||
475 | .readl = bfin_readl, | ||
476 | .writel = bfin_writel, | ||
477 | .read_fifo = musb_read_fifo, | ||
478 | .write_fifo = musb_write_fifo, | ||
436 | .enable = bfin_musb_enable, | 479 | .enable = bfin_musb_enable, |
437 | .disable = bfin_musb_disable, | 480 | .disable = bfin_musb_disable, |
438 | 481 | ||