diff options
Diffstat (limited to 'drivers/mfd/si476x-i2c.c')
-rw-r--r-- | drivers/mfd/si476x-i2c.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/mfd/si476x-i2c.c b/drivers/mfd/si476x-i2c.c index c8d28b844def..accdcdc7f23f 100644 --- a/drivers/mfd/si476x-i2c.c +++ b/drivers/mfd/si476x-i2c.c @@ -97,7 +97,7 @@ static int si476x_core_config_pinmux(struct si476x_core *core) static inline void si476x_core_schedule_polling_work(struct si476x_core *core) { - schedule_delayed_work(&core->status_monitor, + queue_delayed_work(system_freezable_wq, &core->status_monitor, usecs_to_jiffies(SI476X_STATUS_POLL_US)); } @@ -294,7 +294,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; @@ -303,7 +303,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: @@ -729,8 +729,15 @@ static int si476x_core_probe(struct i2c_client *client, memcpy(&core->pinmux, &pdata->pinmux, sizeof(struct si476x_pinmux)); } else { - dev_err(&client->dev, "No platform data provided\n"); - return -EINVAL; + dev_warn(&client->dev, "Using default platform data.\n"); + core->power_up_parameters.xcload = 0x28; + core->power_up_parameters.func = SI476X_FUNC_FM_RECEIVER; + core->power_up_parameters.freq = SI476X_FREQ_37P209375_MHZ; + core->diversity_mode = SI476X_PHDIV_DISABLED; + core->pinmux.dclk = SI476X_DCLK_DAUDIO; + core->pinmux.dfs = SI476X_DFS_DAUDIO; + core->pinmux.dout = SI476X_DOUT_I2S_OUTPUT; + core->pinmux.xout = SI476X_XOUT_TRISTATE; } core->supplies[0].supply = "vd"; @@ -789,12 +796,18 @@ static int si476x_core_probe(struct i2c_client *client, core->chip_id = id->driver_data; + /* Power down si476x first */ + si476x_core_stop(core, true); + rval = si476x_core_get_revision_info(core); if (rval < 0) { rval = -ENODEV; goto free_kfifo; } + if (of_property_read_bool(client->dev.of_node, "revision-a10")) + core->revision = SI476X_REVISION_A10; + cell_num = 0; cell = &core->cells[SI476X_RADIO_CELL]; @@ -810,6 +823,7 @@ static int si476x_core_probe(struct i2c_client *client, core->pinmux.xout == SI476X_XOUT_TRISTATE) { cell = &core->cells[SI476X_CODEC_CELL]; cell->name = "si476x-codec"; + cell->of_compatible = "si476x-codec"; cell_num++; } #endif |