backlight-uclass.c 445 B

12345678910111213141516171819202122232425
  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. #include <common.h>
  8. #include <dm.h>
  9. #include <backlight.h>
  10. int backlight_enable(struct udevice *dev)
  11. {
  12. const struct backlight_ops *ops = backlight_get_ops(dev);
  13. if (!ops->enable)
  14. return -ENOSYS;
  15. return ops->enable(dev);
  16. }
  17. UCLASS_DRIVER(backlight) = {
  18. .id = UCLASS_PANEL_BACKLIGHT,
  19. .name = "backlight",
  20. };