}
usleep_range(1000, 1000);
- if (sensor->hwcfg->set_xclk)
- rval = sensor->hwcfg->set_xclk(
- &sensor->src->sd, sensor->hwcfg->ext_clk);
- else
- rval = clk_prepare_enable(sensor->ext_clk);
+ rval = clk_prepare_enable(sensor->ext_clk);
if (rval < 0) {
dev_dbg(&client->dev, "failed to enable xclk\n");
goto out_xclk_fail;
out_cci_addr_fail:
gpiod_set_value(sensor->xshutdown, 0);
- if (sensor->hwcfg->set_xclk)
- sensor->hwcfg->set_xclk(&sensor->src->sd, 0);
- else
- clk_disable_unprepare(sensor->ext_clk);
+ clk_disable_unprepare(sensor->ext_clk);
out_xclk_fail:
regulator_disable(sensor->vana);
SMIAPP_SOFTWARE_RESET);
gpiod_set_value(sensor->xshutdown, 0);
- if (sensor->hwcfg->set_xclk)
- sensor->hwcfg->set_xclk(&sensor->src->sd, 0);
- else
- clk_disable_unprepare(sensor->ext_clk);
+ clk_disable_unprepare(sensor->ext_clk);
usleep_range(5000, 5000);
regulator_disable(sensor->vana);
sensor->streaming = false;
return PTR_ERR(sensor->vana);
}
- if (!sensor->hwcfg->set_xclk) {
- sensor->ext_clk = devm_clk_get(&client->dev, NULL);
- if (IS_ERR(sensor->ext_clk)) {
- dev_err(&client->dev, "could not get clock (%ld)\n",
- PTR_ERR(sensor->ext_clk));
- return -EPROBE_DEFER;
- }
+ sensor->ext_clk = devm_clk_get(&client->dev, NULL);
+ if (IS_ERR(sensor->ext_clk)) {
+ dev_err(&client->dev, "could not get clock (%ld)\n",
+ PTR_ERR(sensor->ext_clk));
+ return -EPROBE_DEFER;
+ }
- rval = clk_set_rate(sensor->ext_clk,
- sensor->hwcfg->ext_clk);
- if (rval < 0) {
- dev_err(&client->dev,
- "unable to set clock freq to %u\n",
- sensor->hwcfg->ext_clk);
- return rval;
- }
+ rval = clk_set_rate(sensor->ext_clk,
+ sensor->hwcfg->ext_clk);
+ if (rval < 0) {
+ dev_err(&client->dev,
+ "unable to set clock freq to %u\n",
+ sensor->hwcfg->ext_clk);
+ return rval;
}
sensor->xshutdown = devm_gpiod_get_optional(&client->dev, "xshutdown",
if (sensor->power_count) {
gpiod_set_value(sensor->xshutdown, 0);
- if (sensor->hwcfg->set_xclk)
- sensor->hwcfg->set_xclk(&sensor->src->sd, 0);
- else
- clk_disable_unprepare(sensor->ext_clk);
+ clk_disable_unprepare(sensor->ext_clk);
sensor->power_count = 0;
}