Lines Matching +full:6 +full:- +full:wire
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Supported IEC958 input from optional MI/ODI/O add-on card.
9 * -------------------
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
16 * by GPIO20 (0 = CD dig-out, 1 = SPDTX)
17 * * SPDTX goes straight to MI/ODI/O card's SPDIF-OUT coax
20 * - toslink input -> RX0
21 * - coax input -> RX1
22 * - 4wire protocol:
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
33 * OCKS0=1, OCKS1=1 (128fs, 64fs output) and ice1724 -
87 /* dev_dbg(ice->card->dev, "Volume register 0x%02x: 0x%02x\n", idx, new);*/ in stac9460_dac_mute()
100 if (kcontrol->private_value) in stac9460_dac_mute_get()
103 idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + STAC946X_LF_VOLUME; in stac9460_dac_mute_get()
105 ucontrol->value.integer.value[0] = (~val >> 7) & 0x1; in stac9460_dac_mute_get()
112 struct prodigy192_spec *spec = ice->spec; in stac9460_dac_mute_put()
115 if (kcontrol->private_value) in stac9460_dac_mute_put()
118 idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + STAC946X_LF_VOLUME; in stac9460_dac_mute_put()
120 mutex_lock(&spec->mute_mutex); in stac9460_dac_mute_put()
122 dev_dbg(ice->card->dev, "Mute put: reg 0x%02x, ctrl value: 0x%02x\n", idx, in stac9460_dac_mute_put()
123 ucontrol->value.integer.value[0]); in stac9460_dac_mute_put()
125 change = stac9460_dac_mute(ice, idx, ucontrol->value.integer.value[0]); in stac9460_dac_mute_put()
126 mutex_unlock(&spec->mute_mutex); in stac9460_dac_mute_put()
135 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in stac9460_dac_vol_info()
136 uinfo->count = 1; in stac9460_dac_vol_info()
137 uinfo->value.integer.min = 0; /* mute */ in stac9460_dac_vol_info()
138 uinfo->value.integer.max = 0x7f; /* 0dB */ in stac9460_dac_vol_info()
148 if (kcontrol->private_value) in stac9460_dac_vol_get()
151 idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + STAC946X_LF_VOLUME; in stac9460_dac_vol_get()
153 ucontrol->value.integer.value[0] = 0x7f - vol; in stac9460_dac_vol_get()
165 if (kcontrol->private_value) in stac9460_dac_vol_put()
168 idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + STAC946X_LF_VOLUME; in stac9460_dac_vol_put()
169 nvol = ucontrol->value.integer.value[0]; in stac9460_dac_vol_put()
171 ovol = 0x7f - (tmp & 0x7f); in stac9460_dac_vol_put()
174 ovol = (0x7f - nvol) | (tmp & 0x80); in stac9460_dac_vol_put()
176 dev_dbg(ice->card->dev, "DAC Volume: reg 0x%02x: 0x%02x\n", in stac9460_dac_vol_put()
179 stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80)); in stac9460_dac_vol_put()
197 ucontrol->value.integer.value[i] = ~val>>7 & 0x1; in stac9460_adc_mute_get()
213 new = (~ucontrol->value.integer.value[i]<<7&0x80) | (old&~0x80); in stac9460_adc_mute_put()
227 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in stac9460_adc_vol_info()
228 uinfo->count = 2; in stac9460_adc_vol_info()
229 uinfo->value.integer.min = 0; /* 0dB */ in stac9460_adc_vol_info()
230 uinfo->value.integer.max = 0x0f; /* 22.5dB */ in stac9460_adc_vol_info()
243 ucontrol->value.integer.value[i] = 0x0f - vol; in stac9460_adc_vol_get()
258 nvol = ucontrol->value.integer.value[i] & 0x0f; in stac9460_adc_vol_put()
259 ovol = 0x0f - stac9460_get(ice, reg); in stac9460_adc_vol_put()
262 stac9460_put(ice, reg, (0x0f - nvol) | (ovol & ~0x0f)); in stac9460_adc_vol_put()
284 ucontrol->value.enumerated.item[0] = (val >> 7) & 0x1; in stac9460_mic_sw_get()
295 new = (ucontrol->value.enumerated.item[0] << 7 & 0x80) | (old & ~0x80); in stac9460_mic_sw_put()
302 * Handler for setting correct codec rate - called when rate change is detected
309 struct prodigy192_spec *spec = ice->spec; in stac9460_set_rate_val()
311 if (rate == 0) /* no hint - S/PDIF input is master, simply return */ in stac9460_set_rate_val()
323 /* due to possible conflicts with mute controls - mutexing */ in stac9460_set_rate_val()
324 mutex_lock(&spec->mute_mutex); in stac9460_set_rate_val()
329 /*dev_dbg(ice->card->dev, "Rate change: %d, new MC: 0x%02x\n", rate, new);*/ in stac9460_set_rate_val()
332 /* unmuting - only originally unmuted dacs - in stac9460_set_rate_val()
338 mutex_unlock(&spec->mute_mutex); in stac9460_set_rate_val()
342 static const DECLARE_TLV_DB_SCALE(db_scale_dac, -19125, 75, 0);
373 .count = 6,
383 .count = 6,
419 /* AK4114 - ICE1724 connections on Prodigy192 + MI/ODI/O */
420 /* CDTO (pin 32) -- GPIO11 pin 86
421 * CDTI (pin 33) -- GPIO10 pin 77
422 * CCLK (pin 34) -- GPIO9 pin 76
423 * CSN (pin 35) -- GPIO8 pin 75
425 #define AK4114_ADDR 0x00 /* C1-C0: Chip Address
430 * 4wire ak4114 protocol - writing data
435 for (; idx >= 0; idx--) { in write_data()
455 * 4wire ak4114 protocol - reading data
462 for (; idx >= 0; idx--) { in read_data()
479 * 4wire ak4114 protocol - starting sequence
496 * 4wire ak4114 protocol - final sequence
515 addrdata = (AK4114_ADDR << 6) | 0x20 | (addr & 0x1f); in prodigy192_ak4114_write()
532 write_data(ice, tmp, (AK4114_ADDR << 6) | (addr & 0x1f), 7); in prodigy192_ak4114_read()
555 /* AK4114_IPS0 bit = 0 -> RX0 = Toslink in ak4114_input_sw_get()
556 * AK4114_IPS0 bit = 1 -> RX1 = Coax in ak4114_input_sw_get()
558 ucontrol->value.enumerated.item[0] = (val & AK4114_IPS0) ? 1 : 0; in ak4114_input_sw_get()
571 itemvalue = (ucontrol->value.enumerated.item[0]) ? 0xff : 0x00; in ak4114_input_sw_put()
609 struct prodigy192_spec *spec = ice->spec; in prodigy192_ak4114_init()
612 err = snd_ak4114_create(ice->card, in prodigy192_ak4114_init()
616 ice, &spec->ak4114); in prodigy192_ak4114_init()
621 spec->ak4114->check_flags = AK4114_CHECK_NO_RATE; in prodigy192_ak4114_init()
628 struct snd_ice1712 *ice = entry->private_data; in stac9460_proc_regs_read()
630 /* registers 0x0 - 0x14 */ in stac9460_proc_regs_read()
640 snd_card_ro_proc_new(ice->card, "stac9460_codec", ice, in stac9460_proc_init()
647 struct prodigy192_spec *spec = ice->spec; in prodigy192_add_controls()
652 err = snd_ctl_add(ice->card, in prodigy192_add_controls()
657 if (spec->ak4114) { in prodigy192_add_controls()
660 err = snd_ctl_add(ice->card, in prodigy192_add_controls()
666 err = snd_ak4114_build(spec->ak4114, in prodigy192_add_controls()
668 ice->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); in prodigy192_add_controls()
677 * check for presence of MI/ODI/O add-on card with digital inputs
713 (unsigned short)-1 in prodigy192_init()
720 ice->num_total_dacs = 6; in prodigy192_init()
721 ice->num_total_adcs = 2; in prodigy192_init()
722 ice->vt1720 = 0; /* ice1724, e.g. 23 GPIOs */ in prodigy192_init()
726 return -ENOMEM; in prodigy192_init()
727 ice->spec = spec; in prodigy192_init()
728 mutex_init(&spec->mute_mutex); in prodigy192_init()
732 for (; *p != (unsigned short)-1; p += 2) in prodigy192_init()
734 ice->gpio.set_pro_rate = stac9460_set_rate_val; in prodigy192_init()
740 * spec->ak4114 should not be null in prodigy192_init()
742 dev_dbg(ice->card->dev, in prodigy192_init()
745 dev_dbg(ice->card->dev, "AK4114 not found\n"); in prodigy192_init()
758 * spdif-in+ 1 stereo ADC,
763 [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */
774 * 1 = SPDIF-OUT from ice1724