1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2014 Google Inc.
9 #include <linux/types.h>
12 struct display_timing;
15 * Display uclass platform data for each device
17 * @source_id: ID for the source of the display data, typically a video
19 * @src_dev: Source device providing the video
20 * @in_use: Display is being used
24 struct udevice *src_dev;
29 * display_read_timing() - Read timing information
31 * @dev: Device to read from
32 * Return: 0 if OK, -ve on error
34 int display_read_timing(struct udevice *dev, struct display_timing *timing);
37 * display_port_enable() - Enable a display port device
39 * @dev: Device to enable
40 * @panel_bpp: Number of bits per pixel for panel
41 * @timing: Display timings
42 * Return: 0 if OK, -ve on error
44 int display_enable(struct udevice *dev, int panel_bpp,
45 const struct display_timing *timing);
48 * display_in_use() - Check if a display is in use by any device
50 * Return: true if the device is in use (display_enable() has been called
51 * successfully), else false
53 bool display_in_use(struct udevice *dev);
55 struct dm_display_ops {
57 * read_timing() - Read information directly
59 * @dev: Device to read from
60 * @timing: Display timings
61 * @return 0 if OK, -ve on error
63 int (*read_timing)(struct udevice *dev, struct display_timing *timing);
66 * read_edid() - Read information from EDID
68 * @dev: Device to read from
69 * @buf: Buffer to read into (should be EDID_SIZE bytes)
70 * @buf_size: Buffer size (should be EDID_SIZE)
71 * @return number of bytes read, <=0 for error
73 int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
76 * enable() - Enable the display port device
78 * @dev: Device to enable
79 * @panel_bpp: Number of bits per pixel for panel
80 * @timing: Display timings
81 * @return 0 if OK, -ve on error
83 int (*enable)(struct udevice *dev, int panel_bpp,
84 const struct display_timing *timing);
87 * mode_valid() - Check if mode is supported
89 * @dev: Device to enable
90 * @timing: Display timings
91 * @return true if supported, false if not
93 bool (*mode_valid)(struct udevice *dev,
94 const struct display_timing *timing);
97 #define display_get_ops(dev) ((struct dm_display_ops *)(dev)->driver->ops)