static int dpi_set_mode(struct omap_dss_device *dssdev) { struct omap_video_timings *t = &dssdev->panel.timings; unsigned long pck = 0; unsigned long cache_req_pck = 0; bool is_tft; int r = 0; dispc_set_pol_freq(dssdev->channel, dssdev->panel.config, dssdev->panel.acbi, dssdev->panel.acb); is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0; #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL r = dpi_set_dsi_clk(dssdev->channel, is_tft, t->pixel_clock * 1000, &pck); DSSDBG("dpi_set_mode: dpi_set_dsi_clk=%d\n",r); #else /* #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL */ cache_req_pck = dss_get_cache_req_pck(); if (cache_req_pck) r = dpi_set_dispc_clk(dssdev->channel, is_tft, cache_req_pck, &pck); else r = dpi_set_dispc_clk(dssdev->channel, is_tft, t->pixel_clock * 1000, &pck); #endif /* CONFIG_OMAP2_DSS_USE_DSI_PLL */ if (r) return r; pck /= 1000; if (pck != t->pixel_clock) { DSSWARN("Could not find exact pixel clock. " "Requested %d kHz, got %lu kHz\n", t->pixel_clock, pck); t->pixel_clock = pck; } DSSDBG("dpi_set_mode: pixel_clock = %d\n", t->pixel_clock); dispc_set_lcd_timings(dssdev->channel, t); return 0; }
static int dpi_set_mode(struct omap_overlay_manager *mgr) { struct omap_video_timings *t = &dpi.timings; int lck_div = 0, pck_div = 0; unsigned long fck = 0; unsigned long pck; int r = 0; if (dpi.dsidev) r = dpi_set_dsi_clk(mgr->id, t->pixel_clock * 1000, &fck, &lck_div, &pck_div); else r = dpi_set_dispc_clk(t->pixel_clock * 1000, &fck, &lck_div, &pck_div); if (r) return r; pck = fck / lck_div / pck_div / 1000; if (pck != t->pixel_clock) { DSSWARN("Could not find exact pixel clock. " "Requested %d kHz, got %lu kHz\n", t->pixel_clock, pck); t->pixel_clock = pck; } dss_mgr_set_timings(mgr, t); return 0; }
static int dpi_set_mode(struct omap_dss_device *dssdev) { struct omap_video_timings *t = &dssdev->panel.timings; int lck_div, pck_div; unsigned long fck; unsigned long pck; bool is_tft; int r = 0; dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK); dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config, dssdev->panel.acbi, dssdev->panel.acb); is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0; #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL r = dpi_set_dsi_clk(dssdev, is_tft, t->pixel_clock * 1000, &fck, &lck_div, &pck_div); #else r = dpi_set_dispc_clk(dssdev, is_tft, t->pixel_clock * 1000, &fck, &lck_div, &pck_div); #endif if (r) goto err0; pck = fck / lck_div / pck_div / 1000; if (pck != t->pixel_clock) { DSSWARN("Could not find exact pixel clock. " "Requested %d kHz, got %lu kHz\n", t->pixel_clock, pck); t->pixel_clock = pck; } dispc_set_lcd_timings(dssdev->manager->id, t); err0: dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK); return r; }
static int dpi_set_mode(struct omap_display *display) { struct omap_panel *panel = display->panel; int lck_div, pck_div; unsigned long fck; unsigned long pck; bool is_tft; int r = 0; dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); dispc_set_pol_freq(panel); is_tft = (display->panel->config & OMAP_DSS_LCD_TFT) != 0; #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL r = dpi_set_dsi_clk(is_tft, panel->timings.pixel_clock * 1000, &fck, &lck_div, &pck_div); #else r = dpi_set_dispc_clk(is_tft, panel->timings.pixel_clock * 1000, &fck, &lck_div, &pck_div); #endif if (r) goto err0; pck = fck / lck_div / pck_div / 1000; if (pck != panel->timings.pixel_clock) { DSSWARN("Could not find exact pixel clock. " "Requested %d kHz, got %lu kHz\n", panel->timings.pixel_clock, pck); panel->timings.pixel_clock = pck; } dispc_set_lcd_timings(&panel->timings); err0: dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); return r; }
static int dpi_set_mode(struct omap_dss_device *dssdev) { struct omap_video_timings *t = &dssdev->panel.timings; int lck_div = 0, pck_div = 0; unsigned long fck = 0; unsigned long pck; bool is_tft; int r = 0; dispc_set_pol_freq(dssdev->manager->id, dssdev->panel.config, dssdev->panel.acbi, dssdev->panel.acb); is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0; if (dpi_use_dsi_pll(dssdev)) r = dpi_set_dsi_clk(dssdev, is_tft, t->pixel_clock * 1000, &fck, &lck_div, &pck_div); else r = dpi_set_dispc_clk(dssdev, is_tft, t->pixel_clock * 1000, &fck, &lck_div, &pck_div); if (r) return r; pck = fck / lck_div / pck_div / 1000; if (pck != t->pixel_clock) { DSSWARN("Could not find exact pixel clock. " "Requested %d kHz, got %lu kHz\n", t->pixel_clock, pck); t->pixel_clock = pck; } dispc_set_lcd_timings(dssdev->manager->id, t); return 0; }
static int dpi_set_mode(struct omap_dss_device *dssdev) { struct omap_video_timings *t = &dssdev->panel.timings; int lck_div = 0, pck_div = 0; unsigned long fck = 0; unsigned long pck = 0; bool is_tft; int r = 0, lcd_channel_ix = 0; int use_dsi_for_hdmi = 0; if (strncmp("hdmi", dssdev->name, 4) == 0) use_dsi_for_hdmi = 1; if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2) lcd_channel_ix = 1; dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2) dispc_set_pol_freq(OMAP_DSS_CHANNEL_LCD2, dssdev->panel.config, dssdev->panel.acbi, dssdev->panel.acb); else dispc_set_pol_freq(OMAP_DSS_CHANNEL_LCD, dssdev->panel.config, dssdev->panel.acbi, dssdev->panel.acb); is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0; if (use_dsi_for_hdmi) r = dpi_set_dsi_clk(lcd_channel_ix, is_tft, t->pixel_clock * 1000, &fck, &lck_div, &pck_div); else r = dpi_set_dispc_clk(lcd_channel_ix, is_tft, t->pixel_clock * 1000, &fck, &lck_div, &pck_div); if (r) goto err0; if (!cpu_is_omap44xx()) pck = fck / lck_div / pck_div / 1000; else pck = 0; if (pck != t->pixel_clock) { DSSWARN("Could not find exact pixel clock. " "Requested %d kHz, got %lu kHz\n", t->pixel_clock, pck); t->pixel_clock = pck; } if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2) dispc_set_lcd_timings(OMAP_DSS_CHANNEL_LCD2, t); else dispc_set_lcd_timings(OMAP_DSS_CHANNEL_LCD, t); err0: if (cpu_is_omap44xx() && use_dsi_for_hdmi) { dss_select_clk_source_dsi(lcd_channel_ix, false, false); dsi_pll_uninit(lcd_channel_ix); } dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); return r; }