Lines Matching +full:panel +full:- +full:dpi

1 // SPDX-License-Identifier: GPL-2.0
5 * (C) ST-Ericsson SA 2013
9 * DOC: ST-Ericsson MCDE Driver
11 * The MCDE (short for multi-channel display engine) is a graphics
15 * ST-Ericsson U8500 where is was used for mass-market deployments
18 * It can do 1080p30 on SDTV CCIR656, DPI-2, DBI-2 or DSI for
25 * Memory -> Overlay -> Channel -> FIFO -> 8 formatters -> DSI/DPI
27 * source 0..9 C0,C1 2 x DPI
32 * 2 of the formatters are for DPI.
34 * Behind the formatters are the DSI or DPI ports that route to
36 * DPI port, it is possible to configure up to 4 display pipelines
42 * bridge we connect hang a panel bridge or other bridge. This may be subject
47 * - Enabled damaged rectangles using drm_plane_enable_fb_damage_clips()
49 * command-only display.
50 * - Enable mixing of more planes, possibly at the cost of moving away
52 * - Enable output to bridges such as the AV8100 HDMI encoder from
58 #include <linux/dma-buf.h>
116 val = readl(mcde->regs + MCDE_MISERR); in mcde_irq()
121 dev_info(mcde->dev, "some error IRQ\n"); in mcde_irq()
122 writel(val, mcde->regs + MCDE_RISERR); in mcde_irq()
134 * If no other bridge was found, check if we have a DPI panel or in mcde_modeset_init()
135 * any other bridge connected directly to the MCDE DPI output. in mcde_modeset_init()
141 if (!mcde->bridge) { in mcde_modeset_init()
142 struct drm_panel *panel; in mcde_modeset_init() local
145 ret = drm_of_find_panel_or_bridge(drm->dev->of_node, in mcde_modeset_init()
146 0, 0, &panel, &bridge); in mcde_modeset_init()
148 dev_err(drm->dev, in mcde_modeset_init()
149 "Could not locate any output bridge or panel\n"); in mcde_modeset_init()
152 if (panel) { in mcde_modeset_init()
153 bridge = drm_panel_bridge_add_typed(panel, in mcde_modeset_init()
156 dev_err(drm->dev, in mcde_modeset_init()
157 "Could not connect panel bridge\n"); in mcde_modeset_init()
161 mcde->dpi_output = true; in mcde_modeset_init()
162 mcde->bridge = bridge; in mcde_modeset_init()
163 mcde->flow_mode = MCDE_DPI_FORMATTER_FLOW; in mcde_modeset_init()
166 mode_config = &drm->mode_config; in mcde_modeset_init()
167 mode_config->funcs = &mcde_mode_config_funcs; in mcde_modeset_init()
168 mode_config->helper_private = &mcde_mode_config_helpers; in mcde_modeset_init()
170 mode_config->min_width = 1; in mcde_modeset_init()
171 mode_config->max_width = 1920; in mcde_modeset_init()
172 mode_config->min_height = 1; in mcde_modeset_init()
173 mode_config->max_height = 1080; in mcde_modeset_init()
177 dev_err(drm->dev, "failed to init vblank\n"); in mcde_modeset_init()
183 dev_err(drm->dev, "failed to init display\n"); in mcde_modeset_init()
188 ret = drm_simple_display_pipe_attach_bridge(&mcde->pipe, in mcde_modeset_init()
189 mcde->bridge); in mcde_modeset_init()
191 dev_err(drm->dev, "failed to attach display output bridge\n"); in mcde_modeset_init()
226 ret = component_bind_all(drm->dev, drm); in mcde_drm_bind()
245 component_unbind_all(drm->dev, drm); in mcde_drm_bind()
255 component_unbind_all(drm->dev, drm); in mcde_drm_unbind()
269 struct device *dev = &pdev->dev; in mcde_probe()
281 drm = &mcde->drm; in mcde_probe()
282 mcde->dev = dev; in mcde_probe()
286 mcde->epod = devm_regulator_get(dev, "epod"); in mcde_probe()
287 if (IS_ERR(mcde->epod)) { in mcde_probe()
288 ret = PTR_ERR(mcde->epod); in mcde_probe()
292 ret = regulator_enable(mcde->epod); in mcde_probe()
297 mcde->vana = devm_regulator_get(dev, "vana"); in mcde_probe()
298 if (IS_ERR(mcde->vana)) { in mcde_probe()
299 ret = PTR_ERR(mcde->vana); in mcde_probe()
303 ret = regulator_enable(mcde->vana); in mcde_probe()
310 * the v-esram34 regulator, but we don't use that yet in mcde_probe()
314 mcde->mcde_clk = devm_clk_get(dev, "mcde"); in mcde_probe()
315 if (IS_ERR(mcde->mcde_clk)) { in mcde_probe()
317 ret = PTR_ERR(mcde->mcde_clk); in mcde_probe()
320 ret = clk_prepare_enable(mcde->mcde_clk); in mcde_probe()
325 dev_info(dev, "MCDE clk rate %lu Hz\n", clk_get_rate(mcde->mcde_clk)); in mcde_probe()
327 mcde->lcd_clk = devm_clk_get(dev, "lcd"); in mcde_probe()
328 if (IS_ERR(mcde->lcd_clk)) { in mcde_probe()
330 ret = PTR_ERR(mcde->lcd_clk); in mcde_probe()
333 mcde->hdmi_clk = devm_clk_get(dev, "hdmi"); in mcde_probe()
334 if (IS_ERR(mcde->hdmi_clk)) { in mcde_probe()
336 ret = PTR_ERR(mcde->hdmi_clk); in mcde_probe()
340 mcde->regs = devm_platform_ioremap_resource(pdev, 0); in mcde_probe()
341 if (IS_ERR(mcde->regs)) { in mcde_probe()
343 ret = -EINVAL; in mcde_probe()
365 pid = readl(mcde->regs + MCDE_PID); in mcde_probe()
377 ret = -ENODEV; in mcde_probe()
383 writel(0, mcde->regs + MCDE_IMSCERR); in mcde_probe()
384 writel(0xFFFFFFFF, mcde->regs + MCDE_RISERR); in mcde_probe()
391 struct device_driver *drv = &mcde_component_drivers[i]->driver; in mcde_probe()
403 ret = -ENODEV; in mcde_probe()
418 ret = regulator_disable(mcde->epod); in mcde_probe()
426 ret = component_master_add_with_match(&pdev->dev, &mcde_drm_comp_ops, in mcde_probe()
434 clk_disable_unprepare(mcde->mcde_clk); in mcde_probe()
435 regulator_disable(mcde->vana); in mcde_probe()
442 clk_disable_unprepare(mcde->mcde_clk); in mcde_probe()
444 regulator_disable(mcde->vana); in mcde_probe()
446 regulator_disable(mcde->epod); in mcde_probe()
456 component_master_del(&pdev->dev, &mcde_drm_comp_ops); in mcde_remove()
457 clk_disable_unprepare(mcde->mcde_clk); in mcde_remove()
458 regulator_disable(mcde->vana); in mcde_remove()
459 regulator_disable(mcde->epod); in mcde_remove()
466 if (drm->registered) in mcde_shutdown()
496 return -ENODEV; in mcde_drm_register()
516 MODULE_ALIAS("platform:mcde-drm");