]> Git Repo - J-u-boot.git/blame - drivers/video/backlight-uclass.c
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
[J-u-boot.git] / drivers / video / backlight-uclass.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
363bf77a
SG
2/*
3 * Copyright (c) 2016 Google, Inc
4 * Written by Simon Glass <[email protected]>
363bf77a
SG
5 */
6
7#include <common.h>
8#include <dm.h>
9#include <backlight.h>
10
11int backlight_enable(struct udevice *dev)
12{
13 const struct backlight_ops *ops = backlight_get_ops(dev);
14
15 if (!ops->enable)
16 return -ENOSYS;
17
18 return ops->enable(dev);
19}
20
a4f737a9
SG
21int backlight_set_brightness(struct udevice *dev, int percent)
22{
23 const struct backlight_ops *ops = backlight_get_ops(dev);
24
25 if (!ops->set_brightness)
26 return -ENOSYS;
27
28 return ops->set_brightness(dev, percent);
29}
30
363bf77a
SG
31UCLASS_DRIVER(backlight) = {
32 .id = UCLASS_PANEL_BACKLIGHT,
33 .name = "backlight",
34};
This page took 0.238572 seconds and 4 git commands to generate.