From: viresh kumar <viresh.kumar@st.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Pratyush ANAND <pratyush.anand@st.com>,
Rajeev KUMAR <rajeev-dlh.kumar@st.com>,
Bhupesh SHARMA <bhupesh.sharma@st.com>,
Armando VISCONTI <armando.visconti@st.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
Vipin KUMAR <vipin.kumar@st.com>,
Shiraz HASHIM <shiraz.hashim@st.com>,
Vipul Kumar SAMAR <vipulkumar.samar@st.com>,
Deepak SIKRI <deepak.sikri@st.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 21/74] ST SPEAr : Added keyboard support
Date: Wed, 1 Sep 2010 12:31:24 +0530 [thread overview]
Message-ID: <4C7DFA44.3050204@st.com> (raw)
In-Reply-To: <20100901063158.GF23585@core.coreip.homeip.net>
On 9/1/2010 12:01 PM, Dmitry Torokhov wrote:
>>>> +#define DECLARE_KEYMAP(name) \
>>>> > >> +int name[] = {\
>>>> > >> + KEY(0, 0, KEY_ESC), \
[snip...]
>>>> > >> + KEY(8, 6, KEY_KP2), \
>>>> > >> + KEY(8, 7, KEY_KP3), \
>>>> > >> + KEY(8, 8, KEY_KP0), \
>>>> > >> +};
>>> > >
>>> > > Hm, I'd expect this to be in particular board code, not in the header
>>> > > file.
>>> > >
>> >
>> > Currently we have support for evaluation boards only and all of them will have
>> > this structure in their board source files. In order to remove redundant code we
>> > kept it in plat/keyboard.h.
>> >
> So call it "spear_default_keymap" and put it right into the driver? And
> then allow platform code override it.
>
Renaming is fine but I would still like to keep spear_default_keymap in
platform files instead of driver.
>>>> > >> +struct spear_kbd {
>>>> > >> + struct input_dev *input;
>>>> > >> + void __iomem *io_base; /* Keyboard Base Address */
>>>> > >> + struct clk *clk;
>>>> > >> + int *keymap;
>>> > >
>>> > > You need a copy of keymap here so that userspace can modify it safely
>>> > > via EVIOCSKEYCODE.
>>> > >
>> >
>> > We have one copy of struct spear_kbd per device structure. I think it
>> > will be fine if we change this structure only. And so don't need to copy
>> > another structure in driver.
> Normally such platform data should be declared as 'const' and drivers
> should not modify such data. Also unbinding device from driver and
> rebinding later should restore the device into pristine state. Having a
> copy of keymap in spear_kbd allows to achieve such behavior.
>
OK.
viresh.
prev parent reply other threads:[~2010-09-01 7:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1283161023.git.viresh.kumar@st.com>
2010-08-30 10:43 ` [PATCH 21/74] ST SPEAr : Added keyboard support Viresh KUMAR
2010-08-30 16:48 ` Dmitry Torokhov
2010-09-01 5:23 ` rajeev
2010-09-01 5:41 ` rajeev
2010-09-01 6:31 ` Dmitry Torokhov
2010-09-01 7:01 ` viresh kumar [this message]
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=4C7DFA44.3050204@st.com \
--to=viresh.kumar@st.com \
--cc=armando.visconti@st.com \
--cc=bhupesh.sharma@st.com \
--cc=deepak.sikri@st.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=pratyush.anand@st.com \
--cc=rajeev-dlh.kumar@st.com \
--cc=shiraz.hashim@st.com \
--cc=vipin.kumar@st.com \
--cc=vipulkumar.samar@st.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;
as well as URLs for NNTP newsgroup(s).