Commit graph

29 commits

Author SHA1 Message Date
Tai Kuo
f669a1ea52 cs40l26: add DBC bin info and reduce duplicates
Bug: 356823441
Test: dumpsys android.hardware.vibrator.IVibrator/default
Flag: EXEMPT bugfix
Change-Id: Id3d9fac99b204de581269818e69722932e4911fc
(cherry picked from commit 6e4e8d2052e352a56eeab2e452addaf484d79d9f)
2024-10-24 10:46:17 +00:00
Tai Kuo
0b3cc7ea7b cs40l26: organize dump() AIDL section
Bug: 356823441
Test: dumpsys android.hardware.vibrator.IVibrator/default
Flag: EXEMPT refactor
Change-Id: Ie14e60482c3e6763921dc22f804155cd6f3b9fcd
2024-10-21 11:43:19 +08:00
Tai Kuo
c5a772a3f2 vibrator: correct debug() calibration file path
Bug: 356823441
Test: dumpsys
Flag: EXEMPT bugfix
Change-Id: I2d126e63ae7365b4bd199d00776f10b11c700702
2024-10-15 20:27:45 +08:00
Treehugger Robot
5644762c10 Merge "vibrator: Format PWLE header in user driver" into main 2024-10-02 03:17:08 +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
Nathan Kulczak
7105ca38e8 vibrator: Format PWLE header in user driver
Add PWLE header formatting to user side driver to support new kernel
driver and SVC and DVL for OWT effects.

Bug: 279055885
Bug: 361011775
Flag: EXEMPT bugfix
Test: idlcli
Change-Id: I3b447962cc46ab57cf145072bc30303786f581ad
Signed-off-by: Nathan Kulczak <nathankulczak@google.com>
2024-09-02 15:06:34 +08: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
Chris Paulo
42ebfa74b9 vibrator: Update polling timeout to 50ms
Update the polling timeout to match that of main vibrator HAL.  The
polling timeout is too short, and will cause reset logic to run if the
bus is busy.

Bug: 348364432
Flag: EXEMPT bugfix
Test: atest PtsVibratorHalTestSuite \
  PtsHapticsTestCases \
  VibratorHalCs40l26TestSuite \
  VtsHalVibratorManagerTargetTest \
  VtsHalVibratorTargetTest \
  CtsVibratorTestCases
Change-Id: I31dac8f1693eda8f1a5bac8420aaa7c0d11781fa
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
Chris Paulo
e1ab132994 vibrator/cs40l26: Update ff_effect duration
Update the ff_effect duration to pass in 0 for compositions and RAM
indices.  This will allow firmware to take control of the playback
duration, as well as apply SVC braking as required.  This will also help
avoid ending the effect early which can cause ringing.

Bug: 317280093
Test: Verified perception and plotted acceleration
Change-Id: I048b2bbda04af2a627aa8993aafc1f55ccf8fe13
Signed-off-by: Chris Paulo <chrispaulo@google.com>
2024-01-19 14:29:57 -08:00
Chris Paulo
3f346b4849 felix/vibrator: Update durations to match other projects
Updated the duration of effects to match waveform durations.  This will
remove the added overhead durations which are not supposed to be part of
the calculations for durations of effects.

Bug: 305756647
Test: atest VibratorHalCs40l26TestSuitePrivate
Change-Id: I66c761482b13969816630e89b9e79cfb729f6f5c
Signed-off-by: Chris Paulo <chrispaulo@google.com>
2023-10-20 15:04:43 -07:00
TreeHugger Robot
6be97cd21c Merge "cs40l26: Fix the composed effect delay problem" into tm-qpr-dev 2023-02-13 03:59:26 +00:00
Chase Wu
968c3d1a00 cs40l26: Fix the composed effect delay problem
When user typed the gboard back-to-back, HAL will send a STOP call right
after it sends a START call. At this moment, driver is under an
activating process and the vibe_state is not 1, so the erasing process
will be forced to wait for the FW's completed signal.
This makes STOP call consumes lots of waiting time and user would still
feels a delay gap under back-to-back typing behavior.

This patch removes the erased process from the STOP call and let it be
done in the completed process.

Bug: 263476381
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
Test: Type Gboard with five fingers

Change-Id: I02dfdae4e9e9334a253106f631c933228398b077
2023-02-11 11:58:05 +08: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
Chase Wu
2724d61255 [DO NOT MERGE] vibrator/cs40l26: Fix unsupport primitive effects test
Bug: 264219822
Test: atest Vibrator/VibratorAidl#ComposeUnsupportedPrimitives/TOP_LEVEL_VIBRATOR_0
Change-Id: I736e509bcd1e8004c144744e06c63cc35b6fbfb2
2023-01-17 20:15:17 +08:00
Chase Wu
f19351f3a9 [DO NOT MERGE] cs40l26: Report the duration time when using DOUBLE_CLICK effect
DOUBLE_CLICK is a composed effect, but it uses another function to
do the composed process.
When using GPI to trigger a composed effect, HAL needs to update the
overall duration time to chip.

Bug: 263963724
Test: Manully unlock the device
Change-Id: I329fbeff69a56fe990b1ca946bdd30199048ef04
2023-01-04 12:00:36 +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
8d22072195 cs40l26: Add cancelSynced when prepare sync fail
Also add more logs to improve the ability of debugging.

Bug: 259012441
Test: scrolling the minute hand in alarm
Change-Id: I93b9dc7999ef0285d66a54a4fa5b74f4b72150bc
Signed-off-by: Chase Wu <chasewu@google.com>
2022-11-21 22:01:35 +08:00
Chase Wu
a5ab84ba2a cs40l26: Improve the vibrator manager stability
1. Add the return check when doing the prepareSynced process.
2. Add more debugging log pattern
3. Correst the corner case when doing the erase process

Bug: 258391756
Test: command in the bug
Change-Id: Ib6e189cca66f67b0501299cdb1a8c2572215a70e
Signed-off-by: Chase Wu <chasewu@google.com>
2022-11-10 10:58:31 +00:00
Chase Wu
3f32520d2f [DO NOT MERGE] cs40l26: Enable vibrator manager feature
This patch remove the old dual design and add it into the original
vibrator HALs'rc file.

Also, this patch dynamically gets the service name from rc file.

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
Signed-off-by: Chase Wu <chasewu@google.com>
Change-Id: I7a5dd65c67e01a008f8d2c675dc7b96599469622
2022-11-02 22:26:31 +08: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