diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-08-29 02:25:22 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:01:32 -0400 |
commit | 77d97ad1bb77c0e3c60b9781a06b61d4b4667de1 (patch) | |
tree | 3558bb773a38fcb76cbc59316454da2034456372 | |
parent | afead586889f67b111ae23e78f9edf8b32c01f7e (diff) |
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>
-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 6f1ef63086c9..8ac23dff91a1 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, | |||
303 | * possible racing conditions when working in polling mode */ | 303 | * possible racing conditions when working in polling mode */ |
304 | atomic_set(&core->cts, 0); | 304 | atomic_set(&core->cts, 0); |
305 | 305 | ||
306 | /* if (unlikely(command == CMD_POWER_DOWN) */ | 306 | if (!(command == CMD_POWER_DOWN)) |
307 | if (!wait_event_timeout(core->command, | 307 | if (!wait_event_timeout(core->command, |
308 | atomic_read(&core->cts), | 308 | atomic_read(&core->cts), |
309 | usecs_to_jiffies(usecs) + 1)) | 309 | usecs_to_jiffies(usecs) + 1)) |
310 | dev_warn(&core->client->dev, | 310 | dev_warn(&core->client->dev, |
311 | "(%s) [CMD 0x%02x] Answer timeout.\n", | 311 | "(%s) [CMD 0x%02x] Answer timeout.\n", |
312 | __func__, command); | 312 | __func__, command); |
313 | 313 | ||
314 | /* | 314 | /* |
315 | When working in polling mode, for some reason the tuner will | 315 | 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 f5bc8e4bd4bf..e2773cb7ef43 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, | |||
303 | */ | 303 | */ |
304 | udelay(100); | 304 | udelay(100); |
305 | 305 | ||
306 | err = si476x_core_start(core, false); | 306 | err = si476x_core_start(core, true); |
307 | if (err < 0) | 307 | if (err < 0) |
308 | goto disable_regulators; | 308 | goto disable_regulators; |
309 | 309 | ||
@@ -312,7 +312,7 @@ int si476x_core_set_power_state(struct si476x_core *core, | |||
312 | 312 | ||
313 | case SI476X_POWER_DOWN: | 313 | case SI476X_POWER_DOWN: |
314 | core->power_state = next_state; | 314 | core->power_state = next_state; |
315 | err = si476x_core_stop(core, false); | 315 | err = si476x_core_stop(core, true); |
316 | if (err < 0) | 316 | if (err < 0) |
317 | core->power_state = SI476X_POWER_INCONSISTENT; | 317 | core->power_state = SI476X_POWER_INCONSISTENT; |
318 | disable_regulators: | 318 | disable_regulators: |
@@ -799,6 +799,10 @@ static int si476x_core_probe(struct i2c_client *client, | |||
799 | 799 | ||
800 | core->chip_id = id->driver_data; | 800 | core->chip_id = id->driver_data; |
801 | 801 | ||
802 | /* Power down si476x first */ | ||
803 | core->power_state = SI476X_POWER_UP_FULL; | ||
804 | si476x_core_set_power_state(core, SI476X_POWER_DOWN); | ||
805 | |||
802 | rval = si476x_core_get_revision_info(core); | 806 | rval = si476x_core_get_revision_info(core); |
803 | if (rval < 0) { | 807 | if (rval < 0) { |
804 | rval = -ENODEV; | 808 | rval = -ENODEV; |