xref: /freebsd-src/sys/contrib/device-tree/Bindings/input/pwm-vibrator.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1e67e8565SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2e67e8565SEmmanuel Vadot%YAML 1.2
3e67e8565SEmmanuel Vadot---
4fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/input/pwm-vibrator.yaml#
5fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6e67e8565SEmmanuel Vadot
7e67e8565SEmmanuel Vadottitle: PWM vibrator
8e67e8565SEmmanuel Vadot
9e67e8565SEmmanuel Vadotmaintainers:
10e67e8565SEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
11e67e8565SEmmanuel Vadot
12e67e8565SEmmanuel Vadotdescription: >
13e67e8565SEmmanuel Vadot  Registers a PWM device as vibrator. It is expected, that the vibrator's
14e67e8565SEmmanuel Vadot  strength increases based on the duty cycle of the enable PWM channel
15e67e8565SEmmanuel Vadot  (100% duty cycle meaning strongest vibration, 0% meaning no vibration).
16e67e8565SEmmanuel Vadot
17e67e8565SEmmanuel Vadot  The binding supports an optional direction PWM channel, that can be
18e67e8565SEmmanuel Vadot  driven at fixed duty cycle. If available this is can be used to increase
19e67e8565SEmmanuel Vadot  the vibration effect of some devices.
20e67e8565SEmmanuel Vadot
21e67e8565SEmmanuel Vadotproperties:
22e67e8565SEmmanuel Vadot  compatible:
23e67e8565SEmmanuel Vadot    const: pwm-vibrator
24e67e8565SEmmanuel Vadot
25e67e8565SEmmanuel Vadot  pwm-names:
26e67e8565SEmmanuel Vadot    items:
27e67e8565SEmmanuel Vadot      - const: enable
28e67e8565SEmmanuel Vadot      - const: direction
29e67e8565SEmmanuel Vadot    minItems: 1
30e67e8565SEmmanuel Vadot
31e67e8565SEmmanuel Vadot  pwms:
32e67e8565SEmmanuel Vadot    minItems: 1
33e67e8565SEmmanuel Vadot    maxItems: 2
34e67e8565SEmmanuel Vadot
35*f126890aSEmmanuel Vadot  enable-gpios: true
36*f126890aSEmmanuel Vadot
37e67e8565SEmmanuel Vadot  vcc-supply: true
38e67e8565SEmmanuel Vadot
39e67e8565SEmmanuel Vadot  direction-duty-cycle-ns:
40e67e8565SEmmanuel Vadot    description: >
41e67e8565SEmmanuel Vadot      Duty cycle of the direction PWM channel in nanoseconds,
42e67e8565SEmmanuel Vadot      defaults to 50% of the channel's period.
43e67e8565SEmmanuel Vadot
44e67e8565SEmmanuel Vadotrequired:
45e67e8565SEmmanuel Vadot  - compatible
46e67e8565SEmmanuel Vadot  - pwm-names
47e67e8565SEmmanuel Vadot  - pwms
48e67e8565SEmmanuel Vadot
49e67e8565SEmmanuel VadotadditionalProperties: false
50e67e8565SEmmanuel Vadot
51e67e8565SEmmanuel Vadotexamples:
52e67e8565SEmmanuel Vadot  - |
53e67e8565SEmmanuel Vadot    vibrator {
54e67e8565SEmmanuel Vadot        compatible = "pwm-vibrator";
55e67e8565SEmmanuel Vadot        pwms = <&pwm9 0 1000000000 0>,
56e67e8565SEmmanuel Vadot               <&pwm8 0 1000000000 0>;
57e67e8565SEmmanuel Vadot        pwm-names = "enable", "direction";
58e67e8565SEmmanuel Vadot        direction-duty-cycle-ns = <1000000000>;
59e67e8565SEmmanuel Vadot    };
60