From patchwork Fri Aug 15 16:08:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 4727821 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4BE259F38D for ; Fri, 15 Aug 2014 16:08:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B38E2015A for ; Fri, 15 Aug 2014 16:08:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D2FF2017D for ; Fri, 15 Aug 2014 16:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751506AbaHOQIg (ORCPT ); Fri, 15 Aug 2014 12:08:36 -0400 Received: from kdh-gw.itdev.co.uk ([89.21.227.133]:7612 "EHLO hermes.kdh.itdev.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751116AbaHOQIf (ORCPT ); Fri, 15 Aug 2014 12:08:35 -0400 Received: from [192.168.1.193] (unknown [192.168.1.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by hermes.kdh.itdev.co.uk (Postfix) with ESMTPSA id B328A7EA13; Fri, 15 Aug 2014 17:08:30 +0100 (BST) Message-ID: <53EE307E.8060507@itdev.co.uk> Date: Fri, 15 Aug 2014 17:08:30 +0100 From: Nick Dyer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 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 Subject: Re: [PATCH 2/2] Input: atmel_mxt_ts - Add keycodes array example References: <1407372486-25881-1-git-send-email-javier.martinez@collabora.co.uk> <1407372486-25881-2-git-send-email-javier.martinez@collabora.co.uk> <53E37329.4020002@itdev.co.uk> <53E4E41D.4070703@collabora.co.uk> <53EDF6B4.7080804@collabora.co.uk> In-Reply-To: <53EDF6B4.7080804@collabora.co.uk> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 15/08/14 13:01, Javier Martinez Canillas wrote: >> By passing all these keycodes the touchpad worked as expected for me and the >> driver did the same than the Chrome OS driver that has these keycodes hardcoded >> when is_tp is true. >> >>> at the protocol guide for T19. >> >> I don't have access to proper documentation and I wouldn't expect people to have >> access to non-public docs in order to use a Device Tree binding. >> >> That's why I wanted to document an example, so using this property could be >> easier for others and they shouldn't have to look at the driver in order to >> figure it out (and getting it wrong as you said :) ) >> >> So it would be great if you could provide an example on how this is supposed to >> be used. > > Any comments on this? I would really appreciate if you can expand on how > this DT property is supposed to be used so I can re-spin the atmel support > patch for Peach boards. The below patch improves the documentation for the gpio-property. Stephen Warren has a good example here: https://github.com/swarren/linux-tegra/commit/09789801 trackpad@4b { compatible = "atmel,maxtouch"; reg = <0x4b>; interrupt-parent = <&gpio>; interrupts = ; linux,gpio-keymap = <0 0 0 BTN_LEFT>; }; This maps BTN_LEFT to the 4th bit of the T19 message. I haven't looked up what GPIO number that corresponds to on the mXT224SL that he has, it varies with the particular maXTouch device you have. Hope this helps. Signed-off-by: Nick Dyer Acked-by: Stephen Warren --- Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt index baef432..1852906 100644 --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt @@ -11,10 +11,17 @@ Required properties: Optional properties for main touchpad device: -- linux,gpio-keymap: An array of up to 4 entries indicating the Linux - keycode generated by each GPIO. Linux keycodes are defined in +- linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages + on GPIO bit changes. An array of up to 8 entries can be provided + indicating the Linux keycode mapped to each bit of the status byte, + starting at the LSB. Linux keycodes are defined in . + Note: the numbering of the GPIOs and the bit they start at varies between + maXTouch devices. You must either refer to the documentation, or + experiment to determine which bit corresponds to which input. Use + KEY_RESERVED for unused padding values. + Example: touch@4b {