Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757470Ab0KJXar (ORCPT ); Wed, 10 Nov 2010 18:30:47 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:52200 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757268Ab0KJXap (ORCPT ); Wed, 10 Nov 2010 18:30:45 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=ER6HZE1/mznvCuJtjLoV7f3VGrm2ajCB3Zh40ZN5fsC/VEqC/jh7LRiOWbtNANgTXh hR4tqcVWQYNiyaKtXp33t83yThCJK38NJEHg+KWYymC051mpAlnCLzi+1Fu03w0RsFUa yfg2x3+1rPvKUN/VWO2a51oizxdGHADIv5BF0= Date: Wed, 10 Nov 2010 15:30:36 -0800 From: Dmitry Torokhov To: Eric Miao Cc: Trilok Soni , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, rtc-linux@googlegroups.com, linux-arm-msm@vger.kernel.org Subject: Re: [RFC v1 PATCH 1/6] matrix_keypad: Increase the max limit of rows and columns Message-ID: <20101110233036.GB2121@core.coreip.homeip.net> References: <1289393281-4459-1-git-send-email-tsoni@codeaurora.org> <1289393281-4459-2-git-send-email-tsoni@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1838 Lines: 48 On Thu, Nov 11, 2010 at 02:33:45AM +0800, Eric Miao wrote: > On Wed, Nov 10, 2010 at 8:47 PM, Trilok Soni wrote: > > Some keyboard controller have support for more than > > 16 columns and rows. > > > > Cc: Dmitry Torokhov > > Cc: Eric Miao > > Signed-off-by: Trilok Soni > > --- > > ?include/linux/input/matrix_keypad.h | ? ?8 ++++---- > > ?1 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h > > index 80352ad..d80845e 100644 > > --- a/include/linux/input/matrix_keypad.h > > +++ b/include/linux/input/matrix_keypad.h > > @@ -4,11 +4,11 @@ > > ?#include > > ?#include > > > > -#define MATRIX_MAX_ROWS ? ? ? ? ? ? ? ?16 > > -#define MATRIX_MAX_COLS ? ? ? ? ? ? ? ?16 > > +#define MATRIX_MAX_ROWS ? ? ? ? ? ? ? ?18 > > +#define MATRIX_MAX_COLS ? ? ? ? ? ? ? ?18 > > > > -#define KEY(row, col, val) ? ? ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ > > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ > > +#define KEY(row, col, val) ? ? ((((row) % (MATRIX_MAX_ROWS)) << 24) |\ > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(((col) % (MATRIX_MAX_COLS)) << 16) |\ > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (val & 0xffff)) > > > > Or maybe we can solve this completely by introducing something like: > > struct matrix_keycode { > int row; > int col; > int value; Though that triples the space needed to store initial keymaps. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/