Commit Graph
22 Commits
Author SHA1 Message Date
Andy White 1b047e88bc haptic_hv: Select waveform based on duration
If seq <= 2 and duration <= 100, select a waveform based on ranges
defined in the devicetree. There are three ranges, from smallest
duration to largest, corresponding to waveforms 3, 5, and 1,
respectively.

Change-Id: Iaa83fb9d54c02ef9d13fd0ecb8dbfbd6753390df
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2462031
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2022-12-14 14:46:12 -06:00
Andy White c890634342 Reset to default waveform after vibration
After any vibration, reset the waveform to the default index
of 1. This ensures that the vibe state is always consistent.

Change-Id: I7821d7cb0abd57a4b0d0cf1d7315c6b67de58a92
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2452957
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2022-12-14 14:42:58 -06:00
Andy White 9c43eb0176 haptic_hv: Prevent sysfs attrs from being destroyed
If the trigger is changed, there's a chance that the new trigger
will provide attributes that conflict with ones that already exist,
destroying them.

By removing the `trigger` attribute, any init script that attempts
to alter the trigger will fail to do so.

Change-Id: I19f58b08706f4592eeefae65f63d82f44373cb55
Reviewed-on: https://gerrit.mot.com/2451742
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2022-12-06 10:39:23 -06:00
Andy White aff1cd0bc3 haptic_hv: Add HAL compatility
Add alternative 'activate_store' and 'seq_store' functions to allow
existing HAL to properly interact with the haptic_hv driver.

NOTE: This commit does not add compatible RTP playback support

Change-Id: I9b94219d16ada7532de359acd80065a1743a435a
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2425277
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2022-11-14 10:16:38 -06:00
Andy White dfd72aa13f haptic_hv: Prevent sysfs attrs from being destroyed
If the trigger is changed, there's a chance that the new trigger
will provide attributes that conflict with ones that already exist,
destroying them.

By setting the `trigger` attribute to read-only, any init script
that attempts to alter the trigger will fail to do so.

Change-Id: I64b33c375415326354e1fb2a11b04cd3626c6b00
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2386804
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
2022-11-14 10:16:31 -06:00
Andy White 8b84aeebf2 aw86927: Add vendor-supplied driver
Add vendor-supplied driver code and add new Android.mk
Makefile, and Kbuild files to integrate into Android
build system.

Change-Id: Ia0d5eaf8c9093a76ced96c8c962b80b6a7f19736
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2332902
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
2022-07-19 16:30:59 -05:00
Andy White ca7e446885 Add sign-of-life LED trigger module
Add a new configurable LED trigger that alters the LED blink
pattern based on power supply status.

By default:
Device on or fully charged     | LED is solid on
Device is charging             | LED blinks  700ms on/700ms off
Device battery is 15% or lower | LED blinks 3800ms on/200ms off

Change-Id: I5d0df2a7cb535679f8837542fb651f73db4924af
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2192503
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Drew Abbott <drewa@motorola.com>
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2022-04-06 13:19:33 -05:00
Andy White f4e72e165a aw8697: Add "Moto Retro" to ringtone map
Add new ringtone to end of waveform file array.
"Moto Retro" is not present on all AW8697 devices.

Change-Id: I1b4b68aec659306eea3b398a0460ec28326e2c26
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1596551
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2020-06-19 15:52:14 -05:00
Andy White 30b10c835d fg: Trigger POR in factory mode or factory software
Check for factory mode or factory software and reset on probe.

Change-Id: I46ad960219739ff6412f77bc8947a25690da3488
Signed-off-by: Drew Abbott <drewa@motorola.com>
Reviewed-on: https://gerrit.mot.com/1617379
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2020-06-18 13:00:25 -05:00
Andy White 0b3fdf0116 aw8697: smith: Add boot-up vibration
Add 1-second long vibration after waveform library load
as a boot-up vibration. This is distinct from the f0
calibration pulse.

Change-Id: Ic31062da9cbcd163f9af3882e7cdd2bcc389020c
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1593615
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2020-06-03 14:22:14 -05:00
Andy White 17333d3730 capsense: Add dummy set_poll_delay function
Add dummy function so we no longer get "Invalid sensor class
delay handle" errors

