dev_err(&pdev->dev, "Cannot re-set clock rate. Continuing\n");
bg_ptr->clk_rate = clk_rate;
- clk_enable(bg_ptr->fclock);
+ if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL))
+ clk_enable(bg_ptr->fclock);
+
mutex_init(&bg_ptr->bg_mutex);
bg_ptr->dev = &pdev->dev;
return 0;
disable_clk:
- clk_disable(bg_ptr->fclock);
+ if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL))
+ clk_disable(bg_ptr->fclock);
put_clks:
clk_put(bg_ptr->fclock);
clk_put(bg_ptr->div_clk);
omap_bandgap_power(bg_ptr, false);
- clk_disable(bg_ptr->fclock);
+ if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL))
+ clk_disable(bg_ptr->fclock);
clk_put(bg_ptr->fclock);
clk_put(bg_ptr->div_clk);
err = omap_bandgap_save_ctxt(bg_ptr);
omap_bandgap_power(bg_ptr, false);
- clk_disable(bg_ptr->fclock);
+
+ if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL))
+ clk_disable(bg_ptr->fclock);
return err;
}
{
struct omap_bandgap *bg_ptr = dev_get_drvdata(dev);
- clk_enable(bg_ptr->fclock);
+ if (OMAP_BANDGAP_HAS(bg_ptr, CLK_CTRL))
+ clk_enable(bg_ptr->fclock);
+
omap_bandgap_power(bg_ptr, true);
return omap_bandgap_restore_ctxt(bg_ptr);
#define OMAP_BANDGAP_FEATURE_MODE_CONFIG (1 << 3)
#define OMAP_BANDGAP_FEATURE_COUNTER (1 << 4)
#define OMAP_BANDGAP_FEATURE_POWER_SWITCH (1 << 5)
+#define OMAP_BANDGAP_FEATURE_CLK_CTRL (1 << 6)
#define OMAP_BANDGAP_HAS(b, f) \
((b)->conf->features & OMAP_BANDGAP_FEATURE_ ## f)
unsigned int features;
/* OMAP4430 data */
const struct omap_bandgap_data omap4430_data = {
.features = OMAP_BANDGAP_FEATURE_MODE_CONFIG |
+ OMAP_BANDGAP_FEATURE_CLK_CTRL |
OMAP_BANDGAP_FEATURE_POWER_SWITCH,
.fclock_name = "bandgap_fclk",
.div_ck_name = "bandgap_fclk",
OMAP_BANDGAP_FEATURE_TALERT |
OMAP_BANDGAP_FEATURE_MODE_CONFIG |
OMAP_BANDGAP_FEATURE_POWER_SWITCH |
+ OMAP_BANDGAP_FEATURE_CLK_CTRL |
OMAP_BANDGAP_FEATURE_COUNTER,
.fclock_name = "bandgap_ts_fclk",
.div_ck_name = "div_ts_ck",
OMAP_BANDGAP_FEATURE_TALERT |
OMAP_BANDGAP_FEATURE_MODE_CONFIG |
OMAP_BANDGAP_FEATURE_POWER_SWITCH |
+ OMAP_BANDGAP_FEATURE_CLK_CTRL |
OMAP_BANDGAP_FEATURE_COUNTER,
.fclock_name = "bandgap_ts_fclk",
.div_ck_name = "div_ts_ck",
.features = OMAP_BANDGAP_FEATURE_TSHUT_CONFIG |
OMAP_BANDGAP_FEATURE_TALERT |
OMAP_BANDGAP_FEATURE_MODE_CONFIG |
- OMAP_BANDGAP_FEATURE_COUNTER,
+ OMAP_BANDGAP_FEATURE_COUNTER |
+ OMAP_BANDGAP_FEATURE_CLK_CTRL,
.fclock_name = "ts_clk_div_ck",
.div_ck_name = "ts_clk_div_ck",
.conv_table = omap5430_adc_to_temp,