1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
7 #define LOG_CATEGORY UCLASS_PANEL
13 int panel_enable_backlight(struct udevice *dev)
15 struct panel_ops *ops = panel_get_ops(dev);
17 if (!ops->enable_backlight)
20 return ops->enable_backlight(dev);
24 * panel_set_backlight - Set brightness for the panel backlight
26 * @dev: Panel device containing the backlight to update
27 * @percent: Brightness value (0=off, 1=min brightness,
28 * 100=full brightness)
29 * @return 0 if OK, -ve on error
31 int panel_set_backlight(struct udevice *dev, int percent)
33 struct panel_ops *ops = panel_get_ops(dev);
35 if (!ops->set_backlight)
38 return ops->set_backlight(dev, percent);
41 int panel_get_display_timing(struct udevice *dev,
42 struct display_timing *timings)
44 struct panel_ops *ops = panel_get_ops(dev);
46 if (!ops->get_display_timing)
49 return ops->get_display_timing(dev, timings);
52 UCLASS_DRIVER(panel) = {