Lines Matching +full:versatile +full:- +full:tft +full:- +full:panel

1 // SPDX-License-Identifier: GPL-2.0
3 * Panel driver for the ARM Versatile family reference designs from
9 * On the Versatile AB, these panels come mounted on daughterboards
12 * boards support TFT display panels.
14 * - The IB1 is a passive board where the display connector defines a
19 * - The IB2 is a more complex board intended for GSM phone development
23 * On the Versatile PB, a special CLCD adaptor board is available
24 * supporting the same displays as the Versatile AB, plus one more
45 * This configuration register in the Versatile and RealView
51 /* The Versatile can detect the connected panel type */
59 /* IB2 control register for the Versatile daughterboard */
66 * struct versatile_panel_type - lookup struct for the supported panels
70 * @name: the name of this panel
78 * @mode: the DRM display mode for this panel
82 * @bus_flags: the DRM bus flags for this panel e.g. inverted clock
86 * @width_mm: the panel width in mm
90 * @height_mm: the panel height in mm
94 * @ib2: the panel may be connected on an IB2 daughterboard
100 * struct versatile_panel - state container for the Versatile panels
108 * @panel: the DRM panel instance for this device
110 struct drm_panel panel; member
112 * @panel_type: the Versatile panel type as detected
127 * Sanyo TM38QV67A02A - 3.8 inch QVGA (320x240) Color TFT
128 * found on the Versatile AB IB1 connector or the Versatile
150 * Sharp LQ084V1DG21 640x480 VGA Color TFT module
151 * found on the Versatile AB IB1 connector or the Versatile
173 * Epson L2F50113T00 - 2.2 inch QCIF 176x220 Color TFT
174 * found on the Versatile PB adaptor board connector.
197 * Versatile AB IB2 daughterboard for GSM prototyping.
222 to_versatile_panel(struct drm_panel *panel) in to_versatile_panel() argument
224 return container_of(panel, struct versatile_panel, panel); in to_versatile_panel()
227 static int versatile_panel_disable(struct drm_panel *panel) in versatile_panel_disable() argument
229 struct versatile_panel *vpanel = to_versatile_panel(panel); in versatile_panel_disable()
232 if (vpanel->ib2_map) { in versatile_panel_disable()
233 dev_dbg(vpanel->dev, "disable IB2 display\n"); in versatile_panel_disable()
234 regmap_update_bits(vpanel->ib2_map, in versatile_panel_disable()
243 static int versatile_panel_enable(struct drm_panel *panel) in versatile_panel_enable() argument
245 struct versatile_panel *vpanel = to_versatile_panel(panel); in versatile_panel_enable()
248 if (vpanel->ib2_map) { in versatile_panel_enable()
249 dev_dbg(vpanel->dev, "enable IB2 display\n"); in versatile_panel_enable()
250 regmap_update_bits(vpanel->ib2_map, in versatile_panel_enable()
259 static int versatile_panel_get_modes(struct drm_panel *panel, in versatile_panel_get_modes() argument
262 struct versatile_panel *vpanel = to_versatile_panel(panel); in versatile_panel_get_modes()
265 connector->display_info.width_mm = vpanel->panel_type->width_mm; in versatile_panel_get_modes()
266 connector->display_info.height_mm = vpanel->panel_type->height_mm; in versatile_panel_get_modes()
267 connector->display_info.bus_flags = vpanel->panel_type->bus_flags; in versatile_panel_get_modes()
269 mode = drm_mode_duplicate(connector->dev, &vpanel->panel_type->mode); in versatile_panel_get_modes()
271 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in versatile_panel_get_modes()
273 mode->width_mm = vpanel->panel_type->width_mm; in versatile_panel_get_modes()
274 mode->height_mm = vpanel->panel_type->height_mm; in versatile_panel_get_modes()
288 struct device *dev = &pdev->dev; in versatile_panel_probe()
296 parent = dev->parent; in versatile_panel_probe()
298 dev_err(dev, "no parent for versatile panel\n"); in versatile_panel_probe()
299 return -ENODEV; in versatile_panel_probe()
301 map = syscon_node_to_regmap(parent->of_node); in versatile_panel_probe()
303 dev_err(dev, "no regmap for versatile panel parent\n"); in versatile_panel_probe()
309 return -ENOMEM; in versatile_panel_probe()
323 if (pt->magic == val) { in versatile_panel_probe()
324 vpanel->panel_type = pt; in versatile_panel_probe()
329 /* No panel detected or VGA, let's leave this show */ in versatile_panel_probe()
331 dev_info(dev, "no panel detected\n"); in versatile_panel_probe()
332 return -ENODEV; in versatile_panel_probe()
335 dev_info(dev, "detected: %s\n", vpanel->panel_type->name); in versatile_panel_probe()
336 vpanel->dev = dev; in versatile_panel_probe()
337 vpanel->map = map; in versatile_panel_probe()
339 /* Check if the panel is mounted on an IB2 daughterboard */ in versatile_panel_probe()
340 if (vpanel->panel_type->ib2) { in versatile_panel_probe()
341 vpanel->ib2_map = syscon_regmap_lookup_by_compatible( in versatile_panel_probe()
342 "arm,versatile-ib2-syscon"); in versatile_panel_probe()
343 if (IS_ERR(vpanel->ib2_map)) in versatile_panel_probe()
344 vpanel->ib2_map = NULL; in versatile_panel_probe()
346 dev_info(dev, "panel mounted on IB2 daughterboard\n"); in versatile_panel_probe()
349 drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs, in versatile_panel_probe()
352 drm_panel_add(&vpanel->panel); in versatile_panel_probe()
358 { .compatible = "arm,versatile-tft-panel", },
366 .name = "versatile-tft-panel",
373 MODULE_DESCRIPTION("ARM Versatile panel driver");