diff options
author | Sergio Paracuellos <sergio.paracuellos@gmail.com> | 2018-11-04 11:49:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-11 11:36:14 -0800 |
commit | c8242bef7c02c5fe16cb2d2b7e16f998a64b1604 (patch) | |
tree | 39cbc009542b6fe0448a8eaf68a7ce5fb71aded0 /drivers/staging/mt7621-pci | |
parent | a80775d647d3f9b3e25081ca49cc2311a78b7419 (diff) | |
download | linux-c8242bef7c02c5fe16cb2d2b7e16f998a64b1604.tar.bz2 |
staging: mt7621-pci: add two helpers for read and write pcie register ports
mt7621-pcie_port data structure has filed 'base' as the base address for
read and write related port registers. Create two inline functions
'pcie_port_read' and 'pcie_port_write' to make this task easier and
code more readable.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-pci')
-rw-r--r-- | drivers/staging/mt7621-pci/pci-mt7621.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 357bbddb02ad..04e82c30c2e0 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -175,6 +175,17 @@ static inline void pcie_write(struct mt7621_pcie *pcie, u32 val, u32 reg) writel(val, pcie->base + reg); } +static inline u32 pcie_port_read(struct mt7621_pcie_port *port, u32 reg) +{ + return readl(port->base + reg); +} + +static inline void pcie_port_write(struct mt7621_pcie_port *port, + u32 val, u32 reg) +{ + writel(val, port->base + reg); +} + static inline u32 mt7621_pci_get_cfgaddr(unsigned int bus, unsigned int slot, unsigned int func, unsigned int where) { |