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 #include "accelerant.h" 15 16 17 // From the VESA DisplayPort spec 18 // TODO: may want to move these into common code 19 #define AUX_NATIVE_WRITE 0x8 20 #define AUX_NATIVE_READ 0x9 21 #define AUX_I2C_WRITE 0x0 22 #define AUX_I2C_READ 0x1 23 #define AUX_I2C_STATUS 0x2 24 #define AUX_I2C_MOT 0x4 25 26 #define AUX_NATIVE_REPLY_ACK (0x0 << 4) 27 #define AUX_NATIVE_REPLY_NACK (0x1 << 4) 28 #define AUX_NATIVE_REPLY_DEFER (0x2 << 4) 29 #define AUX_NATIVE_REPLY_MASK (0x3 << 4) 30 31 #define AUX_I2C_REPLY_ACK (0x0 << 6) 32 #define AUX_I2C_REPLY_NACK (0x1 << 6) 33 #define AUX_I2C_REPLY_DEFER (0x2 << 6) 34 #define AUX_I2C_REPLY_MASK (0x3 << 6) 35 36 37 // convert radeon connector to common connector type 38 const int connector_convert_legacy[] = { 39 VIDEO_CONNECTOR_UNKNOWN, 40 VIDEO_CONNECTOR_VGA, 41 VIDEO_CONNECTOR_DVII, 42 VIDEO_CONNECTOR_DVID, 43 VIDEO_CONNECTOR_DVIA, 44 VIDEO_CONNECTOR_SVIDEO, 45 VIDEO_CONNECTOR_COMPOSITE, 46 VIDEO_CONNECTOR_LVDS, 47 VIDEO_CONNECTOR_UNKNOWN, 48 VIDEO_CONNECTOR_UNKNOWN, 49 VIDEO_CONNECTOR_HDMIA, 50 VIDEO_CONNECTOR_HDMIB, 51 VIDEO_CONNECTOR_UNKNOWN, 52 VIDEO_CONNECTOR_UNKNOWN, 53 VIDEO_CONNECTOR_9DIN, 54 VIDEO_CONNECTOR_DP 55 }; 56 57 const int connector_convert[] = { 58 VIDEO_CONNECTOR_UNKNOWN, 59 VIDEO_CONNECTOR_DVII, 60 VIDEO_CONNECTOR_DVII, 61 VIDEO_CONNECTOR_DVID, 62 VIDEO_CONNECTOR_DVID, 63 VIDEO_CONNECTOR_VGA, 64 VIDEO_CONNECTOR_COMPOSITE, 65 VIDEO_CONNECTOR_SVIDEO, 66 VIDEO_CONNECTOR_UNKNOWN, 67 VIDEO_CONNECTOR_UNKNOWN, 68 VIDEO_CONNECTOR_9DIN, 69 VIDEO_CONNECTOR_UNKNOWN, 70 VIDEO_CONNECTOR_HDMIA, 71 VIDEO_CONNECTOR_HDMIB, 72 VIDEO_CONNECTOR_LVDS, 73 VIDEO_CONNECTOR_9DIN, 74 VIDEO_CONNECTOR_UNKNOWN, 75 VIDEO_CONNECTOR_UNKNOWN, 76 VIDEO_CONNECTOR_UNKNOWN, 77 VIDEO_CONNECTOR_DP, 78 VIDEO_CONNECTOR_EDP, 79 VIDEO_CONNECTOR_UNKNOWN 80 }; 81 82 83 int dp_aux_write(uint32 hwLine, uint16 address, uint8* send, 84 uint8 sendBytes, uint8 delay); 85 int dp_aux_read(uint32 hwLine, uint16 address, uint8* recv, 86 int recvBytes, uint8 delay); 87 status_t dp_aux_set_i2c_byte(uint32 hwLine, uint16 address, 88 uint8* data, bool end); 89 status_t dp_aux_get_i2c_byte(uint32 hwLine, uint16 address, 90 uint8* data, bool end); 91 92 93 status_t gpio_probe(); 94 status_t connector_attach_gpio(uint32 id, uint8 hw_line); 95 bool connector_read_edid(uint32 connector, edid1_info* edid); 96 status_t connector_probe(); 97 status_t connector_probe_legacy(); 98 void debug_connectors(); 99 100 101 #endif /* RADEON_HD_CONNECTOR_H */ 102