summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Wang <masonwang@google.com>2022-11-08 17:38:01 +0800
committerMason Wang <masonwang@google.com>2022-11-11 09:38:20 +0800
commit4b8c9ca83c5bb67a05d138959dc4c2d8314d9e32 (patch)
tree942f7e22f073481248127f089a83691fb0c73511
parent43dc885acd6851fda6afb58ee592c83c84f08154 (diff)
downloadcommon-android-gs-raviole-5.10-t-qpr2-beta-1.tar.gz
To verify the value of aoc2ap_gpio again when TBN operation is timeout to judge the AP requests/releases bus successfully or not. Bug: 257076750 Test: Basic touch operation and wake-up gesture are working well Signed-off-by: Mason Wang <masonwang@google.com> Change-Id: I5a895b9360c7abbb7b9b502862a1212ca2e7175a
-rw-r--r--touch_bus_negotiator.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/touch_bus_negotiator.c b/touch_bus_negotiator.c
index 375095a..cae8435 100644
--- a/touch_bus_negotiator.c
+++ b/touch_bus_negotiator.c
@@ -94,15 +94,26 @@ int tbn_handshaking(struct tbn_context *tbn, enum tbn_operation operation)
reinit_completion(wait_for_completion);
if (tbn->mode == TBN_MODE_GPIO) {
+ int ap2aoc_val_org = gpio_get_value(tbn->ap2aoc_gpio);
+ int aoc2ap_val_org = gpio_get_value(tbn->aoc2ap_gpio);
+
irq_set_irq_type(tbn->aoc2ap_irq, irq_type);
enable_irq(tbn->aoc2ap_irq);
gpio_direction_output(tbn->ap2aoc_gpio, bus_owner);
if (wait_for_completion_timeout(wait_for_completion,
- msecs_to_jiffies(timeout)) == 0) {
- dev_err(tbn->dev, "AP %s bus ... timeout!, aoc2ap_gpio=%d\n",
- msg, gpio_get_value(tbn->aoc2ap_gpio));
+ msecs_to_jiffies(timeout)) == 0) {
+ int ap2aoc_val = gpio_get_value(tbn->ap2aoc_gpio);
+ int aoc2ap_val = gpio_get_value(tbn->aoc2ap_gpio);
+
complete_all(wait_for_completion);
- ret = -ETIMEDOUT;
+ if (bus_owner == aoc2ap_val)
+ ret = 0;
+ else
+ ret = -ETIMEDOUT;
+ dev_err(tbn->dev, "AP %s bus ... timeout!, ap2aoc_gpio(B:%d,A:%d)"
+ " aoc2ap_gpio(B:%d,A:%d), ret=%d\n",
+ msg, ap2aoc_val_org, ap2aoc_val, aoc2ap_val_org,
+ aoc2ap_val, ret);
} else
dev_info(tbn->dev, "AP %s bus ... SUCCESS!\n", msg);
disable_irq_nosync(tbn->aoc2ap_irq);