Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | f563dc1 | 2016-01-21 19:44:58 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2016 Google, Inc |
| 4 | * Written by Simon Glass <sjg@chromium.org> |
Simon Glass | f563dc1 | 2016-01-21 19:44:58 -0700 | [diff] [blame] | 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); |
Simon Glass | a4f737a | 2018-10-01 12:22:41 -0600 | [diff] [blame] | 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 | |
Yannick Fertré | 28576f8 | 2018-07-13 14:11:09 +0200 | [diff] [blame] | 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); |
Simon Glass | f563dc1 | 2016-01-21 19:44:58 -0700 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | #define panel_get_ops(dev) ((struct panel_ops *)(dev)->driver->ops) |
| 40 | |
| 41 | /** |
Simon Glass | a4f737a | 2018-10-01 12:22:41 -0600 | [diff] [blame] | 42 | * panel_enable_backlight() - Enable/disable the panel backlight |
Simon Glass | f563dc1 | 2016-01-21 19:44:58 -0700 | [diff] [blame] | 43 | * |
| 44 | * @dev: Panel device containing the backlight to enable |
Simon Glass | a4f737a | 2018-10-01 12:22:41 -0600 | [diff] [blame] | 45 | * @enable: true to enable the backlight, false to dis |
Heinrich Schuchardt | 185f812 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 46 | * Return: 0 if OK, -ve on error |
Simon Glass | f563dc1 | 2016-01-21 19:44:58 -0700 | [diff] [blame] | 47 | */ |
| 48 | int panel_enable_backlight(struct udevice *dev); |
| 49 | |
Yannick Fertré | 28576f8 | 2018-07-13 14:11:09 +0200 | [diff] [blame] | 50 | /** |
Simon Glass | a4f737a | 2018-10-01 12:22:41 -0600 | [diff] [blame] | 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) |
Heinrich Schuchardt | 185f812 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 55 | * Return: 0 if OK, -ve on error |
Simon Glass | a4f737a | 2018-10-01 12:22:41 -0600 | [diff] [blame] | 56 | */ |
| 57 | int panel_set_backlight(struct udevice *dev, int percent); |
| 58 | |
| 59 | /** |
Yannick Fertré | 28576f8 | 2018-07-13 14:11:09 +0200 | [diff] [blame] | 60 | * panel_get_display_timing() - Get display timings from panel. |
| 61 | * |
| 62 | * @dev: Panel device containing the display timings |
Heinrich Schuchardt | 185f812 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 63 | * Return: 0 if OK, -ve on error |
Yannick Fertré | 28576f8 | 2018-07-13 14:11:09 +0200 | [diff] [blame] | 64 | */ |
| 65 | int panel_get_display_timing(struct udevice *dev, |
| 66 | struct display_timing *timing); |
| 67 | |
Simon Glass | f563dc1 | 2016-01-21 19:44:58 -0700 | [diff] [blame] | 68 | #endif |