summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorNicolin Chen <b42378@freescale.com>2013-08-29 14:25:22 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:00:05 -0600
commit7570410ffab94f6d823678c6ca000dbe671bcd3c (patch)
treed94d04a9a80e2454878923ddbc47ba2019256da7 /drivers/mfd
parenteb8b7a7c4f9a7f98dbc9767c897b08c1bee237f0 (diff)
MLK-11429-22: mfd: si476x: Fix power up failure
cherry-pick below patch from imx_3.14.y ENGR00276567-4 mfd: si476x: Fix power up failure This's some logical error in power-up code, thus fix it. Signed-off-by: Nicolin Chen <b42378@freescale.com> (cherry picked from commit 77d97ad1bb77c0e3c60b9781a06b61d4b4667de1) (cherry picked from commit b656522da2685ef9a4da2229b6786d5cd0c12189)
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/si476x-cmd.c14
-rw-r--r--drivers/mfd/si476x-i2c.c8
2 files changed, 13 insertions, 9 deletions
diff --git a/drivers/mfd/si476x-cmd.c b/drivers/mfd/si476x-cmd.c
index 2086b4665288..d5cfe7ba4649 100644
--- a/drivers/mfd/si476x-cmd.c
+++ b/drivers/mfd/si476x-cmd.c
@@ -303,13 +303,13 @@ static int si476x_core_send_command(struct si476x_core *core,
* possible racing conditions when working in polling mode */
atomic_set(&core->cts, 0);
- /* if (unlikely(command == CMD_POWER_DOWN) */
- if (!wait_event_timeout(core->command,
- atomic_read(&core->cts),
- usecs_to_jiffies(usecs) + 1))
- dev_warn(&core->client->dev,
- "(%s) [CMD 0x%02x] Answer timeout.\n",
- __func__, command);
+ if (!(command == CMD_POWER_DOWN))
+ if (!wait_event_timeout(core->command,
+ atomic_read(&core->cts),
+ usecs_to_jiffies(usecs) + 1))
+ dev_warn(&core->client->dev,
+ "(%s) [CMD 0x%02x] Answer timeout.\n",
+ __func__, command);
/*
When working in polling mode, for some reason the tuner will
diff --git a/drivers/mfd/si476x-i2c.c b/drivers/mfd/si476x-i2c.c
index 7f87c62d91b3..9f0461d52fe6 100644
--- a/drivers/mfd/si476x-i2c.c
+++ b/drivers/mfd/si476x-i2c.c
@@ -303,7 +303,7 @@ int si476x_core_set_power_state(struct si476x_core *core,
*/
udelay(100);
- err = si476x_core_start(core, false);
+ err = si476x_core_start(core, true);
if (err < 0)
goto disable_regulators;
@@ -312,7 +312,7 @@ int si476x_core_set_power_state(struct si476x_core *core,
case SI476X_POWER_DOWN:
core->power_state = next_state;
- err = si476x_core_stop(core, false);
+ err = si476x_core_stop(core, true);
if (err < 0)
core->power_state = SI476X_POWER_INCONSISTENT;
disable_regulators:
@@ -799,6 +799,10 @@ static int si476x_core_probe(struct i2c_client *client,
core->chip_id = id->driver_data;
+ /* Power down si476x first */
+ core->power_state = SI476X_POWER_UP_FULL;
+ si476x_core_set_power_state(core, SI476X_POWER_DOWN);
+
rval = si476x_core_get_revision_info(core);
if (rval < 0) {
rval = -ENODEV;