aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-08-03 10:26:56 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-08 14:08:41 +0200
commit52ed727ca031ca7a6fcfde55a2902ac4845d736c (patch)
treec56099070c993653fb2748db60ccddea4cdd6dc4 /drivers/staging
parentstaging: mt7621-pci: remove dead code derived to not use custom reads and writes (diff)
downloadlinux-dev-52ed727ca031ca7a6fcfde55a2902ac4845d736c.tar.xz
linux-dev-52ed727ca031ca7a6fcfde55a2902ac4845d736c.zip
staging: mt7621-pci: add pcie_write and pcie_read helpers
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/mt7621-pci/pci-mt7621.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 68f47147cbdb..fe9c68fbe364 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -204,6 +204,16 @@ struct mt7621_pcie {
struct list_head ports;
};
+static inline u32 pcie_read(struct mt7621_pcie *pcie, u32 reg)
+{
+ return readl(pcie->base + reg);
+}
+
+static inline void pcie_write(struct mt7621_pcie *pcie, u32 val, u32 reg)
+{
+ writel(val, pcie->base + reg);
+}
+
static inline u32 mt7621_pci_get_cfgaddr(unsigned int bus, unsigned int slot,
unsigned int func, unsigned int where)
{