xref: /haiku/src/add-ons/accelerants/radeon_hd/connector.h (revision 60b7d1defbf486d4f77a2edaef21095fac407376)
1 /*
2  * Copyright 2006-2011, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Alexander von Gluck, kallisti5@unixzen.com
7  */
8 #ifndef RADEON_HD_CONNECTOR_H
9 #define RADEON_HD_CONNECTOR_H
10 
11 
12 #include <video_configuration.h>
13 
14 
15 // From the VESA DisplayPort spec
16 // TODO: may want to move these into common code
17 #define AUX_NATIVE_WRITE        0x8
18 #define AUX_NATIVE_READ         0x9
19 #define AUX_I2C_WRITE           0x0
20 #define AUX_I2C_READ            0x1
21 #define AUX_I2C_STATUS          0x2
22 #define AUX_I2C_MOT             0x4
23 
24 #define AUX_NATIVE_REPLY_ACK    (0x0 << 4)
25 #define AUX_NATIVE_REPLY_NACK   (0x1 << 4)
26 #define AUX_NATIVE_REPLY_DEFER  (0x2 << 4)
27 #define AUX_NATIVE_REPLY_MASK   (0x3 << 4)
28 
29 #define AUX_I2C_REPLY_ACK       (0x0 << 6)
30 #define AUX_I2C_REPLY_NACK      (0x1 << 6)
31 #define AUX_I2C_REPLY_DEFER     (0x2 << 6)
32 #define AUX_I2C_REPLY_MASK      (0x3 << 6)
33 
34 
35 // convert radeon connector to common connector type
36 const int connector_convert_legacy[] = {
37 	VIDEO_CONNECTOR_UNKNOWN,
38 	VIDEO_CONNECTOR_VGA,
39 	VIDEO_CONNECTOR_DVII,
40 	VIDEO_CONNECTOR_DVID,
41 	VIDEO_CONNECTOR_DVIA,
42 	VIDEO_CONNECTOR_SVIDEO,
43 	VIDEO_CONNECTOR_COMPOSITE,
44 	VIDEO_CONNECTOR_LVDS,
45 	VIDEO_CONNECTOR_UNKNOWN,
46 	VIDEO_CONNECTOR_UNKNOWN,
47 	VIDEO_CONNECTOR_HDMIA,
48 	VIDEO_CONNECTOR_HDMIB,
49 	VIDEO_CONNECTOR_UNKNOWN,
50 	VIDEO_CONNECTOR_UNKNOWN,
51 	VIDEO_CONNECTOR_9DIN,
52 	VIDEO_CONNECTOR_DP
53 };
54 
55 const int connector_convert[] = {
56 	VIDEO_CONNECTOR_UNKNOWN,
57 	VIDEO_CONNECTOR_DVII,
58 	VIDEO_CONNECTOR_DVII,
59 	VIDEO_CONNECTOR_DVID,
60 	VIDEO_CONNECTOR_DVID,
61 	VIDEO_CONNECTOR_VGA,
62 	VIDEO_CONNECTOR_COMPOSITE,
63 	VIDEO_CONNECTOR_SVIDEO,
64 	VIDEO_CONNECTOR_UNKNOWN,
65 	VIDEO_CONNECTOR_UNKNOWN,
66 	VIDEO_CONNECTOR_9DIN,
67 	VIDEO_CONNECTOR_UNKNOWN,
68 	VIDEO_CONNECTOR_HDMIA,
69 	VIDEO_CONNECTOR_HDMIB,
70 	VIDEO_CONNECTOR_LVDS,
71 	VIDEO_CONNECTOR_9DIN,
72 	VIDEO_CONNECTOR_UNKNOWN,
73 	VIDEO_CONNECTOR_UNKNOWN,
74 	VIDEO_CONNECTOR_UNKNOWN,
75 	VIDEO_CONNECTOR_DP,
76 	VIDEO_CONNECTOR_EDP,
77 	VIDEO_CONNECTOR_UNKNOWN
78 };
79 
80 
81 int dp_aux_write(uint32 hwLine, uint16 address, uint8 *send,
82 	uint8 sendBytes, uint8 delay);
83 int dp_aux_read(uint32 hwLine, uint16 address, uint8 *recv,
84 	int recvBytes, uint8 delay);
85 status_t dp_aux_set_i2c_byte(uint32 hwLine, uint16 address,
86 	uint8* data, bool end);
87 status_t dp_aux_get_i2c_byte(uint32 hwLine, uint16 address,
88 	uint8* data, bool end);
89 
90 
91 status_t gpio_probe();
92 status_t connector_attach_gpio(uint32 id, uint8 hw_line);
93 bool connector_read_edid(uint32 connector, edid1_info *edid);
94 status_t connector_probe();
95 status_t connector_probe_legacy();
96 void debug_connectors();
97 
98 
99 #endif /* RADEON_HD_CONNECTOR_H */
100