Skip to content

Commit

Permalink
dt-bindings: input: Add common input binding in json-schema
Browse files Browse the repository at this point in the history
Create schema for the common input properties and merge all properties
from the Documentation/devicetree/bindings/input/keys.txt binding into
this common schema.

Signed-off-by: Michal Vokáč <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
zandar authored and dtor committed Oct 16, 2019
1 parent 792e154 commit 7cef107
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
32 changes: 32 additions & 0 deletions Documentation/devicetree/bindings/input/input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/input.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Common input schema binding

maintainers:
- Dmitry Torokhov <[email protected]>

properties:
autorepeat:
description: Enable autorepeat when key is pressed and held down.
type: boolean

linux,keycodes:
description:
Specifies an array of numeric keycode values to be used for reporting
button presses.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32-array
- items:
minimum: 0
maximum: 0xff

power-off-time-sec:
description:
Duration in seconds which the key should be kept pressed for device to
power off automatically. Device with key pressed shutdown feature can
specify this property.
$ref: /schemas/types.yaml#/definitions/uint32
8 changes: 0 additions & 8 deletions Documentation/devicetree/bindings/input/keys.txt

This file was deleted.

4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Documentation/devicetree/bindings/mfd/mt6397.txt

Required properties:
- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
- linux,keycodes: See Documentation/devicetree/bindings/input/keys.txt
- linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml

Optional Properties:
- wakeup-source: See Documentation/devicetree/bindings/power/wakeup-source.txt
- mediatek,long-press-mode: Long press key shutdown setting, 1 for
pwrkey only, 2 for pwrkey/homekey together, others for disabled.
- power-off-time-sec: See Documentation/devicetree/bindings/input/keys.txt
- power-off-time-sec: See Documentation/devicetree/bindings/input/input.yaml

Example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Optional properties:
- st,onkey-pu-inactive: onkey pull up is not active
- power-off-time-sec: Duration in seconds which the key should be kept
pressed for device to power off automatically (from 1 to 16 seconds).
see See Documentation/devicetree/bindings/input/keys.txt
see See Documentation/devicetree/bindings/input/input.yaml

Example:

Expand Down

0 comments on commit 7cef107

Please sign in to comment.