Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt
[linux-2.6-block.git] / drivers / usb / musb / musb_io.h
CommitLineData
5fd54ace 1// SPDX-License-Identifier: GPL-2.0
550a7375
FB
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
550a7375
FB
8 */
9
10#ifndef __MUSB_LINUX_PLATFORM_ARCH_H__
11#define __MUSB_LINUX_PLATFORM_ARCH_H__
12
13#include <linux/io.h>
14
d026e9c7
TL
15#define musb_ep_select(_mbase, _epnum) musb->io.ep_select((_mbase), (_epnum))
16
5450ac88
TL
17/**
18 * struct musb_io - IO functions for MUSB
5450ac88
TL
19 * @ep_offset: platform specific function to get end point offset
20 * @ep_select: platform specific function to select end point
21 * @fifo_offset: platform specific function to get fifo offset
22 * @read_fifo: platform specific function to read fifo
23 * @write_fifo: platform specific function to write fifo
6cc2af6d 24 * @busctl_offset: platform specific function to get busctl offset
5450ac88
TL
25 */
26struct musb_io {
5450ac88
TL
27 u32 (*ep_offset)(u8 epnum, u16 offset);
28 void (*ep_select)(void __iomem *mbase, u8 epnum);
29 u32 (*fifo_offset)(u8 epnum);
30 void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
31 void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
6cc2af6d 32 u32 (*busctl_offset)(u8 epnum, u16 offset);
5450ac88
TL
33};
34
1b40fc57
TL
35/* Do not add new entries here, add them the struct musb_io instead */
36extern u8 (*musb_readb)(const void __iomem *addr, unsigned offset);
37extern void (*musb_writeb)(void __iomem *addr, unsigned offset, u8 data);
38extern u16 (*musb_readw)(const void __iomem *addr, unsigned offset);
39extern void (*musb_writew)(void __iomem *addr, unsigned offset, u16 data);
42e990ea
BL
40extern u32 musb_readl(const void __iomem *addr, unsigned offset);
41extern void musb_writel(void __iomem *addr, unsigned offset, u32 data);
2c557a4a 42
550a7375 43#endif