From patchwork Thu Dec 20 20:23:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1901371 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4CFDDDF23A for ; Thu, 20 Dec 2012 20:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630Ab2LTUbo (ORCPT ); Thu, 20 Dec 2012 15:31:44 -0500 Received: from mail-qc0-f201.google.com ([209.85.216.201]:63604 "EHLO mail-qc0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983Ab2LTUbo (ORCPT ); Thu, 20 Dec 2012 15:31:44 -0500 X-Greylist: delayed 455 seconds by postgrey-1.27 at vger.kernel.org; Thu, 20 Dec 2012 15:31:43 EST Received: by mail-qc0-f201.google.com with SMTP id a6so406001qch.0 for ; Thu, 20 Dec 2012 12:31:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=aY4SLYAh2T/I8Hvu8GL1WfXVruPPmkfEm7W+JpS3+To=; b=ognmu47dhzQ8f98eIAmZ7nAG/eFiLlDx7bebbhZgrrDmZ3TtrFF5plDepTCV2DjVrl gyBAUtWDQuxGUxfprcSyJbvojfJ1E2MCSocyb/i22RoHmnKrEDDZqid4eqyZtU8WKKYk VJiW6VVPBOb02yF2oH/nuW+SUIpLSSuLZDMOtuin47AkPuTIqv5vmHmv4NlY67IviTwP 5Hr3To9t5DbQvMLTgj5SsIUkLEPauwHJ/aHd7dJ/ED8P/vnFv2+9M/up0CpRiNnOv2Oi 2XcVVHBnX7NB9BG0TNdLEpUEJlXnh6pSyqwkfgm5yCnxk8uJwc0Pz5GW64id0vb57caw Nddg== X-Received: by 10.236.120.70 with SMTP id o46mr4529719yhh.39.1356035047852; Thu, 20 Dec 2012 12:24:07 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id r10si452593ann.1.2012.12.20.12.24.07 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 20 Dec 2012 12:24:07 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id A4644100048; Thu, 20 Dec 2012 12:24:07 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 2EBAF160A9C; Thu, 20 Dec 2012 12:24:07 -0800 (PST) From: Simon Glass To: LKML Cc: Simon Glass , linux-input@vger.kernel.org, Rob Landley , Grant Likely , devicetree-discuss@lists.ozlabs.org, Roland Stigge , linux-doc@vger.kernel.org, Vincent Palatin , Wolfram Sang , Dmitry Torokhov , Felipe Balbi , Sourav Poddar , Luigi Semenzato , Olof Johansson , Rob Herring , Dmitry Torokhov , Stephen Warren Subject: [PATCH] RFC: input: Extend matrix-keypad device tree binding Date: Thu, 20 Dec 2012 12:23:58 -0800 Message-Id: <1356035039-21653-1-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQmD1MiFVMYQo5kd67j5sJGpJf8wQS60lcaLHFvIiuHW8F8qBvBsyF/f2ShHIvjLrQzqlGFP+NKdUCrxtbds/fo3DomV9NJoyFtFDtoXg6HCAA+30OdFgfbmQLr9jVmhCb47ZjKmvbG0REfo3jZge5G98G6cqFMNMqSx0s5kYMUtxB8QH11erK1mCEZYj24pA/24uV24WJH9JFG8V69OGCdAst4GMA== Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Some matrix keypad drivers can support different numbers of rows and columns. Add a generic binding for these. Also define properties for the repeat rate, to allow a sane baseline to be set up for the driver. Implementation note: In order to implement this binding in the kernel, we will need to modify matrix_keypad_() to look up the number of rows and cols in the keymap. Perhaps this could be done by passing 0 for these parameters? Many of the parameters can already be set to NULL. Ick. For the key repeat feature, we need to set this after the input device is registered. So we would need to add a matrix_keypad_setup_input() or similar to be called by the driver after input_register_device(). I am less keen on that idea, and less again on the alternative of perhaps matrix_keypad_register_device() which does input_register_device() and then sets up the key repeat. Thoughts? Signed-off-by: Simon Glass Reviewed-by: Stephen Warren --- .../devicetree/bindings/input/matrix-keymap.txt | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/Documentation/devicetree/bindings/input/matrix-keymap.txt b/Documentation/devicetree/bindings/input/matrix-keymap.txt index 3cd8b98..b953d27 100644 --- a/Documentation/devicetree/bindings/input/matrix-keymap.txt +++ b/Documentation/devicetree/bindings/input/matrix-keymap.txt @@ -9,6 +9,16 @@ Required properties: row << 24 | column << 16 | key-code Optional properties: +Properties for the number of rows and columns are optional because some +drivers will use fixed values for these. +- keypad,num-rows: Number of row lines connected to the keypad controller. +- keypad,num-columns: Number of column lines connected to the keypad + controller. +- keypad,repeat-delay-ms: Number of milliseconds of delay before the first + keyboard repeat when a key is held down. +- keypad,repeat-rate-ms: Number of milliseconds between each subsequent + keyboard repeat when a key is held down. + Some users of this binding might choose to specify secondary keymaps for cases where there is a modifier key such as a Fn key. Proposed names for said properties are "linux,fn-keymap" or with another descriptive @@ -17,3 +27,7 @@ word for the modifier other from "Fn". Example: linux,keymap = < 0x00030012 0x0102003a >; + keypad,num-rows = <2>; + keypad,num-columns = <8>; + keypad,repeat-delay-ms = <600>; + keypad,repeat-rate-ms = <60>;