xref: /OK3568_Linux_fs/u-boot/include/backlight.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (c) 2016 Google, Inc
3  * Written by Simon Glass <sjg@chromium.org>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef _BACKLIGHT_H
9 #define _BACKLIGHT_H
10 
11 struct backlight_ops {
12 	/**
13 	 * enable() - Enable a backlight
14 	 *
15 	 * @dev:	Backlight device to enable
16 	 * @return 0 if OK, -ve on error
17 	 */
18 	int (*enable)(struct udevice *dev);
19 
20 	/**
21 	 * disable() - Disable a backlight
22 	 *
23 	 * @dev:	Backlight device to disable
24 	 * @return 0 if OK, -ve on error
25 	 */
26 	int (*disable)(struct udevice *dev);
27 };
28 
29 #define backlight_get_ops(dev)	((struct backlight_ops *)(dev)->driver->ops)
30 
31 /**
32  * backlight_enable() - Enable a backlight
33  *
34  * @dev:	Backlight device to enable
35  * @return 0 if OK, -ve on error
36  */
37 int backlight_enable(struct udevice *dev);
38 
39 /**
40  * backlight_disable() - Disable a backlight
41  *
42  * @dev:	Backlight device to disable
43  * @return 0 if OK, -ve on error
44  */
45 int backlight_disable(struct udevice *dev);
46 
47 #endif
48