• Home
  • Raw
  • Download

Lines Matching refs:tvout

121 	struct sti_tvout *tvout;  member
127 #define to_sti_tvout(x) to_sti_tvout_encoder(x)->tvout
141 static u32 tvout_read(struct sti_tvout *tvout, int offset) in tvout_read() argument
143 return readl(tvout->regs + offset); in tvout_read()
146 static void tvout_write(struct sti_tvout *tvout, u32 val, int offset) in tvout_write() argument
148 writel(val, tvout->regs + offset); in tvout_write()
160 static void tvout_vip_set_color_order(struct sti_tvout *tvout, int reg, in tvout_vip_set_color_order() argument
163 u32 val = tvout_read(tvout, reg); in tvout_vip_set_color_order()
172 tvout_write(tvout, val, reg); in tvout_vip_set_color_order()
182 static void tvout_vip_set_clip_mode(struct sti_tvout *tvout, int reg, u32 range) in tvout_vip_set_clip_mode() argument
184 u32 val = tvout_read(tvout, reg); in tvout_vip_set_clip_mode()
188 tvout_write(tvout, val, reg); in tvout_vip_set_clip_mode()
198 static void tvout_vip_set_rnd(struct sti_tvout *tvout, int reg, u32 rnd) in tvout_vip_set_rnd() argument
200 u32 val = tvout_read(tvout, reg); in tvout_vip_set_rnd()
204 tvout_write(tvout, val, reg); in tvout_vip_set_rnd()
215 static void tvout_vip_set_sel_input(struct sti_tvout *tvout, in tvout_vip_set_sel_input() argument
221 u32 val = tvout_read(tvout, reg); in tvout_vip_set_sel_input()
242 tvout_write(tvout, val, reg); in tvout_vip_set_sel_input()
252 static void tvout_vip_set_in_vid_fmt(struct sti_tvout *tvout, in tvout_vip_set_in_vid_fmt() argument
255 u32 val = tvout_read(tvout, reg); in tvout_vip_set_in_vid_fmt()
259 tvout_write(tvout, val, reg); in tvout_vip_set_in_vid_fmt()
268 static void tvout_preformatter_set_matrix(struct sti_tvout *tvout, in tvout_preformatter_set_matrix() argument
280 tvout_write(tvout, *(pf_matrix + i), in tvout_preformatter_set_matrix()
282 tvout_write(tvout, *(pf_matrix + i), in tvout_preformatter_set_matrix()
294 static void tvout_dvo_start(struct sti_tvout *tvout, bool main_path) in tvout_dvo_start() argument
299 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_dvo_start()
308 tvout_write(tvout, val, TVO_DVO_SYNC_SEL); in tvout_dvo_start()
317 tvout_write(tvout, val, TVO_DVO_SYNC_SEL); in tvout_dvo_start()
322 tvout_vip_set_color_order(tvout, TVO_VIP_DVO, in tvout_dvo_start()
328 tvout_vip_set_clip_mode(tvout, TVO_VIP_DVO, TVO_VIP_CLIP_DISABLED); in tvout_dvo_start()
331 tvout_vip_set_rnd(tvout, TVO_VIP_DVO, TVO_VIP_RND_8BIT_ROUNDED); in tvout_dvo_start()
334 tvout_vip_set_in_vid_fmt(tvout, tvo_in_vid_format, TVO_IN_FMT_SIGNED); in tvout_dvo_start()
337 tvout_vip_set_sel_input(tvout, TVO_VIP_DVO, main_path, in tvout_dvo_start()
348 static void tvout_hdmi_start(struct sti_tvout *tvout, bool main_path) in tvout_hdmi_start() argument
352 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_hdmi_start()
357 tvout_write(tvout, in tvout_hdmi_start()
364 tvout_write(tvout, in tvout_hdmi_start()
371 tvout_vip_set_color_order(tvout, TVO_VIP_HDMI, in tvout_hdmi_start()
377 tvout_vip_set_clip_mode(tvout, TVO_VIP_HDMI, TVO_VIP_CLIP_DISABLED); in tvout_hdmi_start()
380 tvout_vip_set_rnd(tvout, TVO_VIP_HDMI, TVO_VIP_RND_8BIT_ROUNDED); in tvout_hdmi_start()
383 tvout_vip_set_in_vid_fmt(tvout, tvo_in_vid_format, TVO_IN_FMT_SIGNED); in tvout_hdmi_start()
386 tvout_vip_set_sel_input(tvout, TVO_VIP_HDMI, main_path, in tvout_hdmi_start()
397 static void tvout_hda_start(struct sti_tvout *tvout, bool main_path) in tvout_hda_start() argument
402 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_hda_start()
410 tvout_write(tvout, val, TVO_HD_SYNC_SEL); in tvout_hda_start()
418 tvout_write(tvout, val, TVO_HD_SYNC_SEL); in tvout_hda_start()
423 tvout_vip_set_color_order(tvout, TVO_VIP_HDF, in tvout_hda_start()
429 tvout_vip_set_clip_mode(tvout, TVO_VIP_HDF, TVO_VIP_CLIP_DISABLED); in tvout_hda_start()
432 tvout_vip_set_rnd(tvout, TVO_VIP_HDF, TVO_VIP_RND_10BIT_ROUNDED); in tvout_hda_start()
435 tvout_vip_set_in_vid_fmt(tvout, tvo_in_vid_format, TVO_IN_FMT_SIGNED); in tvout_hda_start()
438 tvout_vip_set_sel_input(tvout, TVO_VIP_HDF, main_path, in tvout_hda_start()
442 tvout_write(tvout, 0, TVO_HD_DAC_CFG_OFF); in tvout_hda_start()
446 readl(tvout->regs + reg))
496 struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data; in tvout_dbg_show() local
499 seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs); in tvout_dbg_show()
502 crtc = tvout->hdmi->crtc; in tvout_dbg_show()
508 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_HDMI)); in tvout_dbg_show()
514 crtc = tvout->dvo->crtc; in tvout_dbg_show()
521 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_DVO)); in tvout_dbg_show()
527 crtc = tvout->hda->crtc; in tvout_dbg_show()
534 readl(tvout->regs + TVO_HD_DAC_CFG_OFF)); in tvout_dbg_show()
536 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_HDF)); in tvout_dbg_show()
570 static void tvout_debugfs_exit(struct sti_tvout *tvout, struct drm_minor *minor) in tvout_debugfs_exit() argument
577 static int tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor) in tvout_debugfs_init() argument
582 tvout_debugfs_files[i].data = tvout; in tvout_debugfs_init()
609 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_tvout_late_register() local
612 if (tvout->debugfs_registered) in sti_tvout_late_register()
615 ret = tvout_debugfs_init(tvout, encoder->dev->primary); in sti_tvout_late_register()
619 tvout->debugfs_registered = true; in sti_tvout_late_register()
625 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_tvout_early_unregister() local
627 if (!tvout->debugfs_registered) in sti_tvout_early_unregister()
630 tvout_debugfs_exit(tvout, encoder->dev->primary); in sti_tvout_early_unregister()
631 tvout->debugfs_registered = false; in sti_tvout_early_unregister()
642 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_dvo_encoder_enable() local
644 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode); in sti_dvo_encoder_enable()
646 tvout_dvo_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_dvo_encoder_enable()
651 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_dvo_encoder_disable() local
654 tvout_write(tvout, 0x0, TVO_VIP_DVO); in sti_dvo_encoder_disable()
666 struct sti_tvout *tvout) in sti_tvout_create_dvo_encoder() argument
671 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_dvo_encoder()
675 encoder->tvout = tvout; in sti_tvout_create_dvo_encoder()
693 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hda_encoder_enable() local
695 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode); in sti_hda_encoder_enable()
697 tvout_hda_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_hda_encoder_enable()
702 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hda_encoder_disable() local
705 tvout_write(tvout, 0x0, TVO_VIP_HDF); in sti_hda_encoder_disable()
708 tvout_write(tvout, 1, TVO_HD_DAC_CFG_OFF); in sti_hda_encoder_disable()
719 struct sti_tvout *tvout) in sti_tvout_create_hda_encoder() argument
724 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_hda_encoder()
728 encoder->tvout = tvout; in sti_tvout_create_hda_encoder()
745 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hdmi_encoder_enable() local
747 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode); in sti_hdmi_encoder_enable()
749 tvout_hdmi_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_hdmi_encoder_enable()
754 struct sti_tvout *tvout = to_sti_tvout(encoder); in sti_hdmi_encoder_disable() local
757 tvout_write(tvout, 0x0, TVO_VIP_HDMI); in sti_hdmi_encoder_disable()
768 struct sti_tvout *tvout) in sti_tvout_create_hdmi_encoder() argument
773 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_hdmi_encoder()
777 encoder->tvout = tvout; in sti_tvout_create_hdmi_encoder()
793 struct sti_tvout *tvout) in sti_tvout_create_encoders() argument
795 tvout->hdmi = sti_tvout_create_hdmi_encoder(dev, tvout); in sti_tvout_create_encoders()
796 tvout->hda = sti_tvout_create_hda_encoder(dev, tvout); in sti_tvout_create_encoders()
797 tvout->dvo = sti_tvout_create_dvo_encoder(dev, tvout); in sti_tvout_create_encoders()
800 static void sti_tvout_destroy_encoders(struct sti_tvout *tvout) in sti_tvout_destroy_encoders() argument
802 if (tvout->hdmi) in sti_tvout_destroy_encoders()
803 drm_encoder_cleanup(tvout->hdmi); in sti_tvout_destroy_encoders()
804 tvout->hdmi = NULL; in sti_tvout_destroy_encoders()
806 if (tvout->hda) in sti_tvout_destroy_encoders()
807 drm_encoder_cleanup(tvout->hda); in sti_tvout_destroy_encoders()
808 tvout->hda = NULL; in sti_tvout_destroy_encoders()
810 if (tvout->dvo) in sti_tvout_destroy_encoders()
811 drm_encoder_cleanup(tvout->dvo); in sti_tvout_destroy_encoders()
812 tvout->dvo = NULL; in sti_tvout_destroy_encoders()
817 struct sti_tvout *tvout = dev_get_drvdata(dev); in sti_tvout_bind() local
820 tvout->drm_dev = drm_dev; in sti_tvout_bind()
822 sti_tvout_create_encoders(drm_dev, tvout); in sti_tvout_bind()
830 struct sti_tvout *tvout = dev_get_drvdata(dev); in sti_tvout_unbind() local
832 sti_tvout_destroy_encoders(tvout); in sti_tvout_unbind()
844 struct sti_tvout *tvout; in sti_tvout_probe() local
852 tvout = devm_kzalloc(dev, sizeof(*tvout), GFP_KERNEL); in sti_tvout_probe()
853 if (!tvout) in sti_tvout_probe()
856 tvout->dev = dev; in sti_tvout_probe()
864 tvout->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); in sti_tvout_probe()
865 if (!tvout->regs) in sti_tvout_probe()
869 tvout->reset = devm_reset_control_get(dev, "tvout"); in sti_tvout_probe()
871 if (!IS_ERR(tvout->reset)) in sti_tvout_probe()
872 reset_control_deassert(tvout->reset); in sti_tvout_probe()
874 platform_set_drvdata(pdev, tvout); in sti_tvout_probe()