xref: /freebsd/sys/contrib/device-tree/Bindings/input/pwm-vibrator.txt (revision fe6060f10f634930ff71b7c50291ddc610da2475)
1* PWM vibrator device tree bindings
2
3Registers a PWM device as vibrator. It is expected, that the vibrator's
4strength increases based on the duty cycle of the enable PWM channel
5(100% duty cycle meaning strongest vibration, 0% meaning no vibration).
6
7The binding supports an optional direction PWM channel, that can be
8driven at fixed duty cycle. If available this is can be used to increase
9the vibration effect of some devices.
10
11Required properties:
12- compatible: should contain "pwm-vibrator"
13- pwm-names: Should contain "enable" and optionally "direction"
14- pwms: Should contain a PWM handle for each entry in pwm-names
15
16Optional properties:
17- vcc-supply: Phandle for the regulator supplying power
18- direction-duty-cycle-ns: Duty cycle of the direction PWM channel in
19                           nanoseconds, defaults to 50% of the channel's
20			   period.
21
22Example from Motorola Droid 4:
23
24&omap4_pmx_core {
25	vibrator_direction_pin: pinmux_vibrator_direction_pin {
26		pinctrl-single,pins = <
27		OMAP4_IOPAD(0x1ce, PIN_OUTPUT | MUX_MODE1) /* dmtimer8_pwm_evt (gpio_27) */
28		>;
29	};
30
31	vibrator_enable_pin: pinmux_vibrator_enable_pin {
32		pinctrl-single,pins = <
33		OMAP4_IOPAD(0X1d0, PIN_OUTPUT | MUX_MODE1) /* dmtimer9_pwm_evt (gpio_28) */
34		>;
35	};
36};
37
38/ {
39	pwm8: dmtimer-pwm {
40		pinctrl-names = "default";
41		pinctrl-0 = <&vibrator_direction_pin>;
42
43		compatible = "ti,omap-dmtimer-pwm";
44		#pwm-cells = <3>;
45		ti,timers = <&timer8>;
46		ti,clock-source = <0x01>;
47	};
48
49	pwm9: dmtimer-pwm {
50		pinctrl-names = "default";
51		pinctrl-0 = <&vibrator_enable_pin>;
52
53		compatible = "ti,omap-dmtimer-pwm";
54		#pwm-cells = <3>;
55		ti,timers = <&timer9>;
56		ti,clock-source = <0x01>;
57	};
58
59	vibrator {
60		compatible = "pwm-vibrator";
61		pwms = <&pwm9 0 1000000000 0>,
62                       <&pwm8 0 1000000000 0>;
63		pwm-names = "enable", "direction";
64		direction-duty-cycle-ns = <1000000000>;
65	};
66};
67