From 5efb0a733ea5a2c2e686d318edb0607ef2ed06cd Mon Sep 17 00:00:00 2001 From: Vic Huang Date: Tue, 7 Feb 2023 15:08:40 +0000 Subject: btpower: Set enable_irq_wake when BT turn on Set enable_irq_wake when BT turn on Set disable_irq_wake when BT turn off Bug: 267961645 Bug: 265610362 Test: 1. Basic functions test PASS 2. BCST PASS 3. Power automation test PASS 4. Manual power measurement PASS 5. SDS stability test PASS 6. Issue verified PASS Change-Id: I58839b7999dd46f6ac3a7047239a88ca850731de (cherry picked from commit 1ad11a6b83f97229ef34e527e21e3ef096df3875) --- btpower.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'btpower.c') diff --git a/btpower.c b/btpower.c index 7d7d125..158f4aa 100644 --- a/btpower.c +++ b/btpower.c @@ -583,6 +583,10 @@ static void bt_configure_wakeup_gpios(struct btpower_platform_data *drvdata, boo LOGD(drvdata, "BT-OFF bt-hostwake-gpio(%d) IRQ(%d) value(%d)", bt_host_wake_gpio, drvdata->irq, gpio_get_value(bt_host_wake_gpio)); + rc = disable_irq_wake(drvdata->irq); + if(rc) { + LOGE(drvdata, "Failed to disable IRQ wake"); + } free_irq(drvdata->irq, drvdata); } @@ -605,6 +609,10 @@ static void bt_configure_wakeup_gpios(struct btpower_platform_data *drvdata, boo if (rc) LOGE(drvdata, "unable to request IRQ %d (%d)", bt_host_wake_gpio, rc); + rc = enable_irq_wake(drvdata->irq); + if(rc) { + LOGE(drvdata, "Failed to enable IRQ wake"); + } drvdata->hostwake_state = -1; drvdata->hostwake_count = 0; } -- cgit v1.2.3