From patchwork Thu Jul 14 15:37:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Buchholz X-Patchwork-Id: 1656496 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=MZt/PuS/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LkJYn35Rzz9sB4 for ; Fri, 15 Jul 2022 01:38:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239327AbiGNPiv (ORCPT ); Thu, 14 Jul 2022 11:38:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239808AbiGNPig (ORCPT ); Thu, 14 Jul 2022 11:38:36 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73F8B63925; Thu, 14 Jul 2022 08:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657813095; bh=DtJnqs/sSTnIu3XjHE2BezrZQiBgwGyZEk5B116ynNQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=MZt/PuS/hLfThaTSR2wanewjwHHkJDUdJaOShzdUR80706ftTx4Ea+/bAfV91L8ud FUNxDmDmQ9MTnBXaDCog8iMujDeQ7A1QPwVV1JZ3NoAU4MbB5NYTYZ+vaLjtp0gnsU 8fPxkF5v6vV5yvX8jAA+PWmypDR2/sBB8/kM4ioU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from max-esprimop556.user.selfnet.de ([141.72.241.228]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1My36N-1nL89Z48K7-00zYLE; Thu, 14 Jul 2022 17:38:15 +0200 From: Max Buchholz To: Dmitry Torokhov , Rob Herring , Thierry Reding , Jonathan Hunter , Sameer Pujar Cc: Max Buchholz , David Heidelberg , Max Buchholz , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] dt-bindings: nvidia,tegra20-kbc: Convert to json-schema Date: Thu, 14 Jul 2022 17:37:31 +0200 Message-Id: <20220714153732.48698-1-max.buchholz@gmx.de> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:fIrSM4Gy1y4DV0VVUdtk9JrFSlEEZSzVRogeJi377bW5WwSVUcW A0GI622mXXcKHn8TFGwvftFPvCUNqx013rwmIYQPsYGae1FXE2R67znqsIIEEQ64jAcewnv KKD6qV1YP1O6FH3xIPwNQf6/1Q+pcvMUAy8kF4NX53RIeo8qr7n+wLLVFsXYp3ZcEqHPL+v pYuypIR2TT3/UT0tiWe3w== X-UI-Out-Filterresults: notjunk:1;V03:K0:JcalHAO1k7A=:8RBClnJt1vAxUzvv8Mzo6+ UuvhGP3LrQl134WotTYrrUyTR6IGEbmNdrApGKq+ohmvLbYG3mNgHsrXiZQnr1o+a7odlglKj /KGtK9mQPu6ECxKhU/6h0+5XJwrnYbPolPbVNd7SiwfkbHgKV+UYb2WobOVT13W/7dC+/0+Wh aq4fwZC5UUtg6kdBW2VBCmCvADzd2mxcFBvDXXf0g30EnbRfoKYpWV6omT7E0CsStPyif4cMJ GW3Ji4BVeSBpI5qkVM6Bn6NyV+Ij/9d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olearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Max Buchholz This converts the Nvidia Tegra keyboard controller bindings to YAML and fix them up a bit. Reviewed-by: David Heidelberg Signed-off-by: Max Buchholz --- .../bindings/input/nvidia,tegra20-kbc.txt | 55 --------- .../bindings/input/nvidia,tegra20-kbc.yaml | 109 ++++++++++++++++++ 2 files changed, 109 insertions(+), 55 deletions(-) delete mode 100644 Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt create mode 100644 Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.yaml -- 2.37.0 diff --git a/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt b/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt deleted file mode 100644 index 1faa7292e21f..000000000000 --- a/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt +++ /dev/null @@ -1,55 +0,0 @@ -* Tegra keyboard controller -The key controller has maximum 24 pins to make matrix keypad. Any pin -can be configured as row or column. The maximum column pin can be 8 -and maximum row pins can be 16 for Tegra20/Tegra30. - -Required properties: -- compatible: "nvidia,tegra20-kbc" -- reg: Register base address of KBC. -- interrupts: Interrupt number for the KBC. -- nvidia,kbc-row-pins: The KBC pins which are configured as row. This is an - array of pin numbers which is used as rows. -- nvidia,kbc-col-pins: The KBC pins which are configured as column. This is an - array of pin numbers which is used as column. -- linux,keymap: The keymap for keys as described in the binding document - devicetree/bindings/input/matrix-keymap.txt. -- clocks: Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. -- resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names: Must include the following entries: - - kbc - -Optional properties, in addition to those specified by the shared -matrix-keyboard bindings: - -- linux,fn-keymap: a second keymap, same specification as the - matrix-keyboard-controller spec but to be used when the KEY_FN modifier - key is pressed. -- nvidia,debounce-delay-ms: delay in milliseconds per row scan for debouncing -- nvidia,repeat-delay-ms: delay in milliseconds before repeat starts -- nvidia,ghost-filter: enable ghost filtering for this device -- wakeup-source: configure keyboard as a wakeup source for suspend/resume - (Legacy property supported: "nvidia,wakeup-source") - -Example: - -keyboard: keyboard { - compatible = "nvidia,tegra20-kbc"; - reg = <0x7000e200 0x100>; - interrupts = <0 85 0x04>; - clocks = <&tegra_car 36>; - resets = <&tegra_car 36>; - reset-names = "kbc"; - nvidia,ghost-filter; - nvidia,debounce-delay-ms = <640>; - nvidia,kbc-row-pins = <0 1 2>; /* pin 0, 1, 2 as rows */ - nvidia,kbc-col-pins = <11 12 13>; /* pin 11, 12, 13 as columns */ - linux,keymap = <0x00000074 - 0x00010067 - 0x00020066 - 0x01010068 - 0x02000069 - 0x02010070 - 0x02020071>; -}; diff --git a/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.yaml b/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.yaml new file mode 100644 index 000000000000..8ecd42e02f09 --- /dev/null +++ b/Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.yaml @@ -0,0 +1,109 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/input/nvidia,tegra20-kbc.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Nvidia Tegra keyboard controller + +maintainers: + - Jon Hunter + - Sameer Pujar + +description: The key controller has maximum 24 pins to make matrix keypad. Any pin + can be configured as row or column. + +allOf: + - $ref: "/schemas/input/matrix-keymap.yaml#" + +properties: + compatible: + oneOf: + - items: + - const: nvidia,tegra30-kbc + - const: nvidia,tegra20-kbc + - items: + - const: nvidia,tegra20-kbc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + nvidia,kbc-row-pins: + maxItems: 16 + description: KBC pins which are configured as row + $ref: /schemas/types.yaml#/definitions/uint32-array + + nvidia,kbc-col-pins: + maxItems: 8 + description: KBC pins which are configured as column + $ref: /schemas/types.yaml#/definitions/uint32-array + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + reset-names: + const: kbc + + linux,fn-keymap: + description: a secondary keymap to be used when the KEY_FN modifier key is pressed + + nvidia,debounce-delay-ms: + description: delay in milliseconds per row scan for debouncing + + nvidia,repeat-delay-ms: + description: delay in milliseconds before repeat starts + + nvidia,ghost-filter: + description: enable ghost filtering for this device + type: boolean + + wakeup-source: + description: configure keyboard as a wakeup source for suspend/resume + + nvidia,wakeup-source: + description: configure keyboard as a wakeup source for suspend/resume + deprecated: true + type: boolean + +required: + - compatible + - reg + - interrupts + - nvidia,kbc-row-pins + - nvidia,kbc-col-pins + - linux,keymap + - clocks + - resets + - reset-names + +additionalProperties: false + +examples: + - | + #include + + kbc@7000e200 { + compatible = "nvidia,tegra20-kbc"; + reg = <0x7000e200 0x100>; + interrupts = ; + clocks = <&tegra_car 36>; + resets = <&tegra_car 36>; + reset-names = "kbc"; + nvidia,ghost-filter; + nvidia,debounce-delay-ms = <640>; + nvidia,kbc-row-pins = <0 1 2>; /* pin 0, 1, 2 as rows */ + nvidia,kbc-col-pins = <11 12 13>; /* pin 11, 12, 13 as columns */ + linux,keymap = <0x00000074 + 0x00010067 + 0x00020066 + 0x01010068 + 0x02000069 + 0x02010070 + 0x02020071>; + };