musb_io.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * MUSB OTG driver register I/O
  4. *
  5. * Copyright 2005 Mentor Graphics Corporation
  6. * Copyright (C) 2005-2006 by Texas Instruments
  7. * Copyright (C) 2006-2007 Nokia Corporation
  8. */
  9. #ifndef __MUSB_LINUX_PLATFORM_ARCH_H__
  10. #define __MUSB_LINUX_PLATFORM_ARCH_H__
  11. #include <linux/io.h>
  12. #define musb_ep_select(_mbase, _epnum) musb->io.ep_select((_mbase), (_epnum))
  13. /**
  14. * struct musb_io - IO functions for MUSB
  15. * @ep_offset: platform specific function to get end point offset
  16. * @ep_select: platform specific function to select end point
  17. * @fifo_offset: platform specific function to get fifo offset
  18. * @read_fifo: platform specific function to read fifo
  19. * @write_fifo: platform specific function to write fifo
  20. * @busctl_offset: platform specific function to get busctl offset
  21. */
  22. struct musb_io {
  23. u32 (*ep_offset)(u8 epnum, u16 offset);
  24. void (*ep_select)(void __iomem *mbase, u8 epnum);
  25. u32 (*fifo_offset)(u8 epnum);
  26. void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
  27. void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
  28. u32 (*busctl_offset)(u8 epnum, u16 offset);
  29. };
  30. /* Do not add new entries here, add them the struct musb_io instead */
  31. extern u8 (*musb_readb)(const void __iomem *addr, unsigned offset);
  32. extern void (*musb_writeb)(void __iomem *addr, unsigned offset, u8 data);
  33. extern u16 (*musb_readw)(const void __iomem *addr, unsigned offset);
  34. extern void (*musb_writew)(void __iomem *addr, unsigned offset, u16 data);
  35. extern u32 musb_readl(const void __iomem *addr, unsigned offset);
  36. extern void musb_writel(void __iomem *addr, unsigned offset, u32 data);
  37. #endif