From patchwork Thu Mar 27 00:04:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 3895861 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EFD4EBF540 for ; Thu, 27 Mar 2014 00:08:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D00D2021C for ; Thu, 27 Mar 2014 00:08:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26E7320218 for ; Thu, 27 Mar 2014 00:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755028AbaC0AI3 (ORCPT ); Wed, 26 Mar 2014 20:08:29 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:50039 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756639AbaC0AG4 (ORCPT ); Wed, 26 Mar 2014 20:06:56 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2R06lTR006439; Wed, 26 Mar 2014 19:06:47 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2R06l8f031039; Wed, 26 Mar 2014 19:06:47 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Wed, 26 Mar 2014 19:06:47 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2R06kxY010564; Wed, 26 Mar 2014 19:06:47 -0500 From: Felipe Balbi To: Balaji T K CC: , , , Linux OMAP Mailing List , Linux Kernel Mailing List , Felipe Balbi Subject: [PATCH 3/5] mmc: host: omap_hsmmc: introduce new accessor functions Date: Wed, 26 Mar 2014 19:04:48 -0500 Message-ID: <1395878690-9650-4-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.9.1.286.g5172cb3 In-Reply-To: <1395878690-9650-1-git-send-email-balbi@ti.com> References: <1395878690-9650-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP we introduce new accessors which provide for register access with and without offsets. This is just to make sure newer versions of the IP can access the new registers prepended at the beginning of the address space. Signed-off-by: Felipe Balbi --- drivers/mmc/host/omap_hsmmc.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index d46f768..e596c6a 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -211,6 +211,42 @@ struct omap_hsmmc_host { struct omap_mmc_platform_data *pdata; }; +static inline int _omap_hsmmc_read(struct omap_hsmmc_host *host, + u32 reg, bool offset) +{ + return readl(host->base + reg + (offset ? host->reg_offset : 0)); +} + +static inline void _omap_hsmmc_write(struct omap_hsmmc_host *host, + u32 reg, u32 val, bool offset) +{ + writel(val, host->base + reg + (offset ? host->reg_offset : 0)); +} + +static inline int omap_hsmmc_read_offset(struct omap_hsmmc_host *host, + u32 reg) +{ + return _omap_hsmmc_read(host, reg, true); +} + +static inline void omap_hsmmc_write_offset(struct omap_hsmmc_host *host, + u32 reg, u32 val) +{ + _omap_hsmmc_write(host, reg, val, true); +} + +static inline int omap_hsmmc_read_no_offset(struct omap_hsmmc_host *host, + u32 reg) +{ + return _omap_hsmmc_read(host, reg, false); +} + +static inline void omap_hsmmc_write_no_offset(struct omap_hsmmc_host *host, + u32 reg, u32 val) +{ + _omap_hsmmc_write(host, reg, val, false); +} + struct omap_mmc_of_data { u32 reg_offset; u8 controller_flags;