Commit graph

18 commits

Author SHA1 Message Date
Zouberou Sayibou
0c5fb7e754 Felix HAL: Move mActiveId_mutex as a private member.
Bug: 379619627
Flag: EXEMPT test only
Test: VibratorHalCs40l26TestSuite
Change-Id: I59298139e68777e37f9f45de9661de59ba34cb83
Signed-off-by: Zouberou Sayibou <zouberou@google.com>
2024-12-11 07:55:29 +00:00
Zouberou Sayibou
8a2d7fdd7c Felix HAL: Add Destructor to the vibrator HAL.
Bug: 379618185
Flag: EXEMPT test only
Test: VibratorHalCs40l26TestSuitePrivate
Change-Id: If9519ae3aa6b3bd66bfd0a0c9bac844dddfb2f28
Signed-off-by: Zouberou Sayibou <zouberou@google.com>
2024-12-11 05:53:51 +00:00
Zouberou Sayibou
e9101cc010 Felix HAL: Added IVibrator event logs in dumpsys.
Ported the changes made in legacyHAL to Felix HAL
which involves adding the IVibrator event to the
HwApi to produce a friendly debugging logs.

Bug: 376330571
Flag: EXEMPT log only update
Test: Flash to device and verified dumpsys
Change-Id: I54262b7451b1ab07669eb9b7e5ad3c4cd3477016
Signed-off-by: Zouberou Sayibou <zouberou@google.com>
2024-11-18 10:37:13 +00:00
Zouberou Sayibou
2b7642486b Felix HAL: Fixed VibratorTest unit tests errors.
Fixed Felix HAL VibratorHalCs40l26TestSuitePrivate
3 failed tests:
- VibratorTest#on
- VibratorTest#perform/CLICK_LIGHT,
- VibratorTest#perform/HEAVY_CLICK_STRONG.

Moving the mActiveId_mutex to a global variable caused issues with the #perform/HEAVY_CLICK_STRONG test failing to call the HwApi and the #perform/CLICK_LIGHT test failing due to an outdated timeout value. Additionally, the intensifyToVolLevel function was returning an incorrect value, requiring a check to be added to the testing function.

Bug: 373761684
Flag: TEST_ONLY
Test: Ran VibratorHalCs40l26TestSuitePrivate.
Change-Id: Ibcdbc874c5c96644f3f647cc240b5012907253d4
Signed-off-by: Zouberou Sayibou <zouberou@google.com>
2024-11-01 18:32:25 +00:00
Leonard Ian
09d11a02b0 Merge "cs40l26: Align Felix HAL dump logs with common HAL" into main 2024-09-02 09:04:25 +00:00
leonardian
a644ef2a33 cs40l26: Align Felix HAL dump logs with common HAL
- Add driver, firmware, and tuning versions.
- Increase HAL buffer size to 2048 lines.
- Add F0, active ID, redc

Bug: 348316804
Flag: EXEMPT bugfix
Test: Checked HAL dumpsys
Test: atest PTS, VTS, CTS
Change-Id: I277d270533868cf2075388bdc329d77c9065801e
2024-08-30 04:33:59 +00:00
Chris Paulo
4c54ddb36f Merge changes from topic "felix_polling_scaling" into main
* changes:
  vibrator: Fix scaling logic for felix vibrator
  vibrator: Update polling timeout to 50ms
2024-08-14 00:10:55 +00:00
Chris Paulo
3b2b23e5e2 vibrator: Fix scaling logic for felix vibrator
Felix vibrator has stricter primitive effect scaling values.  We need to
update the logic to assure that we apply the upper and lower bounds of
the voltage range to avoid brownout and to maximize the usable range.

Bug: 344037610
Flag: EXEMPT bugfix
Test: atest PtsVibratorHalTestSuite \
  PtsHapticsTestCases \
  VibratorHalCs40l26TestSuite \
  VtsHalVibratorManagerTargetTest \
  VtsHalVibratorTargetTest \
  CtsVibratorTestCases
Test: Verify scale values
Change-Id: Iba8b8115fea01e56105b43f520d32c63ffcf7fd4
2024-08-12 10:59:08 -07:00
leonardian
0dcee74707 vibrator: cs40l26: Implement braking duration for haptic effects
1. Add sysfs nodes for querying braking duration
   - braking_time_bank
   - braking_time_index
   - braking_time_ms
2. Set delay time between effects to include the whole braking duration
3. Add braking effect durations in HAL dumpsys logs

Bug: 325121485
Test: Plotted acceleration
Test: Checked HAL dumpsys
Test: atest VibratorHalCs40l26TestSuite
Flag: EXEMPT bugfix
Change-Id: Ifacc94db4224adbab971e8d2c01c54422838760c
Signed-off-by: leonardian <leonardian@google.com>
2024-08-02 12:48:19 +08:00
Ravi Jain
75d87040c7 cs40l26: Align Felix Hal with common HAL
Pull ag/22589260 to replace new/delete by using vector from the common
HAL.

Bug: 322648133
Test: idlcli compose commands
Test: adb shell cmd vibrator_manager synced prebaked 1
Test: adb shell idlcli vibrator compose 0 8 1.0; \
      sleep 1; adb shell idlcli vibrator compose 0 7 1.0;
