diff options
| author | Tom Rini <[email protected]> | 2026-01-16 09:07:35 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-01-16 09:53:57 -0600 |
| commit | 03893b263a64b06ef06769b5526918fabd7a774f (patch) | |
| tree | 14e202681bd943ea9c529035b1c1e70a07faea21 /include | |
| parent | cb1d775d253c84a0eee0db94d8bf4145d9fd7bd3 (diff) | |
| parent | de3f687e6e85ab07be4488a2ccfb5077da121652 (diff) | |
Merge patch series "video: simple_panel support for am335x evm panel"
Markus Schneider-Pargmann (TI.com) <[email protected]> says:
This series adds the capability to define hardcoded panel settings to
the simple_panel driver similar to the Linux Kernel and adds the panel
used on am335x evm. panel-uclass.c is extended to support get_modes()
for panels and drm_display_mode conversion. In a second step the tilcdc
is extended to support OF graph to be able to connect to the simple
panel devicetree node.
Link: https://lore.kernel.org/r/20260105-topic-am33-evm-lcd-v2026-01-v4-0-7617591b8159@baylibre.com
Diffstat (limited to 'include')
| -rw-r--r-- | include/panel.h | 72 |
1 files changed, 71 insertions, 1 deletions
diff --git a/include/panel.h b/include/panel.h index ab417bc91ed..8d46fb26a07 100644 --- a/include/panel.h +++ b/include/panel.h @@ -7,6 +7,62 @@ #ifndef _PANEL_H #define _PANEL_H +#include <video.h> +#include <fdtdec.h> + +/* DRM mode flags mapped to U-Boot DISPLAY_FLAGS for direct compatibility */ +#define DRM_MODE_FLAG_NHSYNC DISPLAY_FLAGS_HSYNC_LOW +#define DRM_MODE_FLAG_PHSYNC DISPLAY_FLAGS_HSYNC_HIGH +#define DRM_MODE_FLAG_NVSYNC DISPLAY_FLAGS_VSYNC_LOW +#define DRM_MODE_FLAG_PVSYNC DISPLAY_FLAGS_VSYNC_HIGH +#define DRM_MODE_FLAG_INTERLACE DISPLAY_FLAGS_INTERLACED +#define DRM_MODE_FLAG_DBLSCAN DISPLAY_FLAGS_DOUBLESCAN +#define DRM_MODE_FLAG_DBLCLK DISPLAY_FLAGS_DOUBLECLK + +/** + * struct drm_display_mode - DRM kernel-internal display mode structure + * simplified for U-Boot + * @hdisplay: horizontal display size + * @hsync_start: horizontal sync start + * @hsync_end: horizontal sync end + * @htotal: horizontal total size + * @vdisplay: vertical display size + * @vsync_start: vertical sync start + * @vsync_end: vertical sync end + * @vtotal: vertical total size + * + * The horizontal and vertical timings are defined per the following diagram. + * + * :: + * + * + * Active Front Sync Back + * Region Porch Porch + * <-----------------------><----------------><-------------><--------------> + * //////////////////////| + * ////////////////////// | + * ////////////////////// |.................. ................ + * _______________ + * <----- [hv]display -----> + * <------------- [hv]sync_start ------------> + * <--------------------- [hv]sync_end ---------------------> + * <-------------------------------- [hv]total ----------------------------->* + */ +struct drm_display_mode { + unsigned int clock; /* in kHz */ + + u16 hdisplay; + u16 hsync_start; + u16 hsync_end; + u16 htotal; + u16 vdisplay; + u16 vsync_start; + u16 vsync_end; + u16 vtotal; + + u32 flags; +}; + struct panel_ops { /** * enable_backlight() - Enable the panel backlight @@ -29,11 +85,24 @@ struct panel_ops { * get_timings() - Get display timings from panel. * * @dev: Panel device containing the display timings - * @tim: Place to put timings + * @timing: Pointer to the timing for storing * @return 0 if OK, -ve on error */ int (*get_display_timing)(struct udevice *dev, struct display_timing *timing); + + /** + * get_modes() - Get display modes from panel + * + * Returns an array of display modes supported by the panel. + * Similar to Linux's drm_panel_funcs->get_modes(). + * + * @dev: Panel device + * @modes: Pointer to an array of modes + * @return number of modes if OK, -ve on error + */ + int (*get_modes)(struct udevice *dev, + const struct drm_display_mode **modes); }; #define panel_get_ops(dev) ((struct panel_ops *)(dev)->driver->ops) @@ -60,6 +129,7 @@ int panel_set_backlight(struct udevice *dev, int percent); * panel_get_display_timing() - Get display timings from panel. * * @dev: Panel device containing the display timings + * @timing: Pointer to the timing for storing * Return: 0 if OK, -ve on error */ int panel_get_display_timing(struct udevice *dev, |
