Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: input: Convert mtk-pmic-keys to DT schema

Convert the mtk-pmic-keys to DT schema format.

The old binding was missing documentation for key press/release
interrupts, even though it was supported in hardware and driver,
so support for the same was added during the conversion.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220914103021.43593-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

AngeloGioacchino Del Regno and committed by
Dmitry Torokhov
612a0f0b 7984b435

+113 -46
+113
Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/mediatek,pmic-keys.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MediaTek PMIC Keys 8 + 9 + maintainers: 10 + - Chen Zhong <chen.zhong@mediatek.com> 11 + 12 + allOf: 13 + - $ref: input.yaml# 14 + 15 + description: | 16 + There are two key functions provided by MT6397, MT6323 and other MediaTek 17 + PMICs: pwrkey and homekey. 18 + The key functions are defined as the subnode of the function node provided 19 + by the PMIC that is defined as a Multi-Function Device (MFD). 20 + 21 + For MediaTek MT6323/MT6397 PMIC bindings see 22 + Documentation/devicetree/bindings/mfd/mt6397.txt 23 + 24 + properties: 25 + compatible: 26 + enum: 27 + - mediatek,mt6323-keys 28 + - mediatek,mt6358-keys 29 + - mediatek,mt6397-keys 30 + 31 + power-off-time-sec: true 32 + 33 + mediatek,long-press-mode: 34 + description: | 35 + Key long-press force shutdown setting 36 + 0 - disabled 37 + 1 - pwrkey 38 + 2 - pwrkey+homekey 39 + $ref: /schemas/types.yaml#/definitions/uint32 40 + default: 0 41 + maximum: 2 42 + 43 + patternProperties: 44 + "^((power|home)|(key-[a-z0-9-]+|[a-z0-9-]+-key))$": 45 + $ref: input.yaml# 46 + 47 + properties: 48 + interrupts: 49 + minItems: 1 50 + items: 51 + - description: Key press interrupt 52 + - description: Key release interrupt 53 + 54 + interrupt-names: true 55 + 56 + linux-keycodes: 57 + maxItems: 1 58 + 59 + wakeup-source: true 60 + 61 + required: 62 + - linux,keycodes 63 + 64 + if: 65 + properties: 66 + interrupt-names: 67 + contains: 68 + const: powerkey 69 + then: 70 + properties: 71 + interrupt-names: 72 + minItems: 1 73 + items: 74 + - const: powerkey 75 + - const: powerkey_r 76 + else: 77 + properties: 78 + interrupt-names: 79 + minItems: 1 80 + items: 81 + - const: homekey 82 + - const: homekey_r 83 + 84 + unevaluatedProperties: false 85 + 86 + required: 87 + - compatible 88 + 89 + unevaluatedProperties: false 90 + 91 + examples: 92 + - | 93 + #include <dt-bindings/input/input.h> 94 + #include <dt-bindings/interrupt-controller/arm-gic.h> 95 + 96 + pmic { 97 + compatible = "mediatek,mt6397"; 98 + 99 + keys { 100 + compatible = "mediatek,mt6397-keys"; 101 + mediatek,long-press-mode = <1>; 102 + power-off-time-sec = <0>; 103 + 104 + key-power { 105 + linux,keycodes = <KEY_POWER>; 106 + wakeup-source; 107 + }; 108 + 109 + key-home { 110 + linux,keycodes = <KEY_VOLUMEDOWN>; 111 + }; 112 + }; 113 + };
-46
Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
··· 1 - MediaTek MT6397/MT6323 PMIC Keys Device Driver 2 - 3 - There are two key functions provided by MT6397/MT6323 PMIC, pwrkey 4 - and homekey. The key functions are defined as the subnode of the function 5 - node provided by MT6397/MT6323 PMIC that is being defined as one kind 6 - of Muti-Function Device (MFD) 7 - 8 - For MT6397/MT6323 MFD bindings see: 9 - Documentation/devicetree/bindings/mfd/mt6397.txt 10 - 11 - Required properties: 12 - - compatible: Should be one of: 13 - - "mediatek,mt6397-keys" 14 - - "mediatek,mt6323-keys" 15 - - "mediatek,mt6358-keys" 16 - - linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml 17 - 18 - Optional Properties: 19 - - wakeup-source: See Documentation/devicetree/bindings/power/wakeup-source.txt 20 - - mediatek,long-press-mode: Long press key shutdown setting, 1 for 21 - pwrkey only, 2 for pwrkey/homekey together, others for disabled. 22 - - power-off-time-sec: See Documentation/devicetree/bindings/input/input.yaml 23 - 24 - Example: 25 - 26 - pmic: mt6397 { 27 - compatible = "mediatek,mt6397"; 28 - 29 - ... 30 - 31 - mt6397keys: mt6397keys { 32 - compatible = "mediatek,mt6397-keys"; 33 - mediatek,long-press-mode = <1>; 34 - power-off-time-sec = <0>; 35 - 36 - power { 37 - linux,keycodes = <116>; 38 - wakeup-source; 39 - }; 40 - 41 - home { 42 - linux,keycodes = <114>; 43 - }; 44 - }; 45 - 46 - };