162306a36Sopenharmony_ciDialog Semiconductor DA7280 Haptics bindings
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciRequired properties:
462306a36Sopenharmony_ci- compatible: Should be "dlg,da7280".
562306a36Sopenharmony_ci- reg: Specifies the I2C slave address.
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci- interrupt-parent : Specifies the phandle of the interrupt controller to
862306a36Sopenharmony_ci  which the IRQs from DA7280 are delivered to.
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci- dlg,actuator-type: Set Actuator type. it should be one of:
1162306a36Sopenharmony_ci  "LRA" - Linear Resonance Actuator type.
1262306a36Sopenharmony_ci  "ERM-bar" - Bar type Eccentric Rotating Mass.
1362306a36Sopenharmony_ci  "ERM-coin" - Coin type Eccentric Rotating Mass.
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci- dlg,const-op-mode: Haptic operation mode for FF_CONSTANT.
1662306a36Sopenharmony_ci  Possible values:
1762306a36Sopenharmony_ci	1 - Direct register override(DRO) mode triggered by i2c(default),
1862306a36Sopenharmony_ci	2 - PWM data source mode controlled by PWM duty,
1962306a36Sopenharmony_ci- dlg,periodic-op-mode: Haptic operation mode for FF_PERIODIC.
2062306a36Sopenharmony_ci  Possible values:
2162306a36Sopenharmony_ci	1 - Register triggered waveform memory(RTWM) mode, the pattern
2262306a36Sopenharmony_ci	    assigned to the PS_SEQ_ID played as much times as PS_SEQ_LOOP,
2362306a36Sopenharmony_ci	2 - Edge triggered waveform memory(ETWM) mode, external GPI(N)
2462306a36Sopenharmony_ci	    control are required to enable/disable and it needs to keep
2562306a36Sopenharmony_ci	    device enabled by sending magnitude (X > 0),
2662306a36Sopenharmony_ci	    the pattern is assigned to the GPI(N)_SEQUENCE_ID below.
2762306a36Sopenharmony_ci	The default value is 1 for both of the operation modes.
2862306a36Sopenharmony_ci	For more details, please see the datasheet.
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci- dlg,nom-microvolt: Nominal actuator voltage rating.
3162306a36Sopenharmony_ci  Valid values: 0 - 6000000.
3262306a36Sopenharmony_ci- dlg,abs-max-microvolt: Absolute actuator maximum voltage rating.
3362306a36Sopenharmony_ci  Valid values: 0 - 6000000.
3462306a36Sopenharmony_ci- dlg,imax-microamp: Actuator max current rating.
3562306a36Sopenharmony_ci  Valid values: 0 - 252000.
3662306a36Sopenharmony_ci  Default: 130000.
3762306a36Sopenharmony_ci- dlg,impd-micro-ohms: the impedance of the actuator in micro ohms.
3862306a36Sopenharmony_ci  Valid values: 0 - 1500000000.
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciOptional properties:
4162306a36Sopenharmony_ci- pwms : phandle to the physical PWM(Pulse Width Modulation) device.
4262306a36Sopenharmony_ci  PWM properties should be named "pwms". And number of cell is different
4362306a36Sopenharmony_ci  for each pwm device.
4462306a36Sopenharmony_ci  (See Documentation/devicetree/bindings/pwm/pwm.txt
4562306a36Sopenharmony_ci   for further information relating to pwm properties)
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci- dlg,ps-seq-id: the PS_SEQ_ID(pattern ID in waveform memory inside chip)
4862306a36Sopenharmony_ci  to play back when RTWM-MODE is enabled.
4962306a36Sopenharmony_ci  Valid range: 0 - 15.
5062306a36Sopenharmony_ci- dlg,ps-seq-loop: the PS_SEQ_LOOP, Number of times the pre-stored sequence
5162306a36Sopenharmony_ci  pointed to by PS_SEQ_ID or GPI(N)_SEQUENCE_ID is repeated.
5262306a36Sopenharmony_ci  Valid range: 0 - 15.
5362306a36Sopenharmony_ci- dlg,gpiN-seq-id: the GPI(N)_SEQUENCE_ID, pattern to play
5462306a36Sopenharmony_ci  when gpi0 is triggered, 'N' must be 0 - 2.
5562306a36Sopenharmony_ci  Valid range: 0 - 15.
5662306a36Sopenharmony_ci- dlg,gpiN-mode: the pattern mode which can select either
5762306a36Sopenharmony_ci  "Single-pattern" or "Multi-pattern", 'N' must be 0 - 2.
5862306a36Sopenharmony_ci- dlg,gpiN-polarity: gpiN polarity which can be chosen among
5962306a36Sopenharmony_ci  "Rising-edge", "Falling-edge" and "Both-edge",
6062306a36Sopenharmony_ci  'N' must be 0 - 2
6162306a36Sopenharmony_ci  Haptic will work by this edge option in case of ETWM mode.
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci- dlg,resonant-freq-hz: use in case of LRA.
6462306a36Sopenharmony_ci  the frequency range: 50 - 300.
6562306a36Sopenharmony_ci  Default: 205.
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci- dlg,bemf-sens-enable: Enable for internal loop computations.
6862306a36Sopenharmony_ci- dlg,freq-track-enable: Enable for resonant frequency tracking.
6962306a36Sopenharmony_ci- dlg,acc-enable: Enable for active acceleration.
7062306a36Sopenharmony_ci- dlg,rapid-stop-enable: Enable for rapid stop.
7162306a36Sopenharmony_ci- dlg,amp-pid-enable: Enable for the amplitude PID.
7262306a36Sopenharmony_ci- dlg,mem-array: Customized waveform memory(patterns) data downloaded to
7362306a36Sopenharmony_ci  the device during initialization. This is an array of 100 values(u8).
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ciFor further information, see device datasheet.
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci======
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ciExample:
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci	haptics: da7280-haptics@4a {
8262306a36Sopenharmony_ci		compatible = "dlg,da7280";
8362306a36Sopenharmony_ci		reg = <0x4a>;
8462306a36Sopenharmony_ci		interrupt-parent = <&gpio6>;
8562306a36Sopenharmony_ci		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
8662306a36Sopenharmony_ci		dlg,actuator-type = "LRA";
8762306a36Sopenharmony_ci		dlg,dlg,const-op-mode = <1>;
8862306a36Sopenharmony_ci		dlg,dlg,periodic-op-mode = <1>;
8962306a36Sopenharmony_ci		dlg,nom-microvolt = <2000000>;
9062306a36Sopenharmony_ci		dlg,abs-max-microvolt = <2000000>;
9162306a36Sopenharmony_ci		dlg,imax-microamp = <170000>;
9262306a36Sopenharmony_ci		dlg,resonant-freq-hz = <180>;
9362306a36Sopenharmony_ci		dlg,impd-micro-ohms = <10500000>;
9462306a36Sopenharmony_ci		dlg,freq-track-enable;
9562306a36Sopenharmony_ci		dlg,rapid-stop-enable;
9662306a36Sopenharmony_ci		dlg,mem-array = <
9762306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
9862306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
9962306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10062306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10162306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10262306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10362306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10462306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10562306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10662306a36Sopenharmony_ci		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
10762306a36Sopenharmony_ci		>;
10862306a36Sopenharmony_ci	};
109