From: Balaji T K <balajitk@ti.com>
To: Felipe Balbi <balbi@ti.com>
Cc: <chris@printf.net>, <ulf.hansson@linaro.org>,
<linux-mmc@vger.kernel.org>,
Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] mmc: host: omap_hsmmc: introduce new accessor functions
Date: Thu, 24 Apr 2014 20:47:38 +0530 [thread overview]
Message-ID: <53592B12.8090700@ti.com> (raw)
In-Reply-To: <1395878690-9650-4-git-send-email-balbi@ti.com>
On Thursday 27 March 2014 05:34 AM, Felipe Balbi wrote:
> 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 <balbi@ti.com>
> ---
> 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,
I think you can rename this function as just omap_hsmmc_read
(removing _offset suffix)
> + u32 reg)
> +{
> + return _omap_hsmmc_read(host, reg, true);
> +}
> +
> +static inline void omap_hsmmc_write_offset(struct omap_hsmmc_host *host,
and this one as omap_hsmmc_write since this version of read/write is most often
used, the one with no_offset might be used less often.
next prev parent reply other threads:[~2014-04-24 15:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 0:04 [PATCH 0/5] mmc: host: omap_hsmmc: a few improvements Felipe Balbi
2014-03-27 0:04 ` [PATCH 1/5] mmc: host: omap_hsmmc: pass host as an argument Felipe Balbi
2014-03-27 0:04 ` [PATCH 2/5] mmc: host: omap_hsmmc: add reg_offset field Felipe Balbi
2014-03-27 0:04 ` [PATCH 3/5] mmc: host: omap_hsmmc: introduce new accessor functions Felipe Balbi
2014-04-24 15:17 ` Balaji T K [this message]
2014-03-27 0:04 ` [PATCH 4/5] mmc: host: omap_hsmmc: switch over to new accessors Felipe Balbi
2014-03-27 0:04 ` [PATCH 5/5] mmc: host: omap_hsmmc: set max_blk_size correctly Felipe Balbi
2014-03-27 0:12 ` Felipe Balbi
2014-04-21 17:32 ` [PATCH 0/5] mmc: host: omap_hsmmc: a few improvements Felipe Balbi
2014-04-22 15:30 ` Balaji T K
2014-04-22 15:48 ` Felipe Balbi
2014-04-23 16:26 ` Felipe Balbi
2014-04-24 15:21 ` Balaji T K
2014-04-24 15:26 ` Felipe Balbi
2014-04-24 14:31 ` Balaji T K
2014-04-24 14:39 ` Felipe Balbi
2014-04-24 14:43 ` Balaji T K
2014-04-24 14:48 ` Felipe Balbi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53592B12.8090700@ti.com \
--to=balajitk@ti.com \
--cc=balbi@ti.com \
--cc=chris@printf.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox