vt1720_mobo.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * ALSA driver for VT1720/VT1724 (Envy24PT/Envy24HT)
  4. *
  5. * Lowlevel functions for VT1720-based motherboards
  6. *
  7. * Copyright (c) 2004 Takashi Iwai <[email protected]>
  8. */
  9. #include <linux/delay.h>
  10. #include <linux/interrupt.h>
  11. #include <linux/init.h>
  12. #include <sound/core.h>
  13. #include "ice1712.h"
  14. #include "envy24ht.h"
  15. #include "vt1720_mobo.h"
  16. static int k8x800_init(struct snd_ice1712 *ice)
  17. {
  18. ice->vt1720 = 1;
  19. /* VT1616 codec */
  20. ice->num_total_dacs = 6;
  21. ice->num_total_adcs = 2;
  22. /* WM8728 codec */
  23. /* FIXME: TODO */
  24. return 0;
  25. }
  26. static int k8x800_add_controls(struct snd_ice1712 *ice)
  27. {
  28. /* FIXME: needs some quirks for VT1616? */
  29. return 0;
  30. }
  31. /* EEPROM image */
  32. static const unsigned char k8x800_eeprom[] = {
  33. [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */
  34. [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */
  35. [ICE_EEP2_I2S] = 0x00, /* - */
  36. [ICE_EEP2_SPDIF] = 0x00, /* - */
  37. [ICE_EEP2_GPIO_DIR] = 0xff,
  38. [ICE_EEP2_GPIO_DIR1] = 0xff,
  39. [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */
  40. [ICE_EEP2_GPIO_MASK] = 0xff,
  41. [ICE_EEP2_GPIO_MASK1] = 0xff,
  42. [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */
  43. [ICE_EEP2_GPIO_STATE] = 0x00,
  44. [ICE_EEP2_GPIO_STATE1] = 0x00,
  45. [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */
  46. };
  47. static const unsigned char sn25p_eeprom[] = {
  48. [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */
  49. [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */
  50. [ICE_EEP2_I2S] = 0x00, /* - */
  51. [ICE_EEP2_SPDIF] = 0x41, /* - */
  52. [ICE_EEP2_GPIO_DIR] = 0xff,
  53. [ICE_EEP2_GPIO_DIR1] = 0xff,
  54. [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */
  55. [ICE_EEP2_GPIO_MASK] = 0xff,
  56. [ICE_EEP2_GPIO_MASK1] = 0xff,
  57. [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */
  58. [ICE_EEP2_GPIO_STATE] = 0x00,
  59. [ICE_EEP2_GPIO_STATE1] = 0x00,
  60. [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */
  61. };
  62. /* entry point */
  63. struct snd_ice1712_card_info snd_vt1720_mobo_cards[] = {
  64. {
  65. .subvendor = VT1720_SUBDEVICE_K8X800,
  66. .name = "Albatron K8X800 Pro II",
  67. .model = "k8x800",
  68. .chip_init = k8x800_init,
  69. .build_controls = k8x800_add_controls,
  70. .eeprom_size = sizeof(k8x800_eeprom),
  71. .eeprom_data = k8x800_eeprom,
  72. },
  73. {
  74. .subvendor = VT1720_SUBDEVICE_ZNF3_150,
  75. .name = "Chaintech ZNF3-150",
  76. /* identical with k8x800 */
  77. .chip_init = k8x800_init,
  78. .build_controls = k8x800_add_controls,
  79. .eeprom_size = sizeof(k8x800_eeprom),
  80. .eeprom_data = k8x800_eeprom,
  81. },
  82. {
  83. .subvendor = VT1720_SUBDEVICE_ZNF3_250,
  84. .name = "Chaintech ZNF3-250",
  85. /* identical with k8x800 */
  86. .chip_init = k8x800_init,
  87. .build_controls = k8x800_add_controls,
  88. .eeprom_size = sizeof(k8x800_eeprom),
  89. .eeprom_data = k8x800_eeprom,
  90. },
  91. {
  92. .subvendor = VT1720_SUBDEVICE_9CJS,
  93. .name = "Chaintech 9CJS",
  94. /* identical with k8x800 */
  95. .chip_init = k8x800_init,
  96. .build_controls = k8x800_add_controls,
  97. .eeprom_size = sizeof(k8x800_eeprom),
  98. .eeprom_data = k8x800_eeprom,
  99. },
  100. {
  101. .subvendor = VT1720_SUBDEVICE_SN25P,
  102. .name = "Shuttle SN25P",
  103. .model = "sn25p",
  104. .chip_init = k8x800_init,
  105. .build_controls = k8x800_add_controls,
  106. .eeprom_size = sizeof(k8x800_eeprom),
  107. .eeprom_data = sn25p_eeprom,
  108. },
  109. { } /* terminator */
  110. };