Test: atest PtsVibratorHalTestSuite \
  PtsHapticsTestCases \
  VibratorHalCs40l26TestSuitePrivate \
  VtsHalVibratorManagerTargetTest \
  VtsHalVibratorTargetTest \
  android.os.cts.VibratorTest \
  android.os.cts.VibratorManagerTest \
  android.os.cts.VibrationEffectTest \
  android.os.cts.VibrationAttributesTest \
  android.os.cts.CombinedVibrationTest
Change-Id: Ia6e9111c47f27089521f05a68b538bbefb235d6b
2024-03-22 00:42:07 +00:00
Ravi Jain
85299be2ad cs40l26: Align Felix Hal with common HAL
Pull DSPMemChunk related CLs from common HAL.
ag/22087481, ag/22093662

Bug: 322648133
Test: idlcli compose commands
Test: adb shell cmd vibrator_manager synced prebaked 1
Test: adb shell idlcli vibrator composePwle -b \
  a 0.1 300.0 0.1 30.0 1000 \
  a 0.1 30.0 0.1 300.0 500
Test: atest PtsVibratorHalTestSuite \
  PtsHapticsTestCases \
  VibratorHalCs40l26TestSuite \
  VtsHalVibratorManagerTargetTest \
  VtsHalVibratorTargetTest \
  android.os.cts.VibratorTest \
  android.os.cts.VibratorManagerTest \
  android.os.cts.VibrationEffectTest \
  android.os.cts.VibrationAttributesTest \
  android.os.cts.CombinedVibrationTest
Change-Id: I32258500ec02c2a8cbfc6d0b37aaea2c83c7c8b4
2024-03-06 11:19:19 +00:00
Chase Wu
e4e692f74d cs40l26: Add a maximum scale protection for primitive effects
Bug: 267419872
Test: HW test
Change-Id: I18f0e096e63ae6844bb0b47c43011cd012845f75
2023-02-08 17:20:41 +08:00
Nathan Kulczak
6346fec3af [DO NOT MERGE] vibrator/cs40l26: Adding minimum scale for composition primitives
Adding minimum scale for composition primitives to make 0 scale
primitives perform similarly to C10.

Bug: 260611234
Test: Flashed to device and played compositions with idlcli
Change-Id: Iaf872011b79de9da46de0de3ca770b794f67cd88
Signed-off-by: Nathan Kulczak <nathankulczak@google.com>
2022-12-20 19:27:56 +00:00
Chase Wu
97a989bfba [DO NOT MERGE] cs40l26: Fix the temporary no function symptom
When device was stuck on the erased timeout process, user cannot
feel the continuous haptic effects.

Bug: 262675927
Test: Fold the device and unfold the device under OOBE thud effect
Change-Id: Ia7b07b26e77f1e35d00075b91a31199575b61e3a
Signed-off-by: Chase Wu <chasewu@google.com>
2022-12-18 20:22:34 +08:00
Chase Wu
07468b074a [DO NOT MERGE] cs40l26: single HAL for dual haptics
We need to sync both haptics on the single HAL
architecture to reduce the time overhead and prevent the
mismatch behavior from vibrator manager HAL implementation.

Bug: 260090235
Bug: 261687849
Bug: 261841035
Bug: 261832151
Test: atest PtsVibratorHalTestSuite \
PtsHapticsTestCases \
PtsHapticsFeatureTestCases \
VibratorHalCs40l26TestSuite \
VtsHalVibratorManagerTargetTest \
VtsHalVibratorTargetTest \
android.os.cts.VibratorTest \
android.os.cts.VibratorManagerTest \
android.os.cts.VibrationEffectTest \
android.os.cts.VibrationAttributesTest \
android.os.cts.CombinedVibrationTest \
Change-Id: I084e1da952ab2f63e5c217a7f708ac3d34635336
Signed-off-by: Chase Wu <chasewu@google.com>
2022-12-12 17:34:18 +00:00
Nathan Kulczak
c73579497f [DO NOT MERGE] vibrator/cs40l26: Synchronize base and flip actuator F0
Calculate F0 offset using calibration data during initialization for
both Vibrator services.

Bug: 255435707
Test: Flashed to F10 with logs to verify correct offsets were
calculated.
Change-Id: I923b45967f5cae04f968178b75382584091869b8
Signed-off-by: Nathan Kulczak <nathankulczak@google.com>
2022-11-30 19:06:45 +00:00
Chase Wu
3584a67955 cs40l26: Add vibrator manager support
Bug: 181615889
Test: Manual type and trigger a long/short vibration
Test: cmd vibrator_manager synced xxxx
Test: cmd vibrator_manager sequential -v 0 xxxx
Test: atest VtsHalVibratorManagerTargetTest \
VtsHalVibratorTargetTest android.os.cts.VibratorTest \
android.os.cts.VibratorManagerTest android.os.cts.VibrationEffectTest \
android.os.cts.VibrationAttributesTest \
android.os.cts.CombinedVibrationTest \
Signed-off-by: Chase Wu <chasewu@google.com>
Change-Id: Ib93e8eb4a0de9269116e07f76b66a77b58915211
2022-10-28 23:31:25 +08:00
Chase Wu
89fda9efcb cs40l26: Move the latest vibrator HAL to device
This is the base version for the vibrator manager feature.

Bug: 181615889
Test: Run all test suites
Signed-off-by: Chase Wu <chasewu@google.com>
Change-Id: I703835346864853a0d5a5918e3c50f541b67dc1f
2022-10-28 23:31:07 +08:00