summaryrefslogtreecommitdiff
path: root/drivers/video/backlight-uclass.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight-uclass.c')
-rw-r--r--drivers/video/backlight-uclass.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/video/backlight-uclass.c b/drivers/video/backlight-uclass.c
new file mode 100644
index 0000000000..0238289d1b
--- /dev/null
+++ b/drivers/video/backlight-uclass.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <backlight.h>
+
+int backlight_enable(struct udevice *dev)
+{
+ const struct backlight_ops *ops = backlight_get_ops(dev);
+
+ if (!ops->enable)
+ return -ENOSYS;
+
+ return ops->enable(dev);
+}
+
+UCLASS_DRIVER(backlight) = {
+ .id = UCLASS_PANEL_BACKLIGHT,
+ .name = "backlight",
+};