From: Felipe Balbi <balbi@ti.com>
To: "Poddar, Sourav" <sourav.poddar@ti.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
balbi@ti.com
Subject: Re: [PATCH RESEND] Input: omap-keypad: dynamically handle register offsets
Date: Wed, 11 Apr 2012 11:56:39 +0300 [thread overview]
Message-ID: <20120411085638.GC12064@arwen.pp.htv.fi> (raw)
In-Reply-To: <CAKdam57PkBQXTHv3VZ79vQ_v4TZYLxKCP4FY01XFEQJ-PPLkuQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 928 bytes --]
On Wed, Apr 11, 2012 at 02:19:48PM +0530, Poddar, Sourav wrote:
> >> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
> >> +{
> >> + if (keypad_data->revision == KBD_REVISION_OMAP4)
> >> + return __raw_readl(keypad_data->base + offset);
> >> + else if (keypad_data->revision == KBD_REVISION_OMAP5)
> >> + return __raw_readl(keypad_data->base + offset + 0x10);
> >> +
> >> + return -ENODEV;
> >
> > Instead do:
> >
> > return __raw_readl(keypad_data->base + keypad_data->reg_offset +
> > offset);
> >> +}
> I have a couple of doubts on this:
> 1. Before using kbd_readl/kbd_write anywhere we
> need to populate the "keypad_data->reg_offset" with the register address
> which we need to read or write.
no no... keypad_data->reg_offset would be 0 or 0x10 depending on the
scheme you decode from revision.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-04-11 8:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-03 5:22 [PATCH RESEND] Input: omap-keypad: dynamically handle register offsets Sourav Poddar
2012-04-06 7:41 ` S, Venkatraman
2012-04-06 13:26 ` Shubhrajyoti
2012-04-10 9:24 ` Felipe Balbi
[not found] ` <CAKdam56-Pu+WJKLUpodTzOzGuGbAHuqZ3F-zVmrAtFM7EDhxpg@mail.gmail.com>
2012-04-10 10:16 ` Felipe Balbi
2012-04-10 10:30 ` Poddar, Sourav
2012-04-10 16:23 ` Dmitry Torokhov
2012-04-10 16:39 ` H Hartley Sweeten
2012-04-10 17:47 ` Dmitry Torokhov
2012-04-11 8:49 ` Poddar, Sourav
2012-04-11 8:56 ` Felipe Balbi [this message]
2012-04-11 9:04 ` Poddar, Sourav
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=20120411085638.GC12064@arwen.pp.htv.fi \
--to=balbi@ti.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=sourav.poddar@ti.com \
/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