Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267432
b: refs/heads/master
c: 45fda7d
h: refs/heads/master
v: v3
  • Loading branch information
Franky Lin authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent f94c83a commit d6eb6dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 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: a9b977183727004e9f5bf38f45fe4d1e98d42d60
refs/heads/master: 45fda7d2fdcb10d09fd5498491212be6ffcf91e1
22 changes: 0 additions & 22 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,28 +619,6 @@ struct bcmevent_name {
const char *name;
};

#if defined(CONFIG_PM_SLEEP)
#define BRCMF_SPINWAIT_SLEEP_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
#define BRCMF_SPINWAIT_SLEEP(a, exp, us) do { \
uint countdown = (us) + 9999; \
while ((exp) && (countdown >= 10000)) { \
wait_event_timeout(a, false, HZ/100); \
countdown -= 10000; \
} \
} while (0)

#else
#define BRCMF_SPINWAIT_SLEEP_INIT(a)
#define BRCMF_SPINWAIT_SLEEP(a, exp, us) do { \
uint countdown = (us) + 9; \
while ((exp) && (countdown >= 10)) { \
udelay(10); \
countdown -= 10; \
} \
} while (0)

#endif /* defined(CONFIG_PM_SLEEP) */

/*
* Insmod parameters for debug/test
*/
Expand Down
21 changes: 11 additions & 10 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ struct rte_console {
(((prio) == PRIO_8021D_NONE || (prio) == PRIO_8021D_BE) ? \
((prio^2)) : (prio))

BRCMF_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);

/*
* Core reg address translation.
* Both macro's returns a 32 bits byte address on the backplane bus.
Expand Down Expand Up @@ -1033,6 +1031,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
int err;
u8 clkctl, clkreq, devctl;
struct brcmf_sdio_card *card;
unsigned long timeout;

BRCMF_TRACE(("%s: Enter\n", __func__));

Expand Down Expand Up @@ -1102,14 +1101,16 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
}

/* Otherwise, wait here (polling) for HT Avail */
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
BRCMF_SPINWAIT_SLEEP(sdioh_spinwait_sleep,
((clkctl =
brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
&err)),
!SBSDIO_CLKAV(clkctl, bus->alp_only)),
PMU_MAX_TRANSITION_DLY);
timeout = jiffies +
msecs_to_jiffies(PMU_MAX_TRANSITION_DLY/1000);
while (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
clkctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
&err);
if (time_after(jiffies, timeout))
break;
else
usleep_range(5000, 10000);
}
if (err) {
BRCMF_ERROR(("%s: HT Avail request error: %d\n",
Expand Down

0 comments on commit d6eb6dd

Please sign in to comment.