From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dyer Subject: Re: [PATCH 2/2] Input: atmel_mxt_ts - Add keycodes array example Date: Thu, 07 Aug 2014 13:38:01 +0100 Message-ID: <53E37329.4020002@itdev.co.uk> References: <1407372486-25881-1-git-send-email-javier.martinez@collabora.co.uk> <1407372486-25881-2-git-send-email-javier.martinez@collabora.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from kdh-gw.itdev.co.uk ([89.21.227.133]:34161 "EHLO hermes.kdh.itdev.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754910AbaHGMiH (ORCPT ); Thu, 7 Aug 2014 08:38:07 -0400 In-Reply-To: <1407372486-25881-2-git-send-email-javier.martinez@collabora.co.uk> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Javier Martinez Canillas , Dmitry Torokhov Cc: Stephen Warren , Yufeng Shen , Benson Leung , Doug Anderson , Olof Johansson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org On 07/08/14 01:48, Javier Martinez Canillas wrote: > The Atmel maXTouch driver allows to dynamically define the > event keycodes set that the device is capable of. This may > not be evident when reading the DT binding document so add > an example to make it easier to understand how this works. > > Also, the current documentation says that the array limit > is four entries but the driver dynamically allocates the > keymap array and does not limit the array size. There is a physical limit to the number of GPIOs on the device. The number 4 is wrong, the protocol does allow for up to 8 GPIOs. But it is a hard limit. > > Signed-off-by: Javier Martinez Canillas > --- > Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt > index baef432..be50476 100644 > --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt > +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt > @@ -11,7 +11,7 @@ Required properties: > > Optional properties for main touchpad device: > > -- linux,gpio-keymap: An array of up to 4 entries indicating the Linux > +- linux,gpio-keymap: An array of entries indicating the Linux > keycode generated by each GPIO. Linux keycodes are defined in > . > > @@ -22,4 +22,10 @@ Example: > reg = <0x4b>; > interrupt-parent = <&gpio>; > interrupts = ; > + linux,gpio-keymap = < BTN_LEFT > + BTN_TOOL_FINGER > + BTN_TOOL_DOUBLETAP > + BTN_TOOL_TRIPLETAP > + BTN_TOOL_QUADTAP > + BTN_TOOL_QUINTTAP >; I'm afraid you have misunderstood the impact of this change to the way that the GPIOs coming in to the touch controller are mapped to key codes. Look at the protocol guide for T19. The DOUBLE/TRIPLE/QUAD/QUINTTAP stuff is filled in for us by the input core when we use INPUT_MT_POINTER, anyway.