displayport.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2014 Google Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef _DISPLAYPORT_H
  7. #define _DISPLAYPORT_H
  8. struct udevice;
  9. struct display_timing;
  10. /**
  11. * display_port_read_edid() - Read information from EDID
  12. *
  13. * @dev: Device to read from
  14. * @buf: Buffer to read into (should be EDID_SIZE bytes)
  15. * @buf_size: Buffer size (should be EDID_SIZE)
  16. * @return number of bytes read, <=0 for error
  17. */
  18. int display_port_read_edid(struct udevice *dev, u8 *buf, int buf_size);
  19. /**
  20. * display_port_enable() - Enable a display port device
  21. *
  22. * @dev: Device to enable
  23. * @panel_bpp: Number of bits per pixel for panel
  24. * @timing: Display timings
  25. * @return 0 if OK, -ve on error
  26. */
  27. int display_port_enable(struct udevice *dev, int panel_bpp,
  28. const struct display_timing *timing);
  29. struct dm_display_port_ops {
  30. /**
  31. * read_edid() - Read information from EDID
  32. *
  33. * @dev: Device to read from
  34. * @buf: Buffer to read into (should be EDID_SIZE bytes)
  35. * @buf_size: Buffer size (should be EDID_SIZE)
  36. * @return number of bytes read, <=0 for error
  37. */
  38. int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
  39. /**
  40. * enable() - Enable the display port device
  41. *
  42. * @dev: Device to enable
  43. * @panel_bpp: Number of bits per pixel for panel
  44. * @timing: Display timings
  45. * @return 0 if OK, -ve on error
  46. */
  47. int (*enable)(struct udevice *dev, int panel_bpp,
  48. const struct display_timing *timing);
  49. };
  50. #define display_port_get_ops(dev) \
  51. ((struct dm_display_port_ops *)(dev)->driver->ops)
  52. #endif