Commit Graph

9 Commits

Author SHA1 Message Date
David Lin
9a0a8d2f42 haptics: move playback mode setting to on()
This patch moves the device playback mode configuration from off() to
on() to avoid the unnecessarily switching from rtp to waveform mode for
consecutive waveform playbacks.

Bug: 62507430
Test: vts, haptic stresss test
Change-Id: I0f7c1f6263dcb4da59695c1619aade47f7381541
Signed-off-by: David Lin <dtwlin@google.com>
2017-06-13 02:41:40 +00:00
David Lin
e2ac78d27f haptics: implements vibrator 1.1 HAL
Obtain tick/click effect duration from system property and implement the
new perform 1.1 function for supporting tick effect.

Bug: 62176703
Test: VtsHalVibratorV1_1TargetTest
Change-Id: Icbd50c2e7d05fd520aeda4511ba95151dde2a5ed
Signed-off-by: David Lin <dtwlin@google.com>
2017-06-05 16:21:17 -07:00
David Lin
89b4aa84af haptics: update effect waveform
EFFECT_CLICK
- Walleye: On resonance (f1=155 Hz), square wave full amplitude
  (A1=127), auto-brake, duration T1=6ms.
- Taimen: On resonance (f1=155 Hz), square wave full amplitude
  (A1=127), auto-brake, duration T1=10 ms.

EFFECT_DOUBLE_CLICK
- Two actuations T1=25 ms, A1=63, T3=100ms, T2=10 ms, A2=127

LONG_PRESS
- Walleye: 8ms duration with full amplitude
- Taimen: 12ms duration with full amplitude

Bug: 62176703
Test: VTS 1.0
Change-Id: Idf728ad793b3dd64f52d1ea95e8ea2cf3085a72a
Signed-off-by: David Lin <dtwlin@google.com>
2017-06-01 13:32:11 -07:00
TreeHugger Robot
e57a86cce7 Merge "vibrator: add calibration data loading support" 2017-05-22 21:27:43 +00:00
David Lin
0f959efa6c vibrator: add calibration data loading support
This patch adds the support of loading a calibration file and write it
back to the drv2624 kernel driver. The calibration file contains the
BEMF, GAIN and COMP numbers generated using the auto-calibration feature
of the drv2624 driver IC. The file also contains the per-device resonant
frequency number.

Test: calibrate the device and read back the values from kernel
Change-Id: Ieafe5b317c7544bd8d657168250fb41e2ee0d8fc
Signed-off-by: David Lin <dtwlin@google.com>
2017-05-22 16:36:47 +00:00
David Lin
ed1c9bd230 vibrator: update manifest.xml and fix issue with setAmplitude()
When outputting uint8_t / char to sysfs using ofstream it gets to
stringified to a character instead of string. For example, writing 127
would get converted to "\x7F\0a" in text while sysfs generally only
accept input in dec "127" or "0x7f" in hex format. This patch changes
the rtp_input type to uint32_t instead.

Bug: 36097386
Test done: VtsHalVibratorV1_0TargetTest all passed
Change-Id: Ie98e42584fd32843dec46edde7af54f9cdcbc4cc
Signed-off-by: David Lin <dtwlin@google.com>
2017-05-22 09:35:42 -07:00
David Lin
a6e2550687 vibrator: fix incorrect error checking when opening kernel sysfs nodes
Test: test device vibrates
Change-Id: I05c2e5afa6d66a69aacd65885d7d3092ef0fec63
Signed-off-by: David Lin <dtwlin@google.com>
2017-05-15 18:09:01 -07:00
David Lin
646e1e592b vibrator hal: add loop mode control and update waveform
This patch updates the click waveform to use 6 ms full amplitude as well
as switching to open-loop mode for any duration that's less than 20 ms.
The medium and strong now shares the same strength to provide a stronger
default feedback.

Bug: 37952639
Test: keyboard and home key taps
Change-Id: I00086e47e41d97ce8363ba4032eeab320ad1b765
Signed-off-by: David Lin <dtwlin@google.com>
2017-05-05 00:37:04 +00:00
David Lin
971ea5d074 vibrator hal: add support for drv2624 haptics driver on wahoo
This adds the vibrator HAL that implements the new setAmplitude and
perform(Effect) API.

Test done: vibrator_hidl_hal_test
Bug: 36782452

Change-Id: If9988434277790becb469d4dd928e75f7e6af41a
Signed-off-by: David Lin <dtwlin@google.com>
2017-04-05 12:44:20 -07:00