Lines Matching refs:dpi
98 #define DPI_READ(offset) readl(dpi->regs + (offset))
99 #define DPI_WRITE(offset, val) writel(val, dpi->regs + (offset))
104 struct vc4_dpi *dpi; member
121 struct vc4_dpi *dpi = vc4_encoder->dpi; in vc4_dpi_encoder_disable() local
123 clk_disable_unprepare(dpi->pixel_clock); in vc4_dpi_encoder_disable()
131 struct vc4_dpi *dpi = vc4_encoder->dpi; in vc4_dpi_encoder_enable() local
197 ret = clk_set_rate(dpi->pixel_clock, mode->clock * 1000); in vc4_dpi_encoder_enable()
201 ret = clk_prepare_enable(dpi->pixel_clock); in vc4_dpi_encoder_enable()
229 static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) in vc4_dpi_init_bridge() argument
231 struct device *dev = &dpi->pdev->dev; in vc4_dpi_init_bridge()
245 return drm_bridge_attach(dpi->encoder, bridge, NULL, 0); in vc4_dpi_init_bridge()
253 struct vc4_dpi *dpi; in vc4_dpi_bind() local
257 dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL); in vc4_dpi_bind()
258 if (!dpi) in vc4_dpi_bind()
266 vc4_dpi_encoder->dpi = dpi; in vc4_dpi_bind()
267 dpi->encoder = &vc4_dpi_encoder->base.base; in vc4_dpi_bind()
269 dpi->pdev = pdev; in vc4_dpi_bind()
270 dpi->regs = vc4_ioremap_regs(pdev, 0); in vc4_dpi_bind()
271 if (IS_ERR(dpi->regs)) in vc4_dpi_bind()
272 return PTR_ERR(dpi->regs); in vc4_dpi_bind()
273 dpi->regset.base = dpi->regs; in vc4_dpi_bind()
274 dpi->regset.regs = dpi_regs; in vc4_dpi_bind()
275 dpi->regset.nregs = ARRAY_SIZE(dpi_regs); in vc4_dpi_bind()
283 dpi->core_clock = devm_clk_get(dev, "core"); in vc4_dpi_bind()
284 if (IS_ERR(dpi->core_clock)) { in vc4_dpi_bind()
285 ret = PTR_ERR(dpi->core_clock); in vc4_dpi_bind()
290 dpi->pixel_clock = devm_clk_get(dev, "pixel"); in vc4_dpi_bind()
291 if (IS_ERR(dpi->pixel_clock)) { in vc4_dpi_bind()
292 ret = PTR_ERR(dpi->pixel_clock); in vc4_dpi_bind()
298 ret = clk_prepare_enable(dpi->core_clock); in vc4_dpi_bind()
302 drm_simple_encoder_init(drm, dpi->encoder, DRM_MODE_ENCODER_DPI); in vc4_dpi_bind()
303 drm_encoder_helper_add(dpi->encoder, &vc4_dpi_encoder_helper_funcs); in vc4_dpi_bind()
305 ret = vc4_dpi_init_bridge(dpi); in vc4_dpi_bind()
309 dev_set_drvdata(dev, dpi); in vc4_dpi_bind()
311 vc4->dpi = dpi; in vc4_dpi_bind()
313 vc4_debugfs_add_regset32(drm, "dpi_regs", &dpi->regset); in vc4_dpi_bind()
318 drm_encoder_cleanup(dpi->encoder); in vc4_dpi_bind()
319 clk_disable_unprepare(dpi->core_clock); in vc4_dpi_bind()
328 struct vc4_dpi *dpi = dev_get_drvdata(dev); in vc4_dpi_unbind() local
332 drm_encoder_cleanup(dpi->encoder); in vc4_dpi_unbind()
334 clk_disable_unprepare(dpi->core_clock); in vc4_dpi_unbind()
336 vc4->dpi = NULL; in vc4_dpi_unbind()