vt1720_mobo.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * ALSA driver for VT1720/VT1724 (Envy24PT/Envy24HT)
  3. *
  4. * Lowlevel functions for VT1720-based motherboards
  5. *
  6. * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #include <asm/io.h>
  24. #include <linux/delay.h>
  25. #include <linux/interrupt.h>
  26. #include <linux/init.h>
  27. #include <sound/core.h>
  28. #include "ice1712.h"
  29. #include "envy24ht.h"
  30. #include "vt1720_mobo.h"
  31. static int __devinit k8x800_init(struct snd_ice1712 *ice)
  32. {
  33. ice->vt1720 = 1;
  34. /* VT1616 codec */
  35. ice->num_total_dacs = 6;
  36. ice->num_total_adcs = 2;
  37. /* WM8728 codec */
  38. /* FIXME: TODO */
  39. return 0;
  40. }
  41. static int __devinit k8x800_add_controls(struct snd_ice1712 *ice)
  42. {
  43. /* FIXME: needs some quirks for VT1616? */
  44. return 0;
  45. }
  46. /* EEPROM image */
  47. static unsigned char k8x800_eeprom[] __devinitdata = {
  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] = 0x00, /* - */
  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. static unsigned char sn25p_eeprom[] __devinitdata = {
  63. [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */
  64. [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */
  65. [ICE_EEP2_I2S] = 0x00, /* - */
  66. [ICE_EEP2_SPDIF] = 0x41, /* - */
  67. [ICE_EEP2_GPIO_DIR] = 0xff,
  68. [ICE_EEP2_GPIO_DIR1] = 0xff,
  69. [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */
  70. [ICE_EEP2_GPIO_MASK] = 0xff,
  71. [ICE_EEP2_GPIO_MASK1] = 0xff,
  72. [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */
  73. [ICE_EEP2_GPIO_STATE] = 0x00,
  74. [ICE_EEP2_GPIO_STATE1] = 0x00,
  75. [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */
  76. };
  77. /* entry point */
  78. struct snd_ice1712_card_info snd_vt1720_mobo_cards[] __devinitdata = {
  79. {
  80. .subvendor = VT1720_SUBDEVICE_K8X800,
  81. .name = "Albatron K8X800 Pro II",
  82. .model = "k8x800",
  83. .chip_init = k8x800_init,
  84. .build_controls = k8x800_add_controls,
  85. .eeprom_size = sizeof(k8x800_eeprom),
  86. .eeprom_data = k8x800_eeprom,
  87. },
  88. {
  89. .subvendor = VT1720_SUBDEVICE_ZNF3_150,
  90. .name = "Chaintech ZNF3-150",
  91. /* identical with k8x800 */
  92. .chip_init = k8x800_init,
  93. .build_controls = k8x800_add_controls,
  94. .eeprom_size = sizeof(k8x800_eeprom),
  95. .eeprom_data = k8x800_eeprom,
  96. },
  97. {
  98. .subvendor = VT1720_SUBDEVICE_ZNF3_250,
  99. .name = "Chaintech ZNF3-250",
  100. /* identical with k8x800 */
  101. .chip_init = k8x800_init,
  102. .build_controls = k8x800_add_controls,
  103. .eeprom_size = sizeof(k8x800_eeprom),
  104. .eeprom_data = k8x800_eeprom,
  105. },
  106. {
  107. .subvendor = VT1720_SUBDEVICE_9CJS,
  108. .name = "Chaintech 9CJS",
  109. /* identical with k8x800 */
  110. .chip_init = k8x800_init,
  111. .build_controls = k8x800_add_controls,
  112. .eeprom_size = sizeof(k8x800_eeprom),
  113. .eeprom_data = k8x800_eeprom,
  114. },
  115. {
  116. .subvendor = VT1720_SUBDEVICE_SN25P,
  117. .name = "Shuttle SN25P",
  118. .model = "sn25p",
  119. .chip_init = k8x800_init,
  120. .build_controls = k8x800_add_controls,
  121. .eeprom_size = sizeof(k8x800_eeprom),
  122. .eeprom_data = sn25p_eeprom,
  123. },
  124. { } /* terminator */
  125. };