vt1720_mobo.c 3.5 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 <sound/driver.h>
  24. #include <asm/io.h>
  25. #include <linux/delay.h>
  26. #include <linux/interrupt.h>
  27. #include <linux/init.h>
  28. #include <linux/slab.h>
  29. #include <sound/core.h>
  30. #include "ice1712.h"
  31. #include "vt1720_mobo.h"
  32. static int __devinit k8x800_init(struct snd_ice1712 *ice)
  33. {
  34. ice->vt1720 = 1;
  35. /* VT1616 codec */
  36. ice->num_total_dacs = 6;
  37. ice->num_total_adcs = 2;
  38. /* WM8728 codec */
  39. /* FIXME: TODO */
  40. return 0;
  41. }
  42. static int __devinit k8x800_add_controls(struct snd_ice1712 *ice)
  43. {
  44. /* FIXME: needs some quirks for VT1616? */
  45. return 0;
  46. }
  47. /* EEPROM image */
  48. static unsigned char k8x800_eeprom[] __devinitdata = {
  49. 0x01, /* SYSCONF: clock 256, 1ADC, 2DACs */
  50. 0x02, /* ACLINK: ACLINK, packed */
  51. 0x00, /* I2S: - */
  52. 0x00, /* SPDIF: - */
  53. 0xff, /* GPIO_DIR */
  54. 0xff, /* GPIO_DIR1 */
  55. 0x00, /* - */
  56. 0xff, /* GPIO_MASK */
  57. 0xff, /* GPIO_MASK1 */
  58. 0x00, /* - */
  59. 0x00, /* GPIO_STATE */
  60. 0x00, /* GPIO_STATE1 */
  61. 0x00, /* - */
  62. };
  63. static unsigned char sn25p_eeprom[] __devinitdata = {
  64. 0x01, /* SYSCONF: clock 256, 1ADC, 2DACs */
  65. 0x02, /* ACLINK: ACLINK, packed */
  66. 0x00, /* I2S: - */
  67. 0x41, /* SPDIF: - */
  68. 0xff, /* GPIO_DIR */
  69. 0xff, /* GPIO_DIR1 */
  70. 0x00, /* - */
  71. 0xff, /* GPIO_MASK */
  72. 0xff, /* GPIO_MASK1 */
  73. 0x00, /* - */
  74. 0x00, /* GPIO_STATE */
  75. 0x00, /* GPIO_STATE1 */
  76. 0x00, /* - */
  77. };
  78. /* entry point */
  79. struct snd_ice1712_card_info snd_vt1720_mobo_cards[] __devinitdata = {
  80. {
  81. .subvendor = VT1720_SUBDEVICE_K8X800,
  82. .name = "Albatron K8X800 Pro II",
  83. .model = "k8x800",
  84. .chip_init = k8x800_init,
  85. .build_controls = k8x800_add_controls,
  86. .eeprom_size = sizeof(k8x800_eeprom),
  87. .eeprom_data = k8x800_eeprom,
  88. },
  89. {
  90. .subvendor = VT1720_SUBDEVICE_ZNF3_150,
  91. .name = "Chaintech ZNF3-150",
  92. /* identical with k8x800 */
  93. .chip_init = k8x800_init,
  94. .build_controls = k8x800_add_controls,
  95. .eeprom_size = sizeof(k8x800_eeprom),
  96. .eeprom_data = k8x800_eeprom,
  97. },
  98. {
  99. .subvendor = VT1720_SUBDEVICE_ZNF3_250,
  100. .name = "Chaintech ZNF3-250",
  101. /* identical with k8x800 */
  102. .chip_init = k8x800_init,
  103. .build_controls = k8x800_add_controls,
  104. .eeprom_size = sizeof(k8x800_eeprom),
  105. .eeprom_data = k8x800_eeprom,
  106. },
  107. {
  108. .subvendor = VT1720_SUBDEVICE_9CJS,
  109. .name = "Chaintech 9CJS",
  110. /* identical with k8x800 */
  111. .chip_init = k8x800_init,
  112. .build_controls = k8x800_add_controls,
  113. .eeprom_size = sizeof(k8x800_eeprom),
  114. .eeprom_data = k8x800_eeprom,
  115. },
  116. {
  117. .subvendor = VT1720_SUBDEVICE_SN25P,
  118. .name = "Shuttle SN25P",
  119. .model = "sn25p",
  120. .chip_init = k8x800_init,
  121. .build_controls = k8x800_add_controls,
  122. .eeprom_size = sizeof(k8x800_eeprom),
  123. .eeprom_data = sn25p_eeprom,
  124. },
  125. { } /* terminator */
  126. };