struct dsi_clock_info current_cinfo;
+ bool vdds_dsi_enabled;
struct regulator *vdds_dsi_reg;
struct {
enable_clocks(1);
dsi_enable_pll_clock(1);
- r = regulator_enable(dsi.vdds_dsi_reg);
- if (r)
- goto err0;
+ if (!dsi.vdds_dsi_enabled) {
+ r = regulator_enable(dsi.vdds_dsi_reg);
+ if (r)
+ goto err0;
+ dsi.vdds_dsi_enabled = true;
+ }
/* XXX PLL does not come out of reset without this... */
dispc_pck_free_enable(1);
return 0;
err1:
- regulator_disable(dsi.vdds_dsi_reg);
+ if (dsi.vdds_dsi_enabled) {
+ regulator_disable(dsi.vdds_dsi_reg);
+ dsi.vdds_dsi_enabled = false;
+ }
err0:
enable_clocks(0);
dsi_enable_pll_clock(0);
return r;
}
-void dsi_pll_uninit(void)
+void dsi_pll_uninit(bool disconnect_lanes)
{
enable_clocks(0);
dsi_enable_pll_clock(0);
dsi.pll_locked = 0;
dsi_pll_power(DSI_PLL_POWER_OFF);
- regulator_disable(dsi.vdds_dsi_reg);
+ if (disconnect_lanes) {
+ WARN_ON(!dsi.vdds_dsi_enabled);
+ regulator_disable(dsi.vdds_dsi_reg);
+ dsi.vdds_dsi_enabled = false;
+ }
DSSDBG("PLL uninit done\n");
}
dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
dss_select_dsi_clk_source(OMAP_DSS_CLK_SRC_FCK);
err1:
- dsi_pll_uninit();
+ dsi_pll_uninit(true);
err0:
return r;
}
-static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev)
+static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev,
+ bool disconnect_lanes)
{
if (!dsi.ulps_enabled)
dsi_enter_ulps();
dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK);
dss_select_dsi_clk_source(OMAP_DSS_CLK_SRC_FCK);
dsi_complexio_uninit();
- dsi_pll_uninit();
+ dsi_pll_uninit(disconnect_lanes);
}
static int dsi_core_init(void)
}
EXPORT_SYMBOL(omapdss_dsi_display_enable);
-void omapdss_dsi_display_disable(struct omap_dss_device *dssdev)
+void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
+ bool disconnect_lanes)
{
DSSDBG("dsi_display_disable\n");
dsi_display_uninit_dispc(dssdev);
- dsi_display_uninit_dsi(dssdev);
+ dsi_display_uninit_dsi(dssdev, disconnect_lanes);
enable_clocks(0);
dsi_enable_pll_clock(0);
struct dispc_clock_info *dispc_cinfo);
int dsi_pll_init(struct omap_dss_device *dssdev, bool enable_hsclk,
bool enable_hsdiv);
-void dsi_pll_uninit(void);
+void dsi_pll_uninit(bool disconnect_lanes);
void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, enum omap_burst_size *burst_size,
u32 *fifo_low, u32 *fifo_high);
void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel);
int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
-void omapdss_dsi_display_disable(struct omap_dss_device *dssdev);
+void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
+ bool disconnect_lanes);
int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);