Lines Matching +full:aux +full:- +full:output +full:- +full:power
1 // SPDX-License-Identifier: GPL-2.0
106 /* enum listing the supported output data format */
131 #define to_sti_tvout(x) to_sti_tvout_encoder(x)->tvout
147 return readl(tvout->regs + offset);
152 writel(val, tvout->regs + offset);
156 * tvout_vip_set_color_order - Set the clipping mode of a VIP
180 * tvout_vip_set_clip_mode - Set the clipping mode of a VIP
196 * tvout_vip_set_rnd - Set the rounded value of a VIP
212 * tvout_vip_set_sel_input - Select the VIP input
217 * @video_out: selected_input (main/aux + conv)
250 * tvout_vip_set_in_vid_fmt - Select the input video signed or unsigned
267 * tvout_preformatter_set_matrix - Set preformatter matrix
278 if (mode->vdisplay >= TVO_MIN_HD_HEIGHT)
292 * tvout_dvo_start - Start VIP block for DVO output
296 * else aux path is used.
303 dev_dbg(tvout->dev, "%s\n", __func__);
315 DRM_DEBUG_DRIVER("aux vip for DVO\n");
334 /* Set round mode (rounded to 8-bit per component) */
346 * tvout_hdmi_start - Start VIP block for HDMI output
350 * else aux path is used.
356 dev_dbg(tvout->dev, "%s\n", __func__);
366 DRM_DEBUG_DRIVER("aux vip for hdmi\n");
383 /* set round mode (rounded to 8-bit per component) */
395 * tvout_hda_start - Start HDF VIP and HD DAC
399 * else aux path is used.
406 dev_dbg(tvout->dev, "%s\n", __func__);
417 DRM_DEBUG_DRIVER("aux vip for HDF\n");
435 /* set round mode (rounded to 10-bit per component) */
445 /* power up HD DAC */
449 #define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \
450 readl(tvout->regs + reg))
458 char *const round[] = {"8-bit", "10-bit", "12-bit"};
460 "Main (color matrix by-passed)",
462 "Aux (color matrix enabled)",
463 "Aux (color matrix by-passed)",
473 seq_printf(s, "%-24s %s->%s %s->%s %s->%s\n", "Reorder:",
480 seq_printf(s, "%-24s %s\n", "Clipping:", clipping[tmp]);
484 seq_printf(s, "%-24s input data rounded to %s per component\n",
488 seq_printf(s, "%-24s %s", "Input selection:", input_sel[tmp]);
493 seq_printf(s, "\t%-24s %s", "HD DAC:",
499 struct drm_info_node *node = s->private;
500 struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data;
503 seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs);
506 crtc = tvout->hdmi->crtc;
509 sti_crtc_is_main(crtc) ? "main" : "aux");
512 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_HDMI));
518 crtc = tvout->dvo->crtc;
521 sti_crtc_is_main(crtc) ? "main" : "aux");
525 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_DVO));
531 crtc = tvout->hda->crtc;
534 sti_crtc_is_main(crtc) ? "main" : "aux");
538 readl(tvout->regs + TVO_HD_DAC_CFG_OFF));
540 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_HDF));
582 minor->debugfs_root, minor);
607 if (tvout->debugfs_registered)
610 tvout_debugfs_init(tvout, encoder->dev->primary);
612 tvout->debugfs_registered = true;
620 if (!tvout->debugfs_registered)
623 tvout->debugfs_registered = false;
636 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode);
638 tvout_dvo_start(tvout, sti_crtc_is_main(encoder->crtc));
663 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL);
667 encoder->tvout = tvout;
669 drm_encoder = &encoder->encoder;
671 drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
686 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode);
688 tvout_hda_start(tvout, sti_crtc_is_main(encoder->crtc));
698 /* power down HD DAC */
715 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL);
719 encoder->tvout = tvout;
721 drm_encoder = &encoder->encoder;
723 drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
737 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode);
739 tvout_hdmi_start(tvout, sti_crtc_is_main(encoder->crtc));
763 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL);
767 encoder->tvout = tvout;
769 drm_encoder = &encoder->encoder;
771 drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
784 tvout->hdmi = sti_tvout_create_hdmi_encoder(dev, tvout);
785 tvout->hda = sti_tvout_create_hda_encoder(dev, tvout);
786 tvout->dvo = sti_tvout_create_dvo_encoder(dev, tvout);
788 tvout->hdmi->possible_clones = drm_encoder_mask(tvout->hdmi) |
789 drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo);
790 tvout->hda->possible_clones = drm_encoder_mask(tvout->hdmi) |
791 drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo);
792 tvout->dvo->possible_clones = drm_encoder_mask(tvout->hdmi) |
793 drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo);
798 if (tvout->hdmi)
799 drm_encoder_cleanup(tvout->hdmi);
800 tvout->hdmi = NULL;
802 if (tvout->hda)
803 drm_encoder_cleanup(tvout->hda);
804 tvout->hda = NULL;
806 if (tvout->dvo)
807 drm_encoder_cleanup(tvout->dvo);
808 tvout->dvo = NULL;
816 tvout->drm_dev = drm_dev;
838 struct device *dev = &pdev->dev;
839 struct device_node *node = dev->of_node;
845 return -ENODEV;
849 return -ENOMEM;
851 tvout->dev = dev;
852 tvout->regs = devm_platform_ioremap_resource_byname(pdev, "tvout-reg");
853 if (IS_ERR(tvout->regs))
854 return PTR_ERR(tvout->regs);
857 tvout->reset = devm_reset_control_get(dev, "tvout");
859 if (!IS_ERR(tvout->reset))
860 reset_control_deassert(tvout->reset);
869 component_del(&pdev->dev, &sti_tvout_ops);
873 { .compatible = "st,stih407-tvout", },
880 .name = "sti-tvout",