Lines Matching +full:versatile +full:- +full:tft +full:- +full:panel
1 // SPDX-License-Identifier: GPL-2.0-only
3 * (C) COPYRIGHT 2012-2013 ARM Limited. All rights reserved.
7 * Copyright (c) 2006-2008 Intel Corporation
15 * The PL110/PL111 is a simple LCD controller that can support TFT
29 * - Fix race between setting plane base address and getting IRQ for
32 * - Read back hardware state at boot to skip reprogramming the
33 * hardware when doing a no-op modeset.
35 * - Use the CLKSEL bit to support switching between the two external
40 #include <linux/dma-buf.h>
76 struct pl111_drm_dev_private *priv = dev->dev_private; in pl111_modeset_init()
77 struct device_node *np = dev->dev->of_node; in pl111_modeset_init()
79 struct drm_panel *panel = NULL; in pl111_modeset_init() local
89 mode_config = &dev->mode_config; in pl111_modeset_init()
90 mode_config->funcs = &mode_config_funcs; in pl111_modeset_init()
91 mode_config->min_width = 1; in pl111_modeset_init()
92 mode_config->max_width = 1024; in pl111_modeset_init()
93 mode_config->min_height = 1; in pl111_modeset_init()
94 mode_config->max_height = 768; in pl111_modeset_init()
101 dev_dbg(dev->dev, "checking endpoint %d\n", i); in pl111_modeset_init()
103 ret = drm_of_find_panel_or_bridge(dev->dev->of_node, in pl111_modeset_init()
108 if (ret == -EPROBE_DEFER) { in pl111_modeset_init()
111 * another way of saying -ENODEV, but let's in pl111_modeset_init()
115 } else if (ret != -ENODEV) { in pl111_modeset_init()
117 dev_err(dev->dev, in pl111_modeset_init()
123 dev_info(dev->dev, in pl111_modeset_init()
124 "found panel on endpoint %d\n", i); in pl111_modeset_init()
125 panel = tmp_panel; in pl111_modeset_init()
128 dev_info(dev->dev, in pl111_modeset_init()
137 * If we can't find neither panel nor bridge on any of the in pl111_modeset_init()
138 * endpoints, and any of them retured -EPROBE_DEFER, then in pl111_modeset_init()
141 if ((!panel && !bridge) && defer) in pl111_modeset_init()
142 return -EPROBE_DEFER; in pl111_modeset_init()
144 if (panel) { in pl111_modeset_init()
145 bridge = drm_panel_bridge_add_typed(panel, in pl111_modeset_init()
152 dev_info(dev->dev, "Using non-panel bridge\n"); in pl111_modeset_init()
154 dev_err(dev->dev, "No bridge, exiting\n"); in pl111_modeset_init()
155 return -ENODEV; in pl111_modeset_init()
158 priv->bridge = bridge; in pl111_modeset_init()
159 if (panel) { in pl111_modeset_init()
160 priv->panel = panel; in pl111_modeset_init()
161 priv->connector = drm_panel_bridge_connector(bridge); in pl111_modeset_init()
166 dev_err(dev->dev, "Failed to init display\n"); in pl111_modeset_init()
170 ret = drm_simple_display_pipe_attach_bridge(&priv->pipe, in pl111_modeset_init()
175 if (!priv->variant->broken_vblank) { in pl111_modeset_init()
178 dev_err(dev->dev, "Failed to init vblank\n"); in pl111_modeset_init()
190 if (panel) in pl111_modeset_init()
201 struct pl111_drm_dev_private *priv = dev->dev_private; in pl111_gem_import_sg_table()
204 * When using device-specific reserved memory we can't import in pl111_gem_import_sg_table()
208 if (priv->use_device_memory) in pl111_gem_import_sg_table()
209 return ERR_PTR(-EINVAL); in pl111_gem_import_sg_table()
245 struct device *dev = &amba_dev->dev; in pl111_amba_probe()
247 const struct pl111_variant_data *variant = id->data; in pl111_amba_probe()
253 return -ENOMEM; in pl111_amba_probe()
259 priv->drm = drm; in pl111_amba_probe()
260 drm->dev_private = priv; in pl111_amba_probe()
261 priv->variant = variant; in pl111_amba_probe()
265 dev_info(dev, "using device-specific reserved memory\n"); in pl111_amba_probe()
266 priv->use_device_memory = true; in pl111_amba_probe()
269 if (of_property_read_u32(dev->of_node, "max-memory-bandwidth", in pl111_amba_probe()
270 &priv->memory_bw)) { in pl111_amba_probe()
272 priv->memory_bw = 0; in pl111_amba_probe()
276 if (variant->is_pl110 || variant->is_lcdc) { in pl111_amba_probe()
277 priv->ienb = CLCD_PL110_IENB; in pl111_amba_probe()
278 priv->ctrl = CLCD_PL110_CNTL; in pl111_amba_probe()
280 priv->ienb = CLCD_PL111_IENB; in pl111_amba_probe()
281 priv->ctrl = CLCD_PL111_CNTL; in pl111_amba_probe()
284 priv->regs = devm_ioremap_resource(dev, &amba_dev->res); in pl111_amba_probe()
285 if (IS_ERR(priv->regs)) { in pl111_amba_probe()
287 ret = PTR_ERR(priv->regs); in pl111_amba_probe()
299 writel(0, priv->regs + priv->ienb); in pl111_amba_probe()
301 ret = devm_request_irq(dev, amba_dev->irq[0], pl111_irq, 0, in pl111_amba_probe()
302 variant->name, priv); in pl111_amba_probe()
316 drm_fbdev_generic_setup(drm, priv->variant->fb_bpp); in pl111_amba_probe()
329 struct device *dev = &amba_dev->dev; in pl111_amba_remove()
331 struct pl111_drm_dev_private *priv = drm->dev_private; in pl111_amba_remove()
334 if (priv->panel) in pl111_amba_remove()
335 drm_panel_bridge_remove(priv->bridge); in pl111_amba_remove()
364 /* RealView, Versatile Express etc use this modern variant */
440 .name = "drm-clcd-pl111",