一.基本配置
1.确定马达类型(qcom,actuator-type):erm/lra(一般DC是erm,AC是lra)
2.确定马达频率(qcom,play-rate-us)
3.确定马达电压(qcom,vmax-mv)
二.花样配置
kernel/msm-4.14/Documentation/devicetree/bindings/input/qti-haptics.txt
wf_x {
/* CLICK */
......
};
wf_x为不同的震动方式,对应系统目录里的/d/haptics/effectx
wf-pattern:
116 - qcom,wf-pattern 117 Usage: required 118 Value type: <prop-encoded-array> 119 Definition: Specifies the waveform pattern in a byte array that will be 120 played for the effect-id. The bit fields of each byte are: 121 [7]: drive direction, 0 - forward; 1 - reverse 122 [6]: overdrive, 0 -- 1x drive; 1 -- 2x drive 123 [5:1]: waveform amplitude 124 [0]: reserved.
定义:指定将为effect-id播放的字节数组中的波形模式。 每个字节的位字段是:
[7]:行驶方向,0 - 前进; 1 - 反向
[6]:过载,0 - 1x驱动; 1 - 2x驱动器
[5:1]:波形幅度
[0]:保留。
135 - qcom,wf-play-rate-us 136 Usage: optional 137 Value type: <u32> 138 Definition: Specifies the play period in microseconds for each byte pattern. 139 Allowed values are: 0 to 20475. For LRA actuator, if 140 "qcom,lra-allow-variable-play-rate" is defined, it could be 141 set to other values not equal to the resonance period of the 142 LRA actuator.
定义:指定每个字节模式的播放时间(以微秒为单位)。
允许值为:0至20475.对于LRA执行器,如果定义了
“qcom,lra-allow-variable-play-rate”,则可将其设置
为不等于LRA执行器的共振周期的其他值。
156 - qcom,wf-brake-pattern 157 Usage: optional 158 Value type: <prop-encoded-array> 159 Definition: Specifies the brake pattern with 4 elements used to enable the 160 internal reverse braking. Allowed values for each element are: 161 0: no brake 162 1: brake with (Vmax / 2) strength 163 2: brake with Vmax strength 164 3: brake with (2 * Vmax) strength 165 If this property is specified with an array of non-zero values, 166 then the brake pattern is applied at the end of the playing 167 waveform.
定义:指定带有4个元件的制动模式,用于启用内部反向制动。 每个元素的允许值为:
0:没有刹车
1:制动器具有(Vmax / 2)强度
2:Vmax强度制动
3:制动(2 * Vmax)强度
如果使用非零值数组指定此属性,则在播放波形结束时应用制动模式。
169 - qcom,lra-auto-resonance-disable 170 Usage: optional 171 Value type: <empty> 172 Definition: If specified, the hardware feature of LRA auto resonance detection 173 is disabled.
定义:如果指定,则禁用LRA自动共振检测的硬件功能。
144 - qcom,wf-repeat-count 145 Usage: optional 146 Value type: <u32> 147 Definition: Specifies the repeat times for the waveform pattern. Allowed 148 values are: 1, 2, 4, 8, 16, 32, 64, 128.
定义:指定波形图案的重复次数。 允许的值为:1,2,4,8,16,32,64,128。
150 - qcom,wf-s-repeat-count 151 Usage: optional 152 Value type: <u32> 153 Definition: Specifies the repeat times for each sample defined in 154 qcom,wf-pattern. Allowed values are: 1, 2, 4, 8.
定义:指定qcom,wf-pattern中定义的每个样本的重复次数。 允许的值为:1,2,4,8。
三.测试刷机
dtsi文件的编译方式是:make dtboimage, 刷机时需要刷dtbo.img文件。(刚开始我疯狂刷boot.img,怎么改都没有生效。。。),刷完重启手机adb shell, cd /d/haptics/effectx 目录看看对应的值是不是正确了