ddk750_dvi.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #define USE_DVICHIP
  2. #ifdef USE_DVICHIP
  3. #include "ddk750_help.h"
  4. #include "ddk750_reg.h"
  5. #include "ddk750_dvi.h"
  6. #include "ddk750_sii164.h"
  7. /* This global variable contains all the supported driver and its corresponding
  8. function API. Please set the function pointer to NULL whenever the function
  9. is not supported. */
  10. static dvi_ctrl_device_t g_dcftSupportedDviController[] = {
  11. #ifdef DVI_CTRL_SII164
  12. {
  13. .pfnInit = sii164InitChip,
  14. .pfnGetVendorId = sii164GetVendorID,
  15. .pfnGetDeviceId = sii164GetDeviceID,
  16. #ifdef SII164_FULL_FUNCTIONS
  17. .pfnResetChip = sii164ResetChip,
  18. .pfnGetChipString = sii164GetChipString,
  19. .pfnSetPower = sii164SetPower,
  20. .pfnEnableHotPlugDetection = sii164EnableHotPlugDetection,
  21. .pfnIsConnected = sii164IsConnected,
  22. .pfnCheckInterrupt = sii164CheckInterrupt,
  23. .pfnClearInterrupt = sii164ClearInterrupt,
  24. #endif
  25. },
  26. #endif
  27. };
  28. int dviInit(
  29. unsigned char edgeSelect,
  30. unsigned char busSelect,
  31. unsigned char dualEdgeClkSelect,
  32. unsigned char hsyncEnable,
  33. unsigned char vsyncEnable,
  34. unsigned char deskewEnable,
  35. unsigned char deskewSetting,
  36. unsigned char continuousSyncEnable,
  37. unsigned char pllFilterEnable,
  38. unsigned char pllFilterValue
  39. )
  40. {
  41. dvi_ctrl_device_t *pCurrentDviCtrl;
  42. pCurrentDviCtrl = g_dcftSupportedDviController;
  43. if (pCurrentDviCtrl->pfnInit != NULL) {
  44. return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable,
  45. vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable,
  46. pllFilterEnable, pllFilterValue);
  47. }
  48. return -1; /* error */
  49. }
  50. /*
  51. * dviGetVendorID
  52. * This function gets the vendor ID of the DVI controller chip.
  53. *
  54. * Output:
  55. * Vendor ID
  56. */
  57. unsigned short dviGetVendorID(void)
  58. {
  59. dvi_ctrl_device_t *pCurrentDviCtrl;
  60. pCurrentDviCtrl = g_dcftSupportedDviController;
  61. if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0)
  62. return pCurrentDviCtrl->pfnGetVendorId();
  63. return 0x0000;
  64. }
  65. /*
  66. * dviGetDeviceID
  67. * This function gets the device ID of the DVI controller chip.
  68. *
  69. * Output:
  70. * Device ID
  71. */
  72. unsigned short dviGetDeviceID(void)
  73. {
  74. dvi_ctrl_device_t *pCurrentDviCtrl;
  75. pCurrentDviCtrl = g_dcftSupportedDviController;
  76. if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0)
  77. return pCurrentDviCtrl->pfnGetDeviceId();
  78. return 0x0000;
  79. }
  80. #endif