Linus Walleij <linus.walleij@xxxxxxxxxx> writes: > The ARM reference designs "Versatile AB" and "Versatile PB" > contain panel connectors with autodetection of the connected > panel type. This adds a small driver utilizing the MFD syscon > look-up to read the autodetection register and set up the > corresponding panel appropriately. > > In the source file there is a bit of elaboration of the > panel types and interfaces on these boards. > > This was tested with the PL111 DRM driver on the ARM Versatile > AB with the IB2 daughterboard. > > Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> > diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c > new file mode 100644 > index 000000000000..ce778ca20f3f > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c > @@ -0,0 +1,353 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Panel driver for the ARM Versatile family reference designs from > + * ARM Limited. > + * > + * Author: > + * Linus Walleij <linus.wallei@xxxxxxxxxx> > + * > + * On the Versatile AB, these panels come mounted on daughterboards > + * named "IB1" or "IB2" (Interface Board 1 & 2 respectively.) They > + * are documented in ARM DUI 0225D Appendix C and D. These daughter > + * boards support TFT display panels. > + * > + * - The IB1 is a passive board where the display connector defines a > + * few wires for encoding the display type for autodetection, > + * suitable display settings can then be looked up from this setting. > + * The magic bits can be read out from the system controller. > + * > + * - The IB2 is a more complex board intended for GSM phone development > + * with some logic and a control register, which needs to be accessed > + * and the board display needs to be turned on explicitly. > + * > + * On the Versatile PB, a special CLCD adaptor board is available > + * supporting the same displays as the Versatile AB, plus one more > + * Epson QCIF display. > + * > + */ Thanks for describing the module at the top! > +/** > + * struct versatile_panel_type - lookup struct for the supported panels > + * @name: the name of this panel > + * @magic: the magic value from the detection register > + * @mode: the DRM display mode for this panel > + * @bus_flags: the DRM bus flags for this panel e.g. inverted clock > + * @width_mm: the panel width in mm > + * @height_mm: the panel height in mm > + * @ib2: the panel may be connected on an IB2 daughterboard > + */ Optional style suggestion: You can put the kerneldoc field descriptions inside the struct now, so that they don't end up getting left behind as people modify the code. > + /* > + * Epson L2F50113T00 - 2.2 inch QCIF 176x220 Color TFT > + * found on the Versatile PB adaptor board connector. > + */ > + { > + .name = "Epson L2F50113T00", > + .magic = SYS_CLCD_ID_EPSON_2_2, > + .width_mm = 34, > + .height_mm = 45, > + .mode = { > + .clock = 625000000, > + .hdisplay = 176, > + .hsync_start = 176 + 2, > + .hsync_end = 176 + 2 + 3, > + .htotal = 176 + 2 + 3 + 3, > + .vdisplay = 220, > + .vsync_start = 220 + 0, > + .vsync_end = 220 + 0 + 2, > + .vtotal = 220 + 0 + 2 + 1, > + .vrefresh = 390, > + .flags = 0, These panels might want PHSYNC/PVSYNC in their flags if they don't want N. (I don't get why we have two separate bits for what is a single bit of information) > +static int versatile_panel_disable(struct drm_panel *panel) > +{ > + struct versatile_panel *vpanel = to_versatile_panel(panel); > + > + /* If we're on an IB2 daughterboard, turn off display */ > + if (vpanel->ib2_map) { > + dev_info(vpanel->dev, "disable IB2 display\n"); Looks like disable and enable have a debug printf left in. With that fixed, Reviewed-by: Eric Anholt <eric@xxxxxxxxxx>
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel