* 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
*/
udelay(100);
- err = si476x_core_start(core, false);
+ err = si476x_core_start(core, true);
if (err < 0)
goto disable_regulators;
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:
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;