xref: /linux/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dcb.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: MIT */
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 
16 struct dcb_output {
17 	int index;	/* may not be raw dcb index if merging has happened */
18 	u16 hasht;
19 	u16 hashm;
20 	enum dcb_output_type type;
21 	uint8_t i2c_index;
22 	uint8_t heads;
23 	uint8_t connector;
24 	uint8_t bus;
25 	uint8_t location;
26 	uint8_t or;
27 	uint8_t link;
28 	bool duallink_possible;
29 	uint8_t extdev;
30 	union {
31 		struct sor_conf {
32 			int link;
33 		} sorconf;
34 		struct {
35 			int maxfreq;
36 		} crtconf;
37 		struct {
38 			struct sor_conf sor;
39 			bool use_straps_for_mode;
40 			bool use_acpi_for_edid;
41 			bool use_power_scripts;
42 		} lvdsconf;
43 		struct {
44 			bool has_component_output;
45 		} tvconf;
46 		struct {
47 			struct sor_conf sor;
48 			int link_nr;
49 			int link_bw;
50 		} dpconf;
51 		struct {
52 			struct sor_conf sor;
53 			int slave_addr;
54 		} tmdsconf;
55 	};
56 	bool i2c_upper_default;
57 	int id;
58 };
59 
60 u16 dcb_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *ent, u8 *len);
61 u16 dcb_outp(struct nvkm_bios *, u8 idx, u8 *ver, u8 *len);
62 u16 dcb_outp_parse(struct nvkm_bios *, u8 idx, u8 *, u8 *,
63 		   struct dcb_output *);
64 u16 dcb_outp_match(struct nvkm_bios *, u16 type, u16 mask, u8 *, u8 *,
65 		   struct dcb_output *);
66 int dcb_outp_foreach(struct nvkm_bios *, void *data, int (*exec)
67 		     (struct nvkm_bios *, void *, int index, u16 entry));
68 #endif
69