ddk750_sii164.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #ifndef DDK750_SII164_H__
  2. #define DDK750_SII164_H__
  3. #define USE_DVICHIP
  4. /* Hot Plug detection mode structure */
  5. typedef enum _sii164_hot_plug_mode_t {
  6. SII164_HOTPLUG_DISABLE = 0, /* Disable Hot Plug output bit (always high). */
  7. SII164_HOTPLUG_USE_MDI, /* Use Monitor Detect Interrupt bit. */
  8. SII164_HOTPLUG_USE_RSEN, /* Use Receiver Sense detect bit. */
  9. SII164_HOTPLUG_USE_HTPLG /* Use Hot Plug detect bit. */
  10. } sii164_hot_plug_mode_t;
  11. /* Silicon Image SiI164 chip prototype */
  12. long sii164InitChip(
  13. unsigned char edgeSelect,
  14. unsigned char busSelect,
  15. unsigned char dualEdgeClkSelect,
  16. unsigned char hsyncEnable,
  17. unsigned char vsyncEnable,
  18. unsigned char deskewEnable,
  19. unsigned char deskewSetting,
  20. unsigned char continuousSyncEnable,
  21. unsigned char pllFilterEnable,
  22. unsigned char pllFilterValue
  23. );
  24. unsigned short sii164GetVendorID(void);
  25. unsigned short sii164GetDeviceID(void);
  26. #ifdef SII164_FULL_FUNCTIONS
  27. void sii164ResetChip(void);
  28. char *sii164GetChipString(void);
  29. void sii164SetPower(unsigned char powerUp);
  30. void sii164EnableHotPlugDetection(unsigned char enableHotPlug);
  31. unsigned char sii164IsConnected(void);
  32. unsigned char sii164CheckInterrupt(void);
  33. void sii164ClearInterrupt(void);
  34. #endif
  35. /* below register definination is used for Silicon Image SiI164 DVI controller chip */
  36. /*
  37. * Vendor ID registers
  38. */
  39. #define SII164_VENDOR_ID_LOW 0x00
  40. #define SII164_VENDOR_ID_HIGH 0x01
  41. /*
  42. * Device ID registers
  43. */
  44. #define SII164_DEVICE_ID_LOW 0x02
  45. #define SII164_DEVICE_ID_HIGH 0x03
  46. /*
  47. * Device Revision
  48. */
  49. #define SII164_DEVICE_REVISION 0x04
  50. /*
  51. * Frequency Limitation registers
  52. */
  53. #define SII164_FREQUENCY_LIMIT_LOW 0x06
  54. #define SII164_FREQUENCY_LIMIT_HIGH 0x07
  55. /*
  56. * Power Down and Input Signal Configuration registers
  57. */
  58. #define SII164_CONFIGURATION 0x08
  59. /* Power down (PD) */
  60. #define SII164_CONFIGURATION_POWER_DOWN 0x00
  61. #define SII164_CONFIGURATION_POWER_NORMAL 0x01
  62. #define SII164_CONFIGURATION_POWER_MASK 0x01
  63. /* Input Edge Latch Select (EDGE) */
  64. #define SII164_CONFIGURATION_LATCH_FALLING 0x00
  65. #define SII164_CONFIGURATION_LATCH_RISING 0x02
  66. /* Bus Select (BSEL) */
  67. #define SII164_CONFIGURATION_BUS_12BITS 0x00
  68. #define SII164_CONFIGURATION_BUS_24BITS 0x04
  69. /* Dual Edge Clock Select (DSEL) */
  70. #define SII164_CONFIGURATION_CLOCK_SINGLE 0x00
  71. #define SII164_CONFIGURATION_CLOCK_DUAL 0x08
  72. /* Horizontal Sync Enable (HEN) */
  73. #define SII164_CONFIGURATION_HSYNC_FORCE_LOW 0x00
  74. #define SII164_CONFIGURATION_HSYNC_AS_IS 0x10
  75. /* Vertical Sync Enable (VEN) */
  76. #define SII164_CONFIGURATION_VSYNC_FORCE_LOW 0x00
  77. #define SII164_CONFIGURATION_VSYNC_AS_IS 0x20
  78. /*
  79. * Detection registers
  80. */
  81. #define SII164_DETECT 0x09
  82. /* Monitor Detect Interrupt (MDI) */
  83. #define SII164_DETECT_MONITOR_STATE_CHANGE 0x00
  84. #define SII164_DETECT_MONITOR_STATE_NO_CHANGE 0x01
  85. #define SII164_DETECT_MONITOR_STATE_CLEAR 0x01
  86. #define SII164_DETECT_MONITOR_STATE_MASK 0x01
  87. /* Hot Plug detect Input (HTPLG) */
  88. #define SII164_DETECT_HOT_PLUG_STATUS_OFF 0x00
  89. #define SII164_DETECT_HOT_PLUG_STATUS_ON 0x02
  90. #define SII164_DETECT_HOT_PLUG_STATUS_MASK 0x02
  91. /* Receiver Sense (RSEN) */
  92. #define SII164_DETECT_RECEIVER_SENSE_NOT_DETECTED 0x00
  93. #define SII164_DETECT_RECEIVER_SENSE_DETECTED 0x04
  94. /* Interrupt Generation Method (TSEL) */
  95. #define SII164_DETECT_INTERRUPT_BY_RSEN_PIN 0x00
  96. #define SII164_DETECT_INTERRUPT_BY_HTPLG_PIN 0x08
  97. #define SII164_DETECT_INTERRUPT_MASK 0x08
  98. /* Monitor Sense Output (MSEN) */
  99. #define SII164_DETECT_MONITOR_SENSE_OUTPUT_HIGH 0x00
  100. #define SII164_DETECT_MONITOR_SENSE_OUTPUT_MDI 0x10
  101. #define SII164_DETECT_MONITOR_SENSE_OUTPUT_RSEN 0x20
  102. #define SII164_DETECT_MONITOR_SENSE_OUTPUT_HTPLG 0x30
  103. #define SII164_DETECT_MONITOR_SENSE_OUTPUT_FLAG 0x30
  104. /*
  105. * Skewing registers
  106. */
  107. #define SII164_DESKEW 0x0A
  108. /* General Purpose Input (CTL[3:1]) */
  109. #define SII164_DESKEW_GENERAL_PURPOSE_INPUT_MASK 0x0E
  110. /* De-skewing Enable bit (DKEN) */
  111. #define SII164_DESKEW_DISABLE 0x00
  112. #define SII164_DESKEW_ENABLE 0x10
  113. /* De-skewing Setting (DK[3:1])*/
  114. #define SII164_DESKEW_1_STEP 0x00
  115. #define SII164_DESKEW_2_STEP 0x20
  116. #define SII164_DESKEW_3_STEP 0x40
  117. #define SII164_DESKEW_4_STEP 0x60
  118. #define SII164_DESKEW_5_STEP 0x80
  119. #define SII164_DESKEW_6_STEP 0xA0
  120. #define SII164_DESKEW_7_STEP 0xC0
  121. #define SII164_DESKEW_8_STEP 0xE0
  122. /*
  123. * User Configuration Data registers (CFG 7:0)
  124. */
  125. #define SII164_USER_CONFIGURATION 0x0B
  126. /*
  127. * PLL registers
  128. */
  129. #define SII164_PLL 0x0C
  130. /* PLL Filter Value (PLLF) */
  131. #define SII164_PLL_FILTER_VALUE_MASK 0x0E
  132. /* PLL Filter Enable (PFEN) */
  133. #define SII164_PLL_FILTER_DISABLE 0x00
  134. #define SII164_PLL_FILTER_ENABLE 0x01
  135. /* Sync Continuous (SCNT) */
  136. #define SII164_PLL_FILTER_SYNC_CONTINUOUS_DISABLE 0x00
  137. #define SII164_PLL_FILTER_SYNC_CONTINUOUS_ENABLE 0x80
  138. #endif