diff options
author | Chase Wu <chasewu@google.com> | 2023-02-08 12:26:22 +0800 |
---|---|---|
committer | Chase Wu <chasewu@google.com> | 2023-02-08 04:31:44 +0000 |
commit | 744867aa387aa6cc8b776b357e76daf500bf6e46 (patch) | |
tree | 5bb6d8b0d67ffee67cf230e3819ec0f58f6bd07c | |
parent | 78b56211491a0839760625807b044e3d8a4ec6dc (diff) |
Revert "cs40l26: Improve the performance for primitive effects"
If we remove the delay time in the erase function, under back-to-back
fast typing scenario, FW would still has the chance to enter a unknown
situation and the erase function will be losed forever.
Bug: 266331748
Test: all current haptic testing and manually four fingers typing
This reverts commit db2f13d19fe68a77ec9f1c1584a222dfa2c9e0c7.
Change-Id: I4929300ad5b1927531cb89e7980f1aeace5980ff
-rw-r--r-- | vibrator/cs40l26/Hardware.h | 7 | ||||
-rw-r--r-- | vibrator/cs40l26/Vibrator.cpp | 1 | ||||
-rw-r--r-- | vibrator/cs40l26/Vibrator.h | 3 |
3 files changed, 2 insertions, 9 deletions
diff --git a/vibrator/cs40l26/Hardware.h b/vibrator/cs40l26/Hardware.h index 2143b96..ae052ba 100644 --- a/vibrator/cs40l26/Hardware.h +++ b/vibrator/cs40l26/Hardware.h @@ -220,10 +220,7 @@ class HwApi : public Vibrator::HwApi, private HwApiBase { ALOGE("Invalid waveform index for OWT erase: %d", effectIndex); return false; } - // Turn off the waiting time for SVC init phase to complete since chip - // should already under STOP state - setMinOnOffInterval(0); - // Do erase flow + if (effectIndex < WAVEFORM_MAX_INDEX) { /* Normal situation. Only erase the effect which we just played. */ if (ioctl(fd, EVIOCRMFF, effectIndex) < 0) { @@ -251,8 +248,6 @@ class HwApi : public Vibrator::HwApi, private HwApiBase { (*effect)[i].id = -1; } } - // Turn on the waiting time for SVC init phase to complete - setMinOnOffInterval(Vibrator::MIN_ON_OFF_INTERVAL_US); return true; } diff --git a/vibrator/cs40l26/Vibrator.cpp b/vibrator/cs40l26/Vibrator.cpp index 2501224..c19c7f8 100644 --- a/vibrator/cs40l26/Vibrator.cpp +++ b/vibrator/cs40l26/Vibrator.cpp @@ -48,6 +48,7 @@ static constexpr uint32_t WAVEFORM_LONG_VIBRATION_THRESHOLD_MS = 50; static constexpr uint8_t VOLTAGE_SCALE_MAX = 100; static constexpr int8_t MAX_COLD_START_LATENCY_MS = 6; // I2C Transaction + DSP Return-From-Standby +static constexpr uint32_t MIN_ON_OFF_INTERVAL_US = 8500; // SVC initialization time static constexpr int8_t MAX_PAUSE_TIMING_ERROR_MS = 1; // ALERT Irq Handling static constexpr uint32_t MAX_TIME_MS = UINT16_MAX; diff --git a/vibrator/cs40l26/Vibrator.h b/vibrator/cs40l26/Vibrator.h index 27ee283..220c974 100644 --- a/vibrator/cs40l26/Vibrator.h +++ b/vibrator/cs40l26/Vibrator.h @@ -154,9 +154,6 @@ class Vibrator : public BnVibrator { binder_status_t dump(int fd, const char **args, uint32_t numArgs) override; - // SVC initialization time - static constexpr uint32_t MIN_ON_OFF_INTERVAL_US = 8500; - private: ndk::ScopedAStatus on(uint32_t timeoutMs, uint32_t effectIndex, struct dspmem_chunk *ch, const std::shared_ptr<IVibratorCallback> &callback); |