Lines Matching +full:hdmi +full:- +full:bridge
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 -> 5 formatters -> DSI/DPI
26 * External 0..5 0..3 A,B, 3 x DSI bridge
29 * FIFOs A and B are for LCD and HDMI while FIFO CO/C1 are for
41 * helpers. We then provide a bridge to the DSI port, and on the DSI port
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
53 * the DSI bridge.
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()
133 if (!mcde->bridge) { in mcde_modeset_init()
134 dev_err(drm->dev, "no display output bridge yet\n"); in mcde_modeset_init()
135 return -EPROBE_DEFER; in mcde_modeset_init()
138 mode_config = &drm->mode_config; in mcde_modeset_init()
139 mode_config->funcs = &mcde_mode_config_funcs; in mcde_modeset_init()
140 mode_config->helper_private = &mcde_mode_config_helpers; in mcde_modeset_init()
142 mode_config->min_width = 1; in mcde_modeset_init()
143 mode_config->max_width = 1920; in mcde_modeset_init()
144 mode_config->min_height = 1; in mcde_modeset_init()
145 mode_config->max_height = 1080; in mcde_modeset_init()
149 dev_err(drm->dev, "failed to init vblank\n"); in mcde_modeset_init()
155 dev_err(drm->dev, "failed to init display\n"); in mcde_modeset_init()
160 * Attach the DSI bridge in mcde_modeset_init()
162 * TODO: when adding support for the DPI bridge or several DSI bridges, in mcde_modeset_init()
163 * we selectively connect the bridge(s) here instead of this simple in mcde_modeset_init()
166 ret = drm_simple_display_pipe_attach_bridge(&mcde->pipe, in mcde_modeset_init()
167 mcde->bridge); in mcde_modeset_init()
169 dev_err(drm->dev, "failed to attach display output bridge\n"); in mcde_modeset_init()
205 ret = component_bind_all(drm->dev, drm); in mcde_drm_bind()
224 component_unbind_all(drm->dev, drm); in mcde_drm_bind()
234 component_unbind_all(drm->dev, drm); in mcde_drm_unbind()
253 struct device *dev = &pdev->dev; in mcde_probe()
266 drm = &mcde->drm; in mcde_probe()
267 mcde->dev = dev; in mcde_probe()
271 mcde->epod = devm_regulator_get(dev, "epod"); in mcde_probe()
272 if (IS_ERR(mcde->epod)) { in mcde_probe()
273 ret = PTR_ERR(mcde->epod); in mcde_probe()
277 ret = regulator_enable(mcde->epod); in mcde_probe()
282 mcde->vana = devm_regulator_get(dev, "vana"); in mcde_probe()
283 if (IS_ERR(mcde->vana)) { in mcde_probe()
284 ret = PTR_ERR(mcde->vana); in mcde_probe()
288 ret = regulator_enable(mcde->vana); in mcde_probe()
295 * the v-esram34 regulator, but we don't use that yet in mcde_probe()
299 mcde->mcde_clk = devm_clk_get(dev, "mcde"); in mcde_probe()
300 if (IS_ERR(mcde->mcde_clk)) { in mcde_probe()
302 ret = PTR_ERR(mcde->mcde_clk); in mcde_probe()
305 ret = clk_prepare_enable(mcde->mcde_clk); in mcde_probe()
310 dev_info(dev, "MCDE clk rate %lu Hz\n", clk_get_rate(mcde->mcde_clk)); in mcde_probe()
312 mcde->lcd_clk = devm_clk_get(dev, "lcd"); in mcde_probe()
313 if (IS_ERR(mcde->lcd_clk)) { in mcde_probe()
315 ret = PTR_ERR(mcde->lcd_clk); in mcde_probe()
318 mcde->hdmi_clk = devm_clk_get(dev, "hdmi"); in mcde_probe()
319 if (IS_ERR(mcde->hdmi_clk)) { in mcde_probe()
320 dev_err(dev, "unable to get HDMI clock\n"); in mcde_probe()
321 ret = PTR_ERR(mcde->hdmi_clk); in mcde_probe()
326 mcde->regs = devm_ioremap_resource(dev, res); in mcde_probe()
327 if (IS_ERR(mcde->regs)) { in mcde_probe()
329 ret = -EINVAL; in mcde_probe()
335 ret = -EINVAL; in mcde_probe()
351 pid = readl(mcde->regs + MCDE_PID); in mcde_probe()
363 ret = -ENODEV; in mcde_probe()
369 writel(0, mcde->regs + MCDE_IMSCERR); in mcde_probe()
370 writel(0xFFFFFFFF, mcde->regs + MCDE_RISERR); in mcde_probe()
377 struct device_driver *drv = &mcde_component_drivers[i]->driver; in mcde_probe()
389 ret = -ENODEV; in mcde_probe()
404 ret = regulator_disable(mcde->epod); in mcde_probe()
412 ret = component_master_add_with_match(&pdev->dev, &mcde_drm_comp_ops, in mcde_probe()
420 clk_disable_unprepare(mcde->mcde_clk); in mcde_probe()
421 regulator_disable(mcde->vana); in mcde_probe()
428 clk_disable_unprepare(mcde->mcde_clk); in mcde_probe()
430 regulator_disable(mcde->vana); in mcde_probe()
432 regulator_disable(mcde->epod); in mcde_probe()
442 component_master_del(&pdev->dev, &mcde_drm_comp_ops); in mcde_remove()
443 clk_disable_unprepare(mcde->mcde_clk); in mcde_remove()
444 regulator_disable(mcde->vana); in mcde_remove()
445 regulator_disable(mcde->epod); in mcde_remove()
492 MODULE_ALIAS("platform:mcde-drm");