2 * Copyright 2014 Google Inc.
4 * SPDX-License-Identifier: GPL-2.0+
11 struct display_timing;
14 * Display uclass platform data for each device
16 * @source_id: ID for the source of the display data, typically a video
18 * @src_dev: Source device providing the video
19 * @in_use: Display is being used
23 struct udevice *src_dev;
28 * display_read_timing() - Read timing information
30 * @dev: Device to read from
31 * @return 0 if OK, -ve on error
33 int display_read_timing(struct udevice *dev, struct display_timing *timing);
36 * display_port_enable() - Enable a display port device
38 * @dev: Device to enable
39 * @panel_bpp: Number of bits per pixel for panel
40 * @timing: Display timings
41 * @return 0 if OK, -ve on error
43 int display_enable(struct udevice *dev, int panel_bpp,
44 const struct display_timing *timing);
47 * display_in_use() - Check if a display is in use by any device
49 * @return true if the device is in use (display_enable() has been called
50 * successfully), else false
52 bool display_in_use(struct udevice *dev);
54 struct dm_display_ops {
56 * read_timing() - Read information directly
58 * @dev: Device to read from
59 * @timing: Display timings
60 * @return 0 if OK, -ve on error
62 int (*read_timing)(struct udevice *dev, struct display_timing *timing);
65 * read_edid() - Read information from EDID
67 * @dev: Device to read from
68 * @buf: Buffer to read into (should be EDID_SIZE bytes)
69 * @buf_size: Buffer size (should be EDID_SIZE)
70 * @return number of bytes read, <=0 for error
72 int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
75 * enable() - Enable the display port device
77 * @dev: Device to enable
78 * @panel_bpp: Number of bits per pixel for panel
79 * @timing: Display timings
80 * @return 0 if OK, -ve on error
82 int (*enable)(struct udevice *dev, int panel_bpp,
83 const struct display_timing *timing);
86 #define display_get_ops(dev) ((struct dm_display_ops *)(dev)->driver->ops)