blob: 7f9674b641c0c8e98e171c6bfcc5e80bd370d213 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#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
31#include "ice1712.h"
Takashi Iwai189bc172007-01-29 15:25:40 +010032#include "envy24ht.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#include "vt1720_mobo.h"
34
35
Takashi Iwaiab0c7d72005-11-17 15:00:18 +010036static int __devinit k8x800_init(struct snd_ice1712 *ice)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037{
38 ice->vt1720 = 1;
39
40 /* VT1616 codec */
41 ice->num_total_dacs = 6;
42 ice->num_total_adcs = 2;
43
44 /* WM8728 codec */
45 /* FIXME: TODO */
46
47 return 0;
48}
49
Takashi Iwaiab0c7d72005-11-17 15:00:18 +010050static int __devinit k8x800_add_controls(struct snd_ice1712 *ice)
Linus Torvalds1da177e2005-04-16 15:20:36 -070051{
52 /* FIXME: needs some quirks for VT1616? */
53 return 0;
54}
55
56/* EEPROM image */
57
Takashi Iwai1b60f6b2007-03-13 22:13:47 +010058static unsigned char k8x800_eeprom[] __devinitdata = {
Takashi Iwai189bc172007-01-29 15:25:40 +010059 [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */
60 [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */
61 [ICE_EEP2_I2S] = 0x00, /* - */
62 [ICE_EEP2_SPDIF] = 0x00, /* - */
63 [ICE_EEP2_GPIO_DIR] = 0xff,
64 [ICE_EEP2_GPIO_DIR1] = 0xff,
65 [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */
66 [ICE_EEP2_GPIO_MASK] = 0xff,
67 [ICE_EEP2_GPIO_MASK1] = 0xff,
68 [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */
69 [ICE_EEP2_GPIO_STATE] = 0x00,
70 [ICE_EEP2_GPIO_STATE1] = 0x00,
71 [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */
Linus Torvalds1da177e2005-04-16 15:20:36 -070072};
73
Takashi Iwai1b60f6b2007-03-13 22:13:47 +010074static unsigned char sn25p_eeprom[] __devinitdata = {
Takashi Iwai189bc172007-01-29 15:25:40 +010075 [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */
76 [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */
77 [ICE_EEP2_I2S] = 0x00, /* - */
78 [ICE_EEP2_SPDIF] = 0x41, /* - */
79 [ICE_EEP2_GPIO_DIR] = 0xff,
80 [ICE_EEP2_GPIO_DIR1] = 0xff,
81 [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */
82 [ICE_EEP2_GPIO_MASK] = 0xff,
83 [ICE_EEP2_GPIO_MASK1] = 0xff,
84 [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */
85 [ICE_EEP2_GPIO_STATE] = 0x00,
86 [ICE_EEP2_GPIO_STATE1] = 0x00,
87 [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */
Takashi Iwai09f9a892005-11-02 11:54:36 +010088};
89
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
91/* entry point */
Takashi Iwai1b60f6b2007-03-13 22:13:47 +010092struct snd_ice1712_card_info snd_vt1720_mobo_cards[] __devinitdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 {
94 .subvendor = VT1720_SUBDEVICE_K8X800,
95 .name = "Albatron K8X800 Pro II",
96 .model = "k8x800",
97 .chip_init = k8x800_init,
98 .build_controls = k8x800_add_controls,
99 .eeprom_size = sizeof(k8x800_eeprom),
100 .eeprom_data = k8x800_eeprom,
101 },
102 {
103 .subvendor = VT1720_SUBDEVICE_ZNF3_150,
104 .name = "Chaintech ZNF3-150",
105 /* identical with k8x800 */
106 .chip_init = k8x800_init,
107 .build_controls = k8x800_add_controls,
108 .eeprom_size = sizeof(k8x800_eeprom),
109 .eeprom_data = k8x800_eeprom,
110 },
111 {
112 .subvendor = VT1720_SUBDEVICE_ZNF3_250,
113 .name = "Chaintech ZNF3-250",
114 /* identical with k8x800 */
115 .chip_init = k8x800_init,
116 .build_controls = k8x800_add_controls,
117 .eeprom_size = sizeof(k8x800_eeprom),
118 .eeprom_data = k8x800_eeprom,
119 },
120 {
121 .subvendor = VT1720_SUBDEVICE_9CJS,
122 .name = "Chaintech 9CJS",
123 /* identical with k8x800 */
124 .chip_init = k8x800_init,
125 .build_controls = k8x800_add_controls,
126 .eeprom_size = sizeof(k8x800_eeprom),
127 .eeprom_data = k8x800_eeprom,
128 },
Takashi Iwaib9cce372005-05-24 13:16:56 +0200129 {
130 .subvendor = VT1720_SUBDEVICE_SN25P,
131 .name = "Shuttle SN25P",
Takashi Iwai09f9a892005-11-02 11:54:36 +0100132 .model = "sn25p",
Takashi Iwaib9cce372005-05-24 13:16:56 +0200133 .chip_init = k8x800_init,
134 .build_controls = k8x800_add_controls,
135 .eeprom_size = sizeof(k8x800_eeprom),
Takashi Iwai09f9a892005-11-02 11:54:36 +0100136 .eeprom_data = sn25p_eeprom,
Takashi Iwaib9cce372005-05-24 13:16:56 +0200137 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138 { } /* terminator */
139};
140