1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2016 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
16 BACKLIGHT_DEFAULT = -2,
19 struct backlight_ops {
21 * enable() - Enable a backlight
23 * @dev: Backlight device to enable
24 * @return 0 if OK, -ve on error
26 int (*enable)(struct udevice *dev);
29 * set_brightness - Set brightness
31 * @dev: Backlight device to update
32 * @percent: Brightness value (0 to 100, or BACKLIGHT_... value)
33 * @return 0 if OK, -ve on error
35 int (*set_brightness)(struct udevice *dev, int percent);
38 #define backlight_get_ops(dev) ((struct backlight_ops *)(dev)->driver->ops)
41 * backlight_enable() - Enable a backlight
43 * @dev: Backlight device to enable
44 * @return 0 if OK, -ve on error
46 int backlight_enable(struct udevice *dev);
49 * backlight_set_brightness - Set brightness
51 * @dev: Backlight device to update
52 * @percent: Brightness value (0 to 100, or BACKLIGHT_... value)
53 * @return 0 if OK, -ve on error
55 int backlight_set_brightness(struct udevice *dev, int percent);