summaryrefslogtreecommitdiff
path: root/vibrator
AgeCommit message (Collapse)Author
2019-06-19vibrator: Adopt Common ImplementationHarpreet "Eli" Sangha
Adopt the common vibrator HAL implementation for the DRV2624 controller. Test: Manual, PTS, VTS Change-Id: I38e54f146c32ef47a5607c3acec347185c0f53fb Signed-off-by: Harpreet "Eli" Sangha <eliptus@google.com>
2019-05-09vibrator: Enforce API-Specific Effect RangeHarpreet "Eli" Sangha
Bug: 132125931 Test: vts-tradefed run singleCommand vts-hal -m VtsHalVibratorV1_0Target Test: vts-tradefed run singleCommand vts-hal -m VtsHalVibratorV1_1Target Change-Id: Iaea02a05d6bf823172b3957ce64245f6ef235207 Signed-off-by: Harpreet "Eli" Sangha <eliptus@google.com>
2019-01-21haptics: Run clang-formatchasewu
The .clang-format file was copied from device/google/crosshatch/.clang-format as per go/pixel-sw-style Bug: 118414116 Test: manual test haptics cmd commands Change-Id: I8b5d19cce43889d8622d2a29c0f7ccfdeb088f2f Signed-off-by: chasewu <chasewu@google.com>
2019-01-21haptics: Unite all haptics APIschasewu
Since we have used lots of drv2624 APIs in bonito/sargo, we unite those haptics api in a struct to make the code flow clearly. Bug: 123160966 Test: manual test haptics cmd commands Change-Id: I349ad08fa8d4a5407c6f471c2dbd42a44a8533e8 Signed-off-by: chasewu <chasewu@google.com>
2018-12-19haptics: Add a frequency shift mechanism for long vibrationchasewu
This mechanism is used to prevent that actuator has chance to be damaged with best resonance frequency in REL testing. S4: 1.6V, F0 - 10 B4: 1.8V, F0 - 10 Bug: 121176822 Test: HW DOE testing and UT survey Change-Id: Icdd10f38a41dd675a5d10e55f1e8f66f3e1e98c8 Signed-off-by: chasewu <chasewu@google.com>
2018-12-18haptics: Update new double clicks tuning resultchasewu
S4 double clicks: T1: 8ms A1:110 T2: 10ms A2:110 T3: 150ms B4 double clicks: T1: 10ms A1:127 T2: 12ms A2:127 T3: 160ms Bug: 121103603 Test: manual trigger double clicks Change-Id: I34b6665d7faef1f0e82e13b2466c302544dbeb9d Signed-off-by: chasewu <chasewu@google.com>
2018-12-13haptics: Update OWNERS filechasewu
Bug: 120873298 Test: local build Change-Id: I01d084356b2dad9a5256c78ad8ad66c7a1a1a12e Signed-off-by: chasewu <chasewu@google.com>
2018-12-12haptics: Update haptics tuning resultchasewu
Update new haptics duration time and amplitude for sine wave. S4: Click: T1: 8ms, A1: 110 Tick: T1: 5ms, A1: 110 Heavy Click: T1: 12ms, A1: 110 B4: Click: T1: 8ms, A1: 127 Tick: T1: 5ms, A1: 127 Heavy Click: T1: 12ms, A1: 127 Bug: 120764232 Test: manual trigger all prebaked waveforms Change-Id: Ia5af91244ad044bcb89b35713ac0d3fc0f3ce770 Signed-off-by: chasewu <chasewu@google.com>
2018-12-12haptics: Add more parmeters for haptics tuningchasewu
This patch add a waveform shape switch mechanism since the sine wave is better than square wave in the UT survey. Short haptics: S4: sine wave, 2.2V, F0 B4: sine wave, 2.4V, F0 Long vibration: S4: square wave, 1.5V, 155 Hz B4: square wave, 1.5V, 155 Hz Bug: 120517818 Bug: 120764232 Test: UT testing Change-Id: I138e66343cedf1179a9fc7975d2815e42ebb9f40 Signed-off-by: chasewu <chasewu@google.com>
2018-12-05haptics: TICK effect tuningchasewu
change tick effect duration time to 4ms for both S4 and B4 S4: cbc6338f3d9e918ae53cddaa34c5471c6fc4695957d9141d43179d 1f73a0853a Click: T1: 6ms, A1: 127 Tick: T1: 4ms, A1: 110 Heavy Click: T1: 10ms, A1: 127 B4: cbc6338f3d9e918ae53cddaa34c5471c6fc4695957d9141d43179d 1f73a0853a Click: T1: 7ms, A1: 110 Tick: T1: 4ms, A1: 110 Heavy Click: T1: 10ms, A1: 110 Bug: 120518042 Test: trigger all prebaked waveforms Change-Id: Ia5eb8c20b65f7a74161f401504b546d79c207c93 Signed-off-by: chasewu <chasewu@google.com>
2018-11-15haptics: Add a dynmaic voltage and frequency switch mechanismchasewu
1. From haptics tuning meeting, this patch add a dynamic voltage/frequency switch mechanism to make haptics feel better under each kind of criteria. S4 For short vibration: Voltage 2.1V, F0 For long vibration: Voltage 1.5V, F=155Hz B4 For short vibration: Voltage 2.5V, F0 For long vibration: Voltage 1.5V, F=155Hz Bug: 119149580 Test: manual check the voltage value after each haptics Change-Id: I2c3e88fe0c4dcb9b164179d0ddb6504f059d077a Signed-off-by: chasewu <chasewu@google.com>
2018-10-19drv2624: Update new waveform for haptics tuningchasewu
B4: c04f1e16bb28a19072b94288f9b39c3dc7f0cccc076344e f40bcc6498e05b962 S4: dd0d7d619804085b5a02900e465be648b35927754fa7c08 b5d89c59ad3469ff9 Bug: 117396155 Test: manual haptics test pass and waveform checking. Change-Id: I70f1be43c9ac7c2e4acb1646985cf23352e0433f Signed-off-by: chasewu <chasewu@google.com>
2018-10-16haptics: Remove the application of resonant frequencychasewu
This patch remove the application of resonant frequency because this project use a fix frequency for each device. Bug: 117634193 Test: Manual hatpics work well and frequency is fix. Change-Id: Ibea2842a0ec707f964ef4e3f15a8fedcfbba9f48 Signed-off-by: chasewu <chasewu@google.com>
2018-09-20haptics: Modify haptics operating mode to force open loopchasewu
From HW's request, B4S4 only support open loop mode due to the actuator module. Bug: 113640889 Test: manual haptics test pass and loop mode checking Change-Id: I5102331dc1c0c2d53921655ce2c65546a8fa3a3c Signed-off-by: chasewu <chasewu@google.com>
2018-08-30drv2624: Add effect#4 for heavy clickchasewu
This patch adds effect#4 for heavy click which is 8 ms in square wave with full amplitude and modify the config_longPressVibePattern to 8 ms as Walleye version. Bug: 77863933 Test: build pass and manual long press test Change-Id: I432dcb833493a1a59d5eca71f2ca9a655f6cfad9 Signed-off-by: chasewu <chasewu@google.com>
2018-08-24haptics: modify vibrator HAL to Walleye versionchasewu
Pulled the source from following commit. (commit 811d138338cdc049749487963e48abe55b0b6093) Author: David Lin <dtwlin@google.com> Date: Tue Apr 17 10:29:18 2018 -0700 haptics: Implement constant effect for heavy click This patch implements support for heavy click effect which has the following UX requirements: - 8 ms in square wave and full amplitude for Walleye - 12 ms in square wave and full amplitude for Taimen Bug: 112975303 Test: build pass and manual haptics test. Change-Id: Iefc7920e43fa5cb0fa2791d712e7c8132301a538 Signed-off-by: chasewu <chasewu@google.com>
2018-07-12bonito and sargo: initial device supportRoger Liao
Bug: 111163725 Change-Id: I00af3102379676cedf818caa2e86c5e1593a48da Signed-off-by: Roger Liao <rogerliao@google.com>
2018-05-30haptics: Fine tune ringtone-coupled haptics effectsDavid Lin
This change adjust the delay timings for some of the ringtone-coupled effects. Bug: 75947705 Test: manual haptics test Change-Id: Iee7705bfeb06ae8d67217a27ebeff83ee6a8a5a8 Signed-off-by: David Lin <dtwlin@google.com>
2018-05-29haptics: Fix issue with out of sync ringtoneDavid Lin
This change corrects the repeat and wait time for "The Big Adventure" ringtone haptics. Bug: 75947705 Test: manual Change-Id: I96b333ee9919f671c6c0a6a0a68b2cbb05c51990 Signed-off-by: David Lin <dtwlin@google.com>
2018-05-23haptics: Add support for audio-coupled haptic ringtoneDavid Lin
This change adds the support for audio-coupled haptics for P18 ringtones. Bug: 75947705 Test: manual Change-Id: I1d8cfc62ed976062d0c997dda561fe6e90030dab Signed-off-by: David Lin <dtwlin@google.com>
2018-05-04haptics: handle strength for effectDavid Lin
This patch adds the function to handle the waveform index offset for different strength. This also fixes an minor error on the incorrect durations for the effects. Bug: 77243572 Test: manual haptics test Change-Id: I6a07c006540d3284e6f2f247d55dbac761549036 Signed-off-by: David Lin <dtwlin@google.com>
2018-04-30haptics: cs40l20: Update firmware driverDavid Lin
This change updates the firmware driver that addresses the issue with long cold-start latency, and this also removes the workaround changes that was added previously to avoid the issue. Bug: 78128429 Test: manual haptics test Change-Id: I9df69f8fb452e986a5cc3dbe50aae965a98763f2 Signed-off-by: David Lin <dtwlin@google.com>
2018-04-16haptics: account for trigger-to-start latency for the durationDavid Lin
This change adds the trigger-to-start latency (max of 5 ms) to the playback duration. This change contains a workaround with increaed latency to 15 ms to address a firmware issue. Bug: 74752238 Test: manual Change-Id: Ia1e9c9b9643f3b34754e53b227519b1fe7f9fbe0 Signed-off-by: David Lin <dtwlin@google.com>
2018-04-16haptics: add cs40l20 firmware support for power managementDavid Lin
This change adds the firmware (v3.0.0) and the updated waveform library for supporting auto-suspend power management feature on the DSP. Bug: 74752238 Test: manual haptics test power measurement Change-Id: I92d3cfe019f25ef9fca42d506f1cf26e8e51bb53 Signed-off-by: David Lin <dtwlin@google.com>
2018-04-05haptics: update waveform designDavid Lin
This change updates the waveform #6, #7 and #8 so that he waveform of #6 is composed of #1 and #2 with 100ms interval between. Similarly, #7 = #2 + #3, and #8 = #3 + #4. Bug: 73722420 Test: manual haptics test Change-Id: I29bfd2ff90c2f2a9407d994aa61a9bb7b676b3fc Signed-off-by: David Lin <dtwlin@google.com>
2018-03-30haptics: fix issue with ReDC calculationDavid Lin
This change fixes an issue with the script that generates the waveform table was using an incorrect equation. The scaling factor listed in the firmware release notes for ReDC (5.687) has been incorrect since the beginning, and should be 5.857. Therefore the formulae for redc_measured and redc_stored change as follows: ReDC (ohms) = redc_measured / 2^17 * 5.857 redc_stored = ReDC (ohms) / 5.857 * 2^17 Bug: 70630396 Test: perform cal and manual verification Change-Id: I08eaa44c5d7c758b682d1ef1f8423677f40350a8 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-30haptics: update waveform designDavid Lin
This change updates the haptics waveform design from the UX team. Waveform files Index Description ============== ===== =========== continuous_sine_f0.json 0 PWLE reference [#1] 00 (15%).wav 1 Low TICK [#2] 00 (23%).wav 2 Low CLICK / Medium TICK [#3] 00 (39%).wav 3 Low HEAVY_CLICK / medium CLICK / high TICK [#4] 00 (75%).wav 4 Medium HEAVY_CLICK / high CLICK [#5] 11-2 (-3).wav 5 High HEAVY_CLICK [#6] Double (L) = #1 + #2.wav 6 Low DOUBLE_CLICK [#7] Double (M) = #2 + #3.wav 7 Medium DOUBLE_CLICK [#8] Double (H) = #3 + #4.wav 8 High DOUBLE_CLICK Bug: 73722420 Test: manual haptics test Change-Id: Ic77154d7a78385ffd74f0f15d8b09b0fe5a61487 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-28haptics: fix issue with weak notificationDavid Lin
This waveform table update fixes an issue with weak notification vibration due to the missing waveform index 0 for continuous sine wave. Bug: 76440863 Test: manual haptics test Change-Id: Ib48ce9b90086684ab71911b385db64d682949230 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-27haptics: update firmware for cs40l20David Lin
This firmware release addressed the following issues: - First call for vibration following DSP reset may be ignored - Up to three corrupt samples follow compensated waveforms Bug: 76440863 Test: manual haptics test Change-Id: I56234450db4d9a4f64d514de2cd33c6f27afc91e Signed-off-by: David Lin <dtwlin@google.com>
2018-03-23haptics: add click comp supportDavid Lin
This updates the firmware binary as well as the waveform library to support click compensation - that is to load the stored f0 and ReDC value pairs from the factory and apply them to the waveform library be able to produce consistent acceleration of the feedback across different devices. Bug: 70630396 Test: manual haptics test Change-Id: I947974919face6c2b920acd873d7539045c2d2f2 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-23haptics: load calibration file for click comp supportDavid Lin
This CL adds the support of per-device calibration file loading for click compensation support. Bug: 70630396 Test: verify with a dummy calibration pattern Change-Id: I7fa9787f6bc1bd5cd8629500a1b6a28a6195e419 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-21haptics: cs40l20: update waveform designDavid Lin
This change contains the new waveform design from the UX team. General update is to reduce the intensity based on the initial feedbacks. Waveform files Index Description ============== ===== ===================== n/a 0 PWLE reference [#1] 00 (-15).wav 1 Low TICK [#2] 00 (-10).wav 2 Low CLICK / Medium TICK [#3] 00 (-5).wav 3 Low HEAVY_CLICK / medium CLICK / high TICK [#4] 00.wav 4 Medium HEAVY_CLICK / high CLICK [#5] 11-2 (-3)/wav 5 High HEAVY_CLICK [#6] Double (L) = #1 + #2.wav 6 Low DOUBLE_CLICK [#7] Double (M) = #2 + #3.wav 7 Medium DOUBLE_CLICK [#8] Double (H) = @3 + #4.wav 8 High DOUBLE_CLICK Bug: 73722420 Test: manual haptics test Change-Id: Ic9609f24bd4ca7cf0f21b1a2dd7f75b8440561a3 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-20haptics: add support for amplitude controlDavid Lin
This adds the support for amplitude scaling control for the cs40l20 driver IC. Bug: 74767820 Test: charging confirmation apk Change-Id: I9760ff58d0e77bb96a663cd233550194c9533fb7 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-09haptics: update waveform libraryDavid Lin
This change updates the waveform library to contain the following effects designed by the UX team. Index Description ===== =========== 0 PWLE reference 1 Low TICK 2 Low CLICK / default TICK 3 Low HEAVY_CLIK / default CLICK / high TICK 4 Default HEAVY_CLICK / high CLICK 5 High HEAVY_CLICK 6 Low DOUBLE_CLICK 7 Default DOUBLE_CLICK 8 High DOUBLE_CLICK Bug: 73722420 Test: manual test Change-Id: I1a2e51d9b3b15869f689a4bd5f97370588ccd440 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-09haptics: add owners fileDavid Lin
Bug: 73722420 Test: build Change-Id: Idee6d99df535722b2bfae5e797232f46ae32ef62 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-09haptics: hal: add supports for custom effectsDavid Lin
This adds the custom effect playback for TICK, CLICK, HEAVY_CLICK and DOUBLE_CLICK of the default strength. Bug: 73722420 Test: manual test Change-Id: I43d661700336db029a428080cb47e1259d502f92 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-09haptics: remove workaround for the firmware issueDavid Lin
This removes the min 10 ms duration workaround for the firmware issue. Bug: 73722420 Test: manual test Change-Id: I199de5d97535fe401c60e7b4c3441307e7f69015 Signed-off-by: David Lin <dtwlin@google.com>
2018-03-09haptics: upgrade vibrator HAL to 1.2David Lin
Bug: 73722420 Test: VtsHalVibratorV1_2TargetTest Change-Id: I85bb8bf0c8dd5164b817e9ffda833e8db1b619ab Signed-off-by: David Lin <dtwlin@google.com>
2018-03-02haptics: cs40l20: add custom waveform fileDavid Lin
This adds the customized waveforms. Bug: 73722420 Test: manual vibrator test Change-Id: I472ea7d88198b682d03e330c211af68ed1f4c4cb Signed-off-by: David Lin <dtwlin@google.com>
2018-02-09haptics: cs40l20: fix issue with non-stop vibrationDavid Lin
This updated firmware fixes a race condition that DSP may miss the ENDPLAYBACK command from the host. Updated firmware release version is 2.0.5. Bug: 72941200 Test: stress test with gboard Change-Id: I9b570314db5910a040c1b967a7aa4404966d3acb Signed-off-by: David Lin <dtwlin@google.com>
2018-02-06haptics: cs40l20: update dsp firmwareDavid Lin
This updates the DSP firmware from Cirrus Logic to the latest version that address issues such that if the “start playback” register is written while playback is already in progress, the subsequent write to the “stop playback” register is ignored and playback continues indefinitely. Bug: 72941200 Change-Id: I68f4336c55e0a6b7418ca5910f365c5ed24a7f6e Signed-off-by: David Lin <dtwlin@google.com>
2018-02-06haptics: prepare vibrator HAL for cs40l20David Lin
This removes the old code for drv2624 as well as adding a workaround for the DSP firmware issue that for any playback with short duration (< 10 ms) it may cause the playback to be stuck indefinitely. Bug: 72941200 Change-Id: I0cbc9b5520b780b57612b671fcda7f94036e5bec Signed-off-by: David Lin <dtwlin@google.com>
2018-02-02vibrator: do not return failure upon init errorDavid Lin
This is to allow the framework to continue booting in case vibrator driver IC failed to init. Change-Id: I16e282c312222b6030a8badcbdae211d98a40f78 Signed-off-by: David Lin <dtwlin@google.com>
2018-01-31haptics: cs40l20: add firmware with f0 tracking supportDavid Lin
This patch updates the firmware that supports f0 tracking as well as LRA resistance measurement. This new firmware requires a new waveform library format that's incompatible with the old version. We'll remove the waveform library from the device for now to prevent it from for the driver to fail since currently the waveform is not being used. Bug: 70630396 Test: Follow instructions on go/b1c1-haptics-cal Change-Id: I6435b47f27743c4c05ceb5f31201cab431cb0df2 Signed-off-by: David Lin <dtwlin@google.com>
2018-01-12haptics: cs40l20: increase number of samples on calibration waveformDavid Lin
This change increases the number of samples of the calibration chirp waveform from 6247 to 6400 to increase accuracy of the f0 tracking, Bug: 70630396 Change-Id: Icff2b5f499db187632ddd5623a5c26a753c594d3 Signed-off-by: David Lin <dtwlin@google.com>
2018-01-11haptics: cs40l20: update firmware and waveform libraryDavid Lin
This patch updates the firmware to match with the latest kernel driver and the waveform library to include the 132-170 Hz tonal sweep required for factory calibration. Content of the waveform lib (cs40l20.bin): Index - Description 0 - sine tone 150 Hz 1 - strong click round 1 2 - strong click round 2 3 - strong click round 3 4 - subtle click 5 - tonal sweep 132-170 Hz (800 ms) Bug: 69815738 Change-Id: Ia0c119656e98bf03d791972dd1e460906fdb5064 Signed-off-by: David Lin <dtwlin@google.com>
2017-12-08haptics: add firmware and waveform for cs40l20David Lin
This patch adds the firmware and waveform lib for cs40l20. This also moves drv2624 waveform to the common vibrator HAL location. Bug: 69815738 Change-Id: I320429f0eec28192a2816ce77ef61e5b882af1b9 Signed-off-by: David Lin <dtwlin@google.com>
2017-10-30Use -Werror in device/google/crosshatchChih-Hung Hsieh
* Remove unused local variable. * Fix warning of unused return status value. Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: If035c7870d3109ae27e51651054e74daa571439c
2017-08-31Add 'vendor.' prefix to a vendor HAL service nameJaekyun Seok
To prevent property name collisions between properties of system and vendor, 'vendor.' prefix must be added to a vendor HAL service name. You can see the details in http://go/treble-sysprop-compatibility. Test: succeeded building, and confirmed that service names were renamed correctly. Bug: 36796459 Change-Id: I7c51123aa83b93b65208c8cfa1766fcc1af4b45b
2017-06-27crosshatch: Re-add crosshatch, and switch to sdm845Chris Fries
Change-Id: I303e8fe6be155c8c0d5385f5598c7f27c19282b1