Lines Matching refs:mixer_ctx
776 static int mixer_resources_init(struct mixer_context *mixer_ctx) in mixer_resources_init() argument
778 struct device *dev = &mixer_ctx->pdev->dev; in mixer_resources_init()
782 spin_lock_init(&mixer_ctx->reg_slock); in mixer_resources_init()
784 mixer_ctx->mixer = devm_clk_get(dev, "mixer"); in mixer_resources_init()
785 if (IS_ERR(mixer_ctx->mixer)) { in mixer_resources_init()
790 mixer_ctx->hdmi = devm_clk_get(dev, "hdmi"); in mixer_resources_init()
791 if (IS_ERR(mixer_ctx->hdmi)) { in mixer_resources_init()
793 return PTR_ERR(mixer_ctx->hdmi); in mixer_resources_init()
796 mixer_ctx->sclk_hdmi = devm_clk_get(dev, "sclk_hdmi"); in mixer_resources_init()
797 if (IS_ERR(mixer_ctx->sclk_hdmi)) { in mixer_resources_init()
801 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 0); in mixer_resources_init()
807 mixer_ctx->mixer_regs = devm_ioremap(dev, res->start, in mixer_resources_init()
809 if (mixer_ctx->mixer_regs == NULL) { in mixer_resources_init()
814 ret = platform_get_irq(mixer_ctx->pdev, 0); in mixer_resources_init()
817 mixer_ctx->irq = ret; in mixer_resources_init()
819 ret = devm_request_irq(dev, mixer_ctx->irq, mixer_irq_handler, in mixer_resources_init()
820 0, "drm_mixer", mixer_ctx); in mixer_resources_init()
829 static int vp_resources_init(struct mixer_context *mixer_ctx) in vp_resources_init() argument
831 struct device *dev = &mixer_ctx->pdev->dev; in vp_resources_init()
834 mixer_ctx->vp = devm_clk_get(dev, "vp"); in vp_resources_init()
835 if (IS_ERR(mixer_ctx->vp)) { in vp_resources_init()
840 if (test_bit(MXR_BIT_HAS_SCLK, &mixer_ctx->flags)) { in vp_resources_init()
841 mixer_ctx->sclk_mixer = devm_clk_get(dev, "sclk_mixer"); in vp_resources_init()
842 if (IS_ERR(mixer_ctx->sclk_mixer)) { in vp_resources_init()
846 mixer_ctx->mout_mixer = devm_clk_get(dev, "mout_mixer"); in vp_resources_init()
847 if (IS_ERR(mixer_ctx->mout_mixer)) { in vp_resources_init()
852 if (mixer_ctx->sclk_hdmi && mixer_ctx->mout_mixer) in vp_resources_init()
853 clk_set_parent(mixer_ctx->mout_mixer, in vp_resources_init()
854 mixer_ctx->sclk_hdmi); in vp_resources_init()
857 res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1); in vp_resources_init()
863 mixer_ctx->vp_regs = devm_ioremap(dev, res->start, in vp_resources_init()
865 if (mixer_ctx->vp_regs == NULL) { in vp_resources_init()
873 static int mixer_initialize(struct mixer_context *mixer_ctx, in mixer_initialize() argument
878 mixer_ctx->drm_dev = drm_dev; in mixer_initialize()
881 ret = mixer_resources_init(mixer_ctx); in mixer_initialize()
883 DRM_DEV_ERROR(mixer_ctx->dev, in mixer_initialize()
888 if (test_bit(MXR_BIT_VP_ENABLED, &mixer_ctx->flags)) { in mixer_initialize()
890 ret = vp_resources_init(mixer_ctx); in mixer_initialize()
892 DRM_DEV_ERROR(mixer_ctx->dev, in mixer_initialize()
898 return exynos_drm_register_dma(drm_dev, mixer_ctx->dev, in mixer_initialize()
899 &mixer_ctx->dma_priv); in mixer_initialize()
902 static void mixer_ctx_remove(struct mixer_context *mixer_ctx) in mixer_ctx_remove() argument
904 exynos_drm_unregister_dma(mixer_ctx->drm_dev, mixer_ctx->dev, in mixer_ctx_remove()
905 &mixer_ctx->dma_priv); in mixer_ctx_remove()
910 struct mixer_context *mixer_ctx = crtc->ctx; in mixer_enable_vblank() local
912 __set_bit(MXR_BIT_VSYNC, &mixer_ctx->flags); in mixer_enable_vblank()
913 if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) in mixer_enable_vblank()
917 mixer_reg_writemask(mixer_ctx, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); in mixer_enable_vblank()
918 mixer_reg_writemask(mixer_ctx, MXR_INT_EN, ~0, MXR_INT_EN_VSYNC); in mixer_enable_vblank()
925 struct mixer_context *mixer_ctx = crtc->ctx; in mixer_disable_vblank() local
927 __clear_bit(MXR_BIT_VSYNC, &mixer_ctx->flags); in mixer_disable_vblank()
929 if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) in mixer_disable_vblank()
933 mixer_reg_writemask(mixer_ctx, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); in mixer_disable_vblank()
934 mixer_reg_writemask(mixer_ctx, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); in mixer_disable_vblank()
952 struct mixer_context *mixer_ctx = crtc->ctx; in mixer_update_plane() local
954 DRM_DEV_DEBUG_KMS(mixer_ctx->dev, "win: %d\n", plane->index); in mixer_update_plane()
956 if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) in mixer_update_plane()
960 vp_video_buffer(mixer_ctx, plane); in mixer_update_plane()
962 mixer_graph_buffer(mixer_ctx, plane); in mixer_update_plane()
968 struct mixer_context *mixer_ctx = crtc->ctx; in mixer_disable_plane() local
971 DRM_DEV_DEBUG_KMS(mixer_ctx->dev, "win: %d\n", plane->index); in mixer_disable_plane()
973 if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) in mixer_disable_plane()
976 spin_lock_irqsave(&mixer_ctx->reg_slock, flags); in mixer_disable_plane()
977 mixer_cfg_layer(mixer_ctx, plane->index, 0, false); in mixer_disable_plane()
978 spin_unlock_irqrestore(&mixer_ctx->reg_slock, flags); in mixer_disable_plane()
983 struct mixer_context *mixer_ctx = crtc->ctx; in mixer_atomic_flush() local
985 if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) in mixer_atomic_flush()
988 mixer_enable_sync(mixer_ctx); in mixer_atomic_flush()