dcb.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __NVBIOS_DCB_H__
  3. #define __NVBIOS_DCB_H__
  4. enum dcb_output_type {
  5. DCB_OUTPUT_ANALOG = 0x0,
  6. DCB_OUTPUT_TV = 0x1,
  7. DCB_OUTPUT_TMDS = 0x2,
  8. DCB_OUTPUT_LVDS = 0x3,
  9. DCB_OUTPUT_DP = 0x6,
  10. DCB_OUTPUT_WFD = 0x8,
  11. DCB_OUTPUT_EOL = 0xe,
  12. DCB_OUTPUT_UNUSED = 0xf,
  13. DCB_OUTPUT_ANY = -1,
  14. };
  15. struct dcb_output {
  16. int index; /* may not be raw dcb index if merging has happened */
  17. u16 hasht;
  18. u16 hashm;
  19. enum dcb_output_type type;
  20. uint8_t i2c_index;
  21. uint8_t heads;
  22. uint8_t connector;
  23. uint8_t bus;
  24. uint8_t location;
  25. uint8_t or;
  26. uint8_t link;
  27. bool duallink_possible;
  28. uint8_t extdev;
  29. union {
  30. struct sor_conf {
  31. int link;
  32. } sorconf;
  33. struct {
  34. int maxfreq;
  35. } crtconf;
  36. struct {
  37. struct sor_conf sor;
  38. bool use_straps_for_mode;
  39. bool use_acpi_for_edid;
  40. bool use_power_scripts;
  41. } lvdsconf;
  42. struct {
  43. bool has_component_output;
  44. } tvconf;
  45. struct {
  46. struct sor_conf sor;
  47. int link_nr;
  48. int link_bw;
  49. } dpconf;
  50. struct {
  51. struct sor_conf sor;
  52. int slave_addr;
  53. } tmdsconf;
  54. };
  55. bool i2c_upper_default;
  56. };
  57. u16 dcb_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *ent, u8 *len);
  58. u16 dcb_outp(struct nvkm_bios *, u8 idx, u8 *ver, u8 *len);
  59. u16 dcb_outp_parse(struct nvkm_bios *, u8 idx, u8 *, u8 *,
  60. struct dcb_output *);
  61. u16 dcb_outp_match(struct nvkm_bios *, u16 type, u16 mask, u8 *, u8 *,
  62. struct dcb_output *);
  63. int dcb_outp_foreach(struct nvkm_bios *, void *data, int (*exec)
  64. (struct nvkm_bios *, void *, int index, u16 entry));
  65. #endif