From: Mark Rutland <mark.rutland@arm.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH 4/5] input: tc3589x-keypad: support probing from device tree
Date: Thu, 31 Oct 2013 17:58:40 -0700 [thread overview]
Message-ID: <20131101005840.GB8413@kartoffel> (raw)
In-Reply-To: <1381872071-23455-1-git-send-email-linus.walleij@linaro.org>
On Tue, Oct 15, 2013 at 10:21:11PM +0100, Linus Walleij wrote:
> Implement device tree probing for the tc3589x keypad driver.
> This is modeled on the STMPE keypad driver and tested on the
> Ux500 TVK1281618 UIB.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/input/keyboard/tc3589x-keypad.c | 63 +++++++++++++++++++++++++++++++--
> 1 file changed, 61 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c
> index 208de7c..f6ec0d7 100644
> --- a/drivers/input/keyboard/tc3589x-keypad.c
> +++ b/drivers/input/keyboard/tc3589x-keypad.c
> @@ -297,6 +297,62 @@ static void tc3589x_keypad_close(struct input_dev *input)
> tc3589x_keypad_disable(keypad);
> }
>
> +#ifdef CONFIG_OF
> +static const struct tc3589x_keypad_platform_data *
> +tc3589x_keypad_of_probe(struct device *dev)
> +{
> + struct device_node *np = dev->of_node;
> + struct tc3589x_keypad_platform_data *plat;
> + u32 debounce_ms;
> + int proplen;
> +
> + if (!np)
> + return ERR_PTR(-ENODEV);
> +
> + plat = devm_kzalloc(dev, sizeof(*plat), GFP_KERNEL);
> + if (!plat)
> + return ERR_PTR(-ENOMEM);
> +
> + of_property_read_u8(np, "keypad,num-columns", &plat->kcol);
> + of_property_read_u8(np, "keypad,num-rows", &plat->krow);
These look wrong to me, as almost every single use of of_property_read_u8 (or
of_property_read_u16) do. They read _packed_ values out of the dt, and do not
read (u32) cells as u8s or u16s.
The matrix-keymap binding doesn't define these as 8-bit, and the example
binding they are u32 cells. Either the binding document or this code is wrong.
I'm confused as to how this can work. Are you using /bits/ 8 in your dts?
Thanks,
Mark.
next prev parent reply other threads:[~2013-11-01 0:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 21:21 [PATCH 4/5] input: tc3589x-keypad: support probing from device tree Linus Walleij
2013-10-16 6:39 ` Dmitry Torokhov
2013-10-16 7:50 ` Linus Walleij
2013-11-01 0:58 ` Mark Rutland [this message]
2013-11-01 16:08 ` Linus Walleij
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=20131101005840.GB8413@kartoffel \
--to=mark.rutland@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.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).