diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-08-29 14:25:22 +0800 |
---|---|---|
committer | Octavian Purdila <octavian.purdila@nxp.com> | 2017-02-23 14:21:42 +0200 |
commit | da9ebb1dd79fb47eaa2b40bbe94c85a89f261185 (patch) | |
tree | 9ca01c9e78eb2381fd633d3c184c763865bfc7de /drivers | |
parent | 2ba12d543e5ba2a557c2d52e38e2b58300f98cc0 (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')
-rw-r--r-- | drivers/mfd/si476x-cmd.c | 14 | ||||
-rw-r--r-- | drivers/mfd/si476x-i2c.c | 8 |
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 c180b7533bba..4865bb84d091 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: @@ -800,6 +800,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; |