soc: swr-mstr: Avoid handling redundant swr wakeup events

It is sometimes observed that afe could send multiple wakeup
events at a time. Avoid this by handling wakeup event only once
per swr suspend.

Change-Id: Ieb9ed1b18c8c93cb7db4b75e3411cc25838be492
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
This commit is contained in:
Ramprasad Katkam
2018-09-18 13:22:58 +05:30
parent 662dec1e1e
commit cd61c6ef14
2 changed files with 7 additions and 3 deletions

View File

@@ -1499,8 +1499,10 @@ static int swrm_event_notify(struct notifier_block *self,
schedule_work(&(swrm->dc_presence_work)); schedule_work(&(swrm->dc_presence_work));
break; break;
case SWR_WAKE_IRQ_EVENT: case SWR_WAKE_IRQ_EVENT:
if (swrm->wakeup_req) if (swrm->wakeup_req && !swrm->wakeup_triggered) {
swrm->wakeup_triggered = true;
schedule_work(&swrm->wakeup_work); schedule_work(&swrm->wakeup_work);
}
break; break;
default: default:
dev_err(swrm->dev, "%s: invalid event type: %lu\n", dev_err(swrm->dev, "%s: invalid event type: %lu\n",
@@ -1928,9 +1930,11 @@ static int swrm_runtime_suspend(struct device *dev)
swrm_cmd_fifo_wr_cmd(swrm, 0x2, 0xF, 0xF, swrm_cmd_fifo_wr_cmd(swrm, 0x2, 0xF, 0xF,
SWRS_SCP_CONTROL); SWRS_SCP_CONTROL);
usleep_range(100, 105); usleep_range(100, 105);
if (swrm->wakeup_req) if (swrm->wakeup_req) {
msm_aud_evt_blocking_notifier_call_chain( msm_aud_evt_blocking_notifier_call_chain(
SWR_WAKE_IRQ_REGISTER, (void *)swrm); SWR_WAKE_IRQ_REGISTER, (void *)swrm);
swrm->wakeup_triggered = false;
}
} }
swrm_clk_request(swrm, false); swrm_clk_request(swrm, false);
} }

View File

@@ -150,8 +150,8 @@ struct swr_mstr_ctrl {
u32 clk_stop_mode0_supp; u32 clk_stop_mode0_supp;
struct work_struct wakeup_work; struct work_struct wakeup_work;
u32 wakeup_req; u32 wakeup_req;
bool dev_up; bool dev_up;
bool wakeup_triggered;
}; };
#endif /* _SWR_WCD_CTRL_H */ #endif /* _SWR_WCD_CTRL_H */