Lines Matching refs:tvout

127 	struct sti_tvout *tvout;  member
133 #define to_sti_tvout(x) to_sti_tvout_encoder(x)->tvout
147 static u32 tvout_read(struct sti_tvout *tvout, int offset) in tvout_read() argument
149 return readl(tvout->regs + offset); in tvout_read()
152 static void tvout_write(struct sti_tvout *tvout, u32 val, int offset) in tvout_write() argument
154 writel(val, tvout->regs + offset); in tvout_write()
166 static void tvout_vip_set_color_order(struct sti_tvout *tvout, int reg, in tvout_vip_set_color_order() argument
169 u32 val = tvout_read(tvout, reg); in tvout_vip_set_color_order()
178 tvout_write(tvout, val, reg); in tvout_vip_set_color_order()
188 static void tvout_vip_set_clip_mode(struct sti_tvout *tvout, int reg, u32 range) in tvout_vip_set_clip_mode() argument
190 u32 val = tvout_read(tvout, reg); in tvout_vip_set_clip_mode()
194 tvout_write(tvout, val, reg); in tvout_vip_set_clip_mode()
204 static void tvout_vip_set_rnd(struct sti_tvout *tvout, int reg, u32 rnd) in tvout_vip_set_rnd() argument
206 u32 val = tvout_read(tvout, reg); in tvout_vip_set_rnd()
210 tvout_write(tvout, val, reg); in tvout_vip_set_rnd()
222 static void tvout_vip_set_sel_input(struct sti_tvout *tvout, in tvout_vip_set_sel_input() argument
229 u32 val = tvout_read(tvout, reg); in tvout_vip_set_sel_input()
251 tvout_write(tvout, val, reg); in tvout_vip_set_sel_input()
261 static void tvout_vip_set_in_vid_fmt(struct sti_tvout *tvout, in tvout_vip_set_in_vid_fmt() argument
264 u32 val = tvout_read(tvout, reg); in tvout_vip_set_in_vid_fmt()
268 tvout_write(tvout, val, reg); in tvout_vip_set_in_vid_fmt()
278 static void tvout_dvo_start(struct sti_tvout *tvout, bool main_path) in tvout_dvo_start() argument
280 struct device_node *node = tvout->dev->of_node; in tvout_dvo_start()
285 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_dvo_start()
293 tvout_write(tvout, val, TVO_DVO_SYNC_SEL); in tvout_dvo_start()
301 tvout_write(tvout, val, TVO_DVO_SYNC_SEL); in tvout_dvo_start()
306 tvout_vip_set_color_order(tvout, TVO_VIP_DVO, in tvout_dvo_start()
312 tvout_vip_set_clip_mode(tvout, TVO_VIP_DVO, in tvout_dvo_start()
316 tvout_vip_set_rnd(tvout, TVO_VIP_DVO, TVO_VIP_RND_8BIT_ROUNDED); in tvout_dvo_start()
320 tvout_vip_set_in_vid_fmt(tvout, tvo_in_vid_format, in tvout_dvo_start()
326 tvout_vip_set_sel_input(tvout, TVO_VIP_DVO, main_path, in tvout_dvo_start()
338 static void tvout_hdmi_start(struct sti_tvout *tvout, bool main_path) in tvout_hdmi_start() argument
340 struct device_node *node = tvout->dev->of_node; in tvout_hdmi_start()
344 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_hdmi_start()
349 tvout_write(tvout, TVO_SYNC_MAIN_VTG_SET_1, TVO_HDMI_SYNC_SEL); in tvout_hdmi_start()
354 tvout_write(tvout, TVO_SYNC_AUX_VTG_SET_1, TVO_HDMI_SYNC_SEL); in tvout_hdmi_start()
359 tvout_vip_set_color_order(tvout, TVO_VIP_HDMI, in tvout_hdmi_start()
365 tvout_vip_set_clip_mode(tvout, TVO_VIP_HDMI, in tvout_hdmi_start()
369 tvout_vip_set_rnd(tvout, TVO_VIP_HDMI, TVO_VIP_RND_8BIT_ROUNDED); in tvout_hdmi_start()
373 tvout_vip_set_in_vid_fmt(tvout, tvo_in_vid_format, in tvout_hdmi_start()
379 tvout_vip_set_sel_input(tvout, TVO_VIP_HDMI, main_path, in tvout_hdmi_start()
390 static void tvout_hda_start(struct sti_tvout *tvout, bool main_path) in tvout_hda_start() argument
392 struct device_node *node = tvout->dev->of_node; in tvout_hda_start()
397 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_hda_start()
402 tvout_write(tvout, val, TVO_HD_SYNC_SEL); in tvout_hda_start()
407 tvout_write(tvout, val, TVO_HD_SYNC_SEL); in tvout_hda_start()
412 tvout_vip_set_color_order(tvout, TVO_VIP_HDF, in tvout_hda_start()
418 tvout_vip_set_clip_mode(tvout, TVO_VIP_HDF, TVO_VIP_CLIP_EAV_SAV); in tvout_hda_start()
421 tvout_vip_set_rnd(tvout, TVO_VIP_HDF, TVO_VIP_RND_10BIT_ROUNDED); in tvout_hda_start()
425 tvout_vip_set_in_vid_fmt(tvout, in tvout_hda_start()
431 tvout_vip_set_sel_input(tvout, TVO_VIP_HDF, main_path, in tvout_hda_start()
436 tvout_write(tvout, 0, TVO_HD_DAC_CFG_OFF); in tvout_hda_start()
474 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_dvo_encoder_commit() local
476 tvout_dvo_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_dvo_encoder_commit()
481 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_dvo_encoder_disable() local
484 tvout_write(tvout, 0x0, TVO_VIP_DVO); in sti_dvo_encoder_disable()
498 struct sti_tvout *tvout) in sti_tvout_create_dvo_encoder() argument
503 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_dvo_encoder()
507 encoder->tvout = tvout; in sti_tvout_create_dvo_encoder()
524 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hda_encoder_commit() local
526 tvout_hda_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_hda_encoder_commit()
531 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hda_encoder_disable() local
534 tvout_write(tvout, 0x0, TVO_VIP_HDF); in sti_hda_encoder_disable()
537 tvout_write(tvout, 1, TVO_HD_DAC_CFG_OFF); in sti_hda_encoder_disable()
550 struct sti_tvout *tvout) in sti_tvout_create_hda_encoder() argument
555 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_hda_encoder()
559 encoder->tvout = tvout; in sti_tvout_create_hda_encoder()
576 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hdmi_encoder_commit() local
578 tvout_hdmi_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_hdmi_encoder_commit()
583 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hdmi_encoder_disable() local
586 tvout_write(tvout, 0x0, TVO_VIP_HDMI); in sti_hdmi_encoder_disable()
599 struct sti_tvout *tvout) in sti_tvout_create_hdmi_encoder() argument
604 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_hdmi_encoder()
608 encoder->tvout = tvout; in sti_tvout_create_hdmi_encoder()
624 struct sti_tvout *tvout) in sti_tvout_create_encoders() argument
626 tvout->hdmi = sti_tvout_create_hdmi_encoder(dev, tvout); in sti_tvout_create_encoders()
627 tvout->hda = sti_tvout_create_hda_encoder(dev, tvout); in sti_tvout_create_encoders()
628 tvout->dvo = sti_tvout_create_dvo_encoder(dev, tvout); in sti_tvout_create_encoders()
631 static void sti_tvout_destroy_encoders(struct sti_tvout *tvout) in sti_tvout_destroy_encoders() argument
633 if (tvout->hdmi) in sti_tvout_destroy_encoders()
634 drm_encoder_cleanup(tvout->hdmi); in sti_tvout_destroy_encoders()
635 tvout->hdmi = NULL; in sti_tvout_destroy_encoders()
637 if (tvout->hda) in sti_tvout_destroy_encoders()
638 drm_encoder_cleanup(tvout->hda); in sti_tvout_destroy_encoders()
639 tvout->hda = NULL; in sti_tvout_destroy_encoders()
644 struct sti_tvout *tvout = dev_get_drvdata(dev); in sti_tvout_bind() local
648 tvout->drm_dev = drm_dev; in sti_tvout_bind()
652 tvout_write(tvout, rgb_to_ycbcr_601[i], in sti_tvout_bind()
654 tvout_write(tvout, rgb_to_ycbcr_601[i], in sti_tvout_bind()
658 sti_tvout_create_encoders(drm_dev, tvout); in sti_tvout_bind()
666 struct sti_tvout *tvout = dev_get_drvdata(dev); in sti_tvout_unbind() local
668 sti_tvout_destroy_encoders(tvout); in sti_tvout_unbind()
680 struct sti_tvout *tvout; in sti_tvout_probe() local
688 tvout = devm_kzalloc(dev, sizeof(*tvout), GFP_KERNEL); in sti_tvout_probe()
689 if (!tvout) in sti_tvout_probe()
692 tvout->dev = dev; in sti_tvout_probe()
700 tvout->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); in sti_tvout_probe()
701 if (!tvout->regs) in sti_tvout_probe()
705 tvout->reset = devm_reset_control_get(dev, "tvout"); in sti_tvout_probe()
707 if (!IS_ERR(tvout->reset)) in sti_tvout_probe()
708 reset_control_deassert(tvout->reset); in sti_tvout_probe()
710 platform_set_drvdata(pdev, tvout); in sti_tvout_probe()