Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273430
b: refs/heads/master
c: d6e3002
h: refs/heads/master
v: v3
  • Loading branch information
Mattias Nilsson authored and Samuel Ortiz committed Oct 24, 2011
1 parent cef202c commit bf65cbb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84165b805972320050892e34fa28d09fe86a25eb
refs/heads/master: d6e3002e493e43aa40473935e1803849cf37b6bb
32 changes: 28 additions & 4 deletions trunk/drivers/mfd/db8500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,7 @@ int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
void prcmu_ac_wake_req(void)
{
u32 val;
u32 status;

mutex_lock(&mb0_transfer.ac_wake_lock);

Expand All @@ -1754,11 +1755,34 @@ void prcmu_ac_wake_req(void)

atomic_set(&ac_wake_req_state, 1);

retry:
writel((val | PRCM_HOSTACCESS_REQ_HOSTACCESS_REQ), PRCM_HOSTACCESS_REQ);

if (!wait_for_completion_timeout(&mb0_transfer.ac_wake_work,
msecs_to_jiffies(20000))) {
pr_err("prcmu: %s timed out (20 s) waiting for a reply.\n",
msecs_to_jiffies(5000))) {
panic("prcmu: %s timed out (5 s) waiting for a reply.\n",
__func__);
goto unlock_and_return;
}

/*
* The modem can generate an AC_WAKE_ACK, and then still go to sleep.
* As a workaround, we wait, and then check that the modem is indeed
* awake (in terms of the value of the PRCM_MOD_AWAKE_STATUS
* register, which may not be the whole truth).
*/
udelay(400);
status = (readl(PRCM_MOD_AWAKE_STATUS) & BITS(0, 2));
if (status != (PRCM_MOD_AWAKE_STATUS_PRCM_MOD_AAPD_AWAKE |
PRCM_MOD_AWAKE_STATUS_PRCM_MOD_COREPD_AWAKE)) {
pr_err("prcmu: %s received ack, but modem not awake (0x%X).\n",
__func__, status);
udelay(1200);
writel(val, PRCM_HOSTACCESS_REQ);
if (wait_for_completion_timeout(&mb0_transfer.ac_wake_work,
msecs_to_jiffies(5000)))
goto retry;
panic("prcmu: %s timed out (5 s) waiting for AC_SLEEP_ACK.\n",
__func__);
}

Expand All @@ -1783,8 +1807,8 @@ void prcmu_ac_sleep_req()
PRCM_HOSTACCESS_REQ);

if (!wait_for_completion_timeout(&mb0_transfer.ac_wake_work,
msecs_to_jiffies(20000))) {
pr_err("prcmu: %s timed out (20 s) waiting for a reply.\n",
msecs_to_jiffies(5000))) {
panic("prcmu: %s timed out (5 s) waiting for a reply.\n",
__func__);
}

Expand Down

0 comments on commit bf65cbb

Please sign in to comment.