vt1720_mobo.c 3.9 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
/*
 *   ALSA driver for VT1720/VT1724 (Envy24PT/Envy24HT)
 *
 *   Lowlevel functions for VT1720-based motherboards
 *
 *	Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */      

#include <sound/driver.h>
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <sound/core.h>

#include "ice1712.h"
33
#include "envy24ht.h"
L
Linus Torvalds 已提交
34 35 36
#include "vt1720_mobo.h"


37
static int __devinit k8x800_init(struct snd_ice1712 *ice)
L
Linus Torvalds 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50
{
	ice->vt1720 = 1;

	/* VT1616 codec */
	ice->num_total_dacs = 6;
	ice->num_total_adcs = 2;

	/* WM8728 codec */
	/* FIXME: TODO */

	return 0;
}

51
static int __devinit k8x800_add_controls(struct snd_ice1712 *ice)
L
Linus Torvalds 已提交
52 53 54 55 56 57 58
{
	/* FIXME: needs some quirks for VT1616? */
	return 0;
}

/* EEPROM image */

59
static const unsigned char k8x800_eeprom[] __devinitdata = {
60 61 62 63 64 65 66 67 68 69 70 71 72
	[ICE_EEP2_SYSCONF]     = 0x01,	/* clock 256, 1ADC, 2DACs */
	[ICE_EEP2_ACLINK]      = 0x02,	/* ACLINK, packed */
	[ICE_EEP2_I2S]         = 0x00,	/* - */
	[ICE_EEP2_SPDIF]       = 0x00,	/* - */
	[ICE_EEP2_GPIO_DIR]    = 0xff,
	[ICE_EEP2_GPIO_DIR1]   = 0xff,
	[ICE_EEP2_GPIO_DIR2]   = 0x00,	/* - */
	[ICE_EEP2_GPIO_MASK]   = 0xff,
	[ICE_EEP2_GPIO_MASK1]  = 0xff,
	[ICE_EEP2_GPIO_MASK2]  = 0x00,	/* - */
	[ICE_EEP2_GPIO_STATE]  = 0x00,
	[ICE_EEP2_GPIO_STATE1] = 0x00,
	[ICE_EEP2_GPIO_STATE2] = 0x00,	/* - */
L
Linus Torvalds 已提交
73 74
};

75
static const unsigned char sn25p_eeprom[] __devinitdata = {
76 77 78 79 80 81 82 83 84 85 86 87 88
	[ICE_EEP2_SYSCONF]     = 0x01,	/* clock 256, 1ADC, 2DACs */
	[ICE_EEP2_ACLINK]      = 0x02,	/* ACLINK, packed */
	[ICE_EEP2_I2S]         = 0x00,	/* - */
	[ICE_EEP2_SPDIF]       = 0x41,	/* - */
	[ICE_EEP2_GPIO_DIR]    = 0xff,
	[ICE_EEP2_GPIO_DIR1]   = 0xff,
	[ICE_EEP2_GPIO_DIR2]   = 0x00,	/* - */
	[ICE_EEP2_GPIO_MASK]   = 0xff,
	[ICE_EEP2_GPIO_MASK1]  = 0xff,
	[ICE_EEP2_GPIO_MASK2]  = 0x00,	/* - */
	[ICE_EEP2_GPIO_STATE]  = 0x00,
	[ICE_EEP2_GPIO_STATE1] = 0x00,
	[ICE_EEP2_GPIO_STATE2] = 0x00,	/* - */
89 90
};

L
Linus Torvalds 已提交
91 92

/* entry point */
93
const struct snd_ice1712_card_info snd_vt1720_mobo_cards[] __devinitdata = {
L
Linus Torvalds 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
	{
		.subvendor = VT1720_SUBDEVICE_K8X800,
		.name = "Albatron K8X800 Pro II",
		.model = "k8x800",
		.chip_init = k8x800_init,
		.build_controls = k8x800_add_controls,
		.eeprom_size = sizeof(k8x800_eeprom),
		.eeprom_data = k8x800_eeprom,
	},
	{
		.subvendor = VT1720_SUBDEVICE_ZNF3_150,
		.name = "Chaintech ZNF3-150",
		/* identical with k8x800 */
		.chip_init = k8x800_init,
		.build_controls = k8x800_add_controls,
		.eeprom_size = sizeof(k8x800_eeprom),
		.eeprom_data = k8x800_eeprom,
	},
	{
		.subvendor = VT1720_SUBDEVICE_ZNF3_250,
		.name = "Chaintech ZNF3-250",
		/* identical with k8x800 */
		.chip_init = k8x800_init,
		.build_controls = k8x800_add_controls,
		.eeprom_size = sizeof(k8x800_eeprom),
		.eeprom_data = k8x800_eeprom,
	},
	{
		.subvendor = VT1720_SUBDEVICE_9CJS,
		.name = "Chaintech 9CJS",
		/* identical with k8x800 */
		.chip_init = k8x800_init,
		.build_controls = k8x800_add_controls,
		.eeprom_size = sizeof(k8x800_eeprom),
		.eeprom_data = k8x800_eeprom,
	},
T
Takashi Iwai 已提交
130 131 132
	{
		.subvendor = VT1720_SUBDEVICE_SN25P,
		.name = "Shuttle SN25P",
133
		.model = "sn25p",
T
Takashi Iwai 已提交
134 135 136
		.chip_init = k8x800_init,
		.build_controls = k8x800_add_controls,
		.eeprom_size = sizeof(k8x800_eeprom),
137
		.eeprom_data = sn25p_eeprom,
T
Takashi Iwai 已提交
138
	},
L
Linus Torvalds 已提交
139 140 141
	{ } /* terminator */
};