Commit graph

40 commits

Author SHA1 Message Date
Ravi Jain
810423348e vibrator: Update location of PixelVibratorFlags
Temporary move the definition from main repository to manage visibility
and prevent aosp without vendor build fails

Bug: 362659323
Test: Build pass
Flag: EXEMPT refactor
Change-Id: Ie3bb23838743df1f75261fd530652dcf55b6a643
2024-10-01 15:31:33 +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
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
1d29f93863 vibrator: common: Check whether file is opened correctly
- Add compile-time type checking inside the has() function to ensure it
  receives the correct type.
- Add is_open() inside the has() function.

Bug: 350911314
Test: alarm, ringtone vibrations
Test: keyboard vibrations
Test: idlcli commands
Test: atest PTS, CTS, VTS
Flag: EXEMPT bugfix
Change-Id: Ifa8f197f6f4b25d51b2edaf6fec27a086bd4f73c
2024-08-02 12:55:23 +08: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
Michael Wright
f7e56e0dd5 Merge "Use singular OWNERS file." into main 2024-06-13 17:13:21 +00:00
Michael Wright
22b192c34a Use singular OWNERS file.
Rather than every project having an OWNERS with explicit people, just
use one centralized OWNERS file and have every other OWNERS reference
that. This way when the team changes there's only one place that needs
to be updated.

Bug: 346876927
Test: N/A
Flag: EXEMPT OWNERS change
Change-Id: Ia51b1745f14bda22629e05cd33f6c807cf6f6565
2024-06-13 14:47:44 +01:00
Elliott Hughes
f005b04430 libc++fs is part of libc++ now. am: e6dbfef4d8 am: a24eb002fd
Original change: https://android-review.googlesource.com/c/device/google/felix/+/3122791

Change-Id: I978717fe7ec141313214d84cdef40dc22073bc43
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-10 22:11:20 +00:00
Elliott Hughes
a24eb002fd libc++fs is part of libc++ now. am: e6dbfef4d8
Original change: https://android-review.googlesource.com/c/device/google/felix/+/3122791

Change-Id: I4e10554e6f7abbac2e06953c68bfba6f7ffe77d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-10 21:49:03 +00:00
Elliott Hughes
e6dbfef4d8 libc++fs is part of libc++ now.
Change-Id: I543c95f9813e055dd441ea03363f2205648847c8
2024-06-10 17:38:45 +00:00
Chris Paulo
c1da63bc66 felix/vibrator: Add removecapo flag reference for it to show up in
aconfig

Bug: 335547922
Test: adb shell device_config list | egrep -i 'remove_capo'
Change-Id: I1f6dca0f0dc61fa4bc2db85a1fc55f56ce7146af
Signed-off-by: Chris Paulo <chrispaulo@google.com>
2024-04-18 16:23:39 -07:00
Ravi Jain
ecc275fbeb 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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:75d87040c7284b0d0ef2f20e5edd2e2d384d943c)
Merged-In: Ia6e9111c47f27089521f05a68b538bbefb235d6b
Change-Id: Ia6e9111c47f27089521f05a68b538bbefb235d6b
2024-03-28 22:11:29 +00: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
0e465792b0 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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:85299be2adc9e3dec373dc48f321c4fa1930e260)
Merged-In: I32258500ec02c2a8cbfc6d0b37aaea2c83c7c8b4
Change-Id: I32258500ec02c2a8cbfc6d0b37aaea2c83c7c8b4
2024-03-08 23:54: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
Jacky Liu
331b140bab Update i2c device paths
Update i2c device paths with static bus numbers.

Bug: 323447554
Test: Boot to home
Change-Id: Id98eda794ef6c14e832dc3b40350f76adcb60ad8
2024-02-06 16:17:39 +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
Nathan Kulczak
74a0f2b801 felix/vibrator: Disable PWLE by default
Set chirp.enabled prop to 0 by default so that it will not cause tests
to fail.
Change prop to persist from ro so that it can be enabled for testing.
Update Felix HAL to use new prop.

Bug: 286921585
Test: Tried using idlcli composePwle before/after setting prop
Change-Id: Ibca473aef62b7cc8e84689ddba83a91daddb8d2e
Signed-off-by: Nathan Kulczak <nathankulczak@google.com>
2023-08-17 00:34:36 +00:00
Tai Kuo
07417015d4 cs40l26: set redc_comp_enable as disabled by default
Bug: 287725914
Bug: 288338790
Test: Check system property and driver attribute.
Change-Id: I3fa5c99daa96168bdd9d15e9a686d1e53a5c90f8
2023-06-27 15:22:28 +08:00
Tai Kuo
dc68fe7730 vibrator: update OWNERS
Bug: 271938764
Test: n/a
Change-Id: Iad04490f13497a5cdbc0718491cd0f2d2eb3f7a4
2023-03-07 11:44:54 +08: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
Bob Badour
bfaa6d8336 [LSC] Add LOCAL_LICENSE_KINDS
Added SPDX-license-identifier-Apache-2.0 to:
  vibrator/cs40l26/aidl/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Change-Id: I0f79d8c1a23c701b8cb149d966a9bc8b688ef585
Merged-In: I0f79d8c1a23c701b8cb149d966a9bc8b688ef585
2022-12-09 16:38:14 +08: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
fd52691553 [DO NOT MERGE] cs40l26: using the project folder mk
The based mk file is different from master one, so
there is no need to merge this patch to master branch.

Bug: 181615889
Test: Run all test suites
Signed-off-by: Chase Wu <chasewu@google.com>
Change-Id: I61106aee64c87f77cef966d307ca5f047b5cc0b2
2022-10-28 23:31:13 +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