public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Driver for TC35894XBG keypad controller
       [not found] ` <20101005161838.16209.16231.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2010-10-05 17:47   ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2010-10-05 17:47 UTC (permalink / raw)
  To: Alan Cox
  Cc: linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Tue, Oct 05, 2010 at 05:19:18PM +0100, Alan Cox wrote:
> +
> +/*
> + * Largest keycode that the chip can send, plus one,
> + * so keys can be mapped directly at the index of the
> + * TC35894XBG keycode instead of subtracting one.
> + */
> +#define TC35894XBG_KEYMAP_SIZE      (0x7f + 1)
> +
> +#define SHIFT_NEEDED    (0x1000)
> +
> +#define KEY_EXCLAM      (KEY_1 + SHIFT_NEEDED)  /* '!' -> shift+1 */
> +#define KEY_AT          (KEY_2 + SHIFT_NEEDED)  /* '@' -> shift+2 */
> +#define KEY_NUMBER_SIGN (KEY_3 + SHIFT_NEEDED)  /* '#' -> shift+3 */
> +#define KEY_DOLLAR_SIGN (KEY_4 + SHIFT_NEEDED)  /* '$' -> shift+4 */
> +#define KEY_NOR         (KEY_6 + SHIFT_NEEDED)  /* '^' -> shift+6 */
> +#define KEY_PERCENT     (KEY_5 + SHIFT_NEEDED)  /* '%' -> shift+5 */
> +#define KEY_AMPERSAND   (KEY_7 + SHIFT_NEEDED)  /* '&' -> shift+7 */
> +#define KEY_PLUS        (KEY_EQUAL + SHIFT_NEEDED) /* '+' -> shift+= */
> +
> +#define KEY_BAR         (KEY_BACKSLASH + SHIFT_NEEDED)  /* '|' -> shift+\ */
> +#define KEY_COLON       (KEY_SEMICOLON + SHIFT_NEEDED)  /* ':' -> shift+; */
> +#define KEY_UNDERSCORE  (KEY_MINUS + SHIFT_NEEDED) /* '_' -> shift+- */
> +#define KEY_QUOTE_DBL   (KEY_APOSTROPHE + SHIFT_NEEDED) /* '"' -> shift+' */

No, this will not fly. It assumes presence of certain keymap which is not
necessarily the case.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Driver for TC35894XBG keypad controller
       [not found] <20101005161838.16209.16231.stgit@localhost.localdomain>
       [not found] ` <20101005161838.16209.16231.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2010-10-06 16:09 ` Rabin Vincent
  1 sibling, 0 replies; 2+ messages in thread
From: Rabin Vincent @ 2010-10-06 16:09 UTC (permalink / raw)
  To: Alan Cox; +Cc: dmitry.torokhov, linux-input, linux-i2c, sundar.iyer

On Tue, Oct 05, 2010 at 04:19:18PM -0000, Alan Cox wrote:
> +config KEYBOARD_TC35894XBG
> +	tristate "TC35894XBG I2C keypad support"

This looks one of the TC3589x family of I/O expanders.  For the TC35892,
there's already a minimal MFD core in driver/mfd/tc35892.c, and a driver
for the GPIO block based on that in drivers/gpio/tc35892-gpio.c.

Comparing the registers map in this patch with the TC35892 datasheet,
the parts look very similar, so would it be possible for you to make
this driver use the TC35892 MFD core, so that multiple blocks can used
simultaneously?

There's no keypad driver for the series in mainline yet, but Sundar was
readying one for the TC35893; I'll let him comment on how similar the
keypad parts look, and what it would take to support the TC35894XBG and
TC35893 keypads in one driver.

Rabin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-06 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20101005161838.16209.16231.stgit@localhost.localdomain>
     [not found] ` <20101005161838.16209.16231.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-10-05 17:47   ` [PATCH] Driver for TC35894XBG keypad controller Dmitry Torokhov
2010-10-06 16:09 ` Rabin Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox