1 From 7e92994ec22c9d337f6012ac913e7958012ad52e Mon Sep 17 00:00:00 2001
2 From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
3 Date: Tue, 25 Jun 2019 09:09:28 +0000
4 Subject: [PATCH] PCI: mobiveil: Add 8-bit and 16-bit CSR register accessors
6 There are some 8-bit and 16-bit registers in PCIe configuration
7 space, so add these accessors accordingly.
9 Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
10 Reviewed-by: Minghuan Lian <Minghuan.Lian@nxp.com>
11 Reviewed-by: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
13 drivers/pci/controller/mobiveil/pcie-mobiveil.h | 20 ++++++++++++++++++++
14 1 file changed, 20 insertions(+)
16 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h
17 +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h
18 @@ -182,9 +182,29 @@ static inline u32 csr_readl(struct mobiv
19 return csr_read(pcie, off, 0x4);
22 +static inline u32 csr_readw(struct mobiveil_pcie *pcie, u32 off)
24 + return csr_read(pcie, off, 0x2);
27 +static inline u32 csr_readb(struct mobiveil_pcie *pcie, u32 off)
29 + return csr_read(pcie, off, 0x1);
32 static inline void csr_writel(struct mobiveil_pcie *pcie, u32 val, u32 off)
34 csr_write(pcie, val, off, 0x4);
37 +static inline void csr_writew(struct mobiveil_pcie *pcie, u32 val, u32 off)
39 + csr_write(pcie, val, off, 0x2);
42 +static inline void csr_writeb(struct mobiveil_pcie *pcie, u32 val, u32 off)
44 + csr_write(pcie, val, off, 0x1);
47 #endif /* _PCIE_MOBIVEIL_H */