1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ALSA driver for ICEnsemble VT1724 (Envy24HT)
5 * Lowlevel functions for AudioTrak Prodigy 192 cards
6 * Supported IEC958 input from optional MI/ODI/O add-on card.
11 * * SPDIF-OUT on the card:
12 * - coax (through isolation transformer)/toslink supplied by
13 * 74HC04 gates - 3 in parallel
14 * - output switched between on-board CD drive dig-out connector
15 * and ice1724 SPDTX pin, using 74HC02 NOR gates, controlled
16 * by GPIO20 (0 = CD dig-out, 1 = SPDTX)
17 * * SPDTX goes straight to MI/ODI/O card's SPDIF-OUT coax
19 * * MI/ODI/O card: AK4114 based, used for iec958 input only
20 * - toslink input -> RX0
24 * ------------------------------
25 * CDTO (pin 32) -- GPIO11 pin 86
26 * CDTI (pin 33) -- GPIO10 pin 77
27 * CCLK (pin 34) -- GPIO9 pin 76
28 * CSN (pin 35) -- GPIO8 pin 75
29 * - output data Mode 7 (24bit, I2S, slave)
30 * - both MCKO1 and MCKO2 of ak4114 are fed to FPGA, which
31 * outputs master clock to SPMCLKIN of ice1724.
32 * Experimentally I found out that only a combination of
33 * OCKS0=1, OCKS1=1 (128fs, 64fs output) and ice1724 -
34 * VT1724_MT_I2S_MCLK_128X=0 (256fs input) yields correct
35 * sampling rate. That means that the FPGA doubles the
38 * Copyright (c) 2003 Takashi Iwai <tiwai@suse.de>
39 * Copyright (c) 2003 Dimitromanolakis Apostolos <apostol@cs.utoronto.ca>
40 * Copyright (c) 2004 Kouichi ONO <co2b@ceres.dti.ne.jp>
43 #include <linux/delay.h>
44 #include <linux/interrupt.h>
45 #include <linux/init.h>
46 #include <linux/slab.h>
47 #include <sound/core.h>
51 #include "prodigy192.h"
53 #include <sound/tlv.h>
55 struct prodigy192_spec
{
56 struct ak4114
*ak4114
;
57 /* rate change needs atomic mute/unmute of all dacs*/
58 struct mutex mute_mutex
;
61 static inline void stac9460_put(struct snd_ice1712
*ice
, int reg
, unsigned char val
)
63 snd_vt1724_write_i2c(ice
, PRODIGY192_STAC9460_ADDR
, reg
, val
);
66 static inline unsigned char stac9460_get(struct snd_ice1712
*ice
, int reg
)
68 return snd_vt1724_read_i2c(ice
, PRODIGY192_STAC9460_ADDR
, reg
);
76 * idx = STAC9460 volume register number, mute: 0 = mute, 1 = unmute
78 static int stac9460_dac_mute(struct snd_ice1712
*ice
, int idx
,
81 unsigned char new, old
;
83 old
= stac9460_get(ice
, idx
);
84 new = (~mute
<< 7 & 0x80) | (old
& ~0x80);
85 change
= (new != old
);
87 /* dev_dbg(ice->card->dev, "Volume register 0x%02x: 0x%02x\n", idx, new);*/
88 stac9460_put(ice
, idx
, new);
92 #define stac9460_dac_mute_info snd_ctl_boolean_mono_info
94 static int stac9460_dac_mute_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
96 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
100 if (kcontrol
->private_value
)
101 idx
= STAC946X_MASTER_VOLUME
;
103 idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
) + STAC946X_LF_VOLUME
;
104 val
= stac9460_get(ice
, idx
);
105 ucontrol
->value
.integer
.value
[0] = (~val
>> 7) & 0x1;
109 static int stac9460_dac_mute_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
111 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
112 struct prodigy192_spec
*spec
= ice
->spec
;
115 if (kcontrol
->private_value
)
116 idx
= STAC946X_MASTER_VOLUME
;
118 idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
) + STAC946X_LF_VOLUME
;
119 /* due to possible conflicts with stac9460_set_rate_val, mutexing */
120 mutex_lock(&spec
->mute_mutex
);
122 dev_dbg(ice->card->dev, "Mute put: reg 0x%02x, ctrl value: 0x%02x\n", idx,
123 ucontrol->value.integer.value[0]);
125 change
= stac9460_dac_mute(ice
, idx
, ucontrol
->value
.integer
.value
[0]);
126 mutex_unlock(&spec
->mute_mutex
);
131 * DAC volume attenuation mixer control
133 static int stac9460_dac_vol_info(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_info
*uinfo
)
135 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_INTEGER
;
137 uinfo
->value
.integer
.min
= 0; /* mute */
138 uinfo
->value
.integer
.max
= 0x7f; /* 0dB */
142 static int stac9460_dac_vol_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
144 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
148 if (kcontrol
->private_value
)
149 idx
= STAC946X_MASTER_VOLUME
;
151 idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
) + STAC946X_LF_VOLUME
;
152 vol
= stac9460_get(ice
, idx
) & 0x7f;
153 ucontrol
->value
.integer
.value
[0] = 0x7f - vol
;
158 static int stac9460_dac_vol_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
160 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
162 unsigned char tmp
, ovol
, nvol
;
165 if (kcontrol
->private_value
)
166 idx
= STAC946X_MASTER_VOLUME
;
168 idx
= snd_ctl_get_ioffidx(kcontrol
, &ucontrol
->id
) + STAC946X_LF_VOLUME
;
169 nvol
= ucontrol
->value
.integer
.value
[0];
170 tmp
= stac9460_get(ice
, idx
);
171 ovol
= 0x7f - (tmp
& 0x7f);
172 change
= (ovol
!= nvol
);
174 stac9460_put(ice
, idx
, (0x7f - nvol
) | (tmp
& 0x80));
182 #define stac9460_adc_mute_info snd_ctl_boolean_stereo_info
184 static int stac9460_adc_mute_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
186 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
190 for (i
= 0; i
< 2; ++i
) {
191 val
= stac9460_get(ice
, STAC946X_MIC_L_VOLUME
+ i
);
192 ucontrol
->value
.integer
.value
[i
] = ~val
>>7 & 0x1;
198 static int stac9460_adc_mute_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
200 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
201 unsigned char new, old
;
205 for (i
= 0; i
< 2; ++i
) {
206 reg
= STAC946X_MIC_L_VOLUME
+ i
;
207 old
= stac9460_get(ice
, reg
);
208 new = (~ucontrol
->value
.integer
.value
[i
]<<7&0x80) | (old
&~0x80);
209 change
= (new != old
);
211 stac9460_put(ice
, reg
, new);
218 * ADC gain mixer control
220 static int stac9460_adc_vol_info(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_info
*uinfo
)
222 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_INTEGER
;
224 uinfo
->value
.integer
.min
= 0; /* 0dB */
225 uinfo
->value
.integer
.max
= 0x0f; /* 22.5dB */
229 static int stac9460_adc_vol_get(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
231 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
235 for (i
= 0; i
< 2; ++i
) {
236 reg
= STAC946X_MIC_L_VOLUME
+ i
;
237 vol
= stac9460_get(ice
, reg
) & 0x0f;
238 ucontrol
->value
.integer
.value
[i
] = 0x0f - vol
;
244 static int stac9460_adc_vol_put(struct snd_kcontrol
*kcontrol
, struct snd_ctl_elem_value
*ucontrol
)
246 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
248 unsigned char ovol
, nvol
;
251 for (i
= 0; i
< 2; ++i
) {
252 reg
= STAC946X_MIC_L_VOLUME
+ i
;
253 nvol
= ucontrol
->value
.integer
.value
[i
] & 0x0f;
254 ovol
= 0x0f - stac9460_get(ice
, reg
);
255 change
= ((ovol
& 0x0f) != nvol
);
257 stac9460_put(ice
, reg
, (0x0f - nvol
) | (ovol
& ~0x0f));
263 static int stac9460_mic_sw_info(struct snd_kcontrol
*kcontrol
,
264 struct snd_ctl_elem_info
*uinfo
)
266 static const char * const texts
[2] = { "Line In", "Mic" };
268 return snd_ctl_enum_info(uinfo
, 1, 2, texts
);
272 static int stac9460_mic_sw_get(struct snd_kcontrol
*kcontrol
,
273 struct snd_ctl_elem_value
*ucontrol
)
275 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
278 val
= stac9460_get(ice
, STAC946X_GENERAL_PURPOSE
);
279 ucontrol
->value
.enumerated
.item
[0] = (val
>> 7) & 0x1;
283 static int stac9460_mic_sw_put(struct snd_kcontrol
*kcontrol
,
284 struct snd_ctl_elem_value
*ucontrol
)
286 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
287 unsigned char new, old
;
289 old
= stac9460_get(ice
, STAC946X_GENERAL_PURPOSE
);
290 new = (ucontrol
->value
.enumerated
.item
[0] << 7 & 0x80) | (old
& ~0x80);
291 change
= (new != old
);
293 stac9460_put(ice
, STAC946X_GENERAL_PURPOSE
, new);
297 * Handler for setting correct codec rate - called when rate change is detected
299 static void stac9460_set_rate_val(struct snd_ice1712
*ice
, unsigned int rate
)
301 unsigned char old
, new;
303 unsigned char changed
[7];
304 struct prodigy192_spec
*spec
= ice
->spec
;
306 if (rate
== 0) /* no hint - S/PDIF input is master, simply return */
308 else if (rate
<= 48000)
309 new = 0x08; /* 256x, base rate mode */
310 else if (rate
<= 96000)
311 new = 0x11; /* 256x, mid rate mode */
313 new = 0x12; /* 128x, high rate mode */
314 old
= stac9460_get(ice
, STAC946X_MASTER_CLOCKING
);
317 /* change detected, setting master clock, muting first */
318 /* due to possible conflicts with mute controls - mutexing */
319 mutex_lock(&spec
->mute_mutex
);
320 /* we have to remember current mute status for each DAC */
321 for (idx
= 0; idx
< 7 ; ++idx
)
322 changed
[idx
] = stac9460_dac_mute(ice
,
323 STAC946X_MASTER_VOLUME
+ idx
, 0);
324 /*dev_dbg(ice->card->dev, "Rate change: %d, new MC: 0x%02x\n", rate, new);*/
325 stac9460_put(ice
, STAC946X_MASTER_CLOCKING
, new);
327 /* unmuting - only originally unmuted dacs -
328 * i.e. those changed when muting */
329 for (idx
= 0; idx
< 7 ; ++idx
) {
331 stac9460_dac_mute(ice
, STAC946X_MASTER_VOLUME
+ idx
, 1);
333 mutex_unlock(&spec
->mute_mutex
);
337 static const DECLARE_TLV_DB_SCALE(db_scale_dac
, -19125, 75, 0);
338 static const DECLARE_TLV_DB_SCALE(db_scale_adc
, 0, 150, 0);
344 static const struct snd_kcontrol_new stac_controls
[] = {
346 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
347 .name
= "Master Playback Switch",
348 .info
= stac9460_dac_mute_info
,
349 .get
= stac9460_dac_mute_get
,
350 .put
= stac9460_dac_mute_put
,
352 .tlv
= { .p
= db_scale_dac
}
355 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
356 .access
= (SNDRV_CTL_ELEM_ACCESS_READWRITE
|
357 SNDRV_CTL_ELEM_ACCESS_TLV_READ
),
358 .name
= "Master Playback Volume",
359 .info
= stac9460_dac_vol_info
,
360 .get
= stac9460_dac_vol_get
,
361 .put
= stac9460_dac_vol_put
,
363 .tlv
= { .p
= db_scale_dac
}
366 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
367 .name
= "DAC Switch",
369 .info
= stac9460_dac_mute_info
,
370 .get
= stac9460_dac_mute_get
,
371 .put
= stac9460_dac_mute_put
,
374 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
375 .access
= (SNDRV_CTL_ELEM_ACCESS_READWRITE
|
376 SNDRV_CTL_ELEM_ACCESS_TLV_READ
),
377 .name
= "DAC Volume",
379 .info
= stac9460_dac_vol_info
,
380 .get
= stac9460_dac_vol_get
,
381 .put
= stac9460_dac_vol_put
,
382 .tlv
= { .p
= db_scale_dac
}
385 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
386 .name
= "ADC Capture Switch",
388 .info
= stac9460_adc_mute_info
,
389 .get
= stac9460_adc_mute_get
,
390 .put
= stac9460_adc_mute_put
,
394 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
395 .access
= (SNDRV_CTL_ELEM_ACCESS_READWRITE
|
396 SNDRV_CTL_ELEM_ACCESS_TLV_READ
),
397 .name
= "ADC Capture Volume",
399 .info
= stac9460_adc_vol_info
,
400 .get
= stac9460_adc_vol_get
,
401 .put
= stac9460_adc_vol_put
,
402 .tlv
= { .p
= db_scale_adc
}
405 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
406 .name
= "Analog Capture Input",
407 .info
= stac9460_mic_sw_info
,
408 .get
= stac9460_mic_sw_get
,
409 .put
= stac9460_mic_sw_put
,
414 /* AK4114 - ICE1724 connections on Prodigy192 + MI/ODI/O */
415 /* CDTO (pin 32) -- GPIO11 pin 86
416 * CDTI (pin 33) -- GPIO10 pin 77
417 * CCLK (pin 34) -- GPIO9 pin 76
418 * CSN (pin 35) -- GPIO8 pin 75
420 #define AK4114_ADDR 0x00 /* C1-C0: Chip Address
421 * (According to datasheet fixed to “00”)
425 * 4wire ak4114 protocol - writing data
427 static void write_data(struct snd_ice1712
*ice
, unsigned int gpio
,
428 unsigned int data
, int idx
)
430 for (; idx
>= 0; idx
--) {
432 gpio
&= ~VT1724_PRODIGY192_CCLK
;
433 snd_ice1712_gpio_write(ice
, gpio
);
436 if (data
& (1 << idx
))
437 gpio
|= VT1724_PRODIGY192_CDOUT
;
439 gpio
&= ~VT1724_PRODIGY192_CDOUT
;
440 snd_ice1712_gpio_write(ice
, gpio
);
443 gpio
|= VT1724_PRODIGY192_CCLK
;
444 snd_ice1712_gpio_write(ice
, gpio
);
450 * 4wire ak4114 protocol - reading data
452 static unsigned char read_data(struct snd_ice1712
*ice
, unsigned int gpio
,
455 unsigned char data
= 0;
457 for (; idx
>= 0; idx
--) {
459 gpio
&= ~VT1724_PRODIGY192_CCLK
;
460 snd_ice1712_gpio_write(ice
, gpio
);
463 if (snd_ice1712_gpio_read(ice
) & VT1724_PRODIGY192_CDIN
)
467 gpio
|= VT1724_PRODIGY192_CCLK
;
468 snd_ice1712_gpio_write(ice
, gpio
);
474 * 4wire ak4114 protocol - starting sequence
476 static unsigned int prodigy192_4wire_start(struct snd_ice1712
*ice
)
480 snd_ice1712_save_gpio_status(ice
);
481 tmp
= snd_ice1712_gpio_read(ice
);
483 tmp
|= VT1724_PRODIGY192_CCLK
; /* high at init */
484 tmp
&= ~VT1724_PRODIGY192_CS
; /* drop chip select */
485 snd_ice1712_gpio_write(ice
, tmp
);
491 * 4wire ak4114 protocol - final sequence
493 static void prodigy192_4wire_finish(struct snd_ice1712
*ice
, unsigned int tmp
)
495 tmp
|= VT1724_PRODIGY192_CS
; /* raise chip select */
496 snd_ice1712_gpio_write(ice
, tmp
);
498 snd_ice1712_restore_gpio_status(ice
);
502 * Write data to addr register of ak4114
504 static void prodigy192_ak4114_write(void *private_data
, unsigned char addr
,
507 struct snd_ice1712
*ice
= private_data
;
508 unsigned int tmp
, addrdata
;
509 tmp
= prodigy192_4wire_start(ice
);
510 addrdata
= (AK4114_ADDR
<< 6) | 0x20 | (addr
& 0x1f);
511 addrdata
= (addrdata
<< 8) | data
;
512 write_data(ice
, tmp
, addrdata
, 15);
513 prodigy192_4wire_finish(ice
, tmp
);
517 * Read data from addr register of ak4114
519 static unsigned char prodigy192_ak4114_read(void *private_data
,
522 struct snd_ice1712
*ice
= private_data
;
526 tmp
= prodigy192_4wire_start(ice
);
527 write_data(ice
, tmp
, (AK4114_ADDR
<< 6) | (addr
& 0x1f), 7);
528 data
= read_data(ice
, tmp
, 7);
529 prodigy192_4wire_finish(ice
, tmp
);
534 static int ak4114_input_sw_info(struct snd_kcontrol
*kcontrol
,
535 struct snd_ctl_elem_info
*uinfo
)
537 static const char * const texts
[2] = { "Toslink", "Coax" };
539 return snd_ctl_enum_info(uinfo
, 1, 2, texts
);
543 static int ak4114_input_sw_get(struct snd_kcontrol
*kcontrol
,
544 struct snd_ctl_elem_value
*ucontrol
)
546 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
549 val
= prodigy192_ak4114_read(ice
, AK4114_REG_IO1
);
550 /* AK4114_IPS0 bit = 0 -> RX0 = Toslink
551 * AK4114_IPS0 bit = 1 -> RX1 = Coax
553 ucontrol
->value
.enumerated
.item
[0] = (val
& AK4114_IPS0
) ? 1 : 0;
557 static int ak4114_input_sw_put(struct snd_kcontrol
*kcontrol
,
558 struct snd_ctl_elem_value
*ucontrol
)
560 struct snd_ice1712
*ice
= snd_kcontrol_chip(kcontrol
);
561 unsigned char new, old
, itemvalue
;
564 old
= prodigy192_ak4114_read(ice
, AK4114_REG_IO1
);
565 /* AK4114_IPS0 could be any bit */
566 itemvalue
= (ucontrol
->value
.enumerated
.item
[0]) ? 0xff : 0x00;
568 new = (itemvalue
& AK4114_IPS0
) | (old
& ~AK4114_IPS0
);
569 change
= (new != old
);
571 prodigy192_ak4114_write(ice
, AK4114_REG_IO1
, new);
576 static const struct snd_kcontrol_new ak4114_controls
[] = {
578 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
579 .name
= "MIODIO IEC958 Capture Input",
580 .info
= ak4114_input_sw_info
,
581 .get
= ak4114_input_sw_get
,
582 .put
= ak4114_input_sw_put
,
588 static int prodigy192_ak4114_init(struct snd_ice1712
*ice
)
590 static const unsigned char ak4114_init_vals
[] = {
591 AK4114_RST
| AK4114_PWN
| AK4114_OCKS0
| AK4114_OCKS1
,
592 /* ice1724 expects I2S and provides clock,
593 * DEM0 disables the deemphasis filter
595 AK4114_DIF_I24I2S
| AK4114_DEM0
,
597 AK4114_EFH_1024
| AK4114_DIT
, /* default input RX0 */
601 static const unsigned char ak4114_init_txcsb
[] = {
602 0x41, 0x02, 0x2c, 0x00, 0x00
604 struct prodigy192_spec
*spec
= ice
->spec
;
607 err
= snd_ak4114_create(ice
->card
,
608 prodigy192_ak4114_read
,
609 prodigy192_ak4114_write
,
610 ak4114_init_vals
, ak4114_init_txcsb
,
614 /* AK4114 in Prodigy192 cannot detect external rate correctly.
615 * No reason to stop capture stream due to incorrect checks */
616 spec
->ak4114
->check_flags
= AK4114_CHECK_NO_RATE
;
620 static void stac9460_proc_regs_read(struct snd_info_entry
*entry
,
621 struct snd_info_buffer
*buffer
)
623 struct snd_ice1712
*ice
= entry
->private_data
;
625 /* registers 0x0 - 0x14 */
626 for (reg
= 0; reg
<= 0x15; reg
++) {
627 val
= stac9460_get(ice
, reg
);
628 snd_iprintf(buffer
, "0x%02x = 0x%02x\n", reg
, val
);
633 static void stac9460_proc_init(struct snd_ice1712
*ice
)
635 snd_card_ro_proc_new(ice
->card
, "stac9460_codec", ice
,
636 stac9460_proc_regs_read
);
640 static int prodigy192_add_controls(struct snd_ice1712
*ice
)
642 struct prodigy192_spec
*spec
= ice
->spec
;
646 for (i
= 0; i
< ARRAY_SIZE(stac_controls
); i
++) {
647 err
= snd_ctl_add(ice
->card
,
648 snd_ctl_new1(&stac_controls
[i
], ice
));
653 /* ak4114 is connected */
654 for (i
= 0; i
< ARRAY_SIZE(ak4114_controls
); i
++) {
655 err
= snd_ctl_add(ice
->card
,
656 snd_ctl_new1(&ak4114_controls
[i
],
661 err
= snd_ak4114_build(spec
->ak4114
,
662 NULL
, /* ak4114 in MIO/DI/O handles no IEC958 output */
663 ice
->pcm
->streams
[SNDRV_PCM_STREAM_CAPTURE
].substream
);
667 stac9460_proc_init(ice
);
672 * check for presence of MI/ODI/O add-on card with digital inputs
674 static int prodigy192_miodio_exists(struct snd_ice1712
*ice
)
677 unsigned char orig_value
;
678 const unsigned char test_data
= 0xd1; /* random value */
679 unsigned char addr
= AK4114_REG_INT0_MASK
; /* random SAFE address */
682 orig_value
= prodigy192_ak4114_read(ice
, addr
);
683 prodigy192_ak4114_write(ice
, addr
, test_data
);
684 if (prodigy192_ak4114_read(ice
, addr
) == test_data
) {
685 /* ak4114 seems to communicate, apparently exists */
686 /* writing back original value */
687 prodigy192_ak4114_write(ice
, addr
, orig_value
);
694 * initialize the chip
696 static int prodigy192_init(struct snd_ice1712
*ice
)
698 static const unsigned short stac_inits_prodigy
[] = {
700 STAC946X_MASTER_CLOCKING
, 0x11,
701 /* STAC946X_MASTER_VOLUME, 0,
702 STAC946X_LF_VOLUME, 0,
703 STAC946X_RF_VOLUME, 0,
704 STAC946X_LR_VOLUME, 0,
705 STAC946X_RR_VOLUME, 0,
706 STAC946X_CENTER_VOLUME, 0,
707 STAC946X_LFE_VOLUME, 0,*/
710 const unsigned short *p
;
712 struct prodigy192_spec
*spec
;
715 ice
->num_total_dacs
= 6;
716 ice
->num_total_adcs
= 2;
717 ice
->vt1720
= 0; /* ice1724, e.g. 23 GPIOs */
719 spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
723 mutex_init(&spec
->mute_mutex
);
725 /* initialize codec */
726 p
= stac_inits_prodigy
;
727 for (; *p
!= (unsigned short)-1; p
+= 2)
728 stac9460_put(ice
, p
[0], p
[1]);
729 ice
->gpio
.set_pro_rate
= stac9460_set_rate_val
;
731 /* MI/ODI/O add on card with AK4114 */
732 if (prodigy192_miodio_exists(ice
)) {
733 err
= prodigy192_ak4114_init(ice
);
734 /* from this moment if err = 0 then
735 * spec->ak4114 should not be null
737 dev_dbg(ice
->card
->dev
,
738 "AK4114 initialized with status %d\n", err
);
740 dev_dbg(ice
->card
->dev
, "AK4114 not found\n");
747 * Aureon boards don't provide the EEPROM data except for the vendor IDs.
748 * hence the driver needs to sets up it properly.
751 static const unsigned char prodigy71_eeprom
[] = {
752 [ICE_EEP2_SYSCONF
] = 0x6a, /* 49MHz crystal, mpu401,
753 * spdif-in+ 1 stereo ADC,
756 [ICE_EEP2_ACLINK
] = 0x80, /* I2S */
757 [ICE_EEP2_I2S
] = 0xf8, /* vol, 96k, 24bit, 192k */
758 [ICE_EEP2_SPDIF
] = 0xc3, /* out-en, out-int, spdif-in */
759 [ICE_EEP2_GPIO_DIR
] = 0xff,
760 [ICE_EEP2_GPIO_DIR1
] = ~(VT1724_PRODIGY192_CDIN
>> 8) ,
761 [ICE_EEP2_GPIO_DIR2
] = 0xbf,
762 [ICE_EEP2_GPIO_MASK
] = 0x00,
763 [ICE_EEP2_GPIO_MASK1
] = 0x00,
764 [ICE_EEP2_GPIO_MASK2
] = 0x00,
765 [ICE_EEP2_GPIO_STATE
] = 0x00,
766 [ICE_EEP2_GPIO_STATE1
] = 0x00,
767 [ICE_EEP2_GPIO_STATE2
] = 0x10, /* GPIO20: 0 = CD drive dig. input
769 * 1 = SPDIF-OUT from ice1724
775 struct snd_ice1712_card_info snd_vt1724_prodigy192_cards
[] = {
777 .subvendor
= VT1724_SUBDEVICE_PRODIGY192VE
,
778 .name
= "Audiotrak Prodigy 192",
779 .model
= "prodigy192",
780 .chip_init
= prodigy192_init
,
781 .build_controls
= prodigy192_add_controls
,
782 .eeprom_size
= sizeof(prodigy71_eeprom
),
783 .eeprom_data
= prodigy71_eeprom
,