blob: ab417bc91ed1d23aadc64e861bb721418199fb0f [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glassf563dc12016-01-21 19:44:58 -07002/*
3 * Copyright (c) 2016 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
Simon Glassf563dc12016-01-21 19:44:58 -07005 */
6
7#ifndef _PANEL_H
8#define _PANEL_H
9
10struct 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 Glassa4f737a2018-10-01 12:22:41 -060018
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é28576f82018-07-13 14:11:09 +020028 /**
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 Glassf563dc12016-01-21 19:44:58 -070037};
38
39#define panel_get_ops(dev) ((struct panel_ops *)(dev)->driver->ops)
40
41/**
Simon Glassa4f737a2018-10-01 12:22:41 -060042 * panel_enable_backlight() - Enable/disable the panel backlight
Simon Glassf563dc12016-01-21 19:44:58 -070043 *
44 * @dev: Panel device containing the backlight to enable
Simon Glassa4f737a2018-10-01 12:22:41 -060045 * @enable: true to enable the backlight, false to dis
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010046 * Return: 0 if OK, -ve on error
Simon Glassf563dc12016-01-21 19:44:58 -070047 */
48int panel_enable_backlight(struct udevice *dev);
49
Yannick Fertré28576f82018-07-13 14:11:09 +020050/**
Simon Glassa4f737a2018-10-01 12:22:41 -060051 * 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 Schuchardt185f8122022-01-19 18:05:50 +010055 * Return: 0 if OK, -ve on error
Simon Glassa4f737a2018-10-01 12:22:41 -060056 */
57int panel_set_backlight(struct udevice *dev, int percent);
58
59/**
Yannick Fertré28576f82018-07-13 14:11:09 +020060 * panel_get_display_timing() - Get display timings from panel.
61 *
62 * @dev: Panel device containing the display timings
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010063 * Return: 0 if OK, -ve on error
Yannick Fertré28576f82018-07-13 14:11:09 +020064 */
65int panel_get_display_timing(struct udevice *dev,
66 struct display_timing *timing);
67
Simon Glassf563dc12016-01-21 19:44:58 -070068#endif