forked from luck/tmp_suning_uos_patched
clk: si5351: Do not enable parent clocks on probe
The si5351 driver should not prepare or enable other clocks in the tree on probe. Let the clients decide when to prepare or enable the clocks. Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Cc: Rabeeh Khoury <rabeeh@solid-run.com> Signed-off-by: Sergej Sawazki <ce3a@gmx.de> [sboyd@codeaurora.org: Remove most of the .remove function too] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
parent
cdba9a4fb0
commit
1fffaf6aed
|
@ -1469,11 +1469,6 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
}
|
||||
}
|
||||
|
||||
if (!IS_ERR(drvdata->pxtal))
|
||||
clk_prepare_enable(drvdata->pxtal);
|
||||
if (!IS_ERR(drvdata->pclkin))
|
||||
clk_prepare_enable(drvdata->pclkin);
|
||||
|
||||
/* register xtal input clock gate */
|
||||
memset(&init, 0, sizeof(init));
|
||||
init.name = si5351_input_names[0];
|
||||
|
@ -1488,7 +1483,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
ret = devm_clk_hw_register(&client->dev, &drvdata->xtal);
|
||||
if (ret) {
|
||||
dev_err(&client->dev, "unable to register %s\n", init.name);
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* register clkin input clock gate */
|
||||
|
@ -1506,7 +1501,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
if (ret) {
|
||||
dev_err(&client->dev, "unable to register %s\n",
|
||||
init.name);
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1528,7 +1523,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
ret = devm_clk_hw_register(&client->dev, &drvdata->pll[0].hw);
|
||||
if (ret) {
|
||||
dev_err(&client->dev, "unable to register %s\n", init.name);
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* register PLLB or VXCO (Si5351B) */
|
||||
|
@ -1552,7 +1547,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
ret = devm_clk_hw_register(&client->dev, &drvdata->pll[1].hw);
|
||||
if (ret) {
|
||||
dev_err(&client->dev, "unable to register %s\n", init.name);
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* register clk multisync and clk out divider */
|
||||
|
@ -1571,7 +1566,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
|
||||
if (WARN_ON(!drvdata->msynth || !drvdata->clkout)) {
|
||||
ret = -ENOMEM;
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (n = 0; n < num_clocks; n++) {
|
||||
|
@ -1591,7 +1586,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
if (ret) {
|
||||
dev_err(&client->dev, "unable to register %s\n",
|
||||
init.name);
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1619,7 +1614,7 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
if (ret) {
|
||||
dev_err(&client->dev, "unable to register %s\n",
|
||||
init.name);
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* set initial clkout rate */
|
||||
|
@ -1638,28 +1633,16 @@ static int si5351_i2c_probe(struct i2c_client *client,
|
|||
drvdata);
|
||||
if (ret) {
|
||||
dev_err(&client->dev, "unable to add clk provider\n");
|
||||
goto err_clk;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_clk:
|
||||
if (!IS_ERR(drvdata->pxtal))
|
||||
clk_disable_unprepare(drvdata->pxtal);
|
||||
if (!IS_ERR(drvdata->pclkin))
|
||||
clk_disable_unprepare(drvdata->pclkin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int si5351_i2c_remove(struct i2c_client *client)
|
||||
{
|
||||
struct si5351_driver_data *drvdata = i2c_get_clientdata(client);
|
||||
|
||||
of_clk_del_provider(client->dev.of_node);
|
||||
if (!IS_ERR(drvdata->pxtal))
|
||||
clk_disable_unprepare(drvdata->pxtal);
|
||||
if (!IS_ERR(drvdata->pclkin))
|
||||
clk_disable_unprepare(drvdata->pclkin);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user