Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <asm/io.h> |
| 25 | #include <linux/delay.h> |
| 26 | #include <linux/interrupt.h> |
| 27 | #include <linux/init.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | #include <sound/core.h> |
| 29 | |
| 30 | #include "ice1712.h" |
Takashi Iwai | 189bc17 | 2007-01-29 15:25:40 +0100 | [diff] [blame] | 31 | #include "envy24ht.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #include "vt1720_mobo.h" |
| 33 | |
| 34 | |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 35 | static int __devinit k8x800_init(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | { |
| 37 | ice->vt1720 = 1; |
| 38 | |
| 39 | /* VT1616 codec */ |
| 40 | ice->num_total_dacs = 6; |
| 41 | ice->num_total_adcs = 2; |
| 42 | |
| 43 | /* WM8728 codec */ |
| 44 | /* FIXME: TODO */ |
| 45 | |
| 46 | return 0; |
| 47 | } |
| 48 | |
Takashi Iwai | ab0c7d7 | 2005-11-17 15:00:18 +0100 | [diff] [blame] | 49 | static int __devinit k8x800_add_controls(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | { |
| 51 | /* FIXME: needs some quirks for VT1616? */ |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | /* EEPROM image */ |
| 56 | |
Takashi Iwai | 1b60f6b | 2007-03-13 22:13:47 +0100 | [diff] [blame] | 57 | static unsigned char k8x800_eeprom[] __devinitdata = { |
Takashi Iwai | 189bc17 | 2007-01-29 15:25:40 +0100 | [diff] [blame] | 58 | [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ |
| 59 | [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ |
| 60 | [ICE_EEP2_I2S] = 0x00, /* - */ |
| 61 | [ICE_EEP2_SPDIF] = 0x00, /* - */ |
| 62 | [ICE_EEP2_GPIO_DIR] = 0xff, |
| 63 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
| 64 | [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */ |
| 65 | [ICE_EEP2_GPIO_MASK] = 0xff, |
| 66 | [ICE_EEP2_GPIO_MASK1] = 0xff, |
| 67 | [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */ |
| 68 | [ICE_EEP2_GPIO_STATE] = 0x00, |
| 69 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
| 70 | [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
Takashi Iwai | 1b60f6b | 2007-03-13 22:13:47 +0100 | [diff] [blame] | 73 | static unsigned char sn25p_eeprom[] __devinitdata = { |
Takashi Iwai | 189bc17 | 2007-01-29 15:25:40 +0100 | [diff] [blame] | 74 | [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ |
| 75 | [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ |
| 76 | [ICE_EEP2_I2S] = 0x00, /* - */ |
| 77 | [ICE_EEP2_SPDIF] = 0x41, /* - */ |
| 78 | [ICE_EEP2_GPIO_DIR] = 0xff, |
| 79 | [ICE_EEP2_GPIO_DIR1] = 0xff, |
| 80 | [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */ |
| 81 | [ICE_EEP2_GPIO_MASK] = 0xff, |
| 82 | [ICE_EEP2_GPIO_MASK1] = 0xff, |
| 83 | [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */ |
| 84 | [ICE_EEP2_GPIO_STATE] = 0x00, |
| 85 | [ICE_EEP2_GPIO_STATE1] = 0x00, |
| 86 | [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */ |
Takashi Iwai | 09f9a89 | 2005-11-02 11:54:36 +0100 | [diff] [blame] | 87 | }; |
| 88 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
| 90 | /* entry point */ |
Takashi Iwai | 1b60f6b | 2007-03-13 22:13:47 +0100 | [diff] [blame] | 91 | struct snd_ice1712_card_info snd_vt1720_mobo_cards[] __devinitdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | { |
| 93 | .subvendor = VT1720_SUBDEVICE_K8X800, |
| 94 | .name = "Albatron K8X800 Pro II", |
| 95 | .model = "k8x800", |
| 96 | .chip_init = k8x800_init, |
| 97 | .build_controls = k8x800_add_controls, |
| 98 | .eeprom_size = sizeof(k8x800_eeprom), |
| 99 | .eeprom_data = k8x800_eeprom, |
| 100 | }, |
| 101 | { |
| 102 | .subvendor = VT1720_SUBDEVICE_ZNF3_150, |
| 103 | .name = "Chaintech ZNF3-150", |
| 104 | /* identical with k8x800 */ |
| 105 | .chip_init = k8x800_init, |
| 106 | .build_controls = k8x800_add_controls, |
| 107 | .eeprom_size = sizeof(k8x800_eeprom), |
| 108 | .eeprom_data = k8x800_eeprom, |
| 109 | }, |
| 110 | { |
| 111 | .subvendor = VT1720_SUBDEVICE_ZNF3_250, |
| 112 | .name = "Chaintech ZNF3-250", |
| 113 | /* identical with k8x800 */ |
| 114 | .chip_init = k8x800_init, |
| 115 | .build_controls = k8x800_add_controls, |
| 116 | .eeprom_size = sizeof(k8x800_eeprom), |
| 117 | .eeprom_data = k8x800_eeprom, |
| 118 | }, |
| 119 | { |
| 120 | .subvendor = VT1720_SUBDEVICE_9CJS, |
| 121 | .name = "Chaintech 9CJS", |
| 122 | /* identical with k8x800 */ |
| 123 | .chip_init = k8x800_init, |
| 124 | .build_controls = k8x800_add_controls, |
| 125 | .eeprom_size = sizeof(k8x800_eeprom), |
| 126 | .eeprom_data = k8x800_eeprom, |
| 127 | }, |
Takashi Iwai | b9cce37 | 2005-05-24 13:16:56 +0200 | [diff] [blame] | 128 | { |
| 129 | .subvendor = VT1720_SUBDEVICE_SN25P, |
| 130 | .name = "Shuttle SN25P", |
Takashi Iwai | 09f9a89 | 2005-11-02 11:54:36 +0100 | [diff] [blame] | 131 | .model = "sn25p", |
Takashi Iwai | b9cce37 | 2005-05-24 13:16:56 +0200 | [diff] [blame] | 132 | .chip_init = k8x800_init, |
| 133 | .build_controls = k8x800_add_controls, |
| 134 | .eeprom_size = sizeof(k8x800_eeprom), |
Takashi Iwai | 09f9a89 | 2005-11-02 11:54:36 +0100 | [diff] [blame] | 135 | .eeprom_data = sn25p_eeprom, |
Takashi Iwai | b9cce37 | 2005-05-24 13:16:56 +0200 | [diff] [blame] | 136 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | { } /* terminator */ |
| 138 | }; |
| 139 | |