From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, patches@opensource.cirrus.com
Subject: [PATCH 09/14] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding
Date: Sun, 18 Aug 2024 21:58:06 -0700 [thread overview]
Message-ID: <20240819045813.2154642-10-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20240819045813.2154642-1-dmitry.torokhov@gmail.com>
The binding with a sub-node per each key is very verbose and is hard to
use with static device properties. Allow standard matrix keymap binding
in addition to the verbose one.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
.../input/samsung,s3c6410-keypad.yaml | 57 ++++++++++++++++++-
1 file changed, 54 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
index a53569aa0ee7..28a318a0ff7e 100644
--- a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
+++ b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
@@ -16,6 +16,10 @@ description:
maintainers:
- Krzysztof Kozlowski <krzk@kernel.org>
+allOf:
+ - $ref: input.yaml#
+ - $ref: matrix-keymap.yaml#
+
properties:
compatible:
enum:
@@ -37,6 +41,10 @@ properties:
wakeup-source: true
+ keypad,num-columns: true
+ keypad,num-rows: true
+ linux,keymap: true
+
linux,input-no-autorepeat:
type: boolean
description:
@@ -81,12 +89,33 @@ patternProperties:
- keypad,row
- linux,code
+dependencies:
+ linux,keymap:
+ required:
+ - keypad,num-columns
+ - keypad,num-rows
+
required:
- compatible
- reg
- interrupts
- - samsung,keypad-num-columns
- - samsung,keypad-num-rows
+
+if:
+ required:
+ - linux,keymap
+then:
+ properties:
+ samsung,keypad-num-columns: false
+ samsung,keypad-num-rows: false
+ patternProperties:
+ '^key-[0-9a-z]+$': false
+else:
+ properties:
+ keypad,num-columns: false
+ keypad,num-rows: false
+ required:
+ - samsung,keypad-num-columns
+ - samsung,keypad-num-rows
additionalProperties: false
@@ -94,8 +123,9 @@ examples:
- |
#include <dt-bindings/clock/exynos4.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/input/input.h>
- keypad@100a0000 {
+ keypad1@100a0000 {
compatible = "samsung,s5pv210-keypad";
reg = <0x100a0000 0x100>;
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
@@ -119,3 +149,24 @@ examples:
linux,code = <3>;
};
};
+ - |
+ #include <dt-bindings/clock/exynos4.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/input/input.h>
+
+ keypad2@100a0000 {
+ compatible = "samsung,s5pv210-keypad";
+ reg = <0x100a0000 0x100>;
+ interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clock CLK_KEYIF>;
+ clock-names = "keypad";
+
+ keypad,num-rows = <2>;
+ keypad,num-columns = <8>;
+ linux,keymap = <
+ MATRIX_KEY(0, 3, 2)
+ MATRIX_KEY(0, 4, 3)
+ >;
+ linux,input-no-autorepeat;
+ wakeup-source;
+ };
--
2.46.0.184.g6999bdac58-goog
next prev parent reply other threads:[~2024-08-19 4:58 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 4:57 [PATCH 00/14] Remove support for platform data from samsung keypad Dmitry Torokhov
2024-08-19 4:57 ` [PATCH 01/14] Input: samsung-keypad - switch to using devm_clk_get_prepared() Dmitry Torokhov
2024-08-19 12:51 ` Krzysztof Kozlowski
2024-08-19 14:46 ` Dmitry Torokhov
2024-08-19 4:57 ` [PATCH 02/14] Input: samsung-keypad - do not set input device's parent explicitly Dmitry Torokhov
2024-08-19 12:51 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 03/14] Input: samsung-keypad - do not combine memory allocation checks Dmitry Torokhov
2024-08-19 12:52 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 04/14] Input: samsung-keypad - use struct_size() helper Dmitry Torokhov
2024-08-19 12:52 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 05/14] Input: samsung-keypad - use devm to disable runtime PM Dmitry Torokhov
2024-08-19 12:54 ` Krzysztof Kozlowski
2024-08-19 14:47 ` Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 06/14] Input: samsung-keypad - use guard notation to acquire mutex Dmitry Torokhov
2024-08-22 15:48 ` Krzysztof Kozlowski
2024-08-22 18:07 ` Dmitry Torokhov
2024-08-23 6:06 ` Krzysztof Kozlowski
2024-08-23 8:32 ` Dmitry Torokhov
2024-08-23 8:52 ` Krzysztof Kozlowski
2024-08-23 15:41 ` Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 07/14] Input: samsung-keypad - use per-chip parameters Dmitry Torokhov
2024-08-19 12:57 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 08/14] Input: samsung-keypad - use BIT() and GENMASK() where appropriate Dmitry Torokhov
2024-08-19 4:58 ` Dmitry Torokhov [this message]
2024-08-19 13:02 ` [PATCH 09/14] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding Krzysztof Kozlowski
2024-08-19 15:49 ` Dmitry Torokhov
2024-08-19 16:48 ` Conor Dooley
2024-08-19 17:14 ` Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 10/14] Input: samsung-keypad - handle " Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 11/14] ARM: s3c: crag6410: switch keypad device to software properties Dmitry Torokhov
2024-08-22 15:41 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 12/14] Input: samsung-keypad - remove support for platform data Dmitry Torokhov
2024-08-19 4:58 ` [PATCH 13/14] ARM: s3c: crag6410: use software nodes/properties to set up GPIO keys Dmitry Torokhov
2024-08-22 15:50 ` Krzysztof Kozlowski
2024-08-19 4:58 ` [PATCH 14/14] ARM: s3c: crag6410 - convert GPIO lookup tables to property entries Dmitry Torokhov
2024-08-22 15:49 ` Krzysztof Kozlowski
2024-08-19 9:40 ` [PATCH 00/14] Remove support for platform data from samsung keypad Arnd Bergmann
2024-10-04 13:38 ` Dmitry Torokhov
2024-10-04 14:58 ` Mark Brown
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=20240819045813.2154642-10-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=patches@opensource.cirrus.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).