From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id C301D1CF2A0 for ; Mon, 16 Jul 2018 15:53:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C063788E94 for ; Mon, 16 Jul 2018 15:53:31 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HXfsDEiOAeKL for ; Mon, 16 Jul 2018 15:53:30 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 44E6088DE4 for ; Mon, 16 Jul 2018 15:53:30 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id s11-v6so32423963wra.13 for ; Mon, 16 Jul 2018 08:53:30 -0700 (PDT) From: Sergio Paracuellos Subject: [PATCH v4 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers Date: Mon, 16 Jul 2018 17:53:11 +0200 Message-Id: <1531756403-7197-4-git-send-email-sergio.paracuellos@gmail.com> In-Reply-To: <1531756403-7197-1-git-send-email-sergio.paracuellos@gmail.com> References: <1531756403-7197-1-git-send-email-sergio.paracuellos@gmail.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index e09bdcb..ed15443 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -193,6 +193,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) { -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel