Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278100
b: refs/heads/master
c: e28e810
h: refs/heads/master
v: v3
  • Loading branch information
Kalle Valo committed Nov 11, 2011
1 parent 14dec19 commit 6d8812b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 34 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: 76a9fbe27ec04420844ddf49b9e7a2f872222983
refs/heads/master: e28e810486a6826417e77e634666f0dfc2bfe548
77 changes: 44 additions & 33 deletions trunk/drivers/net/wireless/ath/ath6kl/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,46 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
return 0;
}

static int ath6kl_sdio_config(struct ath6kl *ar)
{
struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
struct sdio_func *func = ar_sdio->func;
int ret;

sdio_claim_host(func);

if ((ar_sdio->id->device & MANUFACTURER_ID_ATH6KL_BASE_MASK) >=
MANUFACTURER_ID_AR6003_BASE) {
/* enable 4-bit ASYNC interrupt on AR6003 or later */
ret = ath6kl_sdio_func0_cmd52_wr_byte(func->card,
CCCR_SDIO_IRQ_MODE_REG,
SDIO_IRQ_MODE_ASYNC_4BIT_IRQ);
if (ret) {
ath6kl_err("Failed to enable 4-bit async irq mode %d\n",
ret);
goto out;
}

ath6kl_dbg(ATH6KL_DBG_BOOT, "4-bit async irq mode enabled\n");
}

/* give us some time to enable, in ms */
func->enable_timeout = 100;

ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE);
if (ret) {
ath6kl_err("Set sdio block size %d failed: %d)\n",
HIF_MBOX_BLOCK_SIZE, ret);
sdio_release_host(func);
goto out;
}

out:
sdio_release_host(func);

return ret;
}

static int ath6kl_sdio_suspend(struct ath6kl *ar)
{
struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
Expand Down Expand Up @@ -873,45 +913,16 @@ static int ath6kl_sdio_probe(struct sdio_func *func,

ath6kl_sdio_set_mbox_info(ar);

sdio_claim_host(func);

if ((ar_sdio->id->device & MANUFACTURER_ID_ATH6KL_BASE_MASK) >=
MANUFACTURER_ID_AR6003_BASE) {
/* enable 4-bit ASYNC interrupt on AR6003 or later */
ret = ath6kl_sdio_func0_cmd52_wr_byte(func->card,
CCCR_SDIO_IRQ_MODE_REG,
SDIO_IRQ_MODE_ASYNC_4BIT_IRQ);
if (ret) {
ath6kl_err("Failed to enable 4-bit async irq mode %d\n",
ret);
sdio_release_host(func);
goto err_core_alloc;
}

ath6kl_dbg(ATH6KL_DBG_BOOT, "4-bit async irq mode enabled\n");
}

/* give us some time to enable, in ms */
func->enable_timeout = 100;

sdio_release_host(func);

sdio_claim_host(func);

ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE);
ret = ath6kl_sdio_config(ar);
if (ret) {
ath6kl_err("Set sdio block size %d failed: %d)\n",
HIF_MBOX_BLOCK_SIZE, ret);
sdio_release_host(func);
goto err_hif;
ath6kl_err("Failed to config sdio: %d\n", ret);
goto err_core_alloc;
}

sdio_release_host(func);

ret = ath6kl_core_init(ar);
if (ret) {
ath6kl_err("Failed to init ath6kl core\n");
goto err_hif;
goto err_core_alloc;
}

return ret;
Expand Down

0 comments on commit 6d8812b

Please sign in to comment.