Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * MUSB OTG driver register I/O
0004  *
0005  * Copyright 2005 Mentor Graphics Corporation
0006  * Copyright (C) 2005-2006 by Texas Instruments
0007  * Copyright (C) 2006-2007 Nokia Corporation
0008  */
0009 
0010 #ifndef __MUSB_LINUX_PLATFORM_ARCH_H__
0011 #define __MUSB_LINUX_PLATFORM_ARCH_H__
0012 
0013 #include <linux/io.h>
0014 
0015 #define musb_ep_select(_mbase, _epnum)  musb->io.ep_select((_mbase), (_epnum))
0016 
0017 /**
0018  * struct musb_io - IO functions for MUSB
0019  * @ep_offset:  platform specific function to get end point offset
0020  * @ep_select:  platform specific function to select end point
0021  * @fifo_offset: platform specific function to get fifo offset
0022  * @read_fifo:  platform specific function to read fifo
0023  * @write_fifo: platform specific function to write fifo
0024  * @busctl_offset: platform specific function to get busctl offset
0025  * @get_toggle: platform specific function to get toggle
0026  * @set_toggle: platform specific function to set toggle
0027  */
0028 struct musb_io {
0029     u32 (*ep_offset)(u8 epnum, u16 offset);
0030     void    (*ep_select)(void __iomem *mbase, u8 epnum);
0031     u32 (*fifo_offset)(u8 epnum);
0032     void    (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
0033     void    (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
0034     u32 (*busctl_offset)(u8 epnum, u16 offset);
0035     u16 (*get_toggle)(struct musb_qh *qh, int is_out);
0036     u16 (*set_toggle)(struct musb_qh *qh, int is_out, struct urb *urb);
0037 };
0038 
0039 /* Do not add new entries here, add them the struct musb_io instead */
0040 extern u8 (*musb_readb)(void __iomem *addr, u32 offset);
0041 extern void (*musb_writeb)(void __iomem *addr, u32 offset, u8 data);
0042 extern u8 (*musb_clearb)(void __iomem *addr, u32 offset);
0043 extern u16 (*musb_readw)(void __iomem *addr, u32 offset);
0044 extern void (*musb_writew)(void __iomem *addr, u32 offset, u16 data);
0045 extern u16 (*musb_clearw)(void __iomem *addr, u32 offset);
0046 extern u32 musb_readl(void __iomem *addr, u32 offset);
0047 extern void musb_writel(void __iomem *addr, u32 offset, u32 data);
0048 
0049 #endif