]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
f563dc1d SG |
2 | /* |
3 | * Copyright (c) 2016 Google, Inc | |
4 | * Written by Simon Glass <[email protected]> | |
f563dc1d SG |
5 | */ |
6 | ||
7 | #ifndef _PANEL_H | |
8 | #define _PANEL_H | |
9 | ||
10 | struct panel_ops { | |
11 | /** | |
12 | * enable_backlight() - Enable the panel backlight | |
13 | * | |
14 | * @dev: Panel device containing the backlight to enable | |
15 | * @return 0 if OK, -ve on error | |
16 | */ | |
17 | int (*enable_backlight)(struct udevice *dev); | |
a4f737a9 SG |
18 | |
19 | /** | |
20 | * set_backlight - Set panel backlight brightness | |
21 | * | |
22 | * @dev: Panel device containing the backlight to update | |
23 | * @percent: Brightness value (0 to 100, or BACKLIGHT_... value) | |
24 | * @return 0 if OK, -ve on error | |
25 | */ | |
26 | int (*set_backlight)(struct udevice *dev, int percent); | |
27 | ||
28576f81 YF |
28 | /** |
29 | * get_timings() - Get display timings from panel. | |
30 | * | |
31 | * @dev: Panel device containing the display timings | |
32 | * @tim: Place to put timings | |
33 | * @return 0 if OK, -ve on error | |
34 | */ | |
35 | int (*get_display_timing)(struct udevice *dev, | |
36 | struct display_timing *timing); | |
f563dc1d SG |
37 | }; |
38 | ||
39 | #define panel_get_ops(dev) ((struct panel_ops *)(dev)->driver->ops) | |
40 | ||
41 | /** | |
a4f737a9 | 42 | * panel_enable_backlight() - Enable/disable the panel backlight |
f563dc1d SG |
43 | * |
44 | * @dev: Panel device containing the backlight to enable | |
a4f737a9 | 45 | * @enable: true to enable the backlight, false to dis |
f563dc1d SG |
46 | * @return 0 if OK, -ve on error |
47 | */ | |
48 | int panel_enable_backlight(struct udevice *dev); | |
49 | ||
a4f737a9 SG |
50 | /** |
51 | * panel_set_backlight - Set brightness for the panel backlight | |
52 | * | |
53 | * @dev: Panel device containing the backlight to update | |
54 | * @percent: Brightness value (0 to 100, or BACKLIGHT_... value) | |
55 | * @return 0 if OK, -ve on error | |
56 | */ | |
57 | int panel_set_backlight(struct udevice *dev, int percent); | |
58 | ||
28576f81 YF |
59 | /** |
60 | * panel_get_display_timing() - Get display timings from panel. | |
61 | * | |
62 | * @dev: Panel device containing the display timings | |
63 | * @return 0 if OK, -ve on error | |
64 | */ | |
65 | int panel_get_display_timing(struct udevice *dev, | |
66 | struct display_timing *timing); | |
67 | ||
f563dc1d | 68 | #endif |