]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/display.h
arc/cache: really do invalidate_dcache_all() even if IOC exists
[people/ms/u-boot.git] / include / display.h
CommitLineData
51f2c99e
SG
1/*
2 * Copyright 2014 Google Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
2dcf1433
SG
7#ifndef _DISPLAY_H
8#define _DISPLAY_H
51f2c99e
SG
9
10struct udevice;
11struct display_timing;
12
13/**
2dcf1433
SG
14 * Display uclass platform data for each device
15 *
16 * @source_id: ID for the source of the display data, typically a video
17 * controller
18 * @src_dev: Source device providing the video
19 */
20struct display_plat {
21 int source_id;
22 struct udevice *src_dev;
23};
24
25/**
eab314f5 26 * display_read_timing() - Read timing information
51f2c99e
SG
27 *
28 * @dev: Device to read from
2dcf1433 29 * @return 0 if OK, -ve on error
51f2c99e 30 */
2dcf1433 31int display_read_timing(struct udevice *dev, struct display_timing *timing);
51f2c99e
SG
32
33/**
34 * display_port_enable() - Enable a display port device
35 *
36 * @dev: Device to enable
37 * @panel_bpp: Number of bits per pixel for panel
38 * @timing: Display timings
39 * @return 0 if OK, -ve on error
40 */
2dcf1433
SG
41int display_enable(struct udevice *dev, int panel_bpp,
42 const struct display_timing *timing);
51f2c99e 43
2dcf1433 44struct dm_display_ops {
eab314f5
JC
45 /**
46 * read_timing() - Read information directly
47 *
48 * @dev: Device to read from
49 * @timing: Display timings
50 * @return 0 if OK, -ve on error
51 */
52 int (*read_timing)(struct udevice *dev, struct display_timing *timing);
53
51f2c99e
SG
54 /**
55 * read_edid() - Read information from EDID
56 *
57 * @dev: Device to read from
58 * @buf: Buffer to read into (should be EDID_SIZE bytes)
59 * @buf_size: Buffer size (should be EDID_SIZE)
60 * @return number of bytes read, <=0 for error
61 */
62 int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
63
64 /**
65 * enable() - Enable the display port device
66 *
67 * @dev: Device to enable
68 * @panel_bpp: Number of bits per pixel for panel
69 * @timing: Display timings
70 * @return 0 if OK, -ve on error
71 */
72 int (*enable)(struct udevice *dev, int panel_bpp,
73 const struct display_timing *timing);
74};
75
2dcf1433 76#define display_get_ops(dev) ((struct dm_display_ops *)(dev)->driver->ops)
51f2c99e
SG
77
78#endif