All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Gireesh.Hiremath@in.bosch.com>
To: <linux-omap@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-input@vger.kernel.org>,
	<bcousson@baylibre.com>, <tony@atomide.com>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <dmitry.torokhov@gmail.com>,
	<mkorpershoek@baylibre.com>, <davidgow@google.com>,
	<m.felsch@pengutronix.de>, <swboyd@chromium.org>,
	<fengping.yu@mediatek.com>, <y.oudjana@protonmail.com>,
	<rdunlap@infradead.org>, <colin.king@intel.com>,
	<Gireesh.Hiremath@in.bosch.com>
Cc: <sjoerd.simons@collabora.co.uk>,
	<VinayKumar.Shettar@in.bosch.com>,
	<Govindaraji.Sivanantham@in.bosch.com>,
	<anaclaudia.dias@de.bosch.com>
Subject: [PATCH v3 3/3] dt-bindings: input: gpio-matrix-keypad: add reduced matrix keypad bindings definition
Date: Fri, 19 Aug 2022 06:59:46 +0000	[thread overview]
Message-ID: <20220819065946.9572-3-Gireesh.Hiremath@in.bosch.com> (raw)
In-Reply-To: <20220819065946.9572-1-Gireesh.Hiremath@in.bosch.com>

From: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>

Add binding definition for the support of the reduced matrix
keypad driver.

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
---
 .../bindings/input/gpio-matrix-keypad.txt     | 96 +++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
index 570dc10f0cd7..1cedec29505c 100644
--- a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
+++ b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
@@ -1,11 +1,46 @@
 * GPIO driven matrix keypad device tree bindings
 
 GPIO driven matrix keypad is used to interface a SoC with a matrix keypad.
+
+Generic mode:
 The matrix keypad supports multiple row and column lines, a key can be
 placed at each intersection of a unique row and a unique column. The matrix
 keypad can sense a key-press and key-release by means of GPIO lines and
 report the event using GPIO interrupts to the cpu.
 
+Reduced mode:
+The reduced matric keypad supports multiple gpio lines, all gpio lines
+act as row as well as column lines, a key can be placed at each intersection
+of a row number not equal to a column number and they are diagonally
+symmetric.
+
+Example- For 5 gpio lines, possible matrix is 5x5 and maximum possible
+	keys are 10.
+
+	Sample matrix table for 7 buttons and 5 gpio lines
+
+        ------------------------------------------------------
+        |Row\Col |GPIO 0 | GPIO 1 | GPIO 2 | GPIO 3 | GPIO 4 |
+        ------------------------------------------------------
+        | GPIO 0 |  X    | KEY_9  | KEY_2  |   X    | KEY_1  |
+        ------------------------------------------------------
+        | GPIO 1 | KEY_9 |  X     | KEY_6  |   X    |  X     |
+        ------------------------------------------------------
+        | GPIO 2 | KEY_2 | KEY_6  |  X     | KEY_4  | KEY_7  |
+        ------------------------------------------------------
+        | GPIO 3 |  X    |  X     | KEY_4  |  X     | KEY_8  |
+        ------------------------------------------------------
+        | GPIO 4 | KEY_1 |  X     | KEY_7  | KEY_8  |  X     |
+        ------------------------------------------------------
+        X - invalid key
+        KEY_x - preferred key code
+
+The reduced mode sense a key-press and key-release by polling
+GPIO lines and report the event.
+
+
+Generic mode:
+
 Required Properties:
 - compatible:		Should be "gpio-matrix-keypad"
 - row-gpios:		List of gpios used as row lines. The gpio specifier
@@ -47,3 +82,64 @@ Example:
 				0x0101001C
 				0x0201006C>;
 	};
