wl1251: add reset handling
authorGrazvydas Ignotas <notasas@gmail.com>
Tue, 20 Apr 2010 13:04:04 +0000 (16:04 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Tue, 20 Apr 2010 13:13:48 +0000 (16:13 +0300)
drivers/net/wireless/wl12xx/wl1251_sdio.c

index f450c9d..da09f16 100644 (file)
@@ -115,6 +115,20 @@ static void wl1251_sdio_write_elp(struct wl1251 *wl, int addr, u32 val)
 
 static void wl1251_sdio_reset(struct wl1251 *wl)
 {
+       extern int sdio_reset_comm(struct mmc_card *card);
+       struct sdio_func *func = wl_to_func(wl);
+       int ret;
+
+       sdio_claim_host(func);
+       sdio_reset_comm(func->card);
+       ret = sdio_enable_func(func);
+       if (ret)
+               goto release;
+
+       sdio_set_block_size(func, 512);
+
+release:
+       sdio_release_host(func);
 }
 
 static void wl1251_sdio_enable_irq(struct wl1251 *wl)
@@ -248,6 +262,9 @@ static int wl1251_sdio_probe(struct sdio_func *func,
        if (ret)
                goto out_free_irq;
 
+       /* we can power it down now until it's started */
+       wl->set_power(0);
+
        sdio_set_drvdata(func, wl);
        return ret;