From: Stephen Warren <swarren@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 7/9] tegra: Add tegra keyboard driver
Date: Fri, 20 Jan 2012 16:50:43 -0700 [thread overview]
Message-ID: <4F19FDD3.8070807@nvidia.com> (raw)
In-Reply-To: <1326780682-10260-8-git-send-email-sjg@chromium.org>
On 01/16/2012 11:11 PM, Simon Glass wrote:
> From: Rakesh Iyer <riyer@nvidia.com>
>
> Add support for internal matrix keyboard controller for Nvidia Tegra platforms.
> This driver uses the fdt decode function to obtain its key codes.
...
> +static uchar *create_keymap(u32 *data, int len, int map_keycode, int *pos)
...
> + entry = row * KBC_MAX_COL + col;
> + map[entry] = key_code;
This needs to be range-checked.
> + if (pos && map_keycode == key_code)
> + *pos = entry;
> + }
> +
> + return map;
> +}
> +static int fdt_decode_kbc(const void *blob, int node, struct keyb *config)
...
> + /* Name needs to match "1,<type>keymap" */
> + debug("%s: property '%s'\n", __func__, name);
> + if (strncmp(name, "1,", 2) || len < 8 ||
> + strcmp(name + len - 6, "keymap"))
> + continue;
"linux," not "l,". Why not just strcmp against the two values simply and
directly; the above matches against totally bogus stuff like
"l,bogus-cruft-keymap".
> +
> + len -= 8;
No need for that right?
> +static int init_tegra_keyboard(void)
...
> + if (config.fn_keycode) {
> + if (input_add_table(&config.input, KEY_FN, -1,
> + config.fn_keycode, KBC_KEY_COUNT))
> + return -1;
> + }
I don't see anywhere that calls input_add_table() for config.plain_keycode.
> +int drv_keyboard_init(void)
> +{
> + struct stdio_dev dev;
> +
> + if (input_init(&config.input, 0)) {
> + debug("%s: Cannot set up input\n", __func__);
> + return -1;
> + }
> + config.input.read_keys = tegra_kbc_check;
Don't you want to set up config.input.* before passing it to
input_init() which might in theory use it?
> diff --git a/include/tegra-kbc.h b/include/tegra-kbc.h
> +#define KEY_IS_MODIFIER(key) ((key) >= KEY_FIRST_MODIFIER)
Shouldn't that be in the input layer or the file that defines the key codes?
--
nvpublic
next prev parent reply other threads:[~2012-01-20 23:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-17 6:11 [U-Boot] [PATCH v3 0/9] tegra: Enable keyboard with matrix keyboard driver Simon Glass
2012-01-17 6:11 ` [U-Boot] [PATCH v3 2/9] input: Add linux/input.h for key code support Simon Glass
2012-01-17 6:11 ` [U-Boot] [PATCH v3 3/9] input: Add generic keyboard input handler Simon Glass
2012-01-17 6:11 ` [U-Boot] [PATCH v3 4/9] tegra: Add keyboard support to funcmux Simon Glass
2012-01-20 23:23 ` Stephen Warren
[not found] ` <1326780682-10260-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-01-17 6:11 ` [PATCH v3 1/9] fdt: Add fdtdec functions to read byte array Simon Glass
2012-01-17 6:11 ` [U-Boot] " Simon Glass
2012-01-17 6:30 ` Mike Frysinger
2012-01-17 6:30 ` [U-Boot] " Mike Frysinger
[not found] ` <201201170130.48257.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-01-17 7:11 ` Simon Glass
2012-01-17 7:11 ` [U-Boot] " Simon Glass
2012-01-17 15:52 ` Mike Frysinger
2012-01-17 15:52 ` [U-Boot] " Mike Frysinger
2012-01-17 6:11 ` [PATCH v3 5/9] tegra: fdt: Add keyboard controller definition Simon Glass
2012-01-17 6:11 ` [U-Boot] " Simon Glass
[not found] ` <1326780682-10260-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-01-20 23:30 ` Stephen Warren
2012-01-20 23:30 ` [U-Boot] " Stephen Warren
2012-01-17 6:11 ` [PATCH v3 6/9] tegra: fdt: Add keyboard definitions for Seaboard Simon Glass
2012-01-17 6:11 ` [U-Boot] " Simon Glass
2012-01-17 6:11 ` [U-Boot] [PATCH v3 7/9] tegra: Add tegra keyboard driver Simon Glass
2012-01-20 23:50 ` Stephen Warren [this message]
2012-01-17 6:11 ` [U-Boot] [PATCH v3 8/9] tegra: Switch on console mux and use environment for console Simon Glass
2012-01-17 6:11 ` [U-Boot] [PATCH v3 9/9] tegra: Enable keyboard for Seaboard Simon Glass
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=4F19FDD3.8070807@nvidia.com \
--to=swarren@nvidia.com \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.