• Home
  • Raw
  • Download

Lines Matching full:dpi

7  * DOC: VC4 DPI module
9 * The VC4 DPI hardware supports MIPI DPI type 4 and Nokia ViSSI
84 /* General DPI hardware state. */
98 #define DPI_READ(offset) readl(dpi->regs + (offset))
99 #define DPI_WRITE(offset, val) writel(val, dpi->regs + (offset))
101 /* VC4 DPI encoder KMS struct */
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
137 /* Look up the connector attached to DPI so we can get the in vc4_dpi_encoder_enable()
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()
222 { .compatible = "brcm,bcm2835-dpi", .data = NULL },
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()
252 return drm_bridge_attach(dpi->encoder, bridge, NULL, 0); in vc4_dpi_init_bridge()
260 struct vc4_dpi *dpi; in vc4_dpi_bind() local
264 dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL); in vc4_dpi_bind()
265 if (!dpi) in vc4_dpi_bind()
273 vc4_dpi_encoder->dpi = dpi; in vc4_dpi_bind()
274 dpi->encoder = &vc4_dpi_encoder->base.base; in vc4_dpi_bind()
276 dpi->pdev = pdev; in vc4_dpi_bind()
277 dpi->regs = vc4_ioremap_regs(pdev, 0); in vc4_dpi_bind()
278 if (IS_ERR(dpi->regs)) in vc4_dpi_bind()
279 return PTR_ERR(dpi->regs); in vc4_dpi_bind()
280 dpi->regset.base = dpi->regs; in vc4_dpi_bind()
281 dpi->regset.regs = dpi_regs; in vc4_dpi_bind()
282 dpi->regset.nregs = ARRAY_SIZE(dpi_regs); in vc4_dpi_bind()
290 dpi->core_clock = devm_clk_get(dev, "core"); in vc4_dpi_bind()
291 if (IS_ERR(dpi->core_clock)) { in vc4_dpi_bind()
292 ret = PTR_ERR(dpi->core_clock); in vc4_dpi_bind()
297 dpi->pixel_clock = devm_clk_get(dev, "pixel"); in vc4_dpi_bind()
298 if (IS_ERR(dpi->pixel_clock)) { in vc4_dpi_bind()
299 ret = PTR_ERR(dpi->pixel_clock); in vc4_dpi_bind()
305 ret = clk_prepare_enable(dpi->core_clock); in vc4_dpi_bind()
309 drm_simple_encoder_init(drm, dpi->encoder, DRM_MODE_ENCODER_DPI); in vc4_dpi_bind()
310 drm_encoder_helper_add(dpi->encoder, &vc4_dpi_encoder_helper_funcs); in vc4_dpi_bind()
312 ret = vc4_dpi_init_bridge(dpi); in vc4_dpi_bind()
316 dev_set_drvdata(dev, dpi); in vc4_dpi_bind()
318 vc4->dpi = dpi; in vc4_dpi_bind()
320 vc4_debugfs_add_regset32(drm, "dpi_regs", &dpi->regset); in vc4_dpi_bind()
325 drm_encoder_cleanup(dpi->encoder); in vc4_dpi_bind()
326 clk_disable_unprepare(dpi->core_clock); in vc4_dpi_bind()
335 struct vc4_dpi *dpi = dev_get_drvdata(dev); in vc4_dpi_unbind() local
339 drm_encoder_cleanup(dpi->encoder); in vc4_dpi_unbind()
341 clk_disable_unprepare(dpi->core_clock); in vc4_dpi_unbind()
343 vc4->dpi = NULL; in vc4_dpi_unbind()