summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/wilc_sdio.c
diff options
context:
space:
mode:
authorGlen Lee2016-01-25 08:35:09 +0100
committerGreg Kroah-Hartman2016-02-04 00:25:40 +0100
commit5397cbc231e20c8166709e696e70cff08d8ae503 (patch)
treee50973392cbac3a1d4d8ea96be6a668faa0e8116 /drivers/staging/wilc1000/wilc_sdio.c
parentstaging: wilc1000: add sdio resume/suspend (diff)
downloadkernel-qcow2-linux-5397cbc231e20c8166709e696e70cff08d8ae503.tar.gz
kernel-qcow2-linux-5397cbc231e20c8166709e696e70cff08d8ae503.tar.xz
kernel-qcow2-linux-5397cbc231e20c8166709e696e70cff08d8ae503.zip
staging: wilc1000: sdio_init: add resume argument
Part of sdio init codes should not run when sdio init function is called on sdio resume so skip them. Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_sdio.c')
-rw-r--r--drivers/staging/wilc1000/wilc_sdio.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index f40a52730bc6..7c20c8c9c2bc 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -42,7 +42,7 @@ static wilc_sdio_t g_sdio;
static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data);
static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data);
-static int sdio_init(struct wilc *wilc);
+static int sdio_init(struct wilc *wilc, bool resume);
static void wilc_sdio_interrupt(struct sdio_func *func)
{
@@ -196,7 +196,7 @@ static int wilc_sdio_resume(struct device *dev)
dev_info(dev, "sdio resume\n");
sdio_release_host(func);
chip_wakeup(wilc);
- sdio_init(wilc);
+ sdio_init(wilc, true);
if (wilc->suspend_event)
host_wakeup_notify(wilc);
@@ -667,16 +667,17 @@ static int sdio_deinit(struct wilc *wilc)
return 1;
}
-static int sdio_init(struct wilc *wilc)
+static int sdio_init(struct wilc *wilc, bool resume)
{
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
sdio_cmd52_t cmd;
int loop, ret;
u32 chipid;
- memset(&g_sdio, 0, sizeof(wilc_sdio_t));
-
- g_sdio.irq_gpio = (wilc->dev_irq_num);
+ if (!resume) {
+ memset(&g_sdio, 0, sizeof(wilc_sdio_t));
+ g_sdio.irq_gpio = (wilc->dev_irq_num);
+ }
/**
* function 0 csa enable
@@ -766,16 +767,19 @@ static int sdio_init(struct wilc *wilc)
/**
* make sure can read back chip id correctly
**/
- if (!sdio_read_reg(wilc, 0x1000, &chipid)) {
- dev_err(&func->dev, "Fail cmd read chip id...\n");
- goto _fail_;
+ if (!resume) {
+ if (!sdio_read_reg(wilc, 0x1000, &chipid)) {
+ dev_err(&func->dev, "Fail cmd read chip id...\n");
+ goto _fail_;
+ }
+ dev_err(&func->dev, "chipid (%08x)\n", chipid);
+ if ((chipid & 0xfff) > 0x2a0)
+ g_sdio.has_thrpt_enh3 = 1;
+ else
+ g_sdio.has_thrpt_enh3 = 0;
+ dev_info(&func->dev, "has_thrpt_enh3 = %d...\n",
+ g_sdio.has_thrpt_enh3);
}
- dev_err(&func->dev, "chipid (%08x)\n", chipid);
- if ((chipid & 0xfff) > 0x2a0)
- g_sdio.has_thrpt_enh3 = 1;
- else
- g_sdio.has_thrpt_enh3 = 0;
- dev_info(&func->dev, "has_thrpt_enh3 = %d...\n", g_sdio.has_thrpt_enh3);
return 1;