2017-11-03 18:28:30 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2008-07-24 17:27:36 +08:00
|
|
|
/*
|
|
|
|
* MUSB OTG driver register I/O
|
|
|
|
*
|
|
|
|
* Copyright 2005 Mentor Graphics Corporation
|
|
|
|
* Copyright (C) 2005-2006 by Texas Instruments
|
|
|
|
* Copyright (C) 2006-2007 Nokia Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MUSB_LINUX_PLATFORM_ARCH_H__
|
|
|
|
#define __MUSB_LINUX_PLATFORM_ARCH_H__
|
|
|
|
|
|
|
|
#include <linux/io.h>
|
|
|
|
|
2014-11-25 03:05:03 +08:00
|
|
|
#define musb_ep_select(_mbase, _epnum) musb->io.ep_select((_mbase), (_epnum))
|
|
|
|
|
2014-11-25 03:04:59 +08:00
|
|
|
/**
|
|
|
|
* struct musb_io - IO functions for MUSB
|
|
|
|
* @ep_offset: platform specific function to get end point offset
|
|
|
|
* @ep_select: platform specific function to select end point
|
|
|
|
* @fifo_offset: platform specific function to get fifo offset
|
|
|
|
* @read_fifo: platform specific function to read fifo
|
|
|
|
* @write_fifo: platform specific function to write fifo
|
2015-03-21 03:11:12 +08:00
|
|
|
* @busctl_offset: platform specific function to get busctl offset
|
2020-01-15 21:25:42 +08:00
|
|
|
* @get_toggle: platform specific function to get toggle
|
|
|
|
* @set_toggle: platform specific function to set toggle
|
2014-11-25 03:04:59 +08:00
|
|
|
*/
|
|
|
|
struct musb_io {
|
|
|
|
u32 (*ep_offset)(u8 epnum, u16 offset);
|
|
|
|
void (*ep_select)(void __iomem *mbase, u8 epnum);
|
|
|
|
u32 (*fifo_offset)(u8 epnum);
|
|
|
|
void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
|
|
|
|
void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
|
2015-03-21 03:11:12 +08:00
|
|
|
u32 (*busctl_offset)(u8 epnum, u16 offset);
|
2020-01-15 21:25:42 +08:00
|
|
|
u16 (*get_toggle)(struct musb_qh *qh, int is_out);
|
|
|
|
u16 (*set_toggle)(struct musb_qh *qh, int is_out, struct urb *urb);
|
2014-11-25 03:04:59 +08:00
|
|
|
};
|
|
|
|
|
2014-11-25 03:05:02 +08:00
|
|
|
/* Do not add new entries here, add them the struct musb_io instead */
|
|
|
|
extern u8 (*musb_readb)(const void __iomem *addr, unsigned offset);
|
|
|
|
extern void (*musb_writeb)(void __iomem *addr, unsigned offset, u8 data);
|
|
|
|
extern u16 (*musb_readw)(const void __iomem *addr, unsigned offset);
|
|
|
|
extern void (*musb_writew)(void __iomem *addr, unsigned offset, u16 data);
|
2018-05-21 21:42:10 +08:00
|
|
|
extern u32 musb_readl(const void __iomem *addr, unsigned offset);
|
|
|
|
extern void musb_writel(void __iomem *addr, unsigned offset, u32 data);
|
2008-12-03 03:33:46 +08:00
|
|
|
|
2008-07-24 17:27:36 +08:00
|
|
|
#endif
|