blob: f7c7e2528524d16516bf4527eecca3db14a4a80c [file] [log] [blame]
Simon Glass51f2c992015-04-14 21:03:38 -06001/*
2 * Copyright 2014 Google Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef _DISPLAYPORT_H
8#define _DISPLAYPORT_H
9
10struct udevice;
11struct display_timing;
12
13/**
14 * display_port_read_edid() - Read information from EDID
15 *
16 * @dev: Device to read from
17 * @buf: Buffer to read into (should be EDID_SIZE bytes)
18 * @buf_size: Buffer size (should be EDID_SIZE)
19 * @return number of bytes read, <=0 for error
20 */
21int display_port_read_edid(struct udevice *dev, u8 *buf, int buf_size);
22
23/**
24 * display_port_enable() - Enable a display port device
25 *
26 * @dev: Device to enable
27 * @panel_bpp: Number of bits per pixel for panel
28 * @timing: Display timings
29 * @return 0 if OK, -ve on error
30 */
31int display_port_enable(struct udevice *dev, int panel_bpp,
32 const struct display_timing *timing);
33
34struct dm_display_port_ops {
35 /**
36 * read_edid() - Read information from EDID
37 *
38 * @dev: Device to read from
39 * @buf: Buffer to read into (should be EDID_SIZE bytes)
40 * @buf_size: Buffer size (should be EDID_SIZE)
41 * @return number of bytes read, <=0 for error
42 */
43 int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
44
45 /**
46 * enable() - Enable the display port device
47 *
48 * @dev: Device to enable
49 * @panel_bpp: Number of bits per pixel for panel
50 * @timing: Display timings
51 * @return 0 if OK, -ve on error
52 */
53 int (*enable)(struct udevice *dev, int panel_bpp,
54 const struct display_timing *timing);
55};
56
57#define display_port_get_ops(dev) \
58 ((struct dm_display_port_ops *)(dev)->driver->ops)
59
60#endif