Lines Matching refs:dvo

105 	struct sti_dvo *dvo;  member
112 static int dvo_awg_generate_code(struct sti_dvo *dvo, u8 *ram_size, u32 *ram_code) in dvo_awg_generate_code() argument
114 struct drm_display_mode *mode = &dvo->mode; in dvo_awg_generate_code()
115 struct dvo_config *config = dvo->config; in dvo_awg_generate_code()
148 static void dvo_awg_configure(struct sti_dvo *dvo, u32 *awg_ram_code, int nb) in dvo_awg_configure() argument
156 dvo->regs + DVO_DIGSYNC_INSTR_I + i * 4); in dvo_awg_configure()
158 writel(0, dvo->regs + DVO_DIGSYNC_INSTR_I + i * 4); in dvo_awg_configure()
160 writel(DVO_AWG_CTRL_EN, dvo->regs + DVO_AWG_DIGSYNC_CTRL); in dvo_awg_configure()
164 readl(dvo->regs + reg))
182 struct sti_dvo *dvo = (struct sti_dvo *)node->info_ent->data; in dvo_dbg_show() local
184 seq_printf(s, "DVO: (vaddr = 0x%p)", dvo->regs); in dvo_dbg_show()
190 dvo_dbg_awg_microcode(s, dvo->regs + DVO_DIGSYNC_INSTR_I); in dvo_dbg_show()
199 static void dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor) in dvo_debugfs_init() argument
204 dvo_debugfs_files[i].data = dvo; in dvo_debugfs_init()
213 struct sti_dvo *dvo = bridge->driver_private; in sti_dvo_disable() local
215 if (!dvo->enabled) in sti_dvo_disable()
220 if (dvo->config->awg_fwgen_fct) in sti_dvo_disable()
221 writel(0x00000000, dvo->regs + DVO_AWG_DIGSYNC_CTRL); in sti_dvo_disable()
223 writel(0x00000000, dvo->regs + DVO_DOF_CFG); in sti_dvo_disable()
225 drm_panel_disable(dvo->panel); in sti_dvo_disable()
228 clk_disable_unprepare(dvo->clk_pix); in sti_dvo_disable()
229 clk_disable_unprepare(dvo->clk); in sti_dvo_disable()
231 dvo->enabled = false; in sti_dvo_disable()
236 struct sti_dvo *dvo = bridge->driver_private; in sti_dvo_pre_enable() local
237 struct dvo_config *config = dvo->config; in sti_dvo_pre_enable()
242 if (dvo->enabled) in sti_dvo_pre_enable()
246 writel(0x00000000, dvo->regs + DVO_DOF_CFG); in sti_dvo_pre_enable()
247 writel(0x00000000, dvo->regs + DVO_AWG_DIGSYNC_CTRL); in sti_dvo_pre_enable()
253 if (!dvo_awg_generate_code(dvo, &nb_instr, awg_ram_code)) in sti_dvo_pre_enable()
254 dvo_awg_configure(dvo, awg_ram_code, nb_instr); in sti_dvo_pre_enable()
260 if (clk_prepare_enable(dvo->clk_pix)) in sti_dvo_pre_enable()
262 if (clk_prepare_enable(dvo->clk)) in sti_dvo_pre_enable()
265 drm_panel_enable(dvo->panel); in sti_dvo_pre_enable()
268 writel(config->lowbyte, dvo->regs + DVO_LUT_PROG_LOW); in sti_dvo_pre_enable()
269 writel(config->midbyte, dvo->regs + DVO_LUT_PROG_MID); in sti_dvo_pre_enable()
270 writel(config->highbyte, dvo->regs + DVO_LUT_PROG_HIGH); in sti_dvo_pre_enable()
274 writel(val, dvo->regs + DVO_DOF_CFG); in sti_dvo_pre_enable()
276 dvo->enabled = true; in sti_dvo_pre_enable()
283 struct sti_dvo *dvo = bridge->driver_private; in sti_dvo_set_mode() local
284 struct sti_mixer *mixer = to_sti_mixer(dvo->encoder->crtc); in sti_dvo_set_mode()
291 drm_mode_copy(&dvo->mode, mode); in sti_dvo_set_mode()
296 clkp = dvo->clk_main_parent; in sti_dvo_set_mode()
298 clkp = dvo->clk_aux_parent; in sti_dvo_set_mode()
301 clk_set_parent(dvo->clk_pix, clkp); in sti_dvo_set_mode()
302 clk_set_parent(dvo->clk, clkp); in sti_dvo_set_mode()
306 ret = clk_set_rate(dvo->clk_pix, rate); in sti_dvo_set_mode()
312 ret = clk_set_rate(dvo->clk, rate); in sti_dvo_set_mode()
319 dvo->config = &rgb_24bit_de_cfg; in sti_dvo_set_mode()
339 struct sti_dvo *dvo = dvo_connector->dvo; in sti_dvo_connector_get_modes() local
341 if (dvo->panel) in sti_dvo_connector_get_modes()
342 return drm_panel_get_modes(dvo->panel, connector); in sti_dvo_connector_get_modes()
359 struct sti_dvo *dvo = dvo_connector->dvo; in sti_dvo_connector_mode_valid() local
361 result = clk_round_rate(dvo->clk_pix, target); in sti_dvo_connector_mode_valid()
385 struct sti_dvo *dvo = dvo_connector->dvo; in sti_dvo_connector_detect() local
389 if (!dvo->panel) { in sti_dvo_connector_detect()
390 dvo->panel = of_drm_find_panel(dvo->panel_node); in sti_dvo_connector_detect()
391 if (IS_ERR(dvo->panel)) in sti_dvo_connector_detect()
392 dvo->panel = NULL; in sti_dvo_connector_detect()
395 if (dvo->panel) in sti_dvo_connector_detect()
405 struct sti_dvo *dvo = dvo_connector->dvo; in sti_dvo_late_register() local
407 dvo_debugfs_init(dvo, dvo->drm_dev->primary); in sti_dvo_late_register()
436 struct sti_dvo *dvo = dev_get_drvdata(dev); in sti_dvo_bind() local
445 dvo->drm_dev = drm_dev; in sti_dvo_bind()
455 connector->dvo = dvo; in sti_dvo_bind()
461 bridge->driver_private = dvo; in sti_dvo_bind()
463 bridge->of_node = dvo->dev.of_node; in sti_dvo_bind()
470 dvo->bridge = bridge; in sti_dvo_bind()
472 dvo->encoder = encoder; in sti_dvo_bind()
499 struct sti_dvo *dvo = dev_get_drvdata(dev); in sti_dvo_unbind() local
501 drm_bridge_remove(dvo->bridge); in sti_dvo_unbind()
512 struct sti_dvo *dvo; in sti_dvo_probe() local
518 dvo = devm_kzalloc(dev, sizeof(*dvo), GFP_KERNEL); in sti_dvo_probe()
519 if (!dvo) { in sti_dvo_probe()
524 dvo->dev = pdev->dev; in sti_dvo_probe()
531 dvo->regs = devm_ioremap(dev, res->start, in sti_dvo_probe()
533 if (!dvo->regs) in sti_dvo_probe()
536 dvo->clk_pix = devm_clk_get(dev, "dvo_pix"); in sti_dvo_probe()
537 if (IS_ERR(dvo->clk_pix)) { in sti_dvo_probe()
539 return PTR_ERR(dvo->clk_pix); in sti_dvo_probe()
542 dvo->clk = devm_clk_get(dev, "dvo"); in sti_dvo_probe()
543 if (IS_ERR(dvo->clk)) { in sti_dvo_probe()
545 return PTR_ERR(dvo->clk); in sti_dvo_probe()
548 dvo->clk_main_parent = devm_clk_get(dev, "main_parent"); in sti_dvo_probe()
549 if (IS_ERR(dvo->clk_main_parent)) { in sti_dvo_probe()
551 dvo->clk_main_parent = NULL; in sti_dvo_probe()
554 dvo->clk_aux_parent = devm_clk_get(dev, "aux_parent"); in sti_dvo_probe()
555 if (IS_ERR(dvo->clk_aux_parent)) { in sti_dvo_probe()
557 dvo->clk_aux_parent = NULL; in sti_dvo_probe()
560 dvo->panel_node = of_parse_phandle(np, "sti,panel", 0); in sti_dvo_probe()
561 if (!dvo->panel_node) in sti_dvo_probe()
563 of_node_put(dvo->panel_node); in sti_dvo_probe()
565 platform_set_drvdata(pdev, dvo); in sti_dvo_probe()