23 #define DSS_SUBSYS_NAME "DPI"
25 #include <linux/kernel.h>
27 #include <linux/export.h>
29 #include <linux/errno.h>
32 #include <linux/string.h>
63 if (dssdev->
clocks.dispc.dispc_fclk_src ==
65 dssdev->
clocks.dispc.dispc_fclk_src ==
67 dssdev->
clocks.dispc.channel.lcd_clk_src ==
69 dssdev->
clocks.dispc.channel.lcd_clk_src ==
77 unsigned long pck_req,
unsigned long *
fck,
int *lck_div,
95 dpi.mgr_config.clock_info = dispc_cinfo;
97 *fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
98 *lck_div = dispc_cinfo.lck_div;
99 *pck_div = dispc_cinfo.pck_div;
105 unsigned long pck_req,
unsigned long *fck,
int *lck_div,
120 dpi.mgr_config.clock_info = dispc_cinfo;
122 *fck = dss_cinfo.fck;
123 *lck_div = dispc_cinfo.lck_div;
124 *pck_div = dispc_cinfo.pck_div;
133 int lck_div = 0, pck_div = 0;
134 unsigned long fck = 0;
138 if (dpi_use_dsi_pll(dssdev))
139 r = dpi_set_dsi_clk(dssdev, t->
pixel_clock * 1000, &fck,
142 r = dpi_set_dispc_clk(dssdev, t->
pixel_clock * 1000, &fck,
147 pck = fck / lck_div / pck_div / 1000;
150 DSSWARN(
"Could not find exact pixel clock. "
151 "Requested %d kHz, got %lu kHz\n",
168 dpi.mgr_config.stallmode =
false;
169 dpi.mgr_config.fifohandcheck =
false;
171 dpi.mgr_config.video_port_width = dpi.data_lines;
173 dpi.mgr_config.lcden_sig_polarity = 0;
186 DSSERR(
"no VDSS_DSI regulator\n");
192 DSSERR(
"failed to enable display: no output/manager\n");
199 DSSERR(
"failed to start device\n");
217 if (dpi_use_dsi_pll(dssdev)) {
224 goto err_dsi_pll_init;
227 r = dpi_set_mode(dssdev);
231 dpi_config_lcd_manager(dssdev);
245 if (dpi_use_dsi_pll(dssdev))
248 if (dpi_use_dsi_pll(dssdev))
274 if (dpi_use_dsi_pll(dssdev)) {
294 DSSDBG(
"dpi_set_timings\n");
298 dpi.timings = *timings;
309 int lck_div, pck_div;
320 if (dpi_use_dsi_pll(dssdev)) {
324 &dsi_cinfo, &dispc_cinfo);
333 &dss_cinfo, &dispc_cinfo);
344 pck = fck / lck_div / pck_div / 1000;
367 dpi.vdds_dsi_reg ==
NULL) {
372 if (IS_ERR(vdds_dsi)) {
373 DSSERR(
"can't get VDDS_DSI regulator\n");
374 return PTR_ERR(vdds_dsi);
377 dpi.vdds_dsi_reg = vdds_dsi;
380 if (dpi_use_dsi_pll(dssdev)) {
382 dssdev->
clocks.dispc.dispc_fclk_src;
383 dpi.dsidev = dpi_get_dsidev(dispc_fclk_src);
404 if (def_dssdev ==
NULL)
407 if (def_disp_name !=
NULL &&
423 plat_dssdev = dpi_find_dssdev(dpidev);
434 r = dpi_init_display(dssdev);
436 DSSERR(
"device %s init failed: %d\n", dssdev->
name, r);
443 DSSERR(
"device %s register failed: %d\n", dssdev->
name, r);
471 dpi_init_output(pdev);
473 dpi_probe_pdata(pdev);
482 dpi_uninit_output(pdev);
488 .remove =
__exit_p(omap_dpi_remove),
490 .name =
"omapdss_dpi",