Lines Matching +full:meson +full:- +full:gxbb +full:- +full:dw +full:- +full:hdmi
1 // SPDX-License-Identifier: GPL-2.0-or-later
16 #include <linux/soc/amlogic/meson-canvas.h>
42 #define DRIVER_NAME "meson"
43 #define DRIVER_DESC "Amlogic Meson DRM driver"
53 * - Full reset of entire video processing HW blocks
54 * - Scaling and setup of the VPU clock
55 * - Bus clock gates
56 * - Powering up video processing HW blocks
57 * - Powering Up HDMI controller and PHY
73 struct meson_drm *priv = dev->dev_private; in meson_irq()
75 (void)readl_relaxed(priv->io_base + _REG(VENC_INTFLAG)); in meson_irq()
88 args->pitch = ALIGN(DIV_ROUND_UP(args->width * args->bpp, 8), SZ_64); in meson_dumb_create()
89 args->size = PAGE_ALIGN(args->pitch * args->height); in meson_dumb_create()
116 for_each_endpoint_of_node(dev->of_node, ep) { in meson_vpu_has_available_connectors()
146 writel_relaxed(value, priv->io_base + _REG(VPU_RDARB_MODE_L1C1)); in meson_vpu_init()
150 writel_relaxed(value, priv->io_base + _REG(VPU_RDARB_MODE_L1C2)); in meson_vpu_init()
155 writel_relaxed(value, priv->io_base + _REG(VPU_RDARB_MODE_L2C1)); in meson_vpu_init()
159 writel_relaxed(value, priv->io_base + _REG(VPU_WRARB_MODE_L2C1)); in meson_vpu_init()
168 /* S805X/S805Y HDMI PLL won't lock for HDMI PHY freq > 1,65GHz */
193 return -ENODEV; in meson_drv_bind_master()
198 return -ENODEV; in meson_drv_bind_master()
206 ret = -ENOMEM; in meson_drv_bind_master()
209 drm->dev_private = priv; in meson_drv_bind_master()
210 priv->drm = drm; in meson_drv_bind_master()
211 priv->dev = dev; in meson_drv_bind_master()
212 priv->compat = match->compat; in meson_drv_bind_master()
213 priv->afbcd.ops = match->afbcd_ops; in meson_drv_bind_master()
221 priv->io_base = regs; in meson_drv_bind_master()
225 ret = -EINVAL; in meson_drv_bind_master()
229 regs = devm_ioremap(dev, res->start, resource_size(res)); in meson_drv_bind_master()
231 ret = -EADDRNOTAVAIL; in meson_drv_bind_master()
235 priv->hhi = devm_regmap_init_mmio(dev, regs, in meson_drv_bind_master()
237 if (IS_ERR(priv->hhi)) { in meson_drv_bind_master()
238 dev_err(&pdev->dev, "Couldn't create the HHI regmap\n"); in meson_drv_bind_master()
239 ret = PTR_ERR(priv->hhi); in meson_drv_bind_master()
243 priv->canvas = meson_canvas_get(dev); in meson_drv_bind_master()
244 if (IS_ERR(priv->canvas)) { in meson_drv_bind_master()
245 ret = PTR_ERR(priv->canvas); in meson_drv_bind_master()
249 ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_osd1); in meson_drv_bind_master()
252 ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_0); in meson_drv_bind_master()
255 ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_1); in meson_drv_bind_master()
258 ret = meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_2); in meson_drv_bind_master()
262 priv->vsync_irq = platform_get_irq(pdev, 0); in meson_drv_bind_master()
271 priv->limits = &meson_drm_soc_attrs[i].limits; in meson_drv_bind_master()
287 drm->mode_config.max_width = 3840; in meson_drv_bind_master()
288 drm->mode_config.max_height = 2160; in meson_drv_bind_master()
289 drm->mode_config.funcs = &meson_mode_config_funcs; in meson_drv_bind_master()
290 drm->mode_config.helper_private = &meson_mode_config_helpers; in meson_drv_bind_master()
298 if (priv->afbcd.ops) { in meson_drv_bind_master()
299 ret = priv->afbcd.ops->init(priv); in meson_drv_bind_master()
313 dev_err(drm->dev, "Couldn't bind all components\n"); in meson_drv_bind_master()
342 ret = request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm); in meson_drv_bind_master()
361 free_irq(priv->vsync_irq, drm); in meson_drv_bind_master()
363 if (priv->afbcd.ops) in meson_drv_bind_master()
364 priv->afbcd.ops->exit(priv); in meson_drv_bind_master()
366 meson_canvas_free(priv->canvas, priv->canvas_id_vd1_2); in meson_drv_bind_master()
368 meson_canvas_free(priv->canvas, priv->canvas_id_vd1_1); in meson_drv_bind_master()
370 meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0); in meson_drv_bind_master()
372 meson_canvas_free(priv->canvas, priv->canvas_id_osd1); in meson_drv_bind_master()
394 struct drm_device *drm = priv->drm; in meson_drv_unbind()
396 if (priv->canvas) { in meson_drv_unbind()
397 meson_canvas_free(priv->canvas, priv->canvas_id_osd1); in meson_drv_unbind()
398 meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0); in meson_drv_unbind()
399 meson_canvas_free(priv->canvas, priv->canvas_id_vd1_1); in meson_drv_unbind()
400 meson_canvas_free(priv->canvas, priv->canvas_id_vd1_2); in meson_drv_unbind()
406 free_irq(priv->vsync_irq, drm); in meson_drv_unbind()
415 if (priv->afbcd.ops) in meson_drv_unbind()
416 priv->afbcd.ops->exit(priv); in meson_drv_unbind()
431 return drm_mode_config_helper_suspend(priv->drm); in meson_drv_pm_suspend()
445 if (priv->afbcd.ops) in meson_drv_pm_resume()
446 priv->afbcd.ops->init(priv); in meson_drv_pm_resume()
448 return drm_mode_config_helper_resume(priv->drm); in meson_drv_pm_resume()
453 struct meson_drm *priv = dev_get_drvdata(&pdev->dev); in meson_drv_shutdown()
458 drm_kms_helper_poll_fini(priv->drm); in meson_drv_shutdown()
459 drm_atomic_helper_shutdown(priv->drm); in meson_drv_shutdown()
469 { .compatible = "amlogic,meson-gxbb-dw-hdmi" },
470 { .compatible = "amlogic,meson-gxl-dw-hdmi" },
471 { .compatible = "amlogic,meson-gxm-dw-hdmi" },
472 { .compatible = "amlogic,meson-g12a-dw-hdmi" },
479 struct device_node *np = pdev->dev.of_node; in meson_drv_probe()
491 component_match_add(&pdev->dev, &match, component_compare_of, remote); in meson_drv_probe()
493 dev_dbg(&pdev->dev, "parent %pOF remote match add %pOF parent %s\n", in meson_drv_probe()
494 np, remote, dev_name(&pdev->dev)); in meson_drv_probe()
503 return meson_drv_bind_master(&pdev->dev, false); in meson_drv_probe()
507 dev_info(&pdev->dev, "Queued %d outputs on vpu\n", count); in meson_drv_probe()
509 return component_master_add_with_match(&pdev->dev, in meson_drv_probe()
520 component_master_del(&pdev->dev, &meson_drv_master_ops); in meson_drv_remove()
542 { .compatible = "amlogic,meson-gxbb-vpu",
544 { .compatible = "amlogic,meson-gxl-vpu",
546 { .compatible = "amlogic,meson-gxm-vpu",
548 { .compatible = "amlogic,meson-g12a-vpu",
563 .name = "meson-drm",