From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933868AbbBJAvs (ORCPT ); Mon, 9 Feb 2015 19:51:48 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:44173 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932574AbbBJAvq (ORCPT ); Mon, 9 Feb 2015 19:51:46 -0500 Date: Mon, 9 Feb 2015 16:51:34 -0800 From: Dmitry Torokhov To: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Grant Likely , Ray Jui , Jonathan Richardson , Dmitry Torokhov , Anatol Pomazao , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] Input: bcm-keypad: add device tree bindings Message-ID: <20150210005134.GA13695@dtor-ws> References: <1423526861-29579-1-git-send-email-sbranden@broadcom.com> <1423526861-29579-2-git-send-email-sbranden@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423526861-29579-2-git-send-email-sbranden@broadcom.com> 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 Hi Scott, On Mon, Feb 09, 2015 at 04:07:40PM -0800, Scott Branden wrote: > Documents the Broadcom keypad controller device tree bindings. > > Reviewed-by: Ray Jui > Signed-off-by: Scott Branden > --- > .../devicetree/bindings/input/brcm,bcm-keypad.txt | 118 +++++++++++++++++++++ > 1 file changed, 118 insertions(+) > create mode 100644 Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > > diff --git a/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt b/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > new file mode 100644 > index 0000000..645829d > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > @@ -0,0 +1,118 @@ > +* Broadcom Keypad Controller device tree bindings > + > +Broadcom Keypad controller is used to interface a SoC with a matrix-type > +keypad device. The keypad controller supports multiple row and column lines. > +A key can be placed at each intersection of a unique row and a unique column. > +The keypad controller can sense a key-press and key-release and report the > +event using a interrupt to the cpu. > + > +This binding is based on the matrix-keymap binding with the following > +changes: > + > +keypad,num-rows and keypad,num-columns are required. > + > +Required SoC Specific Properties: > +- compatible: should be "brcm,bcm-keypad" > + > +- reg: physical base address of the controller and length of memory mapped > + region. > + > +- interrupts: The interrupt number to the cpu. > + > +Board Specific Properties: > +- keypad,num-rows: Number of row lines connected to the keypad > + controller. > + > +- keypad,num-columns: Number of column lines connected to the > + keypad controller. > + > +- key-interrupt-trigger-type: The type of interrupt trigger asociated with the Keypad matrix. > + > + KEYPAD_INTERRUPT_NO_TRIGGER = 0 > + KEYPAD_INTERRUPT_RISING_EDGE = 1 > + KEYPAD_INTERRUPT_FALLING_EDGE = 2 > + KEYPAD_INTERRUPT_BOTH_EDGES = 3 Can we get this data from the interrupt spec? > + > +- col-debounce-filter-period: The debounce period for the Column filter. > + > + KEYPAD_DEBOUNCE_1_ms = 0 > + KEYPAD_DEBOUNCE_2_ms = 1 > + KEYPAD_DEBOUNCE_4_ms = 2 > + KEYPAD_DEBOUNCE_8_ms = 3 > + KEYPAD_DEBOUNCE_16_ms = 4 > + KEYPAD_DEBOUNCE_32_ms = 5 > + KEYPAD_DEBOUNCE_64_ms = 6 > + KEYPAD_DEBOUNCE_128_ms = 7 > + > +- status-debounce-filter-period: The debounce period for the Status filter. > + > + KEYPAD_DEBOUNCE_1_ms = 0 > + KEYPAD_DEBOUNCE_2_ms = 1 > + KEYPAD_DEBOUNCE_4_ms = 2 > + KEYPAD_DEBOUNCE_8_ms = 3 > + KEYPAD_DEBOUNCE_16_ms = 4 > + KEYPAD_DEBOUNCE_32_ms = 5 > + KEYPAD_DEBOUNCE_64_ms = 6 > + KEYPAD_DEBOUNCE_128_ms = 7 I could swear device-specific properties should be in form of , to ensure it won't clash with changes on subsystem level later on. Device-tree folks, what say you? > + > +- row-output-enabled: An optional property indicating whether the row or > + column is being used as output. If specified the row is being used > + as the output. Else defaults to column. > + > +- pull-up-enabled: An optional property indicating the Keypad scan mode. > + If specified implies the keypad scan pull-up has been enabled. > + > +- Keys represented as child nodes: Each key connected to the keypad > + controller is represented as a child node to the keypad controller > + device node and should include the following properties. > + - row: the row number to which the key is connected. > + - column: the column number to which the key is connected. > + - code: the key-code to be reported when the key is pressed > + and released. That does not seem to be right, linux,keymap is a list, not a subtree. I'd simply refer to Documentation/devicetree/bindings/input/matrix-keymap.txt for details. > + > +Example: > +#include "dt-bindings/input/input.h" > + > +/ { > + keypad: keypad@180ac000 { > + /* Required SoC specific properties */ > + compatible = "brcm,bcm-keypad"; > + > + /* Required Board specific properties */ > + keypad,num-rows = <5>; > + keypad,num-columns = <5>; > + status = "okay"; > + > + linux,keymap = + MATRIX_KEY(0x00, 0x03, KEY_HOME) /* key_home */ > + MATRIX_KEY(0x00, 0x04, KEY_M) /* key_message */ > + MATRIX_KEY(0x01, 0x00, KEY_A) /* key_contacts */ > + MATRIX_KEY(0x01, 0x01, KEY_1) /* key_1 */ > + MATRIX_KEY(0x01, 0x02, KEY_2) /* key_2 */ > + MATRIX_KEY(0x01, 0x03, KEY_3) /* key_3 */ > + MATRIX_KEY(0x01, 0x04, KEY_S) /* key_speaker */ > + MATRIX_KEY(0x02, 0x00, KEY_P) /* key_phone */ > + MATRIX_KEY(0x02, 0x01, KEY_4) /* key_4 */ > + MATRIX_KEY(0x02, 0x02, KEY_5) /* key_5 */ > + MATRIX_KEY(0x02, 0x03, KEY_6) /* key_6 */ > + MATRIX_KEY(0x02, 0x04, KEY_VOLUMEUP) /* key_vol_up */ > + MATRIX_KEY(0x03, 0x00, KEY_C) /* key_call_log */ > + MATRIX_KEY(0x03, 0x01, KEY_7) /* key_7 */ > + MATRIX_KEY(0x03, 0x02, KEY_8) /* key_8 */ > + MATRIX_KEY(0x03, 0x03, KEY_9) /* key_9 */ > + MATRIX_KEY(0x03, 0x04, KEY_VOLUMEDOWN) /* key_vol_down */ > + MATRIX_KEY(0x04, 0x00, KEY_H) /* key_headset */ > + MATRIX_KEY(0x04, 0x01, KEY_KPASTERISK) /* key_* */ > + MATRIX_KEY(0x04, 0x02, KEY_0) /* key_0 */ > + MATRIX_KEY(0x04, 0x03, KEY_GRAVE) /* key_# */ > + MATRIX_KEY(0x04, 0x04, KEY_MUTE) /* key_mute */ > + >; > + > + /* Optional board specific properties */ > + key-interrupt-trigger-type = <3>; > + col-debounce-filter-period = <5>; > + row-output-enabled; > + pull-up-enabled; > + > + }; > +}; > -- > 2.2.2 > Thanks. -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH 1/2] Input: bcm-keypad: add device tree bindings Date: Mon, 9 Feb 2015 16:51:34 -0800 Message-ID: <20150210005134.GA13695@dtor-ws> References: <1423526861-29579-1-git-send-email-sbranden@broadcom.com> <1423526861-29579-2-git-send-email-sbranden@broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1423526861-29579-2-git-send-email-sbranden-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Scott Branden Cc: bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Grant Likely , Ray Jui , Jonathan Richardson , Dmitry Torokhov , Anatol Pomazao , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org Hi Scott, On Mon, Feb 09, 2015 at 04:07:40PM -0800, Scott Branden wrote: > Documents the Broadcom keypad controller device tree bindings. > > Reviewed-by: Ray Jui > Signed-off-by: Scott Branden > --- > .../devicetree/bindings/input/brcm,bcm-keypad.txt | 118 +++++++++++++++++++++ > 1 file changed, 118 insertions(+) > create mode 100644 Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > > diff --git a/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt b/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > new file mode 100644 > index 0000000..645829d > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > @@ -0,0 +1,118 @@ > +* Broadcom Keypad Controller device tree bindings > + > +Broadcom Keypad controller is used to interface a SoC with a matrix-type > +keypad device. The keypad controller supports multiple row and column lines. > +A key can be placed at each intersection of a unique row and a unique column. > +The keypad controller can sense a key-press and key-release and report the > +event using a interrupt to the cpu. > + > +This binding is based on the matrix-keymap binding with the following > +changes: > + > +keypad,num-rows and keypad,num-columns are required. > + > +Required SoC Specific Properties: > +- compatible: should be "brcm,bcm-keypad" > + > +- reg: physical base address of the controller and length of memory mapped > + region. > + > +- interrupts: The interrupt number to the cpu. > + > +Board Specific Properties: > +- keypad,num-rows: Number of row lines connected to the keypad > + controller. > + > +- keypad,num-columns: Number of column lines connected to the > + keypad controller. > + > +- key-interrupt-trigger-type: The type of interrupt trigger asociated with the Keypad matrix. > + > + KEYPAD_INTERRUPT_NO_TRIGGER = 0 > + KEYPAD_INTERRUPT_RISING_EDGE = 1 > + KEYPAD_INTERRUPT_FALLING_EDGE = 2 > + KEYPAD_INTERRUPT_BOTH_EDGES = 3 Can we get this data from the interrupt spec? > + > +- col-debounce-filter-period: The debounce period for the Column filter. > + > + KEYPAD_DEBOUNCE_1_ms = 0 > + KEYPAD_DEBOUNCE_2_ms = 1 > + KEYPAD_DEBOUNCE_4_ms = 2 > + KEYPAD_DEBOUNCE_8_ms = 3 > + KEYPAD_DEBOUNCE_16_ms = 4 > + KEYPAD_DEBOUNCE_32_ms = 5 > + KEYPAD_DEBOUNCE_64_ms = 6 > + KEYPAD_DEBOUNCE_128_ms = 7 > + > +- status-debounce-filter-period: The debounce period for the Status filter. > + > + KEYPAD_DEBOUNCE_1_ms = 0 > + KEYPAD_DEBOUNCE_2_ms = 1 > + KEYPAD_DEBOUNCE_4_ms = 2 > + KEYPAD_DEBOUNCE_8_ms = 3 > + KEYPAD_DEBOUNCE_16_ms = 4 > + KEYPAD_DEBOUNCE_32_ms = 5 > + KEYPAD_DEBOUNCE_64_ms = 6 > + KEYPAD_DEBOUNCE_128_ms = 7 I could swear device-specific properties should be in form of , to ensure it won't clash with changes on subsystem level later on. Device-tree folks, what say you? > + > +- row-output-enabled: An optional property indicating whether the row or > + column is being used as output. If specified the row is being used > + as the output. Else defaults to column. > + > +- pull-up-enabled: An optional property indicating the Keypad scan mode. > + If specified implies the keypad scan pull-up has been enabled. > + > +- Keys represented as child nodes: Each key connected to the keypad > + controller is represented as a child node to the keypad controller > + device node and should include the following properties. > + - row: the row number to which the key is connected. > + - column: the column number to which the key is connected. > + - code: the key-code to be reported when the key is pressed > + and released. That does not seem to be right, linux,keymap is a list, not a subtree. I'd simply refer to Documentation/devicetree/bindings/input/matrix-keymap.txt for details. > + > +Example: > +#include "dt-bindings/input/input.h" > + > +/ { > + keypad: keypad@180ac000 { > + /* Required SoC specific properties */ > + compatible = "brcm,bcm-keypad"; > + > + /* Required Board specific properties */ > + keypad,num-rows = <5>; > + keypad,num-columns = <5>; > + status = "okay"; > + > + linux,keymap = + MATRIX_KEY(0x00, 0x03, KEY_HOME) /* key_home */ > + MATRIX_KEY(0x00, 0x04, KEY_M) /* key_message */ > + MATRIX_KEY(0x01, 0x00, KEY_A) /* key_contacts */ > + MATRIX_KEY(0x01, 0x01, KEY_1) /* key_1 */ > + MATRIX_KEY(0x01, 0x02, KEY_2) /* key_2 */ > + MATRIX_KEY(0x01, 0x03, KEY_3) /* key_3 */ > + MATRIX_KEY(0x01, 0x04, KEY_S) /* key_speaker */ > + MATRIX_KEY(0x02, 0x00, KEY_P) /* key_phone */ > + MATRIX_KEY(0x02, 0x01, KEY_4) /* key_4 */ > + MATRIX_KEY(0x02, 0x02, KEY_5) /* key_5 */ > + MATRIX_KEY(0x02, 0x03, KEY_6) /* key_6 */ > + MATRIX_KEY(0x02, 0x04, KEY_VOLUMEUP) /* key_vol_up */ > + MATRIX_KEY(0x03, 0x00, KEY_C) /* key_call_log */ > + MATRIX_KEY(0x03, 0x01, KEY_7) /* key_7 */ > + MATRIX_KEY(0x03, 0x02, KEY_8) /* key_8 */ > + MATRIX_KEY(0x03, 0x03, KEY_9) /* key_9 */ > + MATRIX_KEY(0x03, 0x04, KEY_VOLUMEDOWN) /* key_vol_down */ > + MATRIX_KEY(0x04, 0x00, KEY_H) /* key_headset */ > + MATRIX_KEY(0x04, 0x01, KEY_KPASTERISK) /* key_* */ > + MATRIX_KEY(0x04, 0x02, KEY_0) /* key_0 */ > + MATRIX_KEY(0x04, 0x03, KEY_GRAVE) /* key_# */ > + MATRIX_KEY(0x04, 0x04, KEY_MUTE) /* key_mute */ > + >; > + > + /* Optional board specific properties */ > + key-interrupt-trigger-type = <3>; > + col-debounce-filter-period = <5>; > + row-output-enabled; > + pull-up-enabled; > + > + }; > +}; > -- > 2.2.2 > Thanks. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: dmitry.torokhov@gmail.com (Dmitry Torokhov) Date: Mon, 9 Feb 2015 16:51:34 -0800 Subject: [PATCH 1/2] Input: bcm-keypad: add device tree bindings In-Reply-To: <1423526861-29579-2-git-send-email-sbranden@broadcom.com> References: <1423526861-29579-1-git-send-email-sbranden@broadcom.com> <1423526861-29579-2-git-send-email-sbranden@broadcom.com> Message-ID: <20150210005134.GA13695@dtor-ws> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Scott, On Mon, Feb 09, 2015 at 04:07:40PM -0800, Scott Branden wrote: > Documents the Broadcom keypad controller device tree bindings. > > Reviewed-by: Ray Jui > Signed-off-by: Scott Branden > --- > .../devicetree/bindings/input/brcm,bcm-keypad.txt | 118 +++++++++++++++++++++ > 1 file changed, 118 insertions(+) > create mode 100644 Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > > diff --git a/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt b/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > new file mode 100644 > index 0000000..645829d > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt > @@ -0,0 +1,118 @@ > +* Broadcom Keypad Controller device tree bindings > + > +Broadcom Keypad controller is used to interface a SoC with a matrix-type > +keypad device. The keypad controller supports multiple row and column lines. > +A key can be placed at each intersection of a unique row and a unique column. > +The keypad controller can sense a key-press and key-release and report the > +event using a interrupt to the cpu. > + > +This binding is based on the matrix-keymap binding with the following > +changes: > + > +keypad,num-rows and keypad,num-columns are required. > + > +Required SoC Specific Properties: > +- compatible: should be "brcm,bcm-keypad" > + > +- reg: physical base address of the controller and length of memory mapped > + region. > + > +- interrupts: The interrupt number to the cpu. > + > +Board Specific Properties: > +- keypad,num-rows: Number of row lines connected to the keypad > + controller. > + > +- keypad,num-columns: Number of column lines connected to the > + keypad controller. > + > +- key-interrupt-trigger-type: The type of interrupt trigger asociated with the Keypad matrix. > + > + KEYPAD_INTERRUPT_NO_TRIGGER = 0 > + KEYPAD_INTERRUPT_RISING_EDGE = 1 > + KEYPAD_INTERRUPT_FALLING_EDGE = 2 > + KEYPAD_INTERRUPT_BOTH_EDGES = 3 Can we get this data from the interrupt spec? > + > +- col-debounce-filter-period: The debounce period for the Column filter. > + > + KEYPAD_DEBOUNCE_1_ms = 0 > + KEYPAD_DEBOUNCE_2_ms = 1 > + KEYPAD_DEBOUNCE_4_ms = 2 > + KEYPAD_DEBOUNCE_8_ms = 3 > + KEYPAD_DEBOUNCE_16_ms = 4 > + KEYPAD_DEBOUNCE_32_ms = 5 > + KEYPAD_DEBOUNCE_64_ms = 6 > + KEYPAD_DEBOUNCE_128_ms = 7 > + > +- status-debounce-filter-period: The debounce period for the Status filter. > + > + KEYPAD_DEBOUNCE_1_ms = 0 > + KEYPAD_DEBOUNCE_2_ms = 1 > + KEYPAD_DEBOUNCE_4_ms = 2 > + KEYPAD_DEBOUNCE_8_ms = 3 > + KEYPAD_DEBOUNCE_16_ms = 4 > + KEYPAD_DEBOUNCE_32_ms = 5 > + KEYPAD_DEBOUNCE_64_ms = 6 > + KEYPAD_DEBOUNCE_128_ms = 7 I could swear device-specific properties should be in form of , to ensure it won't clash with changes on subsystem level later on. Device-tree folks, what say you? > + > +- row-output-enabled: An optional property indicating whether the row or > + column is being used as output. If specified the row is being used > + as the output. Else defaults to column. > + > +- pull-up-enabled: An optional property indicating the Keypad scan mode. > + If specified implies the keypad scan pull-up has been enabled. > + > +- Keys represented as child nodes: Each key connected to the keypad > + controller is represented as a child node to the keypad controller > + device node and should include the following properties. > + - row: the row number to which the key is connected. > + - column: the column number to which the key is connected. > + - code: the key-code to be reported when the key is pressed > + and released. That does not seem to be right, linux,keymap is a list, not a subtree. I'd simply refer to Documentation/devicetree/bindings/input/matrix-keymap.txt for details. > + > +Example: > +#include "dt-bindings/input/input.h" > + > +/ { > + keypad: keypad at 180ac000 { > + /* Required SoC specific properties */ > + compatible = "brcm,bcm-keypad"; > + > + /* Required Board specific properties */ > + keypad,num-rows = <5>; > + keypad,num-columns = <5>; > + status = "okay"; > + > + linux,keymap = + MATRIX_KEY(0x00, 0x03, KEY_HOME) /* key_home */ > + MATRIX_KEY(0x00, 0x04, KEY_M) /* key_message */ > + MATRIX_KEY(0x01, 0x00, KEY_A) /* key_contacts */ > + MATRIX_KEY(0x01, 0x01, KEY_1) /* key_1 */ > + MATRIX_KEY(0x01, 0x02, KEY_2) /* key_2 */ > + MATRIX_KEY(0x01, 0x03, KEY_3) /* key_3 */ > + MATRIX_KEY(0x01, 0x04, KEY_S) /* key_speaker */ > + MATRIX_KEY(0x02, 0x00, KEY_P) /* key_phone */ > + MATRIX_KEY(0x02, 0x01, KEY_4) /* key_4 */ > + MATRIX_KEY(0x02, 0x02, KEY_5) /* key_5 */ > + MATRIX_KEY(0x02, 0x03, KEY_6) /* key_6 */ > + MATRIX_KEY(0x02, 0x04, KEY_VOLUMEUP) /* key_vol_up */ > + MATRIX_KEY(0x03, 0x00, KEY_C) /* key_call_log */ > + MATRIX_KEY(0x03, 0x01, KEY_7) /* key_7 */ > + MATRIX_KEY(0x03, 0x02, KEY_8) /* key_8 */ > + MATRIX_KEY(0x03, 0x03, KEY_9) /* key_9 */ > + MATRIX_KEY(0x03, 0x04, KEY_VOLUMEDOWN) /* key_vol_down */ > + MATRIX_KEY(0x04, 0x00, KEY_H) /* key_headset */ > + MATRIX_KEY(0x04, 0x01, KEY_KPASTERISK) /* key_* */ > + MATRIX_KEY(0x04, 0x02, KEY_0) /* key_0 */ > + MATRIX_KEY(0x04, 0x03, KEY_GRAVE) /* key_# */ > + MATRIX_KEY(0x04, 0x04, KEY_MUTE) /* key_mute */ > + >; > + > + /* Optional board specific properties */ > + key-interrupt-trigger-type = <3>; > + col-debounce-filter-period = <5>; > + row-output-enabled; > + pull-up-enabled; > + > + }; > +}; > -- > 2.2.2 > Thanks. -- Dmitry