dp-uclass.c 742 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright 2014 Google Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <dm.h>
  8. #include <displayport.h>
  9. #include <errno.h>
  10. int display_port_read_edid(struct udevice *dev, u8 *buf, int buf_size)
  11. {
  12. struct dm_display_port_ops *ops = display_port_get_ops(dev);
  13. if (!ops || !ops->read_edid)
  14. return -ENOSYS;
  15. return ops->read_edid(dev, buf, buf_size);
  16. }
  17. int display_port_enable(struct udevice *dev, int panel_bpp,
  18. const struct display_timing *timing)
  19. {
  20. struct dm_display_port_ops *ops = display_port_get_ops(dev);
  21. if (!ops || !ops->enable)
  22. return -ENOSYS;
  23. return ops->enable(dev, panel_bpp, timing);
  24. }
  25. UCLASS_DRIVER(display_port) = {
  26. .id = UCLASS_DISPLAY_PORT,
  27. .name = "display_port",
  28. };