Change-Id: I7b3fd34e485ffff58736b3b58e660bdb276085ad
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1585831
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2020-05-29 13:34:35 -05:00
Andy White 991f9f0549 aw8697: Disable external triggers
External hardware triggering was being enabled, leading to
occasional errant vibrations

Change-Id: I227564de70e9e9a036b8cebca6129255591bc194
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1551942
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2020-05-15 12:56:23 -05:00
Andy White a2793d5541 fg: Trigger POR through sysfs instead of factory mode
Change-Id: Ib623d4ddd9c021c8cfc8692237d02871f47268df
Reviewed-on: https://gerrit.mot.com/1550009
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Ling Jin <lingjin@motorola.com>
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Submit-Approved: Jira Key
2020-05-08 16:25:06 -05:00
Andy White 9b3ec1e171 Reset fuel gauge in factory mode
Reset fuel gauges in factory boot mode or in a
factory build

Change-Id: I63a3efe7ddf1e2a7cf612f56a10ca868265c2467
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1544240
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Submit-Approved: Jira Key
2020-04-29 10:20:55 -05:00
Andy White 22bbf73078 Revert "(CR) aw8697: boost ram loop mode playback"
Using boost mode for long vibrations leads to desense issues.
The long vibration waveform will be modified to increase power
instead.

This reverts commit e5c9b40ce9f6d9abf83dfde7da4adbd0f52664ef.

Change-Id: Idb38ad2fd1f51578ee3c1610ef13c90628b5dbb1
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1505515
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
2020-03-04 14:08:42 -06:00
Andy White afb828d7a6 Racer_turbo: aw8697: Add new entry in ringtone array
Add an entry for the new default ringtone into the RTP
ringtone->waveform map

Change-Id: I1f7faa906ad13b462c5673a88bfbdffe2d50db3c
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1498409
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2020-02-14 14:59:47 -06:00
Andy White 64b289fbc6 aw8697: Add error checking to RTP mode
Error status bits weren't being checked, so RTP mode
would attempt to continue despite errors being present,
causing occasional lock-ups and delays

Change-Id: I9de871e3e2e0ba2255e621b5a8505e87edd90f1e
Signed-off-by: Perry White <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1491069
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2020-01-31 14:09:17 -06:00
awhite6 071e0b2d8b aw8697: Move RTP update work out of irq handler
The vast majority of RTP work was being done directly in
the irq handler. Occasionally, it would take eight or more
seconds to return from the irq.

Change-Id: I7332b9746efcfaac1d09b8c1cc8116da59138cd0
Signed-off-by: awhite6 <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1487522
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2020-01-23 16:43:57 -06:00
awhite6 3764a015a2 aw8697: Add moto ringtone array
Add array of moto ringtone waveform binary file
names needed for RTP mode

Change-Id: I87fd5e7db7c68e28ef7c80a7430e1ecfca233916
Signed-off-by: awhite6 <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1472918
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2019-12-17 11:47:30 -06:00
awhite6 b626f7e340 aw8697: Use RAM mode for long vibration
Configure long vibration to use RAM mode instead of
CONT mode.

Change-Id: Ife3c08ce775d12796e6435ce8a95d7d7a3448410
Signed-off-by: awhite6 <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1471982
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2019-12-13 16:14:42 -06:00
awhite6 fd2ce9474b drivers: aw8697: fix kernel panic on RTP
There was mixing of memory allocation methods, i.e.
allocating with vzalloc() and trying to free with kfree()

Change-Id: I8ae2627c1bb6431b44311bca093c671df162e91d
Signed-off-by: awhite6 <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1471259
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
2019-12-13 10:00:00 -06:00
awhite6 74517246b3 drivers: sx933x: add usb recal for cap sense
Add build config option to recalibrate cap sense upon
insertion of USB.

Change-Id: Ib774aa418d66cd769b5d1149d61b30619b9b4ed7
Signed-off-by: awhite6 <awhite6@motorola.com>
Reviewed-on: https://gerrit.mot.com/1467066
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2019-12-06 09:31:47 -06:00