[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100126095217.GC3480@core.coreip.homeip.net>
Date: Tue, 26 Jan 2010 01:52:17 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Alberto Panizzo <maramaopercheseimorto@...il.com>
Cc: H Hartley Sweeten <hartleys@...ionengravers.com>,
linux-input@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-arm-kernel-infradead <linux-arm-kernel@...ts.infradead.org>,
Sascha linux-arm <s.hauer@...gutronix.de>
Subject: Re: [PATCH v2] input: MXC: add mxc-keypad driver to support the
Keypad Port present in the mxc application processors family.
Hi Alberto,
On Sat, Jan 16, 2010 at 06:48:45PM +0100, Alberto Panizzo wrote:
> Version 2 for this driver proposal.
> --------------------------------------------------------------------------------
> The MXC family of Application Processors is shipped with a Keypad Port
> supported now by this driver.
>
> The peripheral can control up to an 8x8 matrix key pad where all the scanning
> procedure is done via software.
>
> The hardware provide two interrupts: one for a key pressed (KDI) and one for
> all key releases (KRI). There is also a simple circuit for glitch reduction
> (said for synchronization) made by two series of 3 D-latches clocked by the
> keypad-clock that stabilize the interrupts sources.
> KDI and KRI are fired only if the respective conditions are maintained for at
> last 4 keypad-clock cycle.
>
> Those simple synchronization circuits are used also for multiple key pressures:
> between a KDI and a KRI the driver reset the sync circuit and re-enable the KDI
> interrupt so after 3 keypad-clock cycle another KDI is fired making possible to
> repeat the matrix scan operation.
>
Nicely looking driver, thank you.
> This algorithm is done via a threaded management of the keypad interrupt source
> and delayed by a proper (and longer) debounce interval controlled by the
> platform initialization.
This I am not so sure about - the core of the matrix scan routine does
not sleep so I wonder if starting a separate thread is not too wasteful
in this case - you can easily do whan you want with a timer, no?
> +
> + /*
> + * Search for rows and cols enabled
> + */
> + keymap_data = (struct matrix_keymap_data *) pdata->keymap_data;
Why do you need to cast away constness instead of declaring keymap_data
as const pointer?
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists