// SPDX-License-Identifier: GPL-2.0 /* * Panel driver for the ARM Versatile family reference designs from * ARM Limited. * * Author: * Linus Walleij <linus.wallei@linaro.org> * * 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. *
*/
/* * This configuration register in the Versatile and RealView * family is uniformly present but appears more and more * unutilized starting with the RealView series.
*/ #define SYS_CLCD 0x50
/* The Versatile can detect the connected panel type */ #define SYS_CLCD_CLCDID_MASK (BIT(8)|BIT(9)|BIT(10)|BIT(11)|BIT(12)) #define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8) #define SYS_CLCD_ID_SHARP_8_4 (0x01 << 8) #define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8) #define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8) #define SYS_CLCD_ID_VGA (0x1f << 8)
/* IB2 control register for the Versatile daughterboard */ #define IB2_CTRL 0x00 #define IB2_CTRL_LCD_SD BIT(1) /* 1 = shut down LCD */ #define IB2_CTRL_LCD_BL_ON BIT(0) #define IB2_CTRL_LCD_MASK (BIT(0)|BIT(1))
/** * struct versatile_panel_type - lookup struct for the supported panels
*/ struct versatile_panel_type { /** * @name: the name of this panel
*/ constchar *name; /** * @magic: the magic value from the detection register
*/
u32 magic; /** * @mode: the DRM display mode for this panel
*/ struct drm_display_mode mode; /** * @bus_flags: the DRM bus flags for this panel e.g. inverted clock
*/
u32 bus_flags; /** * @width_mm: the panel width in mm
*/
u32 width_mm; /** * @height_mm: the panel height in mm
*/
u32 height_mm; /** * @ib2: the panel may be connected on an IB2 daughterboard
*/ bool ib2;
};
/** * struct versatile_panel - state container for the Versatile panels
*/ struct versatile_panel { /** * @dev: the container device
*/ struct device *dev; /** * @panel: the DRM panel instance for this device
*/ struct drm_panel panel; /** * @panel_type: the Versatile panel type as detected
*/ conststruct versatile_panel_type *panel_type; /** * @map: map to the parent syscon where the main register reside
*/ struct regmap *map; /** * @ib2_map: map to the IB2 syscon, if applicable
*/ struct regmap *ib2_map;
};
/* If we're on an IB2 daughterboard, turn off display */ if (vpanel->ib2_map) {
dev_dbg(vpanel->dev, "disable IB2 display\n");
regmap_update_bits(vpanel->ib2_map,
IB2_CTRL,
IB2_CTRL_LCD_MASK,
IB2_CTRL_LCD_SD);
}
/* If we're on an IB2 daughterboard, turn on display */ if (vpanel->ib2_map) {
dev_dbg(vpanel->dev, "enable IB2 display\n");
regmap_update_bits(vpanel->ib2_map,
IB2_CTRL,
IB2_CTRL_LCD_MASK,
IB2_CTRL_LCD_BL_ON);
}
/* Check if the panel is mounted on an IB2 daughterboard */ if (vpanel->panel_type->ib2) {
vpanel->ib2_map = syscon_regmap_lookup_by_compatible( "arm,versatile-ib2-syscon"); if (IS_ERR(vpanel->ib2_map))
vpanel->ib2_map = NULL; else
dev_info(dev, "panel mounted on IB2 daughterboard\n");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.