Lines Matching +full:gpio +full:- +full:ctrl2

1 // SPDX-License-Identifier: GPL-2.0-only
10 * --------
14 * SPI 0 -> WM8766 (surround, center/LFE, back)
15 * SPI 1 -> WM8776 (front, input)
17 * GPIO 4 <- headphone detect, 0 = plugged
18 * GPIO 6 -> route input jack to mic-in (0) or line-in (1)
19 * GPIO 7 -> enable output to front L/R speaker channels
20 * GPIO 8 -> enable output to other speaker channels and front panel headphone
24 * input 1 <- line
25 * input 2 <- mic
26 * input 3 <- front mic
27 * input 4 <- aux
32 * ------------------
36 * I²C <-> WM8776 (addr 0011010)
38 * GPIO 0 -> disable HDMI output
39 * GPIO 1 -> enable HP output
40 * GPIO 6 -> firmware EEPROM I²C clock
41 * GPIO 7 <-> firmware EEPROM I²C data
43 * UART <-> HDMI controller
47 * input 1 <- mic
48 * input 2 <- aux
111 struct xonar_wm87x6 *data = chip->model_data; in wm8776_write()
113 if ((chip->model.function_flags & OXYGEN_FUNCTION_2WIRE_SPI_MASK) == in wm8776_write()
118 if (reg < ARRAY_SIZE(data->wm8776_regs)) { in wm8776_write()
122 data->wm8776_regs[reg] = value; in wm8776_write()
129 struct xonar_wm87x6 *data = chip->model_data; in wm8776_write_cached()
131 if (reg >= ARRAY_SIZE(data->wm8776_regs) || in wm8776_write_cached()
132 value != data->wm8776_regs[reg]) in wm8776_write_cached()
139 struct xonar_wm87x6 *data = chip->model_data; in wm8766_write()
147 if (reg < ARRAY_SIZE(data->wm8766_regs)) { in wm8766_write()
152 data->wm8766_regs[reg] = value; in wm8766_write()
159 struct xonar_wm87x6 *data = chip->model_data; in wm8766_write_cached()
161 if (reg >= ARRAY_SIZE(data->wm8766_regs) || in wm8766_write_cached()
162 value != data->wm8766_regs[reg]) in wm8766_write_cached()
168 struct xonar_wm87x6 *data = chip->model_data; in wm8776_registers_init()
174 wm8776_write(chip, WM8776_DACMUTE, chip->dac_mute ? WM8776_DMUTE : 0); in wm8776_registers_init()
178 data->wm8776_regs[WM8776_ADCIFCTRL]); in wm8776_registers_init()
179 wm8776_write(chip, WM8776_MSTRCTRL, data->wm8776_regs[WM8776_MSTRCTRL]); in wm8776_registers_init()
180 wm8776_write(chip, WM8776_PWRDOWN, data->wm8776_regs[WM8776_PWRDOWN]); in wm8776_registers_init()
181 wm8776_write(chip, WM8776_HPLVOL, data->wm8776_regs[WM8776_HPLVOL]); in wm8776_registers_init()
182 wm8776_write(chip, WM8776_HPRVOL, data->wm8776_regs[WM8776_HPRVOL] | in wm8776_registers_init()
184 wm8776_write(chip, WM8776_ADCLVOL, data->wm8776_regs[WM8776_ADCLVOL]); in wm8776_registers_init()
185 wm8776_write(chip, WM8776_ADCRVOL, data->wm8776_regs[WM8776_ADCRVOL]); in wm8776_registers_init()
186 wm8776_write(chip, WM8776_ADCMUX, data->wm8776_regs[WM8776_ADCMUX]); in wm8776_registers_init()
187 wm8776_write(chip, WM8776_DACLVOL, chip->dac_volume[0]); in wm8776_registers_init()
188 wm8776_write(chip, WM8776_DACRVOL, chip->dac_volume[1] | WM8776_UPDATE); in wm8776_registers_init()
193 struct xonar_wm87x6 *data = chip->model_data; in wm8766_registers_init()
196 wm8766_write(chip, WM8766_DAC_CTRL, data->wm8766_regs[WM8766_DAC_CTRL]); in wm8766_registers_init()
199 WM8766_ZCD | (chip->dac_mute ? WM8766_DMUTE_MASK : 0)); in wm8766_registers_init()
200 wm8766_write(chip, WM8766_LDA1, chip->dac_volume[2]); in wm8766_registers_init()
201 wm8766_write(chip, WM8766_RDA1, chip->dac_volume[3]); in wm8766_registers_init()
202 wm8766_write(chip, WM8766_LDA2, chip->dac_volume[4]); in wm8766_registers_init()
203 wm8766_write(chip, WM8766_RDA2, chip->dac_volume[5]); in wm8766_registers_init()
204 wm8766_write(chip, WM8766_LDA3, chip->dac_volume[6]); in wm8766_registers_init()
205 wm8766_write(chip, WM8766_RDA3, chip->dac_volume[7] | WM8766_UPDATE); in wm8766_registers_init()
210 struct xonar_wm87x6 *data = chip->model_data; in wm8776_init()
212 data->wm8776_regs[WM8776_HPLVOL] = (0x79 - 60) | WM8776_HPZCEN; in wm8776_init()
213 data->wm8776_regs[WM8776_HPRVOL] = (0x79 - 60) | WM8776_HPZCEN; in wm8776_init()
214 data->wm8776_regs[WM8776_ADCIFCTRL] = in wm8776_init()
216 data->wm8776_regs[WM8776_MSTRCTRL] = in wm8776_init()
218 data->wm8776_regs[WM8776_PWRDOWN] = WM8776_HPPD; in wm8776_init()
219 data->wm8776_regs[WM8776_ADCLVOL] = 0xa5 | WM8776_ZCA; in wm8776_init()
220 data->wm8776_regs[WM8776_ADCRVOL] = 0xa5 | WM8776_ZCA; in wm8776_init()
221 data->wm8776_regs[WM8776_ADCMUX] = 0x001; in wm8776_init()
227 struct xonar_wm87x6 *data = chip->model_data; in wm8766_init()
229 data->wm8766_regs[WM8766_DAC_CTRL] = in wm8766_init()
236 struct xonar_wm87x6 *data = chip->model_data; in xonar_ds_handle_hp_jack()
240 mutex_lock(&chip->mutex); in xonar_ds_handle_hp_jack()
249 reg = data->wm8766_regs[WM8766_DAC_CTRL] & ~WM8766_MUTEALL; in xonar_ds_handle_hp_jack()
254 snd_jack_report(data->hp_jack, hp_plugged ? SND_JACK_HEADPHONE : 0); in xonar_ds_handle_hp_jack()
256 mutex_unlock(&chip->mutex); in xonar_ds_handle_hp_jack()
261 struct xonar_wm87x6 *data = chip->model_data; in xonar_ds_init()
263 data->generic.anti_pop_delay = 300; in xonar_ds_init()
264 data->generic.output_enable_bit = GPIO_DS_OUTPUT_ENABLE; in xonar_ds_init()
275 chip->interrupt_mask |= OXYGEN_INT_GPIO; in xonar_ds_init()
279 snd_jack_new(chip->card, "Headphone", in xonar_ds_init()
280 SND_JACK_HEADPHONE, &data->hp_jack, false, false); in xonar_ds_init()
283 snd_component_add(chip->card, "WM8776"); in xonar_ds_init()
284 snd_component_add(chip->card, "WM8766"); in xonar_ds_init()
289 struct xonar_wm87x6 *data = chip->model_data; in xonar_hdav_slim_init()
291 data->generic.anti_pop_delay = 300; in xonar_hdav_slim_init()
292 data->generic.output_enable_bit = GPIO_SLIM_OUTPUT_ENABLE; in xonar_hdav_slim_init()
301 xonar_hdmi_init(chip, &data->hdmi); in xonar_hdav_slim_init()
304 snd_component_add(chip->card, "WM8776"); in xonar_hdav_slim_init()
341 struct xonar_wm87x6 *data = chip->model_data; in xonar_hdav_slim_resume()
344 xonar_hdmi_resume(chip, &data->hdmi); in xonar_hdav_slim_resume()
352 hardware->rates = SNDRV_PCM_RATE_32000 | in wm8776_adc_hardware_filter()
358 hardware->rate_max = 96000; in wm8776_adc_hardware_filter()
388 struct xonar_wm87x6 *data = chip->model_data; in set_hdav_slim_dac_params()
390 xonar_set_hdmi_params(chip, &data->hdmi, params); in set_hdav_slim_dac_params()
395 struct xonar_wm87x6 *data = chip->model_data; in update_wm8776_volume()
398 if (chip->dac_volume[0] == chip->dac_volume[1]) { in update_wm8776_volume()
399 if (chip->dac_volume[0] != data->wm8776_regs[WM8776_DACLVOL] || in update_wm8776_volume()
400 chip->dac_volume[1] != data->wm8776_regs[WM8776_DACRVOL]) { in update_wm8776_volume()
402 chip->dac_volume[0] | WM8776_UPDATE); in update_wm8776_volume()
403 data->wm8776_regs[WM8776_DACLVOL] = chip->dac_volume[0]; in update_wm8776_volume()
404 data->wm8776_regs[WM8776_DACRVOL] = chip->dac_volume[0]; in update_wm8776_volume()
407 to_change = (chip->dac_volume[0] != in update_wm8776_volume()
408 data->wm8776_regs[WM8776_DACLVOL]) << 0; in update_wm8776_volume()
409 to_change |= (chip->dac_volume[1] != in update_wm8776_volume()
410 data->wm8776_regs[WM8776_DACLVOL]) << 1; in update_wm8776_volume()
412 wm8776_write(chip, WM8776_DACLVOL, chip->dac_volume[0] | in update_wm8776_volume()
416 chip->dac_volume[1] | WM8776_UPDATE); in update_wm8776_volume()
427 struct xonar_wm87x6 *data = chip->model_data; in update_wm87x6_volume()
432 if (chip->dac_volume[2] == chip->dac_volume[3] && in update_wm87x6_volume()
433 chip->dac_volume[2] == chip->dac_volume[4] && in update_wm87x6_volume()
434 chip->dac_volume[2] == chip->dac_volume[5] && in update_wm87x6_volume()
435 chip->dac_volume[2] == chip->dac_volume[6] && in update_wm87x6_volume()
436 chip->dac_volume[2] == chip->dac_volume[7]) { in update_wm87x6_volume()
439 if (chip->dac_volume[2] != in update_wm87x6_volume()
440 data->wm8766_regs[wm8766_regs[i]]) in update_wm87x6_volume()
444 chip->dac_volume[2] | WM8766_UPDATE); in update_wm87x6_volume()
446 data->wm8766_regs[wm8766_regs[i]] = in update_wm87x6_volume()
447 chip->dac_volume[2]; in update_wm87x6_volume()
452 to_change |= (chip->dac_volume[2 + i] != in update_wm87x6_volume()
453 data->wm8766_regs[wm8766_regs[i]]) << i; in update_wm87x6_volume()
457 chip->dac_volume[2 + i] | in update_wm87x6_volume()
466 chip->dac_mute ? WM8776_DMUTE : 0); in update_wm8776_mute()
473 (chip->dac_mute ? WM8766_DMUTE_MASK : 0)); in update_wm87x6_mute()
478 struct xonar_wm87x6 *data = chip->model_data; in update_wm8766_center_lfe_mix()
485 reg = data->wm8766_regs[WM8766_DAC_CTRL] & in update_wm8766_center_lfe_mix()
502 struct oxygen *chip = ctl->private_data; in wm8776_bit_switch_get()
503 struct xonar_wm87x6 *data = chip->model_data; in wm8776_bit_switch_get()
504 u16 bit = ctl->private_value & 0xffff; in wm8776_bit_switch_get()
505 unsigned int reg_index = (ctl->private_value >> 16) & 0xff; in wm8776_bit_switch_get()
506 bool invert = (ctl->private_value >> 24) & 1; in wm8776_bit_switch_get()
508 value->value.integer.value[0] = in wm8776_bit_switch_get()
509 ((data->wm8776_regs[reg_index] & bit) != 0) ^ invert; in wm8776_bit_switch_get()
516 struct oxygen *chip = ctl->private_data; in wm8776_bit_switch_put()
517 struct xonar_wm87x6 *data = chip->model_data; in wm8776_bit_switch_put()
518 u16 bit = ctl->private_value & 0xffff; in wm8776_bit_switch_put()
520 unsigned int reg_index = (ctl->private_value >> 16) & 0xff; in wm8776_bit_switch_put()
521 bool invert = (ctl->private_value >> 24) & 1; in wm8776_bit_switch_put()
524 mutex_lock(&chip->mutex); in wm8776_bit_switch_put()
525 reg_value = data->wm8776_regs[reg_index] & ~bit; in wm8776_bit_switch_put()
526 if (value->value.integer.value[0] ^ invert) in wm8776_bit_switch_put()
528 changed = reg_value != data->wm8776_regs[reg_index]; in wm8776_bit_switch_put()
531 mutex_unlock(&chip->mutex); in wm8776_bit_switch_put()
571 max = (ctl->private_value >> 12) & 0xf; in wm8776_field_enum_info()
572 switch ((ctl->private_value >> 24) & 0x1f) { in wm8776_field_enum_info()
577 if (((ctl->private_value >> 20) & 0xf) == 0) { in wm8776_field_enum_info()
578 if (ctl->private_value & LC_CONTROL_LIMITER) in wm8776_field_enum_info()
583 if (ctl->private_value & LC_CONTROL_LIMITER) in wm8776_field_enum_info()
593 return -ENXIO; in wm8776_field_enum_info()
601 info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in wm8776_field_volume_info()
602 info->count = 1; in wm8776_field_volume_info()
603 info->value.integer.min = (ctl->private_value >> 8) & 0xf; in wm8776_field_volume_info()
604 info->value.integer.max = (ctl->private_value >> 12) & 0xf; in wm8776_field_volume_info()
610 struct oxygen *chip = ctl->private_data; in wm8776_field_set_from_ctl()
611 struct xonar_wm87x6 *data = chip->model_data; in wm8776_field_set_from_ctl()
617 if ((data->wm8776_regs[WM8776_ALCCTRL1] & WM8776_LCSEL_MASK) == in wm8776_field_set_from_ctl()
622 if (!(ctl->private_value & mode)) in wm8776_field_set_from_ctl()
625 value = ctl->private_value & 0xf; in wm8776_field_set_from_ctl()
626 min = (ctl->private_value >> 8) & 0xf; in wm8776_field_set_from_ctl()
627 max = (ctl->private_value >> 12) & 0xf; in wm8776_field_set_from_ctl()
628 mask = (ctl->private_value >> 16) & 0xf; in wm8776_field_set_from_ctl()
629 shift = (ctl->private_value >> 20) & 0xf; in wm8776_field_set_from_ctl()
630 reg_index = (ctl->private_value >> 24) & 0x1f; in wm8776_field_set_from_ctl()
631 invert = (ctl->private_value >> 29) & 0x1; in wm8776_field_set_from_ctl()
634 value = max - (value - min); in wm8776_field_set_from_ctl()
635 reg_value = data->wm8776_regs[reg_index]; in wm8776_field_set_from_ctl()
643 struct oxygen *chip = ctl->private_data; in wm8776_field_set()
647 min = (ctl->private_value >> 8) & 0xf; in wm8776_field_set()
648 max = (ctl->private_value >> 12) & 0xf; in wm8776_field_set()
650 return -EINVAL; in wm8776_field_set()
651 mutex_lock(&chip->mutex); in wm8776_field_set()
652 changed = value != (ctl->private_value & 0xf); in wm8776_field_set()
654 ctl->private_value = (ctl->private_value & ~0xf) | value; in wm8776_field_set()
657 mutex_unlock(&chip->mutex); in wm8776_field_set()
664 value->value.enumerated.item[0] = ctl->private_value & 0xf; in wm8776_field_enum_get()
671 value->value.integer.value[0] = ctl->private_value & 0xf; in wm8776_field_volume_get()
678 return wm8776_field_set(ctl, value->value.enumerated.item[0]); in wm8776_field_enum_put()
684 return wm8776_field_set(ctl, value->value.integer.value[0]); in wm8776_field_volume_put()
690 info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in wm8776_hp_vol_info()
691 info->count = 2; in wm8776_hp_vol_info()
692 info->value.integer.min = 0x79 - 60; in wm8776_hp_vol_info()
693 info->value.integer.max = 0x7f; in wm8776_hp_vol_info()
700 struct oxygen *chip = ctl->private_data; in wm8776_hp_vol_get()
701 struct xonar_wm87x6 *data = chip->model_data; in wm8776_hp_vol_get()
703 mutex_lock(&chip->mutex); in wm8776_hp_vol_get()
704 value->value.integer.value[0] = in wm8776_hp_vol_get()
705 data->wm8776_regs[WM8776_HPLVOL] & WM8776_HPATT_MASK; in wm8776_hp_vol_get()
706 value->value.integer.value[1] = in wm8776_hp_vol_get()
707 data->wm8776_regs[WM8776_HPRVOL] & WM8776_HPATT_MASK; in wm8776_hp_vol_get()
708 mutex_unlock(&chip->mutex); in wm8776_hp_vol_get()
715 struct oxygen *chip = ctl->private_data; in wm8776_hp_vol_put()
716 struct xonar_wm87x6 *data = chip->model_data; in wm8776_hp_vol_put()
719 mutex_lock(&chip->mutex); in wm8776_hp_vol_put()
720 to_update = (value->value.integer.value[0] != in wm8776_hp_vol_put()
721 (data->wm8776_regs[WM8776_HPLVOL] & WM8776_HPATT_MASK)) in wm8776_hp_vol_put()
723 to_update |= (value->value.integer.value[1] != in wm8776_hp_vol_put()
724 (data->wm8776_regs[WM8776_HPRVOL] & WM8776_HPATT_MASK)) in wm8776_hp_vol_put()
726 if (value->value.integer.value[0] == value->value.integer.value[1]) { in wm8776_hp_vol_put()
729 value->value.integer.value[0] | in wm8776_hp_vol_put()
731 data->wm8776_regs[WM8776_HPLVOL] = in wm8776_hp_vol_put()
732 value->value.integer.value[0] | WM8776_HPZCEN; in wm8776_hp_vol_put()
733 data->wm8776_regs[WM8776_HPRVOL] = in wm8776_hp_vol_put()
734 value->value.integer.value[0] | WM8776_HPZCEN; in wm8776_hp_vol_put()
739 value->value.integer.value[0] | in wm8776_hp_vol_put()
744 value->value.integer.value[1] | in wm8776_hp_vol_put()
747 mutex_unlock(&chip->mutex); in wm8776_hp_vol_put()
754 struct oxygen *chip = ctl->private_data; in wm8776_input_mux_get()
755 struct xonar_wm87x6 *data = chip->model_data; in wm8776_input_mux_get()
756 unsigned int mux_bit = ctl->private_value; in wm8776_input_mux_get()
758 value->value.integer.value[0] = in wm8776_input_mux_get()
759 !!(data->wm8776_regs[WM8776_ADCMUX] & mux_bit); in wm8776_input_mux_get()
766 struct oxygen *chip = ctl->private_data; in wm8776_input_mux_put()
767 struct xonar_wm87x6 *data = chip->model_data; in wm8776_input_mux_put()
769 unsigned int mux_bit = ctl->private_value; in wm8776_input_mux_put()
773 mutex_lock(&chip->mutex); in wm8776_input_mux_put()
774 reg = data->wm8776_regs[WM8776_ADCMUX]; in wm8776_input_mux_put()
775 if (value->value.integer.value[0]) { in wm8776_input_mux_put()
777 /* line-in and mic-in are exclusive */ in wm8776_input_mux_put()
782 other_ctl = data->line_adcmux_control; in wm8776_input_mux_put()
784 other_ctl = data->mic_adcmux_control; in wm8776_input_mux_put()
785 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in wm8776_input_mux_put()
786 &other_ctl->id); in wm8776_input_mux_put()
790 changed = reg != data->wm8776_regs[WM8776_ADCMUX]; in wm8776_input_mux_put()
797 mutex_unlock(&chip->mutex); in wm8776_input_mux_put()
804 info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in wm8776_input_vol_info()
805 info->count = 2; in wm8776_input_vol_info()
806 info->value.integer.min = 0xa5; in wm8776_input_vol_info()
807 info->value.integer.max = 0xff; in wm8776_input_vol_info()
814 struct oxygen *chip = ctl->private_data; in wm8776_input_vol_get()
815 struct xonar_wm87x6 *data = chip->model_data; in wm8776_input_vol_get()
817 mutex_lock(&chip->mutex); in wm8776_input_vol_get()
818 value->value.integer.value[0] = in wm8776_input_vol_get()
819 data->wm8776_regs[WM8776_ADCLVOL] & WM8776_AGMASK; in wm8776_input_vol_get()
820 value->value.integer.value[1] = in wm8776_input_vol_get()
821 data->wm8776_regs[WM8776_ADCRVOL] & WM8776_AGMASK; in wm8776_input_vol_get()
822 mutex_unlock(&chip->mutex); in wm8776_input_vol_get()
829 struct oxygen *chip = ctl->private_data; in wm8776_input_vol_put()
830 struct xonar_wm87x6 *data = chip->model_data; in wm8776_input_vol_put()
833 mutex_lock(&chip->mutex); in wm8776_input_vol_put()
834 changed = (value->value.integer.value[0] != in wm8776_input_vol_put()
835 (data->wm8776_regs[WM8776_ADCLVOL] & WM8776_AGMASK)) || in wm8776_input_vol_put()
836 (value->value.integer.value[1] != in wm8776_input_vol_put()
837 (data->wm8776_regs[WM8776_ADCRVOL] & WM8776_AGMASK)); in wm8776_input_vol_put()
839 value->value.integer.value[0] | WM8776_ZCA); in wm8776_input_vol_put()
841 value->value.integer.value[1] | WM8776_ZCA); in wm8776_input_vol_put()
842 mutex_unlock(&chip->mutex); in wm8776_input_vol_put()
859 struct oxygen *chip = ctl->private_data; in wm8776_level_control_get()
860 struct xonar_wm87x6 *data = chip->model_data; in wm8776_level_control_get()
862 if (!(data->wm8776_regs[WM8776_ALCCTRL2] & WM8776_LCEN)) in wm8776_level_control_get()
863 value->value.enumerated.item[0] = 0; in wm8776_level_control_get()
864 else if ((data->wm8776_regs[WM8776_ALCCTRL1] & WM8776_LCSEL_MASK) == in wm8776_level_control_get()
866 value->value.enumerated.item[0] = 1; in wm8776_level_control_get()
868 value->value.enumerated.item[0] = 2; in wm8776_level_control_get()
877 if (ctl->private_value & mode) in activate_control()
881 if ((ctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_INACTIVE) != access) { in activate_control()
882 ctl->vd[0].access ^= SNDRV_CTL_ELEM_ACCESS_INACTIVE; in activate_control()
883 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_INFO, &ctl->id); in activate_control()
890 struct oxygen *chip = ctl->private_data; in wm8776_level_control_put()
891 struct xonar_wm87x6 *data = chip->model_data; in wm8776_level_control_put()
893 u16 ctrl1, ctrl2; in wm8776_level_control_put() local
896 if (value->value.enumerated.item[0] >= 3) in wm8776_level_control_put()
897 return -EINVAL; in wm8776_level_control_put()
898 mutex_lock(&chip->mutex); in wm8776_level_control_put()
899 changed = value->value.enumerated.item[0] != ctl->private_value; in wm8776_level_control_put()
901 ctl->private_value = value->value.enumerated.item[0]; in wm8776_level_control_put()
902 ctrl1 = data->wm8776_regs[WM8776_ALCCTRL1]; in wm8776_level_control_put()
903 ctrl2 = data->wm8776_regs[WM8776_ALCCTRL2]; in wm8776_level_control_put()
904 switch (value->value.enumerated.item[0]) { in wm8776_level_control_put()
907 ctrl2 & ~WM8776_LCEN); in wm8776_level_control_put()
914 ctrl2 | WM8776_LCEN); in wm8776_level_control_put()
922 ctrl2 | WM8776_LCEN); in wm8776_level_control_put()
926 for (i = 0; i < ARRAY_SIZE(data->lc_controls); ++i) in wm8776_level_control_put()
927 activate_control(chip, data->lc_controls[i], mode); in wm8776_level_control_put()
929 mutex_unlock(&chip->mutex); in wm8776_level_control_put()
936 "None", "High-pass Filter" in hpf_info()
944 struct oxygen *chip = ctl->private_data; in hpf_get()
945 struct xonar_wm87x6 *data = chip->model_data; in hpf_get()
947 value->value.enumerated.item[0] = in hpf_get()
948 !(data->wm8776_regs[WM8776_ADCIFCTRL] & WM8776_ADCHPD); in hpf_get()
954 struct oxygen *chip = ctl->private_data; in hpf_put()
955 struct xonar_wm87x6 *data = chip->model_data; in hpf_put()
959 mutex_lock(&chip->mutex); in hpf_put()
960 reg = data->wm8776_regs[WM8776_ADCIFCTRL] & ~WM8776_ADCHPD; in hpf_put()
961 if (!value->value.enumerated.item[0]) in hpf_put()
963 changed = reg != data->wm8776_regs[WM8776_ADCIFCTRL]; in hpf_put()
966 mutex_unlock(&chip->mutex); in hpf_put()
1003 static const DECLARE_TLV_DB_SCALE(wm87x6_dac_db_scale, -6000, 50, 0);
1004 static const DECLARE_TLV_DB_SCALE(wm8776_adc_db_scale, -2100, 50, 0);
1005 static const DECLARE_TLV_DB_SCALE(wm8776_hp_db_scale, -6000, 100, 0);
1006 static const DECLARE_TLV_DB_SCALE(wm8776_lct_db_scale, -1600, 100, 0);
1008 static const DECLARE_TLV_DB_SCALE(wm8776_ngth_db_scale, -7800, 600, 0);
1009 static const DECLARE_TLV_DB_SCALE(wm8776_maxatten_lim_db_scale, -1200, 100, 0);
1010 static const DECLARE_TLV_DB_SCALE(wm8776_maxatten_alc_db_scale, -2100, 400, 0);
1159 struct xonar_wm87x6 *data = chip->model_data; in add_lc_controls()
1164 BUILD_BUG_ON(ARRAY_SIZE(lc_controls) != ARRAY_SIZE(data->lc_controls)); in add_lc_controls()
1168 return -ENOMEM; in add_lc_controls()
1169 err = snd_ctl_add(chip->card, ctl); in add_lc_controls()
1172 data->lc_controls[i] = ctl; in add_lc_controls()
1179 struct xonar_wm87x6 *data = chip->model_data; in xonar_ds_mixer_init()
1187 return -ENOMEM; in xonar_ds_mixer_init()
1188 err = snd_ctl_add(chip->card, ctl); in xonar_ds_mixer_init()
1191 if (!strcmp(ctl->id.name, "Line Capture Switch")) in xonar_ds_mixer_init()
1192 data->line_adcmux_control = ctl; in xonar_ds_mixer_init()
1193 else if (!strcmp(ctl->id.name, "Mic Capture Switch")) in xonar_ds_mixer_init()
1194 data->mic_adcmux_control = ctl; in xonar_ds_mixer_init()
1196 if (!data->line_adcmux_control || !data->mic_adcmux_control) in xonar_ds_mixer_init()
1197 return -ENXIO; in xonar_ds_mixer_init()
1211 return -ENOMEM; in xonar_hdav_slim_mixer_init()
1212 err = snd_ctl_add(chip->card, ctl); in xonar_hdav_slim_mixer_init()
1223 struct xonar_wm87x6 *data = chip->model_data; in dump_wm8776_registers()
1228 snd_iprintf(buffer, " %03x", data->wm8776_regs[i]); in dump_wm8776_registers()
1231 snd_iprintf(buffer, " %03x", data->wm8776_regs[i]); in dump_wm8776_registers()
1238 struct xonar_wm87x6 *data = chip->model_data; in dump_wm87x6_registers()
1244 snd_iprintf(buffer, " %03x", data->wm8766_regs[i]); in dump_wm87x6_registers()
1272 .dac_volume_min = 255 - 2*60,
1305 .dac_volume_min = 255 - 2*60,
1317 switch (id->subdevice) { in get_xonar_wm87x6_model()
1319 chip->model = model_xonar_ds; in get_xonar_wm87x6_model()
1320 chip->model.shortname = "Xonar DS"; in get_xonar_wm87x6_model()
1323 chip->model = model_xonar_ds; in get_xonar_wm87x6_model()
1324 chip->model.shortname = "Xonar DSX"; in get_xonar_wm87x6_model()
1327 chip->model = model_xonar_hdav_slim; in get_xonar_wm87x6_model()
1330 return -EINVAL; in get_xonar_wm87x6_model()