Lines Matching +full:adc +full:- +full:alt +full:- +full:channel
1 // SPDX-License-Identifier: GPL-2.0-or-later
74 #define DESKTOP_EFX_FILE "ctefx-desktop.bin"
75 #define R3DI_EFX_FILE "ctefx-r3di.bin"
115 #define VNODES_COUNT (VNODE_END_NID - VNODE_START_NID)
126 #define OUT_EFFECTS_COUNT (OUT_EFFECT_END_NID - OUT_EFFECT_START_NID)
134 #define IN_EFFECTS_COUNT (IN_EFFECT_END_NID - IN_EFFECT_START_NID)
154 #define EFFECTS_COUNT (EFFECT_END_NID - EFFECT_START_NID)
163 * X-bass.
182 int params; /* number of default non-on/off params */
223 { .name = "X-Bass",
304 #define TUNING_CTLS_COUNT (TUNING_CTL_END_NID - TUNING_CTL_START_NID)
600 * DSP reqs for handling full-range speakers/bass redirection. If a speaker is
603 * channel. If the surround configuration has no LFE channel, this can't be
604 * enabled. X-Bass must be disabled when using these.
609 /* Between 0x16-0x1a are the X-Bass reqs. */
671 /* Surround output channel count configuration structures. */
763 { .name = "Low (16-31",
766 { .name = "Medium (32-149",
769 { .name = "High (150-600",
900 /* Tracker for the SPDIF-in path is bypassed/enabled */
918 /* Decode Loop (DSP->SRC->DSP) is disabled/enabled */
920 /* De-emphasis filter on DAC-1 disabled/enabled */
922 /* De-emphasis filter on DAC-2 disabled/enabled */
924 /* De-emphasis filter on DAC-3 disabled/enabled */
926 /* High-pass filter on ADC_B disabled/enabled */
928 /* High-pass filter on ADC_C disabled/enabled */
965 * sense given the fact the AE-5 uses it and has the ASI flag set.
1046 DSP_DOWNLOAD_FAILED = -1,
1129 /* AE-5 Control values */
1144 * AE-5 all use PCI region 2 to toggle GPIO and other currently unknown
1151 * Whether or not to use the alt functions like alt_select_out,
1158 * Whether or not to use alt controls: volume effect sliders, EQ
1182 #define ca0132_quirk(spec) ((spec)->quirk)
1183 #define ca0132_use_pci_mmio(spec) ((spec)->use_pci_mmio)
1184 #define ca0132_use_alt_functions(spec) ((spec)->use_alt_functions)
1185 #define ca0132_use_alt_controls(spec) ((spec)->use_alt_controls)
1209 { 0x0b, 0x01017010 }, /* Port G -- Lineout FRONT L/R */
1213 { 0x0f, 0x0221701f }, /* Port A -- BackPanel HP */
1214 { 0x10, 0x01017012 }, /* Port D -- Center/LFE or FP Hp */
1215 { 0x11, 0x01017014 }, /* Port B -- LineMicIn2 / Rear L/R */
1216 { 0x12, 0x01a170f0 }, /* Port C -- LineIn1 */
1224 { 0x0b, 0x01047110 }, /* Port G -- Lineout FRONT L/R */
1225 { 0x0c, 0x414510f0 }, /* SPDIF Out 1 - Disabled*/
1227 { 0x0e, 0x41c520f0 }, /* SPDIF In - Disabled*/
1228 { 0x0f, 0x0122711f }, /* Port A -- BackPanel HP */
1229 { 0x10, 0x01017111 }, /* Port D -- Center/LFE */
1230 { 0x11, 0x01017114 }, /* Port B -- LineMicIn2 / Rear L/R */
1231 { 0x12, 0x01a271f0 }, /* Port C -- LineIn1 */
1239 { 0x0b, 0x01014110 }, /* Port G -- Lineout FRONT L/R */
1243 { 0x0f, 0x0221401f }, /* Port A -- BackPanel HP */
1244 { 0x10, 0x01016011 }, /* Port D -- Center/LFE or FP Hp */
1245 { 0x11, 0x01011014 }, /* Port B -- LineMicIn2 / Rear L/R */
1246 { 0x12, 0x02a090f0 }, /* Port C -- LineIn1 */
1252 /* Sound Blaster AE-5 pin configs taken from Windows Driver */
1254 { 0x0b, 0x01017010 }, /* Port G -- Lineout FRONT L/R */
1258 { 0x0f, 0x01017114 }, /* Port A -- Rear L/R. */
1259 { 0x10, 0x01017012 }, /* Port D -- Center/LFE or FP Hp */
1260 { 0x11, 0x012170ff }, /* Port B -- LineMicIn2 / Rear Headphone */
1261 { 0x12, 0x01a170f0 }, /* Port C -- LineIn1 */
1269 { 0x0b, 0x01014110 }, /* Port G -- Lineout FRONT L/R */
1273 { 0x0f, 0x0221401f }, /* Port A -- BackPanel HP */
1274 { 0x10, 0x01016011 }, /* Port D -- Center/LFE or FP Hp */
1275 { 0x11, 0x01011014 }, /* Port B -- LineMicIn2 / Rear L/R */
1276 { 0x12, 0x02a090f0 }, /* Port C -- LineIn1 */
1307 SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
1313 SND_PCI_QUIRK(0x1102, 0x0051, "Sound Blaster AE-5", QUIRK_AE5),
1314 SND_PCI_QUIRK(0x1102, 0x0191, "Sound Blaster AE-5 Plus", QUIRK_AE5),
1315 SND_PCI_QUIRK(0x1102, 0x0081, "Sound Blaster AE-7", QUIRK_AE7),
1522 return ((response == -1) ? -1 : 0); in codec_send_command()
1534 unsigned char channel, unsigned int *res) in codec_set_converter_stream_channel() argument
1538 converter_stream_channel = (stream << 4) | (channel & 0x0f); in codec_set_converter_stream_channel()
1560 return -EIO; in chipio_send()
1564 * Write chip address through the vendor widget -- NOT protected by the Mutex!
1569 struct ca0132_spec *spec = codec->spec; in chipio_write_address()
1572 if (spec->curr_chip_addx == chip_addx) in chipio_write_address()
1579 if (res != -EIO) { in chipio_write_address()
1585 spec->curr_chip_addx = (res < 0) ? ~0U : chip_addx; in chipio_write_address()
1591 * Write data through the vendor widget -- NOT protected by the Mutex!
1595 struct ca0132_spec *spec = codec->spec; in chipio_write_data()
1601 if (res != -EIO) { in chipio_write_data()
1609 spec->curr_chip_addx = (res != -EIO) ? in chipio_write_data()
1610 (spec->curr_chip_addx + 4) : ~0U; in chipio_write_data()
1615 * Write multiple data through the vendor widget -- NOT protected by the Mutex!
1625 return -EINVAL; in chipio_write_data_multiple()
1628 while ((count-- != 0) && (status == 0)) in chipio_write_data_multiple()
1636 * Read data through the vendor widget -- NOT protected by the Mutex!
1640 struct ca0132_spec *spec = codec->spec; in chipio_read_data()
1646 if (res != -EIO) { in chipio_read_data()
1651 if (res != -EIO) { in chipio_read_data()
1660 spec->curr_chip_addx = (res != -EIO) ? in chipio_read_data()
1661 (spec->curr_chip_addx + 4) : ~0U; in chipio_read_data()
1672 struct ca0132_spec *spec = codec->spec; in chipio_write()
1675 mutex_lock(&spec->chipio_mutex); in chipio_write()
1687 mutex_unlock(&spec->chipio_mutex); in chipio_write()
1723 struct ca0132_spec *spec = codec->spec; in chipio_write_multiple()
1726 mutex_lock(&spec->chipio_mutex); in chipio_write_multiple()
1733 mutex_unlock(&spec->chipio_mutex); in chipio_write_multiple()
1745 struct ca0132_spec *spec = codec->spec; in chipio_read()
1748 mutex_lock(&spec->chipio_mutex); in chipio_read()
1760 mutex_unlock(&spec->chipio_mutex); in chipio_read()
1786 struct ca0132_spec *spec = codec->spec; in chipio_set_control_param()
1794 mutex_lock(&spec->chipio_mutex); in chipio_set_control_param()
1803 mutex_unlock(&spec->chipio_mutex); in chipio_set_control_param()
1908 * 0x80-0xFF.
1920 * Writes to the 8051's exram, which has 16-bits of address space.
1921 * Data at addresses 0x2000-0x7fff is mirrored to 0x8000-0xdfff.
1922 * Data at 0x8000-0xdfff can also be used as program memory for the 8051 by
1924 * 0xe000-0xffff is always mapped as program memory, with only 0xf000-0xffff
1931 /* Lower 8-bits. */ in chipio_8051_set_address()
1936 /* Upper 8-bits. */ in chipio_8051_set_address()
1944 /* 8-bits of data. */ in chipio_8051_set_data()
1958 /* 8-bits of data. */ in chipio_8051_set_data_pll()
1966 struct ca0132_spec *spec = codec->spec; in chipio_8051_write_exram()
1968 mutex_lock(&spec->chipio_mutex); in chipio_8051_write_exram()
1973 mutex_unlock(&spec->chipio_mutex); in chipio_8051_write_exram()
1994 struct ca0132_spec *spec = codec->spec; in chipio_8051_write_pll_pmu()
1996 mutex_lock(&spec->chipio_mutex); in chipio_8051_write_pll_pmu()
2001 mutex_unlock(&spec->chipio_mutex); in chipio_8051_write_pll_pmu()
2016 struct ca0132_spec *spec = codec->spec; in chipio_enable_clocks()
2018 mutex_lock(&spec->chipio_mutex); in chipio_enable_clocks()
2024 mutex_unlock(&spec->chipio_mutex); in chipio_enable_clocks()
2044 return -EIO; in dspio_send()
2070 struct ca0132_spec *spec = codec->spec; in dspio_write()
2075 mutex_lock(&spec->chipio_mutex); in dspio_write()
2090 mutex_unlock(&spec->chipio_mutex); in dspio_write()
2093 -EIO : 0; in dspio_write()
2106 return -EINVAL; in dspio_write_multiple()
2124 if (status == -EIO) in dspio_read()
2128 if (status == -EIO || in dspio_read()
2130 return -EIO; in dspio_read()
2148 return -1; in dspio_read_multiple()
2245 struct ca0132_spec *spec = codec->spec; in dspio_get_response_data()
2250 return -EIO; in dspio_get_response_data()
2252 if ((data & 0x00ffffff) == spec->wait_scp_header) { in dspio_get_response_data()
2253 spec->scp_resp_header = data; in dspio_get_response_data()
2254 spec->scp_resp_count = data >> 27; in dspio_get_response_data()
2255 count = spec->wait_num_data; in dspio_get_response_data()
2256 dspio_read_multiple(codec, spec->scp_resp_data, in dspio_get_response_data()
2257 &spec->scp_resp_count, count); in dspio_get_response_data()
2261 return -EIO; in dspio_get_response_data()
2274 struct ca0132_spec *spec = codec->spec; in dspio_send_scp_message()
2295 return -EINVAL; in dspio_send_scp_message()
2299 return -EINVAL; in dspio_send_scp_message()
2301 spec->wait_scp_header = *((unsigned int *)send_buf); in dspio_send_scp_message()
2306 spec->wait_scp_header &= 0xffff0000; in dspio_send_scp_message()
2307 spec->wait_scp_header |= (resp_src_id << 8) | (resp_target_id); in dspio_send_scp_message()
2308 spec->wait_num_data = return_buf_size/sizeof(unsigned int) - 1; in dspio_send_scp_message()
2309 spec->wait_scp = 1; in dspio_send_scp_message()
2316 spec->wait_scp = 0; in dspio_send_scp_message()
2325 } while (spec->wait_scp && time_before(jiffies, timeout)); in dspio_send_scp_message()
2327 if (!spec->wait_scp) { in dspio_send_scp_message()
2329 memcpy(&ret_msg->hdr, &spec->scp_resp_header, 4); in dspio_send_scp_message()
2330 memcpy(&ret_msg->data, spec->scp_resp_data, in dspio_send_scp_message()
2331 spec->wait_num_data); in dspio_send_scp_message()
2332 *bytes_returned = (spec->scp_resp_count + 1) * 4; in dspio_send_scp_message()
2335 status = -EIO; in dspio_send_scp_message()
2337 spec->wait_scp = 0; in dspio_send_scp_message()
2344 * dspio_scp - Prepare and send the SCP message to DSP
2371 return -EINVAL; in dspio_scp()
2375 return -EINVAL; in dspio_scp()
2380 return -EINVAL; in dspio_scp()
2412 ret_size = (ret_bytes - sizeof(scp_reply.hdr)) in dspio_scp()
2417 return -EINVAL; in dspio_scp()
2420 return -EINVAL; in dspio_scp()
2423 return -EINVAL; in dspio_scp()
2429 codec_dbg(codec, "reply ill-formed or errflag set\n"); in dspio_scp()
2430 return -EIO; in dspio_scp()
2454 * Allocate a DSP DMA channel via an SCP message
2461 codec_dbg(codec, " dspio_alloc_dma_chan() -- begin\n"); in dspio_alloc_dma_chan()
2473 return -EBUSY; in dspio_alloc_dma_chan()
2477 codec_dbg(codec, " dspio_alloc_dma_chan() -- complete\n"); in dspio_alloc_dma_chan()
2490 codec_dbg(codec, " dspio_free_dma_chan() -- begin\n"); in dspio_free_dma_chan()
2502 codec_dbg(codec, " dspio_free_dma_chan() -- complete\n"); in dspio_free_dma_chan()
2553 retry--; in dsp_reset()
2554 } while (res == -EIO && retry); in dsp_reset()
2558 return -EIO; in dsp_reset()
2610 codec_dbg(codec, "-- dsp_dma_setup_common() -- Begin ---------\n"); in dsp_dma_setup_common()
2614 return -EINVAL; in dsp_dma_setup_common()
2619 return -EBUSY; in dsp_dma_setup_common()
2626 return -ENXIO; in dsp_dma_setup_common()
2703 codec_dbg(codec, "-- dsp_dma_setup_common() -- Complete ------\n"); in dsp_dma_setup_common()
2709 * Setup the DSP DMA per-transfer-specific registers
2726 const unsigned int max_dma_count = 1 << (DSPDMAC_XFRCNT_BCNT_HIBIT - in dsp_dma_setup()
2729 codec_dbg(codec, "-- dsp_dma_setup() -- Begin ---------\n"); in dsp_dma_setup()
2733 return -EINVAL; in dsp_dma_setup()
2739 return -ENXIO; in dsp_dma_setup()
2764 adr_ofs = (count - 1) << (DSPDMAC_DSPADROFS_BOFS_LOBIT + in dsp_dma_setup()
2775 base_cnt = (count - 1) << DSPDMAC_XFRCNT_BCNT_LOBIT; in dsp_dma_setup()
2777 cur_cnt = (count - 1) << DSPDMAC_XFRCNT_CCNT_LOBIT; in dsp_dma_setup()
2794 codec_dbg(codec, "-- dsp_dma_setup() -- Complete ---------\n"); in dsp_dma_setup()
2808 codec_dbg(codec, "-- dsp_dma_start() -- Begin ---------\n"); in dsp_dma_start()
2818 codec_dbg(codec, "-- dsp_dma_start() Read CHNLSTART\n"); in dsp_dma_start()
2830 codec_dbg(codec, "-- dsp_dma_start() -- Complete ---------\n"); in dsp_dma_start()
2844 codec_dbg(codec, "-- dsp_dma_stop() -- Begin ---------\n"); in dsp_dma_stop()
2854 codec_dbg(codec, "-- dsp_dma_stop() Read CHNLSTART\n"); in dsp_dma_stop()
2865 codec_dbg(codec, "-- dsp_dma_stop() -- Complete ---------\n"); in dsp_dma_stop()
2871 * dsp_allocate_router_ports - Allocate router ports
2875 * @ports_per_channel: number of ports per channel
2896 val |= (ports_per_channel - 1) << 4; in dsp_allocate_router_ports()
2897 val |= num_chans - 1; in dsp_allocate_router_ports()
2948 codec_dbg(codec, " dsp_allocate_ports() -- begin\n"); in dsp_allocate_ports()
2952 return -EINVAL; in dsp_allocate_ports()
2958 codec_dbg(codec, " dsp_allocate_ports() -- complete\n"); in dsp_allocate_ports()
2975 return -EINVAL; in dsp_allocate_ports_format()
2990 codec_dbg(codec, " dsp_free_ports() -- begin\n"); in dsp_free_ports()
2997 codec_dbg(codec, " dsp_free_ports() -- complete\n"); in dsp_free_ports()
3038 struct hda_codec *codec = dma->codec; in dma_reset()
3039 struct ca0132_spec *spec = codec->spec; in dma_reset()
3042 if (dma->dmab->area) in dma_reset()
3043 snd_hda_codec_load_dsp_cleanup(codec, dma->dmab); in dma_reset()
3046 dma->m_converter_format, in dma_reset()
3047 dma->buf_size, in dma_reset()
3048 dma->dmab); in dma_reset()
3051 spec->dsp_stream_id = status; in dma_reset()
3070 snd_hda_codec_load_dsp_trigger(dma->codec, cmd); in dma_set_state()
3076 return dma->dmab->bytes; in dma_get_buffer_size()
3081 return dma->dmab->area; in dma_get_buffer_addr()
3088 memcpy(dma->dmab->area, data, count); in dma_xfer()
3097 *format = dma->m_converter_format; in dma_get_converter_format()
3102 struct ca0132_spec *spec = dma->codec->spec; in dma_get_stream_id()
3104 return spec->dsp_stream_id; in dma_get_stream_id()
3119 return p->magic == g_magic_value; in is_valid()
3124 return g_chip_addr_magic_value == p->chip_addr; in is_hci_prog_list_seg()
3129 return p->count == 0; in is_last()
3134 return struct_size(p, data, p->count); in dsp_sizeof()
3160 if (fls == NULL || fls->chip_addr != g_chip_addr_magic_value) { in dspxfr_hci_write()
3162 return -EINVAL; in dspxfr_hci_write()
3165 count = fls->count; in dspxfr_hci_write()
3166 data = (u32 *)(fls->data); in dspxfr_hci_write()
3173 count -= 2; in dspxfr_hci_write()
3180 * dspxfr_one_seg - Write a block of data into DSP code or data RAM using pre-allocated DMA engine.
3184 * @reloc: Relocation address for loading single-segment overlays, or 0 for
3222 return -EINVAL; in dspxfr_one_seg()
3235 return -EINVAL; in dspxfr_one_seg()
3238 data = fls->data; in dspxfr_one_seg()
3239 chip_addx = fls->chip_addr; in dspxfr_one_seg()
3240 words_to_write = fls->count; in dspxfr_one_seg()
3251 return -EINVAL; in dspxfr_one_seg()
3261 return -EINVAL; in dspxfr_one_seg()
3274 return -EINVAL; in dspxfr_one_seg()
3280 buffer_size_words -= buffer_size_words % hda_frame_size_words; in dspxfr_one_seg()
3289 return -EINVAL; in dspxfr_one_seg()
3298 words_to_write -= remainder_words; in dspxfr_one_seg()
3325 return -EIO; in dspxfr_one_seg()
3365 words_to_write -= run_size_words; in dspxfr_one_seg()
3377 * dspxfr_image - Write the entire DSP image of a DSP code/data overlay to DSP memories
3381 * @reloc: Relocation address for loading single-segment overlays, or 0 for
3396 struct ca0132_spec *spec = codec->spec; in dspxfr_image()
3406 return -EINVAL; in dspxfr_image()
3410 return -ENOMEM; in dspxfr_image()
3412 dma_engine->dmab = kzalloc(sizeof(*dma_engine->dmab), GFP_KERNEL); in dspxfr_image()
3413 if (!dma_engine->dmab) { in dspxfr_image()
3415 return -ENOMEM; in dspxfr_image()
3418 dma_engine->codec = codec; in dspxfr_image()
3420 dma_engine->m_converter_format = hda_format; in dspxfr_image()
3421 dma_engine->buf_size = (ovly ? DSP_DMA_WRITE_BUFLEN_OVLY : in dspxfr_image()
3435 dma_engine->m_converter_format, in dspxfr_image()
3436 dma_engine->buf_size, in dspxfr_image()
3437 dma_engine->dmab); in dspxfr_image()
3440 spec->dsp_stream_id = status; in dspxfr_image()
3470 status = -EINVAL; in dspxfr_image()
3499 if (dma_engine->dmab->area) in dspxfr_image()
3500 snd_hda_codec_load_dsp_cleanup(codec, dma_engine->dmab); in dspxfr_image()
3501 kfree(dma_engine->dmab); in dspxfr_image()
3512 struct ca0132_spec *spec = codec->spec; in dspload_post_setup()
3513 codec_dbg(codec, "---- dspload_post_setup ------\n"); in dspload_post_setup()
3525 * dspload_image - Download DSP from a DSP Image Fast Load structure.
3530 * @reloc: Relocation address for loading single-segment overlays, or 0 for
3537 * linear, non-constant sized element array of structures, each of which
3553 codec_dbg(codec, "---- dspload_image begin ------\n"); in dspload_image()
3629 * ca0113 related functions. The ca0113 acts as the HDA bus for the pci-e
3635 * For cards with PCI-E region2 (Sound Blaster Z/ZxR, Recon3D, and AE-5)
3639 * AE-5 note: The AE-5 seems to use pins 2 and 3 to somehow set the color value
3640 * of the on-card LED. It seems to use pin 2 for data, then toggles 3 to on and
3646 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_gpio_set()
3652 writew(gpio_data, spec->mem_base + 0x320); in ca0113_mmio_gpio_set()
3656 * Special pci region2 commands that are only used by the AE-5. They follow
3661 * target-id, and value.
3666 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_command_set()
3669 writel(0x0000007e, spec->mem_base + 0x210); in ca0113_mmio_command_set()
3670 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3671 writel(0x0000005a, spec->mem_base + 0x210); in ca0113_mmio_command_set()
3672 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3673 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3675 writel(0x00800005, spec->mem_base + 0x20c); in ca0113_mmio_command_set()
3676 writel(group, spec->mem_base + 0x804); in ca0113_mmio_command_set()
3678 writel(0x00800005, spec->mem_base + 0x20c); in ca0113_mmio_command_set()
3683 writel(write_val, spec->mem_base + 0x204); in ca0113_mmio_command_set()
3689 readl(spec->mem_base + 0x860); in ca0113_mmio_command_set()
3690 readl(spec->mem_base + 0x854); in ca0113_mmio_command_set()
3691 readl(spec->mem_base + 0x840); in ca0113_mmio_command_set()
3693 writel(0x00800004, spec->mem_base + 0x20c); in ca0113_mmio_command_set()
3694 writel(0x00000000, spec->mem_base + 0x210); in ca0113_mmio_command_set()
3695 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3696 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3705 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_command_set_type2()
3708 writel(0x0000007e, spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3709 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3710 writel(0x0000005a, spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3711 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3712 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3714 writel(0x00800003, spec->mem_base + 0x20c); in ca0113_mmio_command_set_type2()
3715 writel(group, spec->mem_base + 0x804); in ca0113_mmio_command_set_type2()
3717 writel(0x00800005, spec->mem_base + 0x20c); in ca0113_mmio_command_set_type2()
3722 writel(write_val, spec->mem_base + 0x204); in ca0113_mmio_command_set_type2()
3724 readl(spec->mem_base + 0x860); in ca0113_mmio_command_set_type2()
3725 readl(spec->mem_base + 0x854); in ca0113_mmio_command_set_type2()
3726 readl(spec->mem_base + 0x840); in ca0113_mmio_command_set_type2()
3728 writel(0x00800004, spec->mem_base + 0x20c); in ca0113_mmio_command_set_type2()
3729 writel(0x00000000, spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3730 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3731 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3744 struct ca0132_spec *spec = codec->spec; in ca0132_gpio_init()
3767 struct ca0132_spec *spec = codec->spec; in ca0132_gpio_setup()
3798 /* Bit 1 - Switch between front/rear mic. 0 = rear, 1 = front */
3800 /* Bit 2 - Switch between headphone/line out. 0 = Headphone, 1 = Line */
3851 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_mic_set()
3866 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3873 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3880 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3893 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_prepare()
3895 snd_hda_codec_setup_stream(codec, spec->dacs[0], stream_tag, 0, format); in ca0132_playback_pcm_prepare()
3904 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_cleanup()
3906 if (spec->dsp_state == DSP_DOWNLOADING) in ca0132_playback_pcm_cleanup()
3911 if (spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) in ca0132_playback_pcm_cleanup()
3914 snd_hda_codec_cleanup_stream(codec, spec->dacs[0]); in ca0132_playback_pcm_cleanup()
3923 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_delay()
3925 struct snd_pcm_runtime *runtime = substream->runtime; in ca0132_playback_pcm_delay()
3927 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_playback_pcm_delay()
3931 if (spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) { in ca0132_playback_pcm_delay()
3932 if ((spec->effects_switch[SURROUND - EFFECT_START_NID]) || in ca0132_playback_pcm_delay()
3933 (spec->effects_switch[DIALOG_PLUS - EFFECT_START_NID])) in ca0132_playback_pcm_delay()
3938 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_playback_pcm_delay()
3941 return (latency * runtime->rate) / 1000; in ca0132_playback_pcm_delay()
3951 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_open()
3952 return snd_hda_multi_out_dig_open(codec, &spec->multiout); in ca0132_dig_playback_pcm_open()
3961 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_prepare()
3962 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, in ca0132_dig_playback_pcm_prepare()
3970 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_cleanup()
3971 return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); in ca0132_dig_playback_pcm_cleanup()
3978 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_close()
3979 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in ca0132_dig_playback_pcm_close()
3991 snd_hda_codec_setup_stream(codec, hinfo->nid, in ca0132_capture_pcm_prepare()
4001 struct ca0132_spec *spec = codec->spec; in ca0132_capture_pcm_cleanup()
4003 if (spec->dsp_state == DSP_DOWNLOADING) in ca0132_capture_pcm_cleanup()
4006 snd_hda_codec_cleanup_stream(codec, hinfo->nid); in ca0132_capture_pcm_cleanup()
4014 struct ca0132_spec *spec = codec->spec; in ca0132_capture_pcm_delay()
4016 struct snd_pcm_runtime *runtime = substream->runtime; in ca0132_capture_pcm_delay()
4018 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_capture_pcm_delay()
4021 if (spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]) in ca0132_capture_pcm_delay()
4024 return (latency * runtime->rate) / 1000; in ca0132_capture_pcm_delay()
4034 #define CA0132_CODEC_VOL_MONO(xname, nid, channel, dir) \ argument
4045 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, 0, dir) }
4052 #define CA0132_ALT_CODEC_VOL_MONO(xname, nid, channel, dir) \ argument
4063 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, 0, dir) }
4065 #define CA0132_CODEC_MUTE_MONO(xname, nid, channel, dir) \ argument
4072 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, 0, dir) }
4088 * values -90 to 9. -90 is the lowest decibel value for both the ADC's and the
4136 * This table counts from float 10 to 1000, which is the range of the x-bass
4233 return -EINVAL; in tuning_ctl_set()
4248 struct ca0132_spec *spec = codec->spec; in tuning_ctl_get()
4250 long *valp = ucontrol->value.integer.value; in tuning_ctl_get()
4251 int idx = nid - TUNING_CTL_START_NID; in tuning_ctl_get()
4253 *valp = spec->cur_ctl_vals[idx]; in tuning_ctl_get()
4261 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in voice_focus_ctl_info()
4262 uinfo->count = chs == 3 ? 2 : 1; in voice_focus_ctl_info()
4263 uinfo->value.integer.min = 20; in voice_focus_ctl_info()
4264 uinfo->value.integer.max = 180; in voice_focus_ctl_info()
4265 uinfo->value.integer.step = 1; in voice_focus_ctl_info()
4274 struct ca0132_spec *spec = codec->spec; in voice_focus_ctl_put()
4276 long *valp = ucontrol->value.integer.value; in voice_focus_ctl_put()
4279 idx = nid - TUNING_CTL_START_NID; in voice_focus_ctl_put()
4281 if (spec->cur_ctl_vals[idx] == *valp) in voice_focus_ctl_put()
4284 spec->cur_ctl_vals[idx] = *valp; in voice_focus_ctl_put()
4286 idx = *valp - 20; in voice_focus_ctl_put()
4296 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in mic_svm_ctl_info()
4297 uinfo->count = chs == 3 ? 2 : 1; in mic_svm_ctl_info()
4298 uinfo->value.integer.min = 0; in mic_svm_ctl_info()
4299 uinfo->value.integer.max = 100; in mic_svm_ctl_info()
4300 uinfo->value.integer.step = 1; in mic_svm_ctl_info()
4309 struct ca0132_spec *spec = codec->spec; in mic_svm_ctl_put()
4311 long *valp = ucontrol->value.integer.value; in mic_svm_ctl_put()
4314 idx = nid - TUNING_CTL_START_NID; in mic_svm_ctl_put()
4316 if (spec->cur_ctl_vals[idx] == *valp) in mic_svm_ctl_put()
4319 spec->cur_ctl_vals[idx] = *valp; in mic_svm_ctl_put()
4331 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in equalizer_ctl_info()
4332 uinfo->count = chs == 3 ? 2 : 1; in equalizer_ctl_info()
4333 uinfo->value.integer.min = 0; in equalizer_ctl_info()
4334 uinfo->value.integer.max = 48; in equalizer_ctl_info()
4335 uinfo->value.integer.step = 1; in equalizer_ctl_info()
4344 struct ca0132_spec *spec = codec->spec; in equalizer_ctl_put()
4346 long *valp = ucontrol->value.integer.value; in equalizer_ctl_put()
4349 idx = nid - TUNING_CTL_START_NID; in equalizer_ctl_put()
4351 if (spec->cur_ctl_vals[idx] == *valp) in equalizer_ctl_put()
4354 spec->cur_ctl_vals[idx] = *valp; in equalizer_ctl_put()
4363 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(eq_db_scale, -2400, 100, 0);
4425 struct ca0132_spec *spec = codec->spec; in ca0132_init_tuning_defaults()
4428 /* Wedge Angle defaults to 30. 10 below is 30 - 20. 20 is min. */ in ca0132_init_tuning_defaults()
4429 spec->cur_ctl_vals[WEDGE_ANGLE - TUNING_CTL_START_NID] = 10; in ca0132_init_tuning_defaults()
4431 spec->cur_ctl_vals[SVM_LEVEL - TUNING_CTL_START_NID] = 74; in ca0132_init_tuning_defaults()
4435 spec->cur_ctl_vals[i] = 24; in ca0132_init_tuning_defaults()
4442 * If jack inserted, headphone will be selected, else built-in speakers
4447 struct ca0132_spec *spec = codec->spec; in ca0132_select_out()
4458 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_select_out()
4461 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_hp); in ca0132_select_out()
4464 spec->vnode_lswitch[VNID_HP_SEL - VNODE_START_NID]; in ca0132_select_out()
4467 spec->cur_out_type = HEADPHONE_OUT; in ca0132_select_out()
4469 spec->cur_out_type = SPEAKER_OUT; in ca0132_select_out()
4471 if (spec->cur_out_type == SPEAKER_OUT) { in ca0132_select_out()
4485 snd_hda_codec_write(codec, spec->out_pins[1], 0, in ca0132_select_out()
4487 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4489 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4491 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4495 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, in ca0132_select_out()
4497 snd_hda_set_pin_ctl(codec, spec->out_pins[1], in ca0132_select_out()
4500 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, in ca0132_select_out()
4502 snd_hda_set_pin_ctl(codec, spec->out_pins[0], in ca0132_select_out()
4518 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4520 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4522 snd_hda_codec_write(codec, spec->out_pins[1], 0, in ca0132_select_out()
4524 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4528 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, in ca0132_select_out()
4530 snd_hda_set_pin_ctl(codec, spec->out_pins[0], in ca0132_select_out()
4533 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, in ca0132_select_out()
4535 snd_hda_set_pin_ctl(codec, spec->out_pins[1], in ca0132_select_out()
4551 struct ca0132_spec *spec = codec->spec; in ae5_mmio_select_out()
4561 ca0113_mmio_command_set(codec, out_cmds->group[i], in ae5_mmio_select_out()
4562 out_cmds->target[i], in ae5_mmio_select_out()
4563 out_cmds->vals[spec->cur_out_type][i]); in ae5_mmio_select_out()
4568 struct ca0132_spec *spec = codec->spec; in ca0132_alt_set_full_range_speaker()
4573 /* 2.0/4.0 setup has no LFE channel, so setting full-range does nothing. */ in ca0132_alt_set_full_range_speaker()
4574 if (spec->channel_cfg_val == SPEAKER_CHANNELS_4_0 in ca0132_alt_set_full_range_speaker()
4575 || spec->channel_cfg_val == SPEAKER_CHANNELS_2_0) in ca0132_alt_set_full_range_speaker()
4578 /* Set front L/R full range. Zero for full-range, one for redirection. */ in ca0132_alt_set_full_range_speaker()
4579 tmp = spec->speaker_range_val[0] ? FLOAT_ZERO : FLOAT_ONE; in ca0132_alt_set_full_range_speaker()
4585 /* When setting full-range rear, both rear and center/lfe are set. */ in ca0132_alt_set_full_range_speaker()
4586 tmp = spec->speaker_range_val[1] ? FLOAT_ZERO : FLOAT_ONE; in ca0132_alt_set_full_range_speaker()
4598 * Only the AE series cards set this value when setting full-range, in ca0132_alt_set_full_range_speaker()
4614 struct ca0132_spec *spec = codec->spec; in ca0132_alt_surround_set_bass_redirection()
4618 if (val && spec->channel_cfg_val != SPEAKER_CHANNELS_4_0 && in ca0132_alt_surround_set_bass_redirection()
4619 spec->channel_cfg_val != SPEAKER_CHANNELS_2_0) in ca0132_alt_surround_set_bass_redirection()
4630 tmp = float_xbass_xover_lookup[spec->xbass_xover_freq]; in ca0132_alt_surround_set_bass_redirection()
4647 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out_get_quirk_data()
4664 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out_quirk_set()
4672 out_info = &quirk_data->out_set_info[spec->cur_out_type]; in ca0132_alt_select_out_quirk_set()
4673 if (quirk_data->is_ae_series) in ca0132_alt_select_out_quirk_set()
4676 if (out_info->has_hda_gpio) { in ca0132_alt_select_out_quirk_set()
4677 gpio_data = snd_hda_codec_read(codec, codec->core.afg, 0, in ca0132_alt_select_out_quirk_set()
4680 if (out_info->hda_gpio_set) in ca0132_alt_select_out_quirk_set()
4681 gpio_data |= (1 << out_info->hda_gpio_pin); in ca0132_alt_select_out_quirk_set()
4683 gpio_data &= ~(1 << out_info->hda_gpio_pin); in ca0132_alt_select_out_quirk_set()
4685 snd_hda_codec_write(codec, codec->core.afg, 0, in ca0132_alt_select_out_quirk_set()
4689 if (out_info->mmio_gpio_count) { in ca0132_alt_select_out_quirk_set()
4690 for (i = 0; i < out_info->mmio_gpio_count; i++) { in ca0132_alt_select_out_quirk_set()
4691 ca0113_mmio_gpio_set(codec, out_info->mmio_gpio_pin[i], in ca0132_alt_select_out_quirk_set()
4692 out_info->mmio_gpio_set[i]); in ca0132_alt_select_out_quirk_set()
4696 if (out_info->scp_cmds_count) { in ca0132_alt_select_out_quirk_set()
4697 for (i = 0; i < out_info->scp_cmds_count; i++) { in ca0132_alt_select_out_quirk_set()
4699 out_info->scp_cmd_mid[i], in ca0132_alt_select_out_quirk_set()
4700 out_info->scp_cmd_req[i], in ca0132_alt_select_out_quirk_set()
4701 out_info->scp_cmd_val[i]); in ca0132_alt_select_out_quirk_set()
4707 chipio_set_control_param(codec, 0x0d, out_info->dac2port); in ca0132_alt_select_out_quirk_set()
4709 if (out_info->has_chipio_write) { in ca0132_alt_select_out_quirk_set()
4710 chipio_write(codec, out_info->chipio_write_addr, in ca0132_alt_select_out_quirk_set()
4711 out_info->chipio_write_data); in ca0132_alt_select_out_quirk_set()
4714 if (quirk_data->has_headphone_gain) { in ca0132_alt_select_out_quirk_set()
4715 if (spec->cur_out_type != HEADPHONE_OUT) { in ca0132_alt_select_out_quirk_set()
4716 if (quirk_data->is_ae_series) in ca0132_alt_select_out_quirk_set()
4721 if (quirk_data->is_ae_series) in ca0132_alt_select_out_quirk_set()
4723 spec->ae5_headphone_gain_val); in ca0132_alt_select_out_quirk_set()
4726 spec->zxr_gain_set); in ca0132_alt_select_out_quirk_set()
4752 * It also adds the ability to auto-detect the front headphone port.
4756 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out()
4762 hda_nid_t headphone_nid = spec->out_pins[1]; in ca0132_alt_select_out()
4768 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_alt_select_out()
4776 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_hp) || in ca0132_alt_select_out()
4777 snd_hda_jack_detect(codec, spec->unsol_tag_front_hp); in ca0132_alt_select_out()
4780 spec->cur_out_type = HEADPHONE_OUT; in ca0132_alt_select_out()
4782 spec->cur_out_type = SPEAKER_OUT; in ca0132_alt_select_out()
4784 spec->cur_out_type = spec->out_enum_val; in ca0132_alt_select_out()
4786 outfx_set = spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]; in ca0132_alt_select_out()
4796 switch (spec->cur_out_type) { in ca0132_alt_select_out()
4801 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_alt_select_out()
4805 ca0132_set_out_node_pincfg(codec, spec->out_pins[1], 0, 0); in ca0132_alt_select_out()
4806 /* Set front L-R to output. */ in ca0132_alt_select_out()
4807 ca0132_set_out_node_pincfg(codec, spec->out_pins[0], 1, 0); in ca0132_alt_select_out()
4809 ca0132_set_out_node_pincfg(codec, spec->out_pins[2], 1, 0); in ca0132_alt_select_out()
4811 ca0132_set_out_node_pincfg(codec, spec->out_pins[3], 1, 0); in ca0132_alt_select_out()
4818 if (!outfx_set && spec->channel_cfg_val == SPEAKER_CHANNELS_2_0) in ca0132_alt_select_out()
4821 tmp = speaker_channel_cfgs[spec->channel_cfg_val].val; in ca0132_alt_select_out()
4830 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_alt_select_out()
4834 ca0132_set_out_node_pincfg(codec, spec->out_pins[0], 0, 0); in ca0132_alt_select_out()
4835 ca0132_set_out_node_pincfg(codec, spec->out_pins[2], 0, 0); in ca0132_alt_select_out()
4836 ca0132_set_out_node_pincfg(codec, spec->out_pins[3], 0, 0); in ca0132_alt_select_out()
4839 if (snd_hda_jack_detect(codec, spec->unsol_tag_front_hp)) in ca0132_alt_select_out()
4840 headphone_nid = spec->out_pins[2]; in ca0132_alt_select_out()
4841 else if (snd_hda_jack_detect(codec, spec->unsol_tag_hp)) in ca0132_alt_select_out()
4842 headphone_nid = spec->out_pins[1]; in ca0132_alt_select_out()
4856 * If output effects are enabled, set the X-Bass effect value again to in ca0132_alt_select_out()
4858 * configurations with an LFE channel. in ca0132_alt_select_out()
4862 spec->effects_switch[X_BASS - EFFECT_START_NID]); in ca0132_alt_select_out()
4878 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_alt_select_out()
4880 spec->bass_redirection_val); in ca0132_alt_select_out()
4890 if (spec->cur_out_type == SPEAKER_OUT) { in ca0132_alt_select_out()
4909 ca0132_alt_select_out(spec->codec); in ca0132_unsol_hp_delayed()
4911 ca0132_select_out(spec->codec); in ca0132_unsol_hp_delayed()
4913 jack = snd_hda_jack_tbl_get(spec->codec, spec->unsol_tag_hp); in ca0132_unsol_hp_delayed()
4915 jack->block_report = 0; in ca0132_unsol_hp_delayed()
4916 snd_hda_jack_report_sync(spec->codec); in ca0132_unsol_hp_delayed()
4932 struct ca0132_spec *spec = codec->spec; in ca0132_set_vipsource()
4935 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_set_vipsource()
4939 if (!spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] || in ca0132_set_vipsource()
4944 if (spec->cur_mic_type == DIGITAL_MIC) in ca0132_set_vipsource()
4954 if (spec->cur_mic_type == DIGITAL_MIC) in ca0132_set_vipsource()
4970 struct ca0132_spec *spec = codec->spec; in ca0132_alt_set_vipsource()
4973 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_alt_set_vipsource()
4982 if (!spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] || in ca0132_alt_set_vipsource()
4983 (val == 0) || spec->in_enum_val == REAR_LINE_IN) { in ca0132_alt_set_vipsource()
4996 if (spec->in_enum_val == REAR_LINE_IN) in ca0132_alt_set_vipsource()
5014 if (spec->effects_switch[VOICE_FOCUS - EFFECT_START_NID]) in ca0132_alt_set_vipsource()
5036 * If jack inserted, ext.mic will be selected, else built-in mic
5041 struct ca0132_spec *spec = codec->spec; in ca0132_select_mic()
5049 auto_jack = spec->vnode_lswitch[VNID_AMIC1_ASEL - VNODE_START_NID]; in ca0132_select_mic()
5052 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_amic1); in ca0132_select_mic()
5055 spec->vnode_lswitch[VNID_AMIC1_SEL - VNODE_START_NID]; in ca0132_select_mic()
5058 spec->cur_mic_type = LINE_MIC_IN; in ca0132_select_mic()
5060 spec->cur_mic_type = DIGITAL_MIC; in ca0132_select_mic()
5062 if (spec->cur_mic_type == DIGITAL_MIC) { in ca0132_select_mic()
5069 spec->effects_switch in ca0132_select_mic()
5070 [VOICE_FOCUS - EFFECT_START_NID]); in ca0132_select_mic()
5075 ca0132_mic_boost_set(codec, spec->cur_mic_boost); in ca0132_select_mic()
5088 * The front mic has no jack-detection, so the only way to switch to it
5093 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_in()
5103 spec->cur_mic_type = spec->in_enum_val; in ca0132_alt_select_in()
5105 switch (spec->cur_mic_type) { in ca0132_alt_select_in()
5163 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_select_in()
5256 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_select_in()
5272 struct ca0132_spec *spec = codec->spec; in ca0132_is_vnode_effective()
5277 nid = spec->shared_out_nid; in ca0132_is_vnode_effective()
5280 nid = spec->shared_mic_nid; in ca0132_is_vnode_effective()
5298 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_set()
5303 tmp = spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] ? in ca0132_voicefx_set()
5320 struct ca0132_spec *spec = codec->spec; in ca0132_effects_set()
5324 int idx = nid - EFFECT_START_NID; in ca0132_effects_set()
5332 if (!spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) in ca0132_effects_set()
5334 if (spec->cur_out_type == SPEAKER_OUT && nid == X_BASS) { in ca0132_effects_set()
5335 channel_cfg = spec->channel_cfg_val; in ca0132_effects_set()
5345 if (!spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]) in ca0132_effects_set()
5348 /* Voice Focus applies to 2-ch Mic, Digital Mic */ in ca0132_effects_set()
5349 if ((nid == VOICE_FOCUS) && (spec->cur_mic_type != DIGITAL_MIC)) in ca0132_effects_set()
5352 /* If Voice Focus on SBZ, set to two channel. */ in ca0132_effects_set()
5354 && (spec->cur_mic_type != REAR_LINE_IN)) { in ca0132_effects_set()
5355 if (spec->effects_switch[CRYSTAL_VOICE - in ca0132_effects_set()
5358 if (spec->effects_switch[VOICE_FOCUS - in ca0132_effects_set()
5373 && (spec->cur_mic_type != REAR_LINE_IN)) { in ca0132_effects_set()
5374 if (spec->effects_switch[CRYSTAL_VOICE - in ca0132_effects_set()
5376 if (spec->effects_switch[NOISE_REDUCTION - in ca0132_effects_set()
5389 spec->in_enum_val == REAR_LINE_IN) in ca0132_effects_set()
5411 struct ca0132_spec *spec = codec->spec; in ca0132_pe_switch_set()
5416 spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]); in ca0132_pe_switch_set()
5421 i = OUT_EFFECT_START_NID - EFFECT_START_NID; in ca0132_pe_switch_set()
5425 ret |= ca0132_effects_set(codec, nid, spec->effects_switch[i]); in ca0132_pe_switch_set()
5433 struct ca0132_spec *spec = codec->spec; in stop_mic1()
5434 unsigned int oldval = snd_hda_codec_read(codec, spec->adcs[0], 0, in stop_mic1()
5437 snd_hda_codec_write(codec, spec->adcs[0], 0, in stop_mic1()
5446 struct ca0132_spec *spec = codec->spec; in resume_mic1()
5447 /* Restore the previous stream and channel */ in resume_mic1()
5449 snd_hda_codec_write(codec, spec->adcs[0], 0, in resume_mic1()
5459 struct ca0132_spec *spec = codec->spec; in ca0132_cvoice_switch_set()
5465 spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]); in ca0132_cvoice_switch_set()
5467 i = IN_EFFECT_START_NID - EFFECT_START_NID; in ca0132_cvoice_switch_set()
5471 ret |= ca0132_effects_set(codec, nid, spec->effects_switch[i]); in ca0132_cvoice_switch_set()
5474 ret |= ca0132_voicefx_set(codec, (spec->voicefx_val ? 1 : 0)); in ca0132_cvoice_switch_set()
5488 struct ca0132_spec *spec = codec->spec; in ca0132_mic_boost_set()
5492 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_mic_boost_set()
5495 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_mic_boost_set()
5503 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_set()
5506 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_alt_mic_boost_set()
5540 struct ca0132_spec *spec = codec->spec; in ca0132_vnode_switch_set()
5545 spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_vnode_switch_set()
5557 spec->vnode_lswitch[VNID_AMIC1_ASEL - VNODE_START_NID]; in ca0132_vnode_switch_set()
5583 mutex_lock(&codec->control_mutex); in ca0132_vnode_switch_set()
5584 pval = kcontrol->private_value; in ca0132_vnode_switch_set()
5585 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(shared_nid, ch, in ca0132_vnode_switch_set()
5588 kcontrol->private_value = pval; in ca0132_vnode_switch_set()
5589 mutex_unlock(&codec->control_mutex); in ca0132_vnode_switch_set()
5638 &(lookup[idx - 1]), sizeof(unsigned int)); in ca0132_alt_slider_ctl_set()
5659 struct ca0132_spec *spec = codec->spec; in ca0132_alt_xbass_xover_slider_ctl_get()
5660 long *valp = ucontrol->value.integer.value; in ca0132_alt_xbass_xover_slider_ctl_get()
5664 *valp = spec->bass_redirect_xover_freq; in ca0132_alt_xbass_xover_slider_ctl_get()
5666 *valp = spec->xbass_xover_freq; in ca0132_alt_xbass_xover_slider_ctl_get()
5675 struct ca0132_spec *spec = codec->spec; in ca0132_alt_slider_ctl_get()
5677 long *valp = ucontrol->value.integer.value; in ca0132_alt_slider_ctl_get()
5678 int idx = nid - OUT_EFFECT_START_NID; in ca0132_alt_slider_ctl_get()
5680 *valp = spec->fx_ctl_val[idx]; in ca0132_alt_slider_ctl_get()
5685 * The X-bass crossover starts at 10hz, so the min is 1. The
5691 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in ca0132_alt_xbass_xover_slider_info()
5692 uinfo->count = 1; in ca0132_alt_xbass_xover_slider_info()
5693 uinfo->value.integer.min = 1; in ca0132_alt_xbass_xover_slider_info()
5694 uinfo->value.integer.max = 100; in ca0132_alt_xbass_xover_slider_info()
5695 uinfo->value.integer.step = 1; in ca0132_alt_xbass_xover_slider_info()
5705 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in ca0132_alt_effect_slider_info()
5706 uinfo->count = chs == 3 ? 2 : 1; in ca0132_alt_effect_slider_info()
5707 uinfo->value.integer.min = 0; in ca0132_alt_effect_slider_info()
5708 uinfo->value.integer.max = 100; in ca0132_alt_effect_slider_info()
5709 uinfo->value.integer.step = 1; in ca0132_alt_effect_slider_info()
5718 struct ca0132_spec *spec = codec->spec; in ca0132_alt_xbass_xover_slider_put()
5720 long *valp = ucontrol->value.integer.value; in ca0132_alt_xbass_xover_slider_put()
5725 cur_val = &spec->bass_redirect_xover_freq; in ca0132_alt_xbass_xover_slider_put()
5727 cur_val = &spec->xbass_xover_freq; in ca0132_alt_xbass_xover_slider_put()
5748 struct ca0132_spec *spec = codec->spec; in ca0132_alt_effect_slider_put()
5750 long *valp = ucontrol->value.integer.value; in ca0132_alt_effect_slider_put()
5753 idx = nid - EFFECT_START_NID; in ca0132_alt_effect_slider_put()
5755 if (spec->fx_ctl_val[idx] == *valp) in ca0132_alt_effect_slider_put()
5758 spec->fx_ctl_val[idx] = *valp; in ca0132_alt_effect_slider_put()
5770 * traditional 0-100 in alsamixer that goes in big steps. I like enum better.
5781 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_mic_boost_info()
5782 uinfo->count = 1; in ca0132_alt_mic_boost_info()
5783 uinfo->value.enumerated.items = MIC_BOOST_NUM_OF_STEPS; in ca0132_alt_mic_boost_info()
5784 if (uinfo->value.enumerated.item >= MIC_BOOST_NUM_OF_STEPS) in ca0132_alt_mic_boost_info()
5785 uinfo->value.enumerated.item = MIC_BOOST_NUM_OF_STEPS - 1; in ca0132_alt_mic_boost_info()
5786 sprintf(namestr, "%d %s", (uinfo->value.enumerated.item * 10), sfx); in ca0132_alt_mic_boost_info()
5787 strcpy(uinfo->value.enumerated.name, namestr); in ca0132_alt_mic_boost_info()
5795 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_get()
5797 ucontrol->value.enumerated.item[0] = spec->mic_boost_enum_val; in ca0132_alt_mic_boost_get()
5805 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_put()
5806 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_mic_boost_put()
5815 spec->mic_boost_enum_val = sel; in ca0132_alt_mic_boost_put()
5817 if (spec->in_enum_val != REAR_LINE_IN) in ca0132_alt_mic_boost_put()
5818 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_mic_boost_put()
5824 * Sound BlasterX AE-5 Headphone Gain Controls.
5833 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ae5_headphone_gain_info()
5834 uinfo->count = 1; in ae5_headphone_gain_info()
5835 uinfo->value.enumerated.items = AE5_HEADPHONE_GAIN_MAX; in ae5_headphone_gain_info()
5836 if (uinfo->value.enumerated.item >= AE5_HEADPHONE_GAIN_MAX) in ae5_headphone_gain_info()
5837 uinfo->value.enumerated.item = AE5_HEADPHONE_GAIN_MAX - 1; in ae5_headphone_gain_info()
5839 ae5_headphone_gain_presets[uinfo->value.enumerated.item].name, in ae5_headphone_gain_info()
5841 strcpy(uinfo->value.enumerated.name, namestr); in ae5_headphone_gain_info()
5849 struct ca0132_spec *spec = codec->spec; in ae5_headphone_gain_get()
5851 ucontrol->value.enumerated.item[0] = spec->ae5_headphone_gain_val; in ae5_headphone_gain_get()
5859 struct ca0132_spec *spec = codec->spec; in ae5_headphone_gain_put()
5860 int sel = ucontrol->value.enumerated.item[0]; in ae5_headphone_gain_put()
5869 spec->ae5_headphone_gain_val = sel; in ae5_headphone_gain_put()
5871 if (spec->out_enum_val == HEADPHONE_OUT) in ae5_headphone_gain_put()
5872 ae5_headphone_gain_set(codec, spec->ae5_headphone_gain_val); in ae5_headphone_gain_put()
5878 * Sound BlasterX AE-5 sound filter enumerated control.
5887 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ae5_sound_filter_info()
5888 uinfo->count = 1; in ae5_sound_filter_info()
5889 uinfo->value.enumerated.items = AE5_SOUND_FILTER_MAX; in ae5_sound_filter_info()
5890 if (uinfo->value.enumerated.item >= AE5_SOUND_FILTER_MAX) in ae5_sound_filter_info()
5891 uinfo->value.enumerated.item = AE5_SOUND_FILTER_MAX - 1; in ae5_sound_filter_info()
5893 ae5_filter_presets[uinfo->value.enumerated.item].name); in ae5_sound_filter_info()
5894 strcpy(uinfo->value.enumerated.name, namestr); in ae5_sound_filter_info()
5902 struct ca0132_spec *spec = codec->spec; in ae5_sound_filter_get()
5904 ucontrol->value.enumerated.item[0] = spec->ae5_filter_val; in ae5_sound_filter_get()
5912 struct ca0132_spec *spec = codec->spec; in ae5_sound_filter_put()
5913 int sel = ucontrol->value.enumerated.item[0]; in ae5_sound_filter_put()
5922 spec->ae5_filter_val = sel; in ae5_sound_filter_put()
5932 * front microphone has no auto-detect, and we need a way to set the rear
5933 * as line-in
5938 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_input_source_info()
5939 uinfo->count = 1; in ca0132_alt_input_source_info()
5940 uinfo->value.enumerated.items = IN_SRC_NUM_OF_INPUTS; in ca0132_alt_input_source_info()
5941 if (uinfo->value.enumerated.item >= IN_SRC_NUM_OF_INPUTS) in ca0132_alt_input_source_info()
5942 uinfo->value.enumerated.item = IN_SRC_NUM_OF_INPUTS - 1; in ca0132_alt_input_source_info()
5943 strcpy(uinfo->value.enumerated.name, in ca0132_alt_input_source_info()
5944 in_src_str[uinfo->value.enumerated.item]); in ca0132_alt_input_source_info()
5952 struct ca0132_spec *spec = codec->spec; in ca0132_alt_input_source_get()
5954 ucontrol->value.enumerated.item[0] = spec->in_enum_val; in ca0132_alt_input_source_get()
5962 struct ca0132_spec *spec = codec->spec; in ca0132_alt_input_source_put()
5963 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_input_source_put()
5967 * The AE-7 has no front microphone, so limit items to 2: rear mic and in ca0132_alt_input_source_put()
5968 * line-in. in ca0132_alt_input_source_put()
5979 spec->in_enum_val = sel; in ca0132_alt_input_source_put()
5990 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_output_select_get_info()
5991 uinfo->count = 1; in ca0132_alt_output_select_get_info()
5992 uinfo->value.enumerated.items = NUM_OF_OUTPUTS; in ca0132_alt_output_select_get_info()
5993 if (uinfo->value.enumerated.item >= NUM_OF_OUTPUTS) in ca0132_alt_output_select_get_info()
5994 uinfo->value.enumerated.item = NUM_OF_OUTPUTS - 1; in ca0132_alt_output_select_get_info()
5995 strcpy(uinfo->value.enumerated.name, in ca0132_alt_output_select_get_info()
5996 out_type_str[uinfo->value.enumerated.item]); in ca0132_alt_output_select_get_info()
6004 struct ca0132_spec *spec = codec->spec; in ca0132_alt_output_select_get()
6006 ucontrol->value.enumerated.item[0] = spec->out_enum_val; in ca0132_alt_output_select_get()
6014 struct ca0132_spec *spec = codec->spec; in ca0132_alt_output_select_put()
6015 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_output_select_put()
6025 spec->out_enum_val = sel; in ca0132_alt_output_select_put()
6027 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_alt_output_select_put()
6041 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_speaker_channel_cfg_get_info()
6042 uinfo->count = 1; in ca0132_alt_speaker_channel_cfg_get_info()
6043 uinfo->value.enumerated.items = items; in ca0132_alt_speaker_channel_cfg_get_info()
6044 if (uinfo->value.enumerated.item >= items) in ca0132_alt_speaker_channel_cfg_get_info()
6045 uinfo->value.enumerated.item = items - 1; in ca0132_alt_speaker_channel_cfg_get_info()
6046 strcpy(uinfo->value.enumerated.name, in ca0132_alt_speaker_channel_cfg_get_info()
6047 speaker_channel_cfgs[uinfo->value.enumerated.item].name); in ca0132_alt_speaker_channel_cfg_get_info()
6055 struct ca0132_spec *spec = codec->spec; in ca0132_alt_speaker_channel_cfg_get()
6057 ucontrol->value.enumerated.item[0] = spec->channel_cfg_val; in ca0132_alt_speaker_channel_cfg_get()
6065 struct ca0132_spec *spec = codec->spec; in ca0132_alt_speaker_channel_cfg_put()
6066 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_speaker_channel_cfg_put()
6075 spec->channel_cfg_val = sel; in ca0132_alt_speaker_channel_cfg_put()
6077 if (spec->out_enum_val == SPEAKER_OUT) in ca0132_alt_speaker_channel_cfg_put()
6094 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_svm_setting_info()
6095 uinfo->count = 1; in ca0132_alt_svm_setting_info()
6096 uinfo->value.enumerated.items = NUM_OF_SVM_SETTINGS; in ca0132_alt_svm_setting_info()
6097 if (uinfo->value.enumerated.item >= NUM_OF_SVM_SETTINGS) in ca0132_alt_svm_setting_info()
6098 uinfo->value.enumerated.item = NUM_OF_SVM_SETTINGS - 1; in ca0132_alt_svm_setting_info()
6099 strcpy(uinfo->value.enumerated.name, in ca0132_alt_svm_setting_info()
6100 out_svm_set_enum_str[uinfo->value.enumerated.item]); in ca0132_alt_svm_setting_info()
6108 struct ca0132_spec *spec = codec->spec; in ca0132_alt_svm_setting_get()
6110 ucontrol->value.enumerated.item[0] = spec->smart_volume_setting; in ca0132_alt_svm_setting_get()
6118 struct ca0132_spec *spec = codec->spec; in ca0132_alt_svm_setting_put()
6119 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_svm_setting_put()
6121 unsigned int idx = SMART_VOLUME - EFFECT_START_NID; in ca0132_alt_svm_setting_put()
6130 spec->smart_volume_setting = sel; in ca0132_alt_svm_setting_put()
6158 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_eq_preset_info()
6159 uinfo->count = 1; in ca0132_alt_eq_preset_info()
6160 uinfo->value.enumerated.items = items; in ca0132_alt_eq_preset_info()
6161 if (uinfo->value.enumerated.item >= items) in ca0132_alt_eq_preset_info()
6162 uinfo->value.enumerated.item = items - 1; in ca0132_alt_eq_preset_info()
6163 strcpy(uinfo->value.enumerated.name, in ca0132_alt_eq_preset_info()
6164 ca0132_alt_eq_presets[uinfo->value.enumerated.item].name); in ca0132_alt_eq_preset_info()
6172 struct ca0132_spec *spec = codec->spec; in ca0132_alt_eq_preset_get()
6174 ucontrol->value.enumerated.item[0] = spec->eq_preset_val; in ca0132_alt_eq_preset_get()
6182 struct ca0132_spec *spec = codec->spec; in ca0132_alt_eq_preset_put()
6184 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_eq_preset_put()
6205 spec->eq_preset_val = sel; in ca0132_alt_eq_preset_put()
6215 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_voicefx_info()
6216 uinfo->count = 1; in ca0132_voicefx_info()
6217 uinfo->value.enumerated.items = items; in ca0132_voicefx_info()
6218 if (uinfo->value.enumerated.item >= items) in ca0132_voicefx_info()
6219 uinfo->value.enumerated.item = items - 1; in ca0132_voicefx_info()
6220 strcpy(uinfo->value.enumerated.name, in ca0132_voicefx_info()
6221 ca0132_voicefx_presets[uinfo->value.enumerated.item].name); in ca0132_voicefx_info()
6229 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_get()
6231 ucontrol->value.enumerated.item[0] = spec->voicefx_val; in ca0132_voicefx_get()
6239 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_put()
6241 int sel = ucontrol->value.enumerated.item[0]; in ca0132_voicefx_put()
6262 spec->voicefx_val = sel; in ca0132_voicefx_put()
6274 struct ca0132_spec *spec = codec->spec; in ca0132_switch_get()
6277 long *valp = ucontrol->value.integer.value; in ca0132_switch_get()
6282 *valp = spec->vnode_lswitch[nid - VNODE_START_NID]; in ca0132_switch_get()
6286 *valp = spec->vnode_rswitch[nid - VNODE_START_NID]; in ca0132_switch_get()
6294 *valp = spec->effects_switch[nid - EFFECT_START_NID]; in ca0132_switch_get()
6299 if (nid == spec->input_pins[0]) { in ca0132_switch_get()
6300 *valp = spec->cur_mic_boost; in ca0132_switch_get()
6305 *valp = spec->zxr_gain_set; in ca0132_switch_get()
6310 *valp = spec->speaker_range_val[nid - SPEAKER_FULL_RANGE_FRONT]; in ca0132_switch_get()
6315 *valp = spec->bass_redirection_val; in ca0132_switch_get()
6326 struct ca0132_spec *spec = codec->spec; in ca0132_switch_put()
6329 long *valp = ucontrol->value.integer.value; in ca0132_switch_put()
6339 spec->vnode_lswitch[nid - VNODE_START_NID] = *valp; in ca0132_switch_put()
6343 spec->vnode_rswitch[nid - VNODE_START_NID] = *valp; in ca0132_switch_put()
6352 spec->effects_switch[nid - EFFECT_START_NID] = *valp; in ca0132_switch_put()
6359 spec->effects_switch[nid - EFFECT_START_NID] = *valp; in ca0132_switch_put()
6367 spec->effects_switch[nid - EFFECT_START_NID] = *valp; in ca0132_switch_put()
6373 if (nid == spec->input_pins[0]) { in ca0132_switch_put()
6374 spec->cur_mic_boost = *valp; in ca0132_switch_put()
6376 if (spec->in_enum_val != REAR_LINE_IN) in ca0132_switch_put()
6380 if (spec->cur_mic_type != DIGITAL_MIC) in ca0132_switch_put()
6388 spec->zxr_gain_set = *valp; in ca0132_switch_put()
6389 if (spec->cur_out_type == HEADPHONE_OUT) in ca0132_switch_put()
6398 spec->speaker_range_val[nid - SPEAKER_FULL_RANGE_FRONT] = *valp; in ca0132_switch_put()
6399 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_switch_put()
6406 spec->bass_redirection_val = *valp; in ca0132_switch_put()
6407 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_switch_put()
6423 * ADC for input. Currently only the SBZ sets dsp capture volume level, and
6428 struct ca0132_spec *spec = codec->spec; in ca0132_alt_dsp_volume_put()
6437 lookup_val = spec->vnode_lvol[nid - VNODE_START_NID]; in ca0132_alt_dsp_volume_put()
6444 lookup_val = spec->vnode_rvol[nid - VNODE_START_NID]; in ca0132_alt_dsp_volume_put()
6460 struct ca0132_spec *spec = codec->spec; in ca0132_volume_info()
6470 nid = spec->shared_out_nid; in ca0132_volume_info()
6471 mutex_lock(&codec->control_mutex); in ca0132_volume_info()
6472 pval = kcontrol->private_value; in ca0132_volume_info()
6473 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_info()
6475 kcontrol->private_value = pval; in ca0132_volume_info()
6476 mutex_unlock(&codec->control_mutex); in ca0132_volume_info()
6480 nid = spec->shared_mic_nid; in ca0132_volume_info()
6481 mutex_lock(&codec->control_mutex); in ca0132_volume_info()
6482 pval = kcontrol->private_value; in ca0132_volume_info()
6483 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_info()
6485 kcontrol->private_value = pval; in ca0132_volume_info()
6486 mutex_unlock(&codec->control_mutex); in ca0132_volume_info()
6498 struct ca0132_spec *spec = codec->spec; in ca0132_volume_get()
6501 long *valp = ucontrol->value.integer.value; in ca0132_volume_get()
6505 *valp = spec->vnode_lvol[nid - VNODE_START_NID]; in ca0132_volume_get()
6509 *valp = spec->vnode_rvol[nid - VNODE_START_NID]; in ca0132_volume_get()
6519 struct ca0132_spec *spec = codec->spec; in ca0132_volume_put()
6522 long *valp = ucontrol->value.integer.value; in ca0132_volume_put()
6529 spec->vnode_lvol[nid - VNODE_START_NID] = *valp; in ca0132_volume_put()
6533 spec->vnode_rvol[nid - VNODE_START_NID] = *valp; in ca0132_volume_put()
6544 mutex_lock(&codec->control_mutex); in ca0132_volume_put()
6545 pval = kcontrol->private_value; in ca0132_volume_put()
6546 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(shared_nid, ch, in ca0132_volume_put()
6549 kcontrol->private_value = pval; in ca0132_volume_put()
6550 mutex_unlock(&codec->control_mutex); in ca0132_volume_put()
6566 struct ca0132_spec *spec = codec->spec; in ca0132_alt_volume_put()
6569 long *valp = ucontrol->value.integer.value; in ca0132_alt_volume_put()
6584 spec->vnode_lvol[vnid - VNODE_START_NID] = *valp; in ca0132_alt_volume_put()
6588 spec->vnode_rvol[vnid - VNODE_START_NID] = *valp; in ca0132_alt_volume_put()
6594 mutex_lock(&codec->control_mutex); in ca0132_alt_volume_put()
6596 mutex_unlock(&codec->control_mutex); in ca0132_alt_volume_put()
6606 struct ca0132_spec *spec = codec->spec; in ca0132_volume_tlv()
6616 nid = spec->shared_out_nid; in ca0132_volume_tlv()
6617 mutex_lock(&codec->control_mutex); in ca0132_volume_tlv()
6618 pval = kcontrol->private_value; in ca0132_volume_tlv()
6619 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_tlv()
6621 kcontrol->private_value = pval; in ca0132_volume_tlv()
6622 mutex_unlock(&codec->control_mutex); in ca0132_volume_tlv()
6626 nid = spec->shared_mic_nid; in ca0132_volume_tlv()
6627 mutex_lock(&codec->control_mutex); in ca0132_volume_tlv()
6628 pval = kcontrol->private_value; in ca0132_volume_tlv()
6629 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_tlv()
6631 kcontrol->private_value = pval; in ca0132_volume_tlv()
6632 mutex_unlock(&codec->control_mutex); in ca0132_volume_tlv()
6679 struct ca0132_spec *spec = codec->spec; in add_fx_switch()
6754 * Add a control for selecting channel count on speaker output. Setting this
6755 * allows the DSP to do bass redirection and channel upmixing on surround
6761 HDA_CODEC_MUTE_MONO("Surround Channel Config", in ca0132_alt_add_speaker_channel_cfg_enum()
6773 * redirected to the LFE channel.
6778 CA0132_CODEC_MUTE_MONO("Full-Range Front Speakers", in ca0132_alt_add_front_full_range_switch()
6788 CA0132_CODEC_MUTE_MONO("Full-Range Rear Speakers", in ca0132_alt_add_rear_full_range_switch()
6797 * channel on speakers that are set as not being full-range. On configurations
6798 * without an LFE channel, it does nothing. Bass redirection seems to be the
6799 * replacement for X-Bass on configurations with an LFE channel.
6830 * because the front microphone has no auto-detect, and Line-in has to be set
6863 * Add headphone gain enumerated control for the AE-5. This switches between
6864 * three modes, low, medium, and high. When non-headphone outputs are selected,
6870 HDA_CODEC_MUTE_MONO("AE-5: Headphone Gain", in ae5_add_headphone_gain_enum()
6880 * Add sound filter enumerated control for the AE-5. This adds three different
6887 HDA_CODEC_MUTE_MONO("AE-5: Sound Filter", in ae5_add_sound_filter_enum()
6915 * Also need special channel map, because the default one is incorrect.
6938 list_for_each_entry(pcm, &codec->pcm_list_head, list) { in ca0132_alt_add_chmap_ctls()
6940 &pcm->stream[SNDRV_PCM_STREAM_PLAYBACK]; in ca0132_alt_add_chmap_ctls()
6945 if (hinfo->channels_max == 6) { in ca0132_alt_add_chmap_ctls()
6946 err = snd_pcm_add_chmap_ctls(pcm->pcm, in ca0132_alt_add_chmap_ctls()
6948 elem, hinfo->channels_max, 0, &chmap); in ca0132_alt_add_chmap_ctls()
6964 HDA_CODEC_VOLUME("Analog-Mic2 Capture Volume", 0x08, 0, HDA_INPUT),
6965 HDA_CODEC_MUTE("Analog-Mic2 Capture Switch", 0x08, 0, HDA_INPUT),
6968 CA0132_CODEC_MUTE_MONO("Mic1-Boost (30dB) Capture Switch",
6982 * Desktop specific control mixer. Removes auto-detect for mic, and adds
6984 * controls to alt so they set the DSP's decibel level.
7005 * Same as the Sound Blaster Z, except doesn't use the alt volume for capture
7028 struct ca0132_spec *spec = codec->spec; in ca0132_build_controls()
7033 for (i = 0; i < spec->num_mixers; i++) { in ca0132_build_controls()
7034 err = snd_hda_add_new_ctls(codec, spec->mixers[i]); in ca0132_build_controls()
7040 snd_hda_set_vmaster_tlv(codec, spec->dacs[0], HDA_OUTPUT, in ca0132_build_controls()
7041 spec->tlv); in ca0132_build_controls()
7043 spec->tlv, ca0132_alt_follower_pfxs, in ca0132_build_controls()
7048 true, 0, &spec->vmaster_mute.sw_kctl); in ca0132_build_controls()
7060 if (i == (ECHO_CANCELLATION - IN_EFFECT_START_NID + in ca0132_build_controls()
7095 num_sliders = OUT_EFFECTS_COUNT - 1; in ca0132_build_controls()
7106 "X-Bass Crossover", EFX_DIR_OUT); in ca0132_build_controls()
7154 * header on the card, and aux-in is handled by the DBPro board. in ca0132_build_controls()
7186 err = snd_hda_jack_add_kctls(codec, &spec->autocfg); in ca0132_build_controls()
7190 if (spec->dig_out) { in ca0132_build_controls()
7191 err = snd_hda_create_spdif_out_ctls(codec, spec->dig_out, in ca0132_build_controls()
7192 spec->dig_out); in ca0132_build_controls()
7195 err = snd_hda_create_spdif_share_sw(codec, &spec->multiout); in ca0132_build_controls()
7198 /* spec->multiout.share_spdif = 1; */ in ca0132_build_controls()
7201 if (spec->dig_in) { in ca0132_build_controls()
7202 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); in ca0132_build_controls()
7215 struct ca0132_spec *spec = codec->spec; in dbpro_build_controls()
7218 if (spec->dig_out) { in dbpro_build_controls()
7219 err = snd_hda_create_spdif_out_ctls(codec, spec->dig_out, in dbpro_build_controls()
7220 spec->dig_out); in dbpro_build_controls()
7225 if (spec->dig_in) { in dbpro_build_controls()
7226 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); in dbpro_build_controls()
7279 struct ca0132_spec *spec = codec->spec; in ca0132_build_pcms()
7284 return -ENOMEM; in ca0132_build_pcms()
7286 info->own_chmap = true; in ca0132_build_pcms()
7287 info->stream[SNDRV_PCM_STREAM_PLAYBACK].chmap in ca0132_build_pcms()
7290 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = ca0132_pcm_analog_playback; in ca0132_build_pcms()
7291 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->dacs[0]; in ca0132_build_pcms()
7292 info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = in ca0132_build_pcms()
7293 spec->multiout.max_channels; in ca0132_build_pcms()
7294 info->stream[SNDRV_PCM_STREAM_CAPTURE] = ca0132_pcm_analog_capture; in ca0132_build_pcms()
7295 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in ca0132_build_pcms()
7296 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0]; in ca0132_build_pcms()
7298 /* With the DSP enabled, desktops don't use this ADC. */ in ca0132_build_pcms()
7300 info = snd_hda_codec_pcm_new(codec, "CA0132 Analog Mic-In2"); in ca0132_build_pcms()
7302 return -ENOMEM; in ca0132_build_pcms()
7303 info->stream[SNDRV_PCM_STREAM_CAPTURE] = in ca0132_build_pcms()
7305 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in ca0132_build_pcms()
7306 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[1]; in ca0132_build_pcms()
7311 return -ENOMEM; in ca0132_build_pcms()
7312 info->stream[SNDRV_PCM_STREAM_CAPTURE] = ca0132_pcm_analog_capture; in ca0132_build_pcms()
7313 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in ca0132_build_pcms()
7314 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[2]; in ca0132_build_pcms()
7316 if (!spec->dig_out && !spec->dig_in) in ca0132_build_pcms()
7321 return -ENOMEM; in ca0132_build_pcms()
7322 info->pcm_type = HDA_PCM_TYPE_SPDIF; in ca0132_build_pcms()
7323 if (spec->dig_out) { in ca0132_build_pcms()
7324 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = in ca0132_build_pcms()
7326 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->dig_out; in ca0132_build_pcms()
7328 if (spec->dig_in) { in ca0132_build_pcms()
7329 info->stream[SNDRV_PCM_STREAM_CAPTURE] = in ca0132_build_pcms()
7331 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in; in ca0132_build_pcms()
7339 struct ca0132_spec *spec = codec->spec; in dbpro_build_pcms()
7342 info = snd_hda_codec_pcm_new(codec, "CA0132 Alt Analog"); in dbpro_build_pcms()
7344 return -ENOMEM; in dbpro_build_pcms()
7345 info->stream[SNDRV_PCM_STREAM_CAPTURE] = ca0132_pcm_analog_capture; in dbpro_build_pcms()
7346 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in dbpro_build_pcms()
7347 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0]; in dbpro_build_pcms()
7350 if (!spec->dig_out && !spec->dig_in) in dbpro_build_pcms()
7355 return -ENOMEM; in dbpro_build_pcms()
7356 info->pcm_type = HDA_PCM_TYPE_SPDIF; in dbpro_build_pcms()
7357 if (spec->dig_out) { in dbpro_build_pcms()
7358 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = in dbpro_build_pcms()
7360 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->dig_out; in dbpro_build_pcms()
7362 if (spec->dig_in) { in dbpro_build_pcms()
7363 info->stream[SNDRV_PCM_STREAM_CAPTURE] = in dbpro_build_pcms()
7365 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in; in dbpro_build_pcms()
7385 static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc) in init_input() argument
7394 if (adc && (get_wcaps(codec, adc) & AC_WCAP_IN_AMP)) { in init_input()
7395 snd_hda_codec_write(codec, adc, 0, AC_VERB_SET_AMP_GAIN_MUTE, in init_input()
7399 snd_hda_codec_amp_stereo(codec, adc, HDA_INPUT, 0, in init_input()
7401 snd_hda_codec_amp_stereo(codec, adc, HDA_INPUT, 0, in init_input()
7416 * Switch between Digital built-in mic and analog mic.
7420 struct ca0132_spec *spec = codec->spec; in ca0132_set_dmic()
7430 /* set DMic input as 2-ch */ in ca0132_set_dmic()
7434 val = spec->dmic_ctl; in ca0132_set_dmic()
7436 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_set_dmic()
7439 if (!(spec->dmic_ctl & 0x20)) in ca0132_set_dmic()
7446 val = spec->dmic_ctl; in ca0132_set_dmic()
7449 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_set_dmic()
7452 if (!(spec->dmic_ctl & 0x20)) in ca0132_set_dmic()
7464 struct ca0132_spec *spec = codec->spec; in ca0132_init_dmic()
7472 * Bit 2-0: MPIO select in ca0132_init_dmic()
7474 * Bit 7-4: reserved in ca0132_init_dmic()
7477 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7481 * Bit 2-0: Data1 MPIO select in ca0132_init_dmic()
7483 * Bit 6-4: Data2 MPIO select in ca0132_init_dmic()
7487 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7490 /* Use Ch-0 and Ch-1. Rate is 48K, mode 1. Disable DMic first. in ca0132_init_dmic()
7491 * Bit 3-0: Channel mask in ca0132_init_dmic()
7502 spec->dmic_ctl = val; in ca0132_init_dmic()
7503 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7512 struct ca0132_spec *spec = codec->spec; in ca0132_init_analog_mic2()
7514 mutex_lock(&spec->chipio_mutex); in ca0132_init_analog_mic2()
7519 mutex_unlock(&spec->chipio_mutex); in ca0132_init_analog_mic2()
7524 struct ca0132_spec *spec = codec->spec; in ca0132_refresh_widget_caps()
7530 for (i = 0; i < spec->multiout.num_dacs; i++) in ca0132_refresh_widget_caps()
7531 refresh_amp_caps(codec, spec->dacs[i], HDA_OUTPUT); in ca0132_refresh_widget_caps()
7533 for (i = 0; i < spec->num_outputs; i++) in ca0132_refresh_widget_caps()
7534 refresh_amp_caps(codec, spec->out_pins[i], HDA_OUTPUT); in ca0132_refresh_widget_caps()
7536 for (i = 0; i < spec->num_inputs; i++) { in ca0132_refresh_widget_caps()
7537 refresh_amp_caps(codec, spec->adcs[i], HDA_INPUT); in ca0132_refresh_widget_caps()
7538 refresh_amp_caps(codec, spec->input_pins[i], HDA_INPUT); in ca0132_refresh_widget_caps()
7543 /* If there is an active channel for some reason, find it and free it. */
7549 /* Read active DSPDMAC channel register. */ in ca0132_alt_free_active_dma_channels()
7552 /* AND against 0xfff to get the active channel bits. */ in ca0132_alt_free_active_dma_channels()
7559 codec_dbg(codec, "%s: Failed to read active DSP DMA channel register.\n", in ca0132_alt_free_active_dma_channels()
7565 * Check each DSP DMA channel for activity, and if the channel is in ca0132_alt_free_active_dma_channels()
7572 codec_dbg(codec, "%s: Failed to free active DSP DMA channel %d.\n", in ca0132_alt_free_active_dma_channels()
7580 * use, audio is no longer routed directly to the DAC/ADC from the HDA stream.
7583 * cause of most of the no-audio on startup issues were due to improperly
7592 * channel being sandwiched between the mic1 and mic2 dma channels.
7602 struct ca0132_spec *spec = codec->spec; in ca0132_alt_start_dsp_audio_streams()
7609 mutex_lock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7620 mutex_unlock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7629 mutex_lock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7638 /* Give the DSP some time to setup the DMA channel. */ in ca0132_alt_start_dsp_audio_streams()
7642 mutex_unlock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7646 * The region of ChipIO memory from 0x190000-0x1903fc is a sort of 'audio
7647 * router', where each entry represents a 48khz audio channel, with a format
7648 * of an 8-bit destination, an 8-bit source, and an unknown 2-bit number
7649 * value. The 2-bit number value is seemingly 0 if inactive, 1 if active,
7656 * the region of exram memory from 0x1477-0x1575 has each byte represent an
7669 * 0x00-0x1f: HDA audio stream input/output ports.
7670 * 0x80-0xbf: Sample rate converter input/outputs. Only valid ports seem to
7671 * have the lower-nibble set to 0x1, 0x2, and 0x9.
7672 * 0xc0-0xdf: DSP DMA input/output ports. Dynamically assigned.
7673 * 0xe0-0xff: DAC/ADC audio input/output ports.
7676 * 0x03: Mic1 ADC to DSP.
7677 * 0x04: Mic2 ADC to DSP.
7695 chipio_8051_read_exram(codec, 0x1578 + remap_data->stream_id, in chipio_remap_stream()
7707 chipio_8051_read_exram(codec, 0x1578 + remap_data->stream_id, in chipio_remap_stream()
7717 __func__, remap_data->stream_id); in chipio_remap_stream()
7721 /* Offset isn't in bytes, its in 32-bit words, so multiply it by 4. */ in chipio_remap_stream()
7725 for (i = 0; i < remap_data->count; i++) { in chipio_remap_stream()
7727 stream_offset + remap_data->offset[i], in chipio_remap_stream()
7728 remap_data->value[i]); in chipio_remap_stream()
7739 /* Non-zero values are floating point 0.000198. */
7744 /* Non-zero values are floating point 0.000220. */
7749 /* Non-zero values are floating point 0.000100. */
7758 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init_speaker_tuning()
7798 * Initialize mic for non-chromebook ca0132 implementations.
7802 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init_analog_mics()
7832 struct ca0132_spec *spec = codec->spec; in sbz_connect_streams()
7834 mutex_lock(&spec->chipio_mutex); in sbz_connect_streams()
7850 mutex_unlock(&spec->chipio_mutex); in sbz_connect_streams()
7862 struct ca0132_spec *spec = codec->spec; in sbz_chipio_startup_data()
7864 mutex_lock(&spec->chipio_mutex); in sbz_chipio_startup_data()
7889 mutex_unlock(&spec->chipio_mutex); in sbz_chipio_startup_data()
7894 struct ca0132_spec *spec = codec->spec; in ca0132_alt_dsp_initial_mic_setup()
7925 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_register_set()
7930 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7931 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7932 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7933 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7934 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7935 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7936 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7937 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7938 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7939 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7940 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7941 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7953 * AE-5's registry values in Windows. in ae5_post_dsp_param_setup()
7958 * change colors on the external LED strip connected to the AE-5. in ae5_post_dsp_param_setup()
7979 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_stream_setup()
7981 mutex_lock(&spec->chipio_mutex); in ae5_post_dsp_stream_setup()
8000 mutex_unlock(&spec->chipio_mutex); in ae5_post_dsp_stream_setup()
8005 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_startup_data()
8007 mutex_lock(&spec->chipio_mutex); in ae5_post_dsp_startup_data()
8032 mutex_unlock(&spec->chipio_mutex); in ae5_post_dsp_startup_data()
8037 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_setup_ports()
8039 mutex_lock(&spec->chipio_mutex); in ae7_post_dsp_setup_ports()
8053 mutex_unlock(&spec->chipio_mutex); in ae7_post_dsp_setup_ports()
8058 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_asi_stream_setup()
8060 mutex_lock(&spec->chipio_mutex); in ae7_post_dsp_asi_stream_setup()
8076 mutex_unlock(&spec->chipio_mutex); in ae7_post_dsp_asi_stream_setup()
8095 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_asi_setup_ports()
8104 mutex_lock(&spec->chipio_mutex); in ae7_post_dsp_asi_setup_ports()
8141 * know what data is being sent. Interestingly, the AE-5 seems to go in ae7_post_dsp_asi_setup_ports()
8143 * step, but the AE-7 does. in ae7_post_dsp_asi_setup_ports()
8167 mutex_unlock(&spec->chipio_mutex); in ae7_post_dsp_asi_setup_ports()
8206 struct ca0132_spec *spec = codec->spec; in ca0132_setup_defaults()
8211 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_setup_defaults()
8251 struct ca0132_spec *spec = codec->spec; in r3d_setup_defaults()
8256 if (spec->dsp_state != DSP_DOWNLOADED) in r3d_setup_defaults()
8301 struct ca0132_spec *spec = codec->spec; in sbz_setup_defaults()
8306 if (spec->dsp_state != DSP_DOWNLOADED) in sbz_setup_defaults()
8351 * Setup default parameters for the Sound BlasterX AE-5 DSP.
8355 struct ca0132_spec *spec = codec->spec; in ae5_setup_defaults()
8360 if (spec->dsp_state != DSP_DOWNLOADED) in ae5_setup_defaults()
8416 * Setup default parameters for the Sound Blaster AE-7 DSP.
8420 struct ca0132_spec *spec = codec->spec; in ae7_setup_defaults()
8425 if (spec->dsp_state != DSP_DOWNLOADED) in ae7_setup_defaults()
8503 struct ca0132_spec *spec = codec->spec; in ca0132_init_flags()
8536 struct ca0132_spec *spec = codec->spec; in ca0132_init_params()
8567 struct ca0132_spec *spec = codec->spec; in ca0132_download_dsp_images()
8580 codec->card->dev) != 0) in ca0132_download_dsp_images()
8587 codec->card->dev) != 0) in ca0132_download_dsp_images()
8588 codec_dbg(codec, "Recon3Di alt firmware not detected."); in ca0132_download_dsp_images()
8596 * Use default ctefx.bin if no alt firmware is detected, or if none in ca0132_download_dsp_images()
8602 codec->card->dev) != 0) in ca0132_download_dsp_images()
8606 dsp_os_image = (struct dsp_image_seg *)(fw_entry->data); in ca0132_download_dsp_images()
8622 struct ca0132_spec *spec = codec->spec; in ca0132_download_dsp()
8628 if (spec->dsp_state == DSP_DOWNLOAD_FAILED) in ca0132_download_dsp()
8632 if (spec->dsp_state != DSP_DOWNLOADED) { in ca0132_download_dsp()
8633 spec->dsp_state = DSP_DOWNLOADING; in ca0132_download_dsp()
8636 spec->dsp_state = DSP_DOWNLOAD_FAILED; in ca0132_download_dsp()
8638 spec->dsp_state = DSP_DOWNLOADED; in ca0132_download_dsp()
8641 /* For codecs using alt functions, this is already done earlier */ in ca0132_download_dsp()
8642 if (spec->dsp_state == DSP_DOWNLOADED && !ca0132_use_alt_functions(spec)) in ca0132_download_dsp()
8649 struct ca0132_spec *spec = codec->spec; in ca0132_process_dsp_response()
8653 if (spec->wait_scp) { in ca0132_process_dsp_response()
8655 spec->wait_scp = 0; in ca0132_process_dsp_response()
8664 struct ca0132_spec *spec = codec->spec; in hp_callback()
8667 /* Delay enabling the HP amp, to let the mic-detection in hp_callback()
8670 tbl = snd_hda_jack_tbl_get(codec, cb->nid); in hp_callback()
8672 tbl->block_report = 1; in hp_callback()
8673 schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(500)); in hp_callback()
8678 struct ca0132_spec *spec = codec->spec; in amic_callback()
8688 struct ca0132_spec *spec = codec->spec; in ca0132_setup_unsol()
8689 snd_hda_jack_detect_enable_callback(codec, spec->unsol_tag_hp, hp_callback); in ca0132_setup_unsol()
8690 snd_hda_jack_detect_enable_callback(codec, spec->unsol_tag_amic1, in ca0132_setup_unsol()
8697 spec->unsol_tag_front_hp, hp_callback); in ca0132_setup_unsol()
8777 struct ca0132_spec *spec = codec->spec; in ca0132_init_chip()
8782 mutex_init(&spec->chipio_mutex); in ca0132_init_chip()
8794 snd_hda_codec_write(codec, codec->core.afg, 0, in ca0132_init_chip()
8796 snd_hda_codec_write(codec, codec->core.afg, 0, in ca0132_init_chip()
8800 spec->cur_out_type = SPEAKER_OUT; in ca0132_init_chip()
8802 spec->cur_mic_type = DIGITAL_MIC; in ca0132_init_chip()
8804 spec->cur_mic_type = REAR_MIC; in ca0132_init_chip()
8806 spec->cur_mic_boost = 0; in ca0132_init_chip()
8809 spec->vnode_lvol[i] = 0x5a; in ca0132_init_chip()
8810 spec->vnode_rvol[i] = 0x5a; in ca0132_init_chip()
8811 spec->vnode_lswitch[i] = 0; in ca0132_init_chip()
8812 spec->vnode_rswitch[i] = 0; in ca0132_init_chip()
8821 spec->effects_switch[i] = on ? 1 : 0; in ca0132_init_chip()
8825 * ca0132 codecs. Also sets x-bass crossover frequency to 80hz. in ca0132_init_chip()
8829 spec->speaker_range_val[0] = 1; in ca0132_init_chip()
8830 spec->speaker_range_val[1] = 1; in ca0132_init_chip()
8832 spec->xbass_xover_freq = 8; in ca0132_init_chip()
8834 spec->fx_ctl_val[i] = effect_slider_defaults[i]; in ca0132_init_chip()
8836 spec->bass_redirect_xover_freq = 8; in ca0132_init_chip()
8839 spec->voicefx_val = 0; in ca0132_init_chip()
8840 spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID] = 1; in ca0132_init_chip()
8841 spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] = 0; in ca0132_init_chip()
8844 * The ZxR doesn't have a front panel header, and it's line-in is on in ca0132_init_chip()
8846 * to make sure that spec->in_enum_val is set properly. in ca0132_init_chip()
8849 spec->in_enum_val = REAR_MIC; in ca0132_init_chip()
8870 struct ca0132_spec *spec = codec->spec; in sbz_region2_exit()
8874 writeb(0x0, spec->mem_base + 0x100); in sbz_region2_exit()
8876 writeb(0xb3, spec->mem_base + 0x304); in sbz_region2_exit()
8941 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, -1); in sbz_exit_chip()
9076 struct ca0132_spec *spec = codec->spec; in sbz_dsp_startup_check()
9083 if (spec->startup_check_entered) in sbz_dsp_startup_check()
9086 spec->startup_check_entered = true; in sbz_dsp_startup_check()
9108 spec->dsp_state = DSP_DOWNLOAD_INIT; in sbz_dsp_startup_check()
9109 codec->patch_ops.init(codec); in sbz_dsp_startup_check()
9119 reload--; in sbz_dsp_startup_check()
9156 struct ca0132_spec *spec = codec->spec; in sbz_pre_dsp_setup()
9158 writel(0x00820680, spec->mem_base + 0x01C); in sbz_pre_dsp_setup()
9159 writel(0x00820680, spec->mem_base + 0x01C); in sbz_pre_dsp_setup()
9269 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init_sbz()
9275 writel(0x00000000, spec->mem_base + addr[i]); in ca0132_mmio_init_sbz()
9298 writel(tmp[i], spec->mem_base + addr[cur_addr + i]); in ca0132_mmio_init_sbz()
9314 writel(data[i], spec->mem_base + addr[cur_addr + i]); in ca0132_mmio_init_sbz()
9319 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init_ae5()
9328 writel(0x00000680, spec->mem_base + 0x1c); in ca0132_mmio_init_ae5()
9329 writel(0x00880680, spec->mem_base + 0x1c); in ca0132_mmio_init_ae5()
9334 * AE-7 shares all writes with the AE-5, except that it writes in ca0132_mmio_init_ae5()
9338 writel(0x00800001, spec->mem_base + addr[i]); in ca0132_mmio_init_ae5()
9342 writel(data[i], spec->mem_base + addr[i]); in ca0132_mmio_init_ae5()
9346 writel(0x00880680, spec->mem_base + 0x1c); in ca0132_mmio_init_ae5()
9351 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init()
9384 struct ca0132_spec *spec = codec->spec; in ae5_register_set()
9408 writeb(tmp[i], spec->mem_base + addr[cur_addr]); in ae5_register_set()
9415 writeb(data[i], spec->mem_base + addr[cur_addr]); in ae5_register_set()
9418 writel(data[i], spec->mem_base + addr[cur_addr]); in ae5_register_set()
9420 writel(0x00800001, spec->mem_base + 0x20c); in ae5_register_set()
9443 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init()
9452 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9453 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9461 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9466 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9467 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9473 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9474 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9480 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9481 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9489 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9490 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9500 struct ca0132_spec *spec = codec->spec; in ca0132_init()
9501 struct auto_pin_cfg *cfg = &spec->autocfg; in ca0132_init()
9515 if (spec->dsp_state == DSP_DOWNLOADED) { in ca0132_init()
9518 spec->dsp_reload = true; in ca0132_init()
9519 spec->dsp_state = DSP_DOWNLOAD_INIT; in ca0132_init()
9527 if (spec->dsp_state != DSP_DOWNLOAD_FAILED) in ca0132_init()
9528 spec->dsp_state = DSP_DOWNLOAD_INIT; in ca0132_init()
9529 spec->curr_chip_addx = INVALID_CHIP_ADDRESS; in ca0132_init()
9542 snd_hda_sequence_write(codec, spec->base_init_verbs); in ca0132_init()
9573 for (i = 0; i < spec->num_outputs; i++) in ca0132_init()
9574 init_output(codec, spec->out_pins[i], spec->dacs[0]); in ca0132_init()
9576 init_output(codec, cfg->dig_out_pins[0], spec->dig_out); in ca0132_init()
9578 for (i = 0; i < spec->num_inputs; i++) in ca0132_init()
9579 init_input(codec, spec->input_pins[i], spec->adcs[i]); in ca0132_init()
9581 init_input(codec, cfg->dig_in_pin, spec->dig_in); in ca0132_init()
9584 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_init()
9594 snd_hda_sequence_write(codec, spec->spec_init_verbs); in ca0132_init()
9609 if (spec->dsp_reload) { in ca0132_init()
9610 spec->dsp_reload = false; in ca0132_init()
9621 struct ca0132_spec *spec = codec->spec; in dbpro_init()
9622 struct auto_pin_cfg *cfg = &spec->autocfg; in dbpro_init()
9625 init_output(codec, cfg->dig_out_pins[0], spec->dig_out); in dbpro_init()
9626 init_input(codec, cfg->dig_in_pin, spec->dig_in); in dbpro_init()
9628 for (i = 0; i < spec->num_inputs; i++) in dbpro_init()
9629 init_input(codec, spec->input_pins[i], spec->adcs[i]); in dbpro_init()
9636 struct ca0132_spec *spec = codec->spec; in ca0132_free()
9638 cancel_delayed_work_sync(&spec->unsol_hp_work); in ca0132_free()
9663 snd_hda_sequence_write(codec, spec->base_exit_verbs); in ca0132_free()
9668 if (spec->mem_base) in ca0132_free()
9669 pci_iounmap(codec->bus->pci, spec->mem_base); in ca0132_free()
9671 kfree(spec->spec_init_verbs); in ca0132_free()
9672 kfree(codec->spec); in ca0132_free()
9677 struct ca0132_spec *spec = codec->spec; in dbpro_free()
9681 kfree(spec->spec_init_verbs); in dbpro_free()
9682 kfree(codec->spec); in dbpro_free()
9687 struct ca0132_spec *spec = codec->spec; in ca0132_suspend()
9689 cancel_delayed_work_sync(&spec->unsol_hp_work); in ca0132_suspend()
9711 struct ca0132_spec *spec = codec->spec; in ca0132_config()
9713 spec->dacs[0] = 0x2; in ca0132_config()
9714 spec->dacs[1] = 0x3; in ca0132_config()
9715 spec->dacs[2] = 0x4; in ca0132_config()
9717 spec->multiout.dac_nids = spec->dacs; in ca0132_config()
9718 spec->multiout.num_dacs = 3; in ca0132_config()
9721 spec->multiout.max_channels = 2; in ca0132_config()
9723 spec->multiout.max_channels = 6; in ca0132_config()
9760 spec->num_outputs = 2; in ca0132_config()
9761 spec->out_pins[0] = 0x0b; /* speaker out */ in ca0132_config()
9762 spec->out_pins[1] = 0x0f; in ca0132_config()
9763 spec->shared_out_nid = 0x2; in ca0132_config()
9764 spec->unsol_tag_hp = 0x0f; in ca0132_config()
9766 spec->adcs[0] = 0x7; /* digital mic / analog mic1 */ in ca0132_config()
9767 spec->adcs[1] = 0x8; /* analog mic2 */ in ca0132_config()
9768 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9770 spec->num_inputs = 3; in ca0132_config()
9771 spec->input_pins[0] = 0x12; in ca0132_config()
9772 spec->input_pins[1] = 0x11; in ca0132_config()
9773 spec->input_pins[2] = 0x13; in ca0132_config()
9774 spec->shared_mic_nid = 0x7; in ca0132_config()
9775 spec->unsol_tag_amic1 = 0x11; in ca0132_config()
9779 spec->num_outputs = 2; in ca0132_config()
9780 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9781 spec->out_pins[1] = 0x0F; /* Rear headphone out */ in ca0132_config()
9782 spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ in ca0132_config()
9783 spec->out_pins[3] = 0x11; /* Rear surround */ in ca0132_config()
9784 spec->shared_out_nid = 0x2; in ca0132_config()
9785 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9786 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9788 spec->adcs[0] = 0x7; /* Rear Mic / Line-in */ in ca0132_config()
9789 spec->adcs[1] = 0x8; /* Front Mic, but only if no DSP */ in ca0132_config()
9790 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9792 spec->num_inputs = 2; in ca0132_config()
9793 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9794 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9795 spec->shared_mic_nid = 0x7; in ca0132_config()
9796 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9799 spec->dig_out = 0x05; in ca0132_config()
9800 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9801 spec->dig_in = 0x09; in ca0132_config()
9804 spec->num_outputs = 2; in ca0132_config()
9805 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9806 spec->out_pins[1] = 0x0F; /* Rear headphone out */ in ca0132_config()
9807 spec->out_pins[2] = 0x10; /* Center/LFE */ in ca0132_config()
9808 spec->out_pins[3] = 0x11; /* Rear surround */ in ca0132_config()
9809 spec->shared_out_nid = 0x2; in ca0132_config()
9810 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9811 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9813 spec->adcs[0] = 0x7; /* Rear Mic / Line-in */ in ca0132_config()
9814 spec->adcs[1] = 0x8; /* Not connected, no front mic */ in ca0132_config()
9815 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9817 spec->num_inputs = 2; in ca0132_config()
9818 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9819 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9820 spec->shared_mic_nid = 0x7; in ca0132_config()
9821 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9824 spec->adcs[0] = 0x8; /* ZxR DBPro Aux In */ in ca0132_config()
9826 spec->num_inputs = 1; in ca0132_config()
9827 spec->input_pins[0] = 0x11; /* RCA Line-in */ in ca0132_config()
9829 spec->dig_out = 0x05; in ca0132_config()
9830 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9832 spec->dig_in = 0x09; in ca0132_config()
9836 spec->num_outputs = 2; in ca0132_config()
9837 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9838 spec->out_pins[1] = 0x11; /* Rear headphone out */ in ca0132_config()
9839 spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ in ca0132_config()
9840 spec->out_pins[3] = 0x0F; /* Rear surround */ in ca0132_config()
9841 spec->shared_out_nid = 0x2; in ca0132_config()
9842 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9843 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9845 spec->adcs[0] = 0x7; /* Rear Mic / Line-in */ in ca0132_config()
9846 spec->adcs[1] = 0x8; /* Front Mic, but only if no DSP */ in ca0132_config()
9847 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9849 spec->num_inputs = 2; in ca0132_config()
9850 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9851 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9852 spec->shared_mic_nid = 0x7; in ca0132_config()
9853 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9856 spec->dig_out = 0x05; in ca0132_config()
9857 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9860 spec->num_outputs = 2; in ca0132_config()
9861 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9862 spec->out_pins[1] = 0x0F; /* Rear headphone out */ in ca0132_config()
9863 spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ in ca0132_config()
9864 spec->out_pins[3] = 0x11; /* Rear surround */ in ca0132_config()
9865 spec->shared_out_nid = 0x2; in ca0132_config()
9866 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9867 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9869 spec->adcs[0] = 0x07; /* Rear Mic / Line-in */ in ca0132_config()
9870 spec->adcs[1] = 0x08; /* Front Mic, but only if no DSP */ in ca0132_config()
9871 spec->adcs[2] = 0x0a; /* what u hear */ in ca0132_config()
9873 spec->num_inputs = 2; in ca0132_config()
9874 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9875 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9876 spec->shared_mic_nid = 0x7; in ca0132_config()
9877 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9880 spec->dig_out = 0x05; in ca0132_config()
9881 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9884 spec->num_outputs = 2; in ca0132_config()
9885 spec->out_pins[0] = 0x0b; /* speaker out */ in ca0132_config()
9886 spec->out_pins[1] = 0x10; /* headphone out */ in ca0132_config()
9887 spec->shared_out_nid = 0x2; in ca0132_config()
9888 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9890 spec->adcs[0] = 0x7; /* digital mic / analog mic1 */ in ca0132_config()
9891 spec->adcs[1] = 0x8; /* analog mic2 */ in ca0132_config()
9892 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9894 spec->num_inputs = 3; in ca0132_config()
9895 spec->input_pins[0] = 0x12; in ca0132_config()
9896 spec->input_pins[1] = 0x11; in ca0132_config()
9897 spec->input_pins[2] = 0x13; in ca0132_config()
9898 spec->shared_mic_nid = 0x7; in ca0132_config()
9899 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9902 spec->dig_out = 0x05; in ca0132_config()
9903 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9904 spec->dig_in = 0x09; in ca0132_config()
9913 struct ca0132_spec *spec = codec->spec; in ca0132_prepare_verbs()
9915 spec->chip_init_verbs = ca0132_init_verbs0; in ca0132_prepare_verbs()
9921 spec->desktop_init_verbs = ca0132_init_verbs1; in ca0132_prepare_verbs()
9922 spec->spec_init_verbs = kcalloc(NUM_SPEC_VERBS, in ca0132_prepare_verbs()
9925 if (!spec->spec_init_verbs) in ca0132_prepare_verbs()
9926 return -ENOMEM; in ca0132_prepare_verbs()
9929 spec->spec_init_verbs[0].nid = 0x0b; in ca0132_prepare_verbs()
9930 spec->spec_init_verbs[0].param = 0x78D; in ca0132_prepare_verbs()
9931 spec->spec_init_verbs[0].verb = 0x00; in ca0132_prepare_verbs()
9935 spec->spec_init_verbs[2].nid = 0x0b; in ca0132_prepare_verbs()
9936 spec->spec_init_verbs[2].param = AC_VERB_SET_EAPD_BTLENABLE; in ca0132_prepare_verbs()
9937 spec->spec_init_verbs[2].verb = 0x02; in ca0132_prepare_verbs()
9939 spec->spec_init_verbs[3].nid = 0x10; in ca0132_prepare_verbs()
9940 spec->spec_init_verbs[3].param = 0x78D; in ca0132_prepare_verbs()
9941 spec->spec_init_verbs[3].verb = 0x02; in ca0132_prepare_verbs()
9943 spec->spec_init_verbs[4].nid = 0x10; in ca0132_prepare_verbs()
9944 spec->spec_init_verbs[4].param = AC_VERB_SET_EAPD_BTLENABLE; in ca0132_prepare_verbs()
9945 spec->spec_init_verbs[4].verb = 0x02; in ca0132_prepare_verbs()
9948 /* Terminator: spec->spec_init_verbs[NUM_SPEC_VERBS-1] */ in ca0132_prepare_verbs()
9960 struct ca0132_spec *spec = codec->spec; in sbz_detect_quirk()
9962 switch (codec->core.subsystem_id) { in sbz_detect_quirk()
9964 spec->quirk = QUIRK_ZXR; in sbz_detect_quirk()
9967 spec->quirk = QUIRK_ZXR_DBPRO; in sbz_detect_quirk()
9970 spec->quirk = QUIRK_SBZ; in sbz_detect_quirk()
9985 return -ENOMEM; in patch_ca0132()
9986 codec->spec = spec; in patch_ca0132()
9987 spec->codec = codec; in patch_ca0132()
9990 quirk = snd_pci_quirk_lookup(codec->bus->pci, ca0132_quirks); in patch_ca0132()
9992 spec->quirk = quirk->value; in patch_ca0132()
9994 spec->quirk = QUIRK_NONE; in patch_ca0132()
9999 codec->patch_ops = dbpro_patch_ops; in patch_ca0132()
10001 codec->patch_ops = ca0132_patch_ops; in patch_ca0132()
10003 codec->pcm_format_first = 1; in patch_ca0132()
10004 codec->no_sticky_stream = 1; in patch_ca0132()
10007 spec->dsp_state = DSP_DOWNLOAD_INIT; in patch_ca0132()
10008 spec->num_mixers = 1; in patch_ca0132()
10013 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10017 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10023 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10027 spec->mixers[0] = r3di_mixer; in patch_ca0132()
10031 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10032 snd_hda_codec_set_name(codec, "Sound BlasterX AE-5"); in patch_ca0132()
10035 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10036 snd_hda_codec_set_name(codec, "Sound Blaster AE-7"); in patch_ca0132()
10039 spec->mixers[0] = ca0132_mixer; in patch_ca0132()
10043 /* Setup whether or not to use alt functions/controls/pci_mmio */ in patch_ca0132()
10050 spec->use_alt_controls = true; in patch_ca0132()
10051 spec->use_alt_functions = true; in patch_ca0132()
10052 spec->use_pci_mmio = true; in patch_ca0132()
10055 spec->use_alt_controls = true; in patch_ca0132()
10056 spec->use_alt_functions = true; in patch_ca0132()
10057 spec->use_pci_mmio = false; in patch_ca0132()
10060 spec->use_alt_controls = false; in patch_ca0132()
10061 spec->use_alt_functions = false; in patch_ca0132()
10062 spec->use_pci_mmio = false; in patch_ca0132()
10067 if (spec->use_pci_mmio) { in patch_ca0132()
10068 spec->mem_base = pci_iomap(codec->bus->pci, 2, 0xC20); in patch_ca0132()
10069 if (spec->mem_base == NULL) { in patch_ca0132()
10071 spec->quirk = QUIRK_NONE; in patch_ca0132()
10076 spec->base_init_verbs = ca0132_base_init_verbs; in patch_ca0132()
10077 spec->base_exit_verbs = ca0132_base_exit_verbs; in patch_ca0132()
10079 INIT_DELAYED_WORK(&spec->unsol_hp_work, ca0132_unsol_hp_delayed); in patch_ca0132()
10089 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); in patch_ca0132()