+
+Reduced mode:
+
+Required Properties:
+- compatible:		Should be "gpio-matrix-keypad-reduced"
+- number-of-buttons:	Number of buttons connected to the keypad controller.
+- line-gpios:		Gpio lines connected to keypad controller.
+			all gpio lines act as row as well as column lines.
+- linux,keymap:		An array of packed 1-cell entries containing the
+			equivalent of row, column and linux key-code.
+			The 32-bit big endian cell is packed as:
+			row << 24 | column << 16 | key-code
+
+Optional Properties:
+- poll-interval-ms:	Time interval between poll.
+- linux,no-autorepeat:	Do no enable autorepeat feature.
+- col-scan-delay-us:	Delay before scanning next active line.
+
+Example:
+        keypad {
+                compatible = "gpio-matrix-keypad-reduced";
+                poll-interval-ms = <10>;
+                col-scan-delay-us = <2>;
+                number-of-buttons = <7>;
+                linux,no-autorepeat;
+                line-gpios = <
+                        &gpio1 24 1     /*gpio_56*/
+                        &gpio1 23 1     /*gpio_55*/
+                        &gpio1 22 1     /*gpio_54*/
+                        &gpio1 20 1     /*gpio_52*/
+                        &gpio1 16 1     /*gpio_48*/
+                >;
+                linux,keymap = <
+                        0x00000000 /* row 0, col 0, KEY_RESERVED */
+                        0x0001000a /* row 0, col 1, KEY_9 */
+                        0x00020003 /* row 0, col 2, KEY_2 */
+                        0x00030000 /* row 0, col 3, KEY_RESERVED */
+                        0x00040002 /* row 0, col 4, KEY_1 */
+                        0x0100000a /* row 1, col 0, KEY_9 */
+                        0x01010000 /* row 1, col 1, KEY_RESERVED */
+                        0x01020007 /* row 1, col 2, KEY_6 */
+                        0x01030000 /* row 1, col 3, KEY_RESERVED */
+                        0x01040000 /* row 1, col 4, KEY_RESERVED */
+                        0x02000003 /* row 2, col 0, KEY_2 */
+                        0x02010007 /* row 2, col 1, KEY_6 */
+                        0x02020000 /* row 2, col 2, KEY_RESERVED */
+                        0x02030005 /* row 2, col 3, KEY_4 */
+                        0x02040008 /* row 2, col 4, KEY_7 */
+                        0x03000000 /* row 3, col 0, KEY_RESERVED */
+                        0x03010000 /* row 3, col 1, KEY_RESERVED */
+                        0x03020005 /* row 3, col 2, KEY_4 */
+                        0x03030000 /* row 3, col 3, KEY_RESERVED */
+                        0x03040009 /* row 3, col 4, KEY_8 */
+                        0x04000002 /* row 4, col 0, KEY_1 */
+                        0x04010000 /* row 4, col 1, KEY_RESERVED */
+                        0x04020008 /* row 4, col 2, KEY_7 */
+                        0x04030009 /* row 4, col 3, KEY_8 */
+                        0x04040000 /* row 4, col 4, KEY_RESERVED */
+                >;
+
+        };
-- 
2.20.1


  parent reply	other threads:[~2022-08-19  7:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  6:59 [PATCH v3 1/3] driver: input: matric-keypad: switch to gpiod Gireesh.Hiremath
2022-08-19  6:59 ` [PATCH v3 2/3] driver: input: matric-keypad: add reduced matrix support Gireesh.Hiremath
2022-08-19 10:35   ` kernel test robot
2022-08-19 11:45   ` kernel test robot
2022-08-19 12:10   ` Krzysztof Kozlowski
2022-08-19  6:59 ` Gireesh.Hiremath [this message]
2022-08-22 18:22   ` [PATCH v3 3/3] dt-bindings: input: gpio-matrix-keypad: add reduced matrix keypad bindings definition Rob Herring
2022-08-19 12:08 ` [PATCH v3 1/3] driver: input: matric-keypad: switch to gpiod Krzysztof Kozlowski
2022-08-19 13:12 ` Marco Felsch
2022-08-20  0:59   ` Dmitry Torokhov
2022-08-20 19:36     ` Marco Felsch
2022-08-21  5:00       ` Dmitry Torokhov
2022-08-19 15:53 kernel test robot
2022-08-22  7:36 ` Dan Carpenter
2022-08-22  7:36 ` Dan Carpenter
2022-08-19 17:36 [PATCH v3 2/3] driver: input: matric-keypad: add reduced matrix support kernel test robot
2022-08-22  7:40 ` Dan Carpenter
2022-08-22  7:40 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220819065946.9572-3-Gireesh.Hiremath@in.bosch.com \
    --to=gireesh.hiremath@in.bosch.com \
    --cc=Govindaraji.Sivanantham@in.bosch.com \
    --cc=VinayKumar.Shettar@in.bosch.com \
    --cc=anaclaudia.dias@de.bosch.com \
    --cc=bcousson@baylibre.com \
    --cc=colin.king@intel.com \
    --cc=davidgow@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fengping.yu@mediatek.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=sjoerd.simons@collabora.co.uk \
    --cc=swboyd@chromium.org \
    --cc=tony@atomide.com \
    --cc=y.oudjana@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.