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: 27164 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 01E5D20369 for ; Thu, 27 Mar 2014 00:08:55 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id hw13sf5407198qab.1 for ; Wed, 26 Mar 2014 17:08:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=rPj+rpXFOuAlJF6GbS4uO9iddp4FmykK6TPkgJxTlUk=; b=KFYj2WMmrgnq4Wkc1gGhXsipDzJdLpwpe09HoHn2NLgKP4+fQlmAK1je6f3Oi+wzr+ cjYWj2F/tcZi9OsPLZ5EYLvsJ51u9T52Yxtwm+4ACXnHZsWHpurkxYzCbJC2IYRjbixg dv4ETmtLbFrxRPzBafOayXu28xZBBjt04rJ1Js3Sc1sEUADwTPdeTzFJAi/rQDA9rweq YQFORZNxXJRCKzC/0smARrQqL4ExvD9uTUGicQsWNoU+vf/Tjxad6m5if8o8ciIt8EbS W3vzHm6aQrrs/sRCB0GzvDM9DLE8ViKJFJu/1l6fbKA0opJ0PdduZpjB4pLvgOlO3/6S dE8Q== X-Gm-Message-State: ALoCoQmhXvJXbAVXCuTkW5pwhAryUCkIgBAMnZMlyrjGwEJZfM/NG+t1+Ym6HNVLaQZ1BCiNOHow X-Received: by 10.224.30.4 with SMTP id s4mr9303540qac.5.1395878935729; Wed, 26 Mar 2014 17:08:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.138 with SMTP id 10ls849787qgj.92.gmail; Wed, 26 Mar 2014 17:08:55 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr61671815vec.15.1395878922039; Wed, 26 Mar 2014 17:08:42 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id nd7si59307vec.211.2014.03.26.17.08.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 17:08:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hu19so3413270vcb.1 for ; Wed, 26 Mar 2014 17:08:41 -0700 (PDT) X-Received: by 10.52.99.168 with SMTP id er8mr11351387vdb.26.1395878921722; Wed, 26 Mar 2014 17:08:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp85964vck; Wed, 26 Mar 2014 17:08:41 -0700 (PDT) X-Received: by 10.66.146.199 with SMTP id te7mr7850679pab.106.1395878920878; Wed, 26 Mar 2014 17:08:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td10si138905pac.140.2014.03.26.17.08.40; Wed, 26 Mar 2014 17:08:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755500AbaC0AIa (ORCPT + 26 others); Wed, 26 Mar 2014 20:08:30 -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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;