Lines Matching +full:i2s +full:- +full:transmitter +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Lowlevel functions for ONKYO WAVIO SE-90PCI and SE-200PCI
7 * Copyright (c) 2007 Shin-ya Okada sh_okada(at)d4.dion.ne.jp
8 * (at) -> @
29 /* ONKYO WAVIO SE-200PCI */
38 * AC-Link configuration ICE_EEP2_ACLINK=0x80
41 * I2S converters feature ICE_EEP2_I2S=0x78
42 * I2S codec has no volume/mute control feature
43 * I2S codec supports 96KHz and 192KHz
44 * I2S codec 24bits
47 * Enable integrated S/PDIF transmitter
56 * A 2ch-DAC of main outputs.
57 * It setuped as I2S mode by wire, so no way to setup from software.
58 * The sample-rate are automatically changed.
59 * ML/I2S (28pin) --------+
60 * MC/DM1 (27pin) -- 5V |
61 * MD/DM0 (26pin) -- GND |
62 * MUTEB (25pin) -- NC |
63 * MODE (24pin) -- GND |
64 * CSBIW (23pin) --------+
66 * RSTB (22pin) --R(1K)-+
70 * A 6ch-DAC for surrounds.
71 * It's control wire was connected to GPIOxx (3-wire serial interface)
72 * ML/I2S (11pin) -- GPIO18
73 * MC/IWL (12pin) -- GPIO17
74 * MD/DM (13pin) -- GPIO16
75 * MUTE (14pin) -- GPIO01
78 * A 2ch-ADC(with 10ch-selector) plus 2ch-DAC.
79 * It's control wire was connected to SDA/SCLK (2-wire serial interface)
80 * MODE (16pin) -- R(1K) -- GND
81 * CE (17pin) -- R(1K) -- GND 2-wire mode (address=0x34)
82 * DI (18pin) -- SDA
83 * CL (19pin) -- SCLK
88 * 7.1ch name -- output connector color -- device (-D option)
90 * FRONT 2ch -- green -- plughw:0,0
91 * CENTER(Lch) SUBWOOFER(Rch) -- black -- plughw:0,2,0
92 * SURROUND 2ch -- orange -- plughw:0,2,1
93 * SURROUND BACK 2ch -- white -- plughw:0,2,2
133 snd_ice1712_gpio_set_dir(ice, ice->gpio.direction | ALL_MASK); in se200pci_WM8766_write()
134 snd_ice1712_gpio_set_mask(ice, ice->gpio.write_mask & ~ALL_MASK); in se200pci_WM8766_write()
139 udelay(1); in se200pci_WM8766_write()
141 st = (st << 1); in se200pci_WM8766_write()
149 udelay(1); in se200pci_WM8766_write()
154 udelay(1); in se200pci_WM8766_write()
158 udelay(1); in se200pci_WM8766_write()
173 case 1: in se200pci_WM8766_set_volume()
190 se200pci_WM8766_set_volume(ice, 1, 0, 0); /* volume L=0 R=0 */ in se200pci_WM8766_init()
193 se200pci_WM8766_write(ice, 0x03, 0x022); /* serial mode I2S-24bits */ in se200pci_WM8766_init()
199 se200pci_WM8766_write(ice, 0x02, 0x124); /* ch-assign L=L R=R RESET */ in se200pci_WM8766_init()
200 se200pci_WM8766_write(ice, 0x02, 0x120); /* ch-assign L=L R=R */ in se200pci_WM8766_init()
242 "LINE-IN", "CD-IN", "MIC-IN", "ALL-MIX", NULL
259 /* AFL -- After Fader Listening */ in se200pci_WM8776_set_afl()
272 /* AGC -- Auto Gain Control of the input */ in se200pci_WM8776_set_agc()
277 case 1: in se200pci_WM8776_set_agc()
301 /* ADC and DAC interface is I2S 24bits mode */ in se200pci_WM8776_init()
302 /* The sample-rate are automatically changed */ in se200pci_WM8776_init()
366 .ch = 1,
423 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in se200pci_cont_volume_info()
424 uinfo->count = 2; in se200pci_cont_volume_info()
425 uinfo->value.integer.min = 0; /* mute */ in se200pci_cont_volume_info()
426 uinfo->value.integer.max = 0xff; /* 0dB */ in se200pci_cont_volume_info()
437 n = kc->private_value; in se200pci_cont_enum_info()
440 return -EINVAL; in se200pci_cont_enum_info()
441 return snd_ctl_enum_info(uinfo, 1, c, se200pci_cont[n].member); in se200pci_cont_enum_info()
448 struct se_spec *spec = ice->spec; in se200pci_cont_volume_get()
449 int n = kc->private_value; in se200pci_cont_volume_get()
450 uc->value.integer.value[0] = spec->vol[n].ch1; in se200pci_cont_volume_get()
451 uc->value.integer.value[1] = spec->vol[n].ch2; in se200pci_cont_volume_get()
459 struct se_spec *spec = ice->spec; in se200pci_cont_boolean_get()
460 int n = kc->private_value; in se200pci_cont_boolean_get()
461 uc->value.integer.value[0] = spec->vol[n].ch1; in se200pci_cont_boolean_get()
469 struct se_spec *spec = ice->spec; in se200pci_cont_enum_get()
470 int n = kc->private_value; in se200pci_cont_enum_get()
471 uc->value.enumerated.item[0] = spec->vol[n].ch1; in se200pci_cont_enum_get()
477 struct se_spec *spec = ice->spec; in se200pci_cont_update()
482 spec->vol[n].ch1, in se200pci_cont_update()
483 spec->vol[n].ch2); in se200pci_cont_update()
488 spec->vol[n].ch1, in se200pci_cont_update()
489 spec->vol[n].ch2); in se200pci_cont_update()
494 spec->vol[n].ch1, in se200pci_cont_update()
495 spec->vol[n].ch2); in se200pci_cont_update()
500 spec->vol[n].ch1); in se200pci_cont_update()
504 se200pci_WM8776_set_agc(ice, spec->vol[n].ch1); in se200pci_cont_update()
508 se200pci_WM8776_set_afl(ice, spec->vol[n].ch1); in se200pci_cont_update()
520 struct se_spec *spec = ice->spec; in se200pci_cont_volume_put()
521 int n = kc->private_value; in se200pci_cont_volume_put()
526 vol1 = uc->value.integer.value[0] & 0xff; in se200pci_cont_volume_put()
527 vol2 = uc->value.integer.value[1] & 0xff; in se200pci_cont_volume_put()
528 if (spec->vol[n].ch1 != vol1) { in se200pci_cont_volume_put()
529 spec->vol[n].ch1 = vol1; in se200pci_cont_volume_put()
530 changed = 1; in se200pci_cont_volume_put()
532 if (spec->vol[n].ch2 != vol2) { in se200pci_cont_volume_put()
533 spec->vol[n].ch2 = vol2; in se200pci_cont_volume_put()
534 changed = 1; in se200pci_cont_volume_put()
546 struct se_spec *spec = ice->spec; in se200pci_cont_boolean_put()
547 int n = kc->private_value; in se200pci_cont_boolean_put()
550 vol1 = !!uc->value.integer.value[0]; in se200pci_cont_boolean_put()
551 if (spec->vol[n].ch1 != vol1) { in se200pci_cont_boolean_put()
552 spec->vol[n].ch1 = vol1; in se200pci_cont_boolean_put()
554 return 1; in se200pci_cont_boolean_put()
563 struct se_spec *spec = ice->spec; in se200pci_cont_enum_put()
564 int n = kc->private_value; in se200pci_cont_enum_put()
567 vol1 = uc->value.enumerated.item[0]; in se200pci_cont_enum_put()
569 return -EINVAL; in se200pci_cont_enum_put()
570 if (spec->vol[n].ch1 != vol1) { in se200pci_cont_enum_put()
571 spec->vol[n].ch1 = vol1; in se200pci_cont_enum_put()
573 return 1; in se200pci_cont_enum_put()
578 static const DECLARE_TLV_DB_SCALE(db_scale_gain1, -12750, 50, 1);
579 static const DECLARE_TLV_DB_SCALE(db_scale_gain2, -10350, 50, 1);
618 return -EINVAL; in se200pci_add_controls()
620 err = snd_ctl_add(ice->card, snd_ctl_new1(&cont, ice)); in se200pci_add_controls()
630 /* ONKYO WAVIO SE-90PCI */
634 * AC-Link configuration ICE_EEP2_ACLINK=0x80
635 * I2S converters feature ICE_EEP2_I2S=0x78
641 * A 2ch-DAC of main outputs.
642 * It setuped as I2S mode by wire, so no way to setup from software.
643 * ML/I2S (28pin) -- +5V
644 * MC/DM1 (27pin) -- GND
645 * MC/DM0 (26pin) -- GND
646 * MUTEB (25pin) -- open (internal pull-up)
647 * MODE (24pin) -- GND
648 * CSBIWO (23pin) -- +5V
665 return -ENOMEM; in se_init()
666 ice->spec = spec; in se_init()
668 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_SE90PCI) { in se_init()
669 ice->num_total_dacs = 2; in se_init()
670 ice->num_total_adcs = 0; in se_init()
671 ice->vt1720 = 1; in se_init()
674 } else if (ice->eeprom.subvendor == VT1724_SUBDEVICE_SE200PCI) { in se_init()
675 ice->num_total_dacs = 8; in se_init()
676 ice->num_total_adcs = 2; in se_init()
680 ice->gpio.set_pro_rate = se200pci_set_pro_rate; in se_init()
684 return -ENOENT; in se_init()
693 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_SE200PCI) in se_add_controls()
705 [ICE_EEP2_SYSCONF] = 0x4b, /* 49.152Hz, spdif-in/ADC, 4DACs */
706 [ICE_EEP2_ACLINK] = 0x80, /* I2S */
707 [ICE_EEP2_I2S] = 0x78, /* 96k-ok, 24bit, 192k-ok */
708 [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */
710 [ICE_EEP2_GPIO_DIR] = 0x02, /* WM8766 mute 1=output */
712 [ICE_EEP2_GPIO_DIR2] = 0x07, /* WM8766 ML/MC/MD 1=output */
724 [ICE_EEP2_SYSCONF] = 0x4b, /* 49.152Hz, spdif-in/ADC, 4DACs */
725 [ICE_EEP2_ACLINK] = 0x80, /* I2S */
726 [ICE_EEP2_I2S] = 0x78, /* 96k-ok, 24bit, 192k-ok */
727 [ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */