Skip to content

Commit

Permalink
USB: musb: add Blackfin version low level register accessing helper f…
Browse files Browse the repository at this point in the history
…unctions

add Blackfin version low level register accessing helper functions

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bryan Wu authored and Greg Kroah-Hartman committed Jan 7, 2009
1 parent d426e60 commit 2c557a4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/usb/musb/musb_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len)

#endif

#ifndef CONFIG_BLACKFIN

/* NOTE: these offsets are all in bytes */

static inline u16 musb_readw(const void __iomem *addr, unsigned offset)
Expand Down Expand Up @@ -114,4 +116,26 @@ static inline void musb_writeb(void __iomem *addr, unsigned offset, u8 data)

#endif /* CONFIG_USB_TUSB6010 */

#else

static inline u8 musb_readb(const void __iomem *addr, unsigned offset)
{ return (u8) (bfin_read16(addr + offset)); }

static inline u16 musb_readw(const void __iomem *addr, unsigned offset)
{ return bfin_read16(addr + offset); }

static inline u32 musb_readl(const void __iomem *addr, unsigned offset)
{ return (u32) (bfin_read16(addr + offset)); }

static inline void musb_writeb(void __iomem *addr, unsigned offset, u8 data)
{ bfin_write16(addr + offset, (u16) data); }

static inline void musb_writew(void __iomem *addr, unsigned offset, u16 data)
{ bfin_write16(addr + offset, data); }

static inline void musb_writel(void __iomem *addr, unsigned offset, u32 data)
{ bfin_write16(addr + offset, (u16) data); }

#endif /* CONFIG_BLACKFIN */

#endif

0 comments on commit 2c557a4

Please sign in to comment.