Lines Matching +full:playback +full:- +full:only

1 // SPDX-License-Identifier: GPL-2.0-or-later
7 * Copyright (c) 2012 Ondrej Zary <linux@rainbow-software.org>
34 * VT1722 (Envy24GT) - 6 outputs, 4 inputs (only 2 used), 24-bit/96kHz
42 * AC-Link configuration ICE_EEP2_ACLINK=0x80
60 * 2-channel DAC used for main output and stereo ADC (with 10-channel MUX)
63 * MODE (pin16) -- GND
64 * CE (pin17) -- GND I2C mode (address=0x34)
65 * DI (pin18) -- SDA (VT1722 pin70)
66 * CL (pin19) -- SCLK (VT1722 pin71)
69 * 6-channel DAC used for rear & center/LFE outputs (only 4 channels used)
71 * MODE (pin 1) -- GPIO19 (VT1722 pin99)
72 * ML/I2S (pin11) -- GPIO18 (VT1722 pin98)
73 * MC/IWL (pin12) -- GPIO17 (VT1722 pin97)
74 * MD/DM (pin13) -- GPIO16 (VT1722 pin96)
75 * MUTE (pin14) -- GPIO20 (VT1722 pin101)
82 * 5.1ch name -- output connector color -- device (-D option)
84 * FRONT 2ch -- green -- plughw:0,0
85 * CENTER(Lch) SUBWOOFER(Rch) -- orange -- plughw:0,2,0
86 * REAR 2ch -- black -- plughw:0,2,1
89 /* codec access low-level functions */
107 struct snd_ice1712 *ice = spec->ice; in psc724_wm8766_write()
114 snd_ice1712_gpio_set_dir(ice, ice->gpio.direction | PSC724_SPI_MASK); in psc724_wm8766_write()
115 snd_ice1712_gpio_set_mask(ice, ice->gpio.write_mask & ~PSC724_SPI_MASK); in psc724_wm8766_write()
150 snd_vt1724_write_i2c(spec->ice, 0x34, addr, data); in psc724_wm8776_write()
158 struct psc724_spec *spec = ice->spec; in psc724_set_master_switch()
160 spec->mute_all = !on; in psc724_set_master_switch()
170 struct psc724_spec *spec = ice->spec; in psc724_get_master_switch()
172 return !spec->mute_all; in psc724_get_master_switch()
179 struct psc724_spec *spec = ice->spec; in psc724_set_jack_state()
181 u16 power = spec->wm8776.regs[WM8776_REG_PWRDOWN] & ~WM8776_PWR_HPPD; in psc724_set_jack_state()
186 snd_wm8776_set_power(&spec->wm8776, power); in psc724_set_jack_state()
187 spec->hp_connected = hp_connected; in psc724_set_jack_state()
189 kctl = snd_ctl_find_id_mixer(ice->card, in psc724_set_jack_state()
190 "Master Speakers Playback Switch"); in psc724_set_jack_state()
192 snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); in psc724_set_jack_state()
194 kctl = snd_ctl_find_id_mixer(ice->card, in psc724_set_jack_state()
195 spec->wm8776.ctl[WM8776_CTL_HP_SW].name); in psc724_set_jack_state()
197 snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); in psc724_set_jack_state()
204 struct snd_ice1712 *ice = spec->ice; in psc724_update_hp_jack_state()
207 schedule_delayed_work(&spec->hp_work, msecs_to_jiffies(JACK_INTERVAL)); in psc724_update_hp_jack_state()
208 if (hp_connected == spec->hp_connected) in psc724_update_hp_jack_state()
215 struct psc724_spec *spec = ice->spec; in psc724_set_jack_detection()
217 if (spec->jack_detect == on) in psc724_set_jack_detection()
220 spec->jack_detect = on; in psc724_set_jack_detection()
224 schedule_delayed_work(&spec->hp_work, in psc724_set_jack_detection()
227 cancel_delayed_work_sync(&spec->hp_work); in psc724_set_jack_detection()
232 struct psc724_spec *spec = ice->spec; in psc724_get_jack_detection()
234 return spec->jack_detect; in psc724_get_jack_detection()
247 .name = "Master Speakers Playback Switch",
252 .name = "Headphone Jack Detection Playback Switch",
262 int n = kcontrol->private_value; in psc724_ctl_get()
264 ucontrol->value.integer.value[0] = psc724_cont[n].get(ice); in psc724_ctl_get()
273 int n = kcontrol->private_value; in psc724_ctl_put()
275 psc724_cont[n].set(ice, ucontrol->value.integer.value[0]); in psc724_ctl_put()
280 static const char *front_volume = "Front Playback Volume";
281 static const char *front_switch = "Front Playback Switch";
282 static const char *front_zc = "Front Zero Cross Detect Playback Switch";
283 static const char *front_izd = "Front Infinite Zero Detect Playback Switch";
284 static const char *front_phase = "Front Phase Invert Playback Switch";
285 static const char *front_deemph = "Front Deemphasis Playback Switch";
291 static const char *rear_volume = "Surround Playback Volume";
292 static const char *clfe_volume = "CLFE Playback Volume";
293 static const char *rear_switch = "Surround Playback Switch";
294 static const char *clfe_switch = "CLFE Playback Switch";
295 static const char *rear_phase = "Surround Phase Invert Playback Switch";
296 static const char *clfe_phase = "CLFE Phase Invert Playback Switch";
297 static const char *rear_deemph = "Surround Deemphasis Playback Switch";
298 static const char *clfe_deemph = "CLFE Deemphasis Playback Switch";
299 static const char *rear_clfe_izd = "Rear Infinite Zero Detect Playback Switch";
300 static const char *rear_clfe_zc = "Rear Zero Cross Detect Playback Switch";
307 struct psc724_spec *spec = ice->spec; in psc724_add_controls()
309 spec->wm8776.ctl[WM8776_CTL_DAC_VOL].name = front_volume; in psc724_add_controls()
310 spec->wm8776.ctl[WM8776_CTL_DAC_SW].name = front_switch; in psc724_add_controls()
311 spec->wm8776.ctl[WM8776_CTL_DAC_ZC_SW].name = front_zc; in psc724_add_controls()
312 spec->wm8776.ctl[WM8776_CTL_AUX_SW].name = NULL; in psc724_add_controls()
313 spec->wm8776.ctl[WM8776_CTL_DAC_IZD_SW].name = front_izd; in psc724_add_controls()
314 spec->wm8776.ctl[WM8776_CTL_PHASE_SW].name = front_phase; in psc724_add_controls()
315 spec->wm8776.ctl[WM8776_CTL_DEEMPH_SW].name = front_deemph; in psc724_add_controls()
316 spec->wm8776.ctl[WM8776_CTL_INPUT1_SW].name = ain1_switch; in psc724_add_controls()
317 spec->wm8776.ctl[WM8776_CTL_INPUT2_SW].name = ain2_switch; in psc724_add_controls()
318 spec->wm8776.ctl[WM8776_CTL_INPUT3_SW].name = ain3_switch; in psc724_add_controls()
319 spec->wm8776.ctl[WM8776_CTL_INPUT4_SW].name = ain4_switch; in psc724_add_controls()
320 spec->wm8776.ctl[WM8776_CTL_INPUT5_SW].name = ain5_switch; in psc724_add_controls()
321 snd_wm8776_build_controls(&spec->wm8776); in psc724_add_controls()
322 spec->wm8766.ctl[WM8766_CTL_CH1_VOL].name = rear_volume; in psc724_add_controls()
323 spec->wm8766.ctl[WM8766_CTL_CH2_VOL].name = clfe_volume; in psc724_add_controls()
324 spec->wm8766.ctl[WM8766_CTL_CH3_VOL].name = NULL; in psc724_add_controls()
325 spec->wm8766.ctl[WM8766_CTL_CH1_SW].name = rear_switch; in psc724_add_controls()
326 spec->wm8766.ctl[WM8766_CTL_CH2_SW].name = clfe_switch; in psc724_add_controls()
327 spec->wm8766.ctl[WM8766_CTL_CH3_SW].name = NULL; in psc724_add_controls()
328 spec->wm8766.ctl[WM8766_CTL_PHASE1_SW].name = rear_phase; in psc724_add_controls()
329 spec->wm8766.ctl[WM8766_CTL_PHASE2_SW].name = clfe_phase; in psc724_add_controls()
330 spec->wm8766.ctl[WM8766_CTL_PHASE3_SW].name = NULL; in psc724_add_controls()
331 spec->wm8766.ctl[WM8766_CTL_DEEMPH1_SW].name = rear_deemph; in psc724_add_controls()
332 spec->wm8766.ctl[WM8766_CTL_DEEMPH2_SW].name = clfe_deemph; in psc724_add_controls()
333 spec->wm8766.ctl[WM8766_CTL_DEEMPH3_SW].name = NULL; in psc724_add_controls()
334 spec->wm8766.ctl[WM8766_CTL_IZD_SW].name = rear_clfe_izd; in psc724_add_controls()
335 spec->wm8766.ctl[WM8766_CTL_ZC_SW].name = rear_clfe_zc; in psc724_add_controls()
336 snd_wm8766_build_controls(&spec->wm8766); in psc724_add_controls()
349 return -ENOMEM; in psc724_add_controls()
350 err = snd_ctl_add(ice->card, ctl); in psc724_add_controls()
360 struct psc724_spec *spec = ice->spec; in psc724_set_pro_rate()
362 snd_wm8776_volume_restore(&spec->wm8776); in psc724_set_pro_rate()
363 snd_wm8766_volume_restore(&spec->wm8766); in psc724_set_pro_rate()
371 struct psc724_spec *spec = ice->spec; in psc724_resume()
373 snd_wm8776_resume(&spec->wm8776); in psc724_resume()
374 snd_wm8766_resume(&spec->wm8766); in psc724_resume()
388 return -ENOMEM; in psc724_init()
389 ice->spec = spec; in psc724_init()
390 spec->ice = ice; in psc724_init()
392 ice->num_total_dacs = 6; in psc724_init()
393 ice->num_total_adcs = 2; in psc724_init()
394 spec->wm8776.ops.write = psc724_wm8776_write; in psc724_init()
395 spec->wm8776.card = ice->card; in psc724_init()
396 snd_wm8776_init(&spec->wm8776); in psc724_init()
397 spec->wm8766.ops.write = psc724_wm8766_write; in psc724_init()
398 spec->wm8766.card = ice->card; in psc724_init()
400 ice->pm_resume = psc724_resume; in psc724_init()
401 ice->pm_suspend_enabled = 1; in psc724_init()
403 snd_wm8766_init(&spec->wm8766); in psc724_init()
404 snd_wm8766_set_if(&spec->wm8766, in psc724_init()
406 ice->gpio.set_pro_rate = psc724_set_pro_rate; in psc724_init()
407 INIT_DELAYED_WORK(&spec->hp_work, psc724_update_hp_jack_state); in psc724_init()
414 struct psc724_spec *spec = ice->spec; in psc724_exit()
416 cancel_delayed_work_sync(&spec->hp_work); in psc724_exit()
424 [ICE_EEP2_SPDIF] = 0xc1, /* spdif out-en, out-int, no input */
428 [ICE_EEP2_GPIO_MASK] = 0xff, /* read-only */
429 [ICE_EEP2_GPIO_MASK1] = 0xff, /* read-only */