diff options
author | Chase Wu <chasewu@google.com> | 2022-12-14 17:09:50 +0800 |
---|---|---|
committer | Chase Wu <chasewu@google.com> | 2022-12-19 19:00:12 +0800 |
commit | 9f374a98c692a587a7a9919d8a11258054864a91 (patch) | |
tree | 4494323fff5c9f8cab45643d7bae66229824b95b /cs40l26/cs40l26.c | |
parent | b0f4296a7368213c91a93df13f212c834689eaab (diff) | |
download | amplifiers-9f374a98c692a587a7a9919d8a11258054864a91.tar.gz |
cs40l26: Performance improvement for short haptic effect and GPIO
sensing rule
1. Remove lock in vibe state sysfd
Since HAL will only read this attribute after sysfs_nofity is called,
removing the mutex_lock to mitigate the chances that HAL only get the
stopped state in triggering the back-to-back short haptic effect
(e.g. TICK effct).
2. Disable falling edge GPIO sensing
Extend the GPIO trigger mask to ignore GPIO1 falling edge as well.
In this way, chip will not waste it's resource to monitor the GPIO
falling edge change and rise the IRQ to driver, then do nothing.
Bug: 262491181
Test: Manually trigger light_tick and check logs
Change-Id: Ie721b804c73f89d4875da17c41c5ac463b59fde8
Signed-off-by: Chase Wu <chasewu@google.com>
Diffstat (limited to 'cs40l26/cs40l26.c')
-rw-r--r-- | cs40l26/cs40l26.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cs40l26/cs40l26.c b/cs40l26/cs40l26.c index d4d4b3f..122842f 100644 --- a/cs40l26/cs40l26.c +++ b/cs40l26/cs40l26.c @@ -3258,8 +3258,14 @@ static int cs40l26_gpio_config(struct cs40l26_private *cs40l26) CS40L26_IRQ1_GPIO1_RISE)); if (mask_gpio) +#if IS_ENABLED(CONFIG_GOOG_CUST) + /* Extend the GPIO trigger mask to ignore GPIO1 falling edge */ + val = (u32) GENMASK(CS40L26_IRQ1_GPIO4_FALL, + CS40L26_IRQ1_GPIO1_FALL); +#else val = (u32) GENMASK(CS40L26_IRQ1_GPIO4_FALL, CS40L26_IRQ1_GPIO2_RISE); +#endif else val = 0; |