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 #include <common.h> 9 #include <dm.h> 10 #include <backlight.h> 11 backlight_enable(struct udevice * dev)12int backlight_enable(struct udevice *dev) 13 { 14 const struct backlight_ops *ops = backlight_get_ops(dev); 15 16 if (!ops->enable) 17 return -ENOSYS; 18 19 return ops->enable(dev); 20 } 21 backlight_disable(struct udevice * dev)22int backlight_disable(struct udevice *dev) 23 { 24 const struct backlight_ops *ops = backlight_get_ops(dev); 25 26 if (!ops->disable) 27 return -ENOSYS; 28 29 return ops->disable(dev); 30 } 31 32 UCLASS_DRIVER(backlight) = { 33 .id = UCLASS_PANEL_BACKLIGHT, 34 .name = "backlight", 35 }; 36