2 * ALSA driver for ICEnsemble ICE1724 (Envy24)
4 * Lowlevel functions for Terratec PHASE 22
6 * Copyright (c) 2005 Misha Zhilin <misha@epiphan.com>
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.
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.
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
25 * Audio controller: VIA Envy24HT-S (slightly trimmed down version of Envy24HT)
26 * Analog chip: AK4524 (partially via Philip's 74HCT125)
27 * Digital receiver: CS8414-CS (not supported in this release)
29 * Envy connects to AK4524
30 * - CS directly from GPIO 10
31 * - CCLK via 74HCT125's gate #4 from GPIO 4
32 * - CDTI via 74HCT125's gate #2 from GPIO 5
33 * CDTI may be completely blocked by 74HCT125's gate #1 controlled by GPIO 3
36 #include <sound/driver.h>
38 #include <linux/delay.h>
39 #include <linux/interrupt.h>
40 #include <linux/init.h>
41 #include <linux/slab.h>
42 #include <sound/core.h>
48 static akm4xxx_t akm_phase22 __devinitdata
= {
54 static struct snd_ak4xxx_private akm_phase22_priv __devinitdata
= {
66 static int __devinit
phase22_init(ice1712_t
*ice
)
71 // Configure DAC/ADC description for generic part of ice1724
72 switch (ice
->eeprom
.subvendor
) {
73 case VT1724_SUBDEVICE_PHASE22
:
74 ice
->num_total_dacs
= 2;
75 ice
->num_total_adcs
= 2;
76 ice
->vt1720
= 1; // Envy24HT-S have 16 bit wide GPIO
83 // Initialize analog chips
84 ak
= ice
->akm
= kcalloc(1, sizeof(akm4xxx_t
), GFP_KERNEL
);
88 switch (ice
->eeprom
.subvendor
) {
89 case VT1724_SUBDEVICE_PHASE22
:
90 if ((err
= snd_ice1712_akm4xxx_init(ak
, &akm_phase22
, &akm_phase22_priv
, ice
)) < 0)
98 static int __devinit
phase22_add_controls(ice1712_t
*ice
)
102 switch (ice
->eeprom
.subvendor
) {
103 case VT1724_SUBDEVICE_PHASE22
:
104 err
= snd_ice1712_akm4xxx_build_controls(ice
);
111 static unsigned char phase22_eeprom
[] __devinitdata
= {
112 0x00, /* SYSCONF: 1xADC, 1xDACs */
113 0x80, /* ACLINK: I2S */
114 0xf8, /* I2S: vol, 96k, 24bit*/
115 0xc3, /* SPDIF: out-en, out-int, spdif-in */
117 0xFF, /* GPIO_DIR1 */
118 0xFF, /* GPIO_DIR2 */
119 0x00, /* GPIO_MASK */
120 0x00, /* GPIO_MASK1 */
121 0x00, /* GPIO_MASK2 */
122 0x00, /* GPIO_STATE: */
123 0x00, /* GPIO_STATE1: */
124 0x00, /* GPIO_STATE2 */
127 struct snd_ice1712_card_info snd_vt1724_phase_cards
[] __devinitdata
= {
129 .subvendor
= VT1724_SUBDEVICE_PHASE22
,
130 .name
= "Terratec PHASE 22",
132 .chip_init
= phase22_init
,
133 .build_controls
= phase22_add_controls
,
134 .eeprom_size
= sizeof(phase22_eeprom
),
135 .eeprom_data
= phase22_eeprom
,