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