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 */
1143 * AE-5 all use PCI region 2 to toggle GPIO and other currently unknown
1150 * Whether or not to use the alt functions like alt_select_out,
1157 * Whether or not to use alt controls: volume effect sliders, EQ
1181 #define ca0132_quirk(spec) ((spec)->codec->fixup_id)
1182 #define ca0132_use_pci_mmio(spec) ((spec)->use_pci_mmio)
1183 #define ca0132_use_alt_functions(spec) ((spec)->use_alt_functions)
1184 #define ca0132_use_alt_controls(spec) ((spec)->use_alt_controls)
1208 { 0x0b, 0x01017010 }, /* Port G -- Lineout FRONT L/R */
1212 { 0x0f, 0x0221701f }, /* Port A -- BackPanel HP */
1213 { 0x10, 0x01017012 }, /* Port D -- Center/LFE or FP Hp */
1214 { 0x11, 0x01017014 }, /* Port B -- LineMicIn2 / Rear L/R */
1215 { 0x12, 0x01a170f0 }, /* Port C -- LineIn1 */
1223 { 0x0b, 0x01047110 }, /* Port G -- Lineout FRONT L/R */
1224 { 0x0c, 0x414510f0 }, /* SPDIF Out 1 - Disabled*/
1226 { 0x0e, 0x41c520f0 }, /* SPDIF In - Disabled*/
1227 { 0x0f, 0x0122711f }, /* Port A -- BackPanel HP */
1228 { 0x10, 0x01017111 }, /* Port D -- Center/LFE */
1229 { 0x11, 0x01017114 }, /* Port B -- LineMicIn2 / Rear L/R */
1230 { 0x12, 0x01a271f0 }, /* Port C -- LineIn1 */
1238 { 0x0b, 0x01014110 }, /* Port G -- Lineout FRONT L/R */
1242 { 0x0f, 0x0221401f }, /* Port A -- BackPanel HP */
1243 { 0x10, 0x01016011 }, /* Port D -- Center/LFE or FP Hp */
1244 { 0x11, 0x01011014 }, /* Port B -- LineMicIn2 / Rear L/R */
1245 { 0x12, 0x02a090f0 }, /* Port C -- LineIn1 */
1251 /* Sound Blaster AE-5 pin configs taken from Windows Driver */
1253 { 0x0b, 0x01017010 }, /* Port G -- Lineout FRONT L/R */
1257 { 0x0f, 0x01017114 }, /* Port A -- Rear L/R. */
1258 { 0x10, 0x01017012 }, /* Port D -- Center/LFE or FP Hp */
1259 { 0x11, 0x012170ff }, /* Port B -- LineMicIn2 / Rear Headphone */
1260 { 0x12, 0x01a170f0 }, /* Port C -- LineIn1 */
1268 { 0x0b, 0x01014110 }, /* Port G -- Lineout FRONT L/R */
1272 { 0x0f, 0x0221401f }, /* Port A -- BackPanel HP */
1273 { 0x10, 0x01016011 }, /* Port D -- Center/LFE or FP Hp */
1274 { 0x11, 0x01011014 }, /* Port B -- LineMicIn2 / Rear L/R */
1275 { 0x12, 0x02a090f0 }, /* Port C -- LineIn1 */
1306 SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
1312 SND_PCI_QUIRK(0x1102, 0x0051, "Sound Blaster AE-5", QUIRK_AE5),
1313 SND_PCI_QUIRK(0x1102, 0x0191, "Sound Blaster AE-5 Plus", QUIRK_AE5),
1314 SND_PCI_QUIRK(0x1102, 0x0081, "Sound Blaster AE-7", QUIRK_AE7),
1320 { .id = QUIRK_ALIENWARE_M17XR4, .name = "alienware-m17xr4" },
1323 { .id = QUIRK_ZXR_DBPRO, .name = "zxr-dbpro" },
1534 return ((response == -1) ? -1 : 0); in codec_send_command()
1546 unsigned char channel, unsigned int *res) in codec_set_converter_stream_channel() argument
1550 converter_stream_channel = (stream << 4) | (channel & 0x0f); in codec_set_converter_stream_channel()
1572 return -EIO; in chipio_send()
1576 * Write chip address through the vendor widget -- NOT protected by the Mutex!
1581 struct ca0132_spec *spec = codec->spec; in chipio_write_address()
1584 if (spec->curr_chip_addx == chip_addx) in chipio_write_address()
1591 if (res != -EIO) { in chipio_write_address()
1597 spec->curr_chip_addx = (res < 0) ? ~0U : chip_addx; in chipio_write_address()
1603 * Write data through the vendor widget -- NOT protected by the Mutex!
1607 struct ca0132_spec *spec = codec->spec; in chipio_write_data()
1613 if (res != -EIO) { in chipio_write_data()
1621 spec->curr_chip_addx = (res != -EIO) ? in chipio_write_data()
1622 (spec->curr_chip_addx + 4) : ~0U; in chipio_write_data()
1627 * Write multiple data through the vendor widget -- NOT protected by the Mutex!
1637 return -EINVAL; in chipio_write_data_multiple()
1640 while ((count-- != 0) && (status == 0)) in chipio_write_data_multiple()
1648 * Read data through the vendor widget -- NOT protected by the Mutex!
1652 struct ca0132_spec *spec = codec->spec; in chipio_read_data()
1658 if (res != -EIO) { in chipio_read_data()
1663 if (res != -EIO) { in chipio_read_data()
1672 spec->curr_chip_addx = (res != -EIO) ? in chipio_read_data()
1673 (spec->curr_chip_addx + 4) : ~0U; in chipio_read_data()
1684 struct ca0132_spec *spec = codec->spec; in chipio_write()
1687 mutex_lock(&spec->chipio_mutex); in chipio_write()
1699 mutex_unlock(&spec->chipio_mutex); in chipio_write()
1735 struct ca0132_spec *spec = codec->spec; in chipio_write_multiple()
1738 mutex_lock(&spec->chipio_mutex); in chipio_write_multiple()
1745 mutex_unlock(&spec->chipio_mutex); in chipio_write_multiple()
1757 struct ca0132_spec *spec = codec->spec; in chipio_read()
1760 mutex_lock(&spec->chipio_mutex); in chipio_read()
1772 mutex_unlock(&spec->chipio_mutex); in chipio_read()
1798 struct ca0132_spec *spec = codec->spec; in chipio_set_control_param()
1806 mutex_lock(&spec->chipio_mutex); in chipio_set_control_param()
1815 mutex_unlock(&spec->chipio_mutex); in chipio_set_control_param()
1920 * 0x80-0xFF.
1932 * Writes to the 8051's exram, which has 16-bits of address space.
1933 * Data at addresses 0x2000-0x7fff is mirrored to 0x8000-0xdfff.
1934 * Data at 0x8000-0xdfff can also be used as program memory for the 8051 by
1936 * 0xe000-0xffff is always mapped as program memory, with only 0xf000-0xffff
1943 /* Lower 8-bits. */ in chipio_8051_set_address()
1948 /* Upper 8-bits. */ in chipio_8051_set_address()
1956 /* 8-bits of data. */ in chipio_8051_set_data()
1970 /* 8-bits of data. */ in chipio_8051_set_data_pll()
1978 struct ca0132_spec *spec = codec->spec; in chipio_8051_write_exram()
1980 mutex_lock(&spec->chipio_mutex); in chipio_8051_write_exram()
1985 mutex_unlock(&spec->chipio_mutex); in chipio_8051_write_exram()
2006 struct ca0132_spec *spec = codec->spec; in chipio_8051_write_pll_pmu()
2008 mutex_lock(&spec->chipio_mutex); in chipio_8051_write_pll_pmu()
2013 mutex_unlock(&spec->chipio_mutex); in chipio_8051_write_pll_pmu()
2028 struct ca0132_spec *spec = codec->spec; in chipio_enable_clocks()
2030 mutex_lock(&spec->chipio_mutex); in chipio_enable_clocks()
2036 mutex_unlock(&spec->chipio_mutex); in chipio_enable_clocks()
2056 return -EIO; in dspio_send()
2082 struct ca0132_spec *spec = codec->spec; in dspio_write()
2087 mutex_lock(&spec->chipio_mutex); in dspio_write()
2102 mutex_unlock(&spec->chipio_mutex); in dspio_write()
2105 -EIO : 0; in dspio_write()
2118 return -EINVAL; in dspio_write_multiple()
2136 if (status == -EIO) in dspio_read()
2140 if (status == -EIO || in dspio_read()
2142 return -EIO; in dspio_read()
2160 return -1; in dspio_read_multiple()
2257 struct ca0132_spec *spec = codec->spec; in dspio_get_response_data()
2262 return -EIO; in dspio_get_response_data()
2264 if ((data & 0x00ffffff) == spec->wait_scp_header) { in dspio_get_response_data()
2265 spec->scp_resp_header = data; in dspio_get_response_data()
2266 spec->scp_resp_count = data >> 27; in dspio_get_response_data()
2267 count = spec->wait_num_data; in dspio_get_response_data()
2268 dspio_read_multiple(codec, spec->scp_resp_data, in dspio_get_response_data()
2269 &spec->scp_resp_count, count); in dspio_get_response_data()
2273 return -EIO; in dspio_get_response_data()
2286 struct ca0132_spec *spec = codec->spec; in dspio_send_scp_message()
2307 return -EINVAL; in dspio_send_scp_message()
2311 return -EINVAL; in dspio_send_scp_message()
2313 spec->wait_scp_header = *((unsigned int *)send_buf); in dspio_send_scp_message()
2318 spec->wait_scp_header &= 0xffff0000; in dspio_send_scp_message()
2319 spec->wait_scp_header |= (resp_src_id << 8) | (resp_target_id); in dspio_send_scp_message()
2320 spec->wait_num_data = return_buf_size/sizeof(unsigned int) - 1; in dspio_send_scp_message()
2321 spec->wait_scp = 1; in dspio_send_scp_message()
2328 spec->wait_scp = 0; in dspio_send_scp_message()
2337 } while (spec->wait_scp && time_before(jiffies, timeout)); in dspio_send_scp_message()
2339 if (!spec->wait_scp) { in dspio_send_scp_message()
2341 memcpy(&ret_msg->hdr, &spec->scp_resp_header, 4); in dspio_send_scp_message()
2342 memcpy(&ret_msg->data, spec->scp_resp_data, in dspio_send_scp_message()
2343 spec->wait_num_data); in dspio_send_scp_message()
2344 *bytes_returned = (spec->scp_resp_count + 1) * 4; in dspio_send_scp_message()
2347 status = -EIO; in dspio_send_scp_message()
2349 spec->wait_scp = 0; in dspio_send_scp_message()
2356 * dspio_scp - Prepare and send the SCP message to DSP
2383 return -EINVAL; in dspio_scp()
2387 return -EINVAL; in dspio_scp()
2392 return -EINVAL; in dspio_scp()
2424 ret_size = (ret_bytes - sizeof(scp_reply.hdr)) in dspio_scp()
2429 return -EINVAL; in dspio_scp()
2432 return -EINVAL; in dspio_scp()
2435 return -EINVAL; in dspio_scp()
2441 codec_dbg(codec, "reply ill-formed or errflag set\n"); in dspio_scp()
2442 return -EIO; in dspio_scp()
2466 * Allocate a DSP DMA channel via an SCP message
2473 codec_dbg(codec, " dspio_alloc_dma_chan() -- begin\n"); in dspio_alloc_dma_chan()
2485 return -EBUSY; in dspio_alloc_dma_chan()
2489 codec_dbg(codec, " dspio_alloc_dma_chan() -- complete\n"); in dspio_alloc_dma_chan()
2502 codec_dbg(codec, " dspio_free_dma_chan() -- begin\n"); in dspio_free_dma_chan()
2514 codec_dbg(codec, " dspio_free_dma_chan() -- complete\n"); in dspio_free_dma_chan()
2565 retry--; in dsp_reset()
2566 } while (res == -EIO && retry); in dsp_reset()
2570 return -EIO; in dsp_reset()
2622 codec_dbg(codec, "-- dsp_dma_setup_common() -- Begin ---------\n"); in dsp_dma_setup_common()
2626 return -EINVAL; in dsp_dma_setup_common()
2631 return -EBUSY; in dsp_dma_setup_common()
2638 return -ENXIO; in dsp_dma_setup_common()
2715 codec_dbg(codec, "-- dsp_dma_setup_common() -- Complete ------\n"); in dsp_dma_setup_common()
2721 * Setup the DSP DMA per-transfer-specific registers
2738 const unsigned int max_dma_count = 1 << (DSPDMAC_XFRCNT_BCNT_HIBIT - in dsp_dma_setup()
2741 codec_dbg(codec, "-- dsp_dma_setup() -- Begin ---------\n"); in dsp_dma_setup()
2745 return -EINVAL; in dsp_dma_setup()
2751 return -ENXIO; in dsp_dma_setup()
2776 adr_ofs = (count - 1) << (DSPDMAC_DSPADROFS_BOFS_LOBIT + in dsp_dma_setup()
2787 base_cnt = (count - 1) << DSPDMAC_XFRCNT_BCNT_LOBIT; in dsp_dma_setup()
2789 cur_cnt = (count - 1) << DSPDMAC_XFRCNT_CCNT_LOBIT; in dsp_dma_setup()
2806 codec_dbg(codec, "-- dsp_dma_setup() -- Complete ---------\n"); in dsp_dma_setup()
2820 codec_dbg(codec, "-- dsp_dma_start() -- Begin ---------\n"); in dsp_dma_start()
2830 codec_dbg(codec, "-- dsp_dma_start() Read CHNLSTART\n"); in dsp_dma_start()
2842 codec_dbg(codec, "-- dsp_dma_start() -- Complete ---------\n"); in dsp_dma_start()
2856 codec_dbg(codec, "-- dsp_dma_stop() -- Begin ---------\n"); in dsp_dma_stop()
2866 codec_dbg(codec, "-- dsp_dma_stop() Read CHNLSTART\n"); in dsp_dma_stop()
2877 codec_dbg(codec, "-- dsp_dma_stop() -- Complete ---------\n"); in dsp_dma_stop()
2883 * dsp_allocate_router_ports - Allocate router ports
2887 * @ports_per_channel: number of ports per channel
2908 val |= (ports_per_channel - 1) << 4; in dsp_allocate_router_ports()
2909 val |= num_chans - 1; in dsp_allocate_router_ports()
2960 codec_dbg(codec, " dsp_allocate_ports() -- begin\n"); in dsp_allocate_ports()
2964 return -EINVAL; in dsp_allocate_ports()
2970 codec_dbg(codec, " dsp_allocate_ports() -- complete\n"); in dsp_allocate_ports()
2987 return -EINVAL; in dsp_allocate_ports_format()
3002 codec_dbg(codec, " dsp_free_ports() -- begin\n"); in dsp_free_ports()
3009 codec_dbg(codec, " dsp_free_ports() -- complete\n"); in dsp_free_ports()
3051 struct hda_codec *codec = dma->codec; in dma_reset()
3052 struct ca0132_spec *spec = codec->spec; in dma_reset()
3055 if (dma->dmab->area) in dma_reset()
3056 snd_hda_codec_load_dsp_cleanup(codec, dma->dmab); in dma_reset()
3059 dma->m_converter_format, in dma_reset()
3060 dma->buf_size, in dma_reset()
3061 dma->dmab); in dma_reset()
3064 spec->dsp_stream_id = status; in dma_reset()
3083 snd_hda_codec_load_dsp_trigger(dma->codec, cmd); in dma_set_state()
3089 return dma->dmab->bytes; in dma_get_buffer_size()
3094 return dma->dmab->area; in dma_get_buffer_addr()
3101 memcpy(dma->dmab->area, data, count); in dma_xfer()
3110 *format = dma->m_converter_format; in dma_get_converter_format()
3115 struct ca0132_spec *spec = dma->codec->spec; in dma_get_stream_id()
3117 return spec->dsp_stream_id; in dma_get_stream_id()
3132 return p->magic == g_magic_value; in is_valid()
3137 return g_chip_addr_magic_value == p->chip_addr; in is_hci_prog_list_seg()
3142 return p->count == 0; in is_last()
3147 return struct_size(p, data, p->count); in dsp_sizeof()
3173 if (fls == NULL || fls->chip_addr != g_chip_addr_magic_value) { in dspxfr_hci_write()
3175 return -EINVAL; in dspxfr_hci_write()
3178 count = fls->count; in dspxfr_hci_write()
3179 data = (u32 *)(fls->data); in dspxfr_hci_write()
3186 count -= 2; in dspxfr_hci_write()
3193 * dspxfr_one_seg - Write a block of data into DSP code or data RAM using pre-allocated DMA engine.
3197 * @reloc: Relocation address for loading single-segment overlays, or 0 for
3235 return -EINVAL; in dspxfr_one_seg()
3248 return -EINVAL; in dspxfr_one_seg()
3251 data = fls->data; in dspxfr_one_seg()
3252 chip_addx = fls->chip_addr; in dspxfr_one_seg()
3253 words_to_write = fls->count; in dspxfr_one_seg()
3264 return -EINVAL; in dspxfr_one_seg()
3274 return -EINVAL; in dspxfr_one_seg()
3287 return -EINVAL; in dspxfr_one_seg()
3293 buffer_size_words -= buffer_size_words % hda_frame_size_words; in dspxfr_one_seg()
3302 return -EINVAL; in dspxfr_one_seg()
3311 words_to_write -= remainder_words; in dspxfr_one_seg()
3338 return -EIO; in dspxfr_one_seg()
3378 words_to_write -= run_size_words; in dspxfr_one_seg()
3390 * dspxfr_image - Write the entire DSP image of a DSP code/data overlay to DSP memories
3394 * @reloc: Relocation address for loading single-segment overlays, or 0 for
3409 struct ca0132_spec *spec = codec->spec; in dspxfr_image()
3419 return -EINVAL; in dspxfr_image()
3423 return -ENOMEM; in dspxfr_image()
3425 dma_engine->dmab = kzalloc(sizeof(*dma_engine->dmab), GFP_KERNEL); in dspxfr_image()
3426 if (!dma_engine->dmab) { in dspxfr_image()
3428 return -ENOMEM; in dspxfr_image()
3431 dma_engine->codec = codec; in dspxfr_image()
3433 dma_engine->m_converter_format = hda_format; in dspxfr_image()
3434 dma_engine->buf_size = (ovly ? DSP_DMA_WRITE_BUFLEN_OVLY : in dspxfr_image()
3448 dma_engine->m_converter_format, in dspxfr_image()
3449 dma_engine->buf_size, in dspxfr_image()
3450 dma_engine->dmab); in dspxfr_image()
3453 spec->dsp_stream_id = status; in dspxfr_image()
3483 status = -EINVAL; in dspxfr_image()
3512 if (dma_engine->dmab->area) in dspxfr_image()
3513 snd_hda_codec_load_dsp_cleanup(codec, dma_engine->dmab); in dspxfr_image()
3514 kfree(dma_engine->dmab); in dspxfr_image()
3525 struct ca0132_spec *spec = codec->spec; in dspload_post_setup()
3526 codec_dbg(codec, "---- dspload_post_setup ------\n"); in dspload_post_setup()
3538 * dspload_image - Download DSP from a DSP Image Fast Load structure.
3543 * @reloc: Relocation address for loading single-segment overlays, or 0 for
3550 * linear, non-constant sized element array of structures, each of which
3566 codec_dbg(codec, "---- dspload_image begin ------\n"); in dspload_image()
3642 * ca0113 related functions. The ca0113 acts as the HDA bus for the pci-e
3648 * For cards with PCI-E region2 (Sound Blaster Z/ZxR, Recon3D, and AE-5)
3652 * AE-5 note: The AE-5 seems to use pins 2 and 3 to somehow set the color value
3653 * of the on-card LED. It seems to use pin 2 for data, then toggles 3 to on and
3659 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_gpio_set()
3665 writew(gpio_data, spec->mem_base + 0x320); in ca0113_mmio_gpio_set()
3669 * Special pci region2 commands that are only used by the AE-5. They follow
3674 * target-id, and value.
3679 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_command_set()
3682 writel(0x0000007e, spec->mem_base + 0x210); in ca0113_mmio_command_set()
3683 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3684 writel(0x0000005a, spec->mem_base + 0x210); in ca0113_mmio_command_set()
3685 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3686 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3688 writel(0x00800005, spec->mem_base + 0x20c); in ca0113_mmio_command_set()
3689 writel(group, spec->mem_base + 0x804); in ca0113_mmio_command_set()
3691 writel(0x00800005, spec->mem_base + 0x20c); in ca0113_mmio_command_set()
3696 writel(write_val, spec->mem_base + 0x204); in ca0113_mmio_command_set()
3702 readl(spec->mem_base + 0x860); in ca0113_mmio_command_set()
3703 readl(spec->mem_base + 0x854); in ca0113_mmio_command_set()
3704 readl(spec->mem_base + 0x840); in ca0113_mmio_command_set()
3706 writel(0x00800004, spec->mem_base + 0x20c); in ca0113_mmio_command_set()
3707 writel(0x00000000, spec->mem_base + 0x210); in ca0113_mmio_command_set()
3708 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3709 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set()
3718 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_command_set_type2()
3721 writel(0x0000007e, spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3722 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3723 writel(0x0000005a, spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3724 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3725 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3727 writel(0x00800003, spec->mem_base + 0x20c); in ca0113_mmio_command_set_type2()
3728 writel(group, spec->mem_base + 0x804); in ca0113_mmio_command_set_type2()
3730 writel(0x00800005, spec->mem_base + 0x20c); in ca0113_mmio_command_set_type2()
3735 writel(write_val, spec->mem_base + 0x204); in ca0113_mmio_command_set_type2()
3737 readl(spec->mem_base + 0x860); in ca0113_mmio_command_set_type2()
3738 readl(spec->mem_base + 0x854); in ca0113_mmio_command_set_type2()
3739 readl(spec->mem_base + 0x840); in ca0113_mmio_command_set_type2()
3741 writel(0x00800004, spec->mem_base + 0x20c); in ca0113_mmio_command_set_type2()
3742 writel(0x00000000, spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3743 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3744 readl(spec->mem_base + 0x210); in ca0113_mmio_command_set_type2()
3757 struct ca0132_spec *spec = codec->spec; in ca0132_gpio_init()
3780 struct ca0132_spec *spec = codec->spec; in ca0132_gpio_setup()
3811 /* Bit 1 - Switch between front/rear mic. 0 = rear, 1 = front */
3813 /* Bit 2 - Switch between headphone/line out. 0 = Headphone, 1 = Line */
3864 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_mic_set()
3879 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3886 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3893 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3906 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_prepare()
3908 snd_hda_codec_setup_stream(codec, spec->dacs[0], stream_tag, 0, format); in ca0132_playback_pcm_prepare()
3917 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_cleanup()
3919 if (spec->dsp_state == DSP_DOWNLOADING) in ca0132_playback_pcm_cleanup()
3924 if (spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) in ca0132_playback_pcm_cleanup()
3927 snd_hda_codec_cleanup_stream(codec, spec->dacs[0]); in ca0132_playback_pcm_cleanup()
3936 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_delay()
3938 struct snd_pcm_runtime *runtime = substream->runtime; in ca0132_playback_pcm_delay()
3940 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_playback_pcm_delay()
3944 if (spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) { in ca0132_playback_pcm_delay()
3945 if ((spec->effects_switch[SURROUND - EFFECT_START_NID]) || in ca0132_playback_pcm_delay()
3946 (spec->effects_switch[DIALOG_PLUS - EFFECT_START_NID])) in ca0132_playback_pcm_delay()
3951 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_playback_pcm_delay()
3954 return (latency * runtime->rate) / 1000; in ca0132_playback_pcm_delay()
3964 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_open()
3965 return snd_hda_multi_out_dig_open(codec, &spec->multiout); in ca0132_dig_playback_pcm_open()
3974 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_prepare()
3975 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, in ca0132_dig_playback_pcm_prepare()
3983 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_cleanup()
3984 return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); in ca0132_dig_playback_pcm_cleanup()
3991 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_close()
3992 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in ca0132_dig_playback_pcm_close()
4004 snd_hda_codec_setup_stream(codec, hinfo->nid, in ca0132_capture_pcm_prepare()
4014 struct ca0132_spec *spec = codec->spec; in ca0132_capture_pcm_cleanup()
4016 if (spec->dsp_state == DSP_DOWNLOADING) in ca0132_capture_pcm_cleanup()
4019 snd_hda_codec_cleanup_stream(codec, hinfo->nid); in ca0132_capture_pcm_cleanup()
4027 struct ca0132_spec *spec = codec->spec; in ca0132_capture_pcm_delay()
4029 struct snd_pcm_runtime *runtime = substream->runtime; in ca0132_capture_pcm_delay()
4031 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_capture_pcm_delay()
4034 if (spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]) in ca0132_capture_pcm_delay()
4037 return (latency * runtime->rate) / 1000; in ca0132_capture_pcm_delay()
4047 #define CA0132_CODEC_VOL_MONO(xname, nid, channel, dir) \ argument
4058 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, 0, dir) }
4065 #define CA0132_ALT_CODEC_VOL_MONO(xname, nid, channel, dir) \ argument
4076 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, 0, dir) }
4078 #define CA0132_CODEC_MUTE_MONO(xname, nid, channel, dir) \ argument
4085 .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, 0, dir) }
4101 * values -90 to 9. -90 is the lowest decibel value for both the ADC's and the
4149 * This table counts from float 10 to 1000, which is the range of the x-bass
4246 return -EINVAL; in tuning_ctl_set()
4261 struct ca0132_spec *spec = codec->spec; in tuning_ctl_get()
4263 long *valp = ucontrol->value.integer.value; in tuning_ctl_get()
4264 int idx = nid - TUNING_CTL_START_NID; in tuning_ctl_get()
4266 *valp = spec->cur_ctl_vals[idx]; in tuning_ctl_get()
4274 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in voice_focus_ctl_info()
4275 uinfo->count = chs == 3 ? 2 : 1; in voice_focus_ctl_info()
4276 uinfo->value.integer.min = 20; in voice_focus_ctl_info()
4277 uinfo->value.integer.max = 180; in voice_focus_ctl_info()
4278 uinfo->value.integer.step = 1; in voice_focus_ctl_info()
4287 struct ca0132_spec *spec = codec->spec; in voice_focus_ctl_put()
4289 long *valp = ucontrol->value.integer.value; in voice_focus_ctl_put()
4292 idx = nid - TUNING_CTL_START_NID; in voice_focus_ctl_put()
4294 if (spec->cur_ctl_vals[idx] == *valp) in voice_focus_ctl_put()
4297 spec->cur_ctl_vals[idx] = *valp; in voice_focus_ctl_put()
4299 idx = *valp - 20; in voice_focus_ctl_put()
4309 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in mic_svm_ctl_info()
4310 uinfo->count = chs == 3 ? 2 : 1; in mic_svm_ctl_info()
4311 uinfo->value.integer.min = 0; in mic_svm_ctl_info()
4312 uinfo->value.integer.max = 100; in mic_svm_ctl_info()
4313 uinfo->value.integer.step = 1; in mic_svm_ctl_info()
4322 struct ca0132_spec *spec = codec->spec; in mic_svm_ctl_put()
4324 long *valp = ucontrol->value.integer.value; in mic_svm_ctl_put()
4327 idx = nid - TUNING_CTL_START_NID; in mic_svm_ctl_put()
4329 if (spec->cur_ctl_vals[idx] == *valp) in mic_svm_ctl_put()
4332 spec->cur_ctl_vals[idx] = *valp; in mic_svm_ctl_put()
4344 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in equalizer_ctl_info()
4345 uinfo->count = chs == 3 ? 2 : 1; in equalizer_ctl_info()
4346 uinfo->value.integer.min = 0; in equalizer_ctl_info()
4347 uinfo->value.integer.max = 48; in equalizer_ctl_info()
4348 uinfo->value.integer.step = 1; in equalizer_ctl_info()
4357 struct ca0132_spec *spec = codec->spec; in equalizer_ctl_put()
4359 long *valp = ucontrol->value.integer.value; in equalizer_ctl_put()
4362 idx = nid - TUNING_CTL_START_NID; in equalizer_ctl_put()
4364 if (spec->cur_ctl_vals[idx] == *valp) in equalizer_ctl_put()
4367 spec->cur_ctl_vals[idx] = *valp; in equalizer_ctl_put()
4376 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(eq_db_scale, -2400, 100, 0);
4438 struct ca0132_spec *spec = codec->spec; in ca0132_init_tuning_defaults()
4441 /* Wedge Angle defaults to 30. 10 below is 30 - 20. 20 is min. */ in ca0132_init_tuning_defaults()
4442 spec->cur_ctl_vals[WEDGE_ANGLE - TUNING_CTL_START_NID] = 10; in ca0132_init_tuning_defaults()
4444 spec->cur_ctl_vals[SVM_LEVEL - TUNING_CTL_START_NID] = 74; in ca0132_init_tuning_defaults()
4448 spec->cur_ctl_vals[i] = 24; in ca0132_init_tuning_defaults()
4455 * If jack inserted, headphone will be selected, else built-in speakers
4460 struct ca0132_spec *spec = codec->spec; in ca0132_select_out()
4471 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_select_out()
4474 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_hp); in ca0132_select_out()
4477 spec->vnode_lswitch[VNID_HP_SEL - VNODE_START_NID]; in ca0132_select_out()
4480 spec->cur_out_type = HEADPHONE_OUT; in ca0132_select_out()
4482 spec->cur_out_type = SPEAKER_OUT; in ca0132_select_out()
4484 if (spec->cur_out_type == SPEAKER_OUT) { in ca0132_select_out()
4498 snd_hda_codec_write(codec, spec->out_pins[1], 0, in ca0132_select_out()
4500 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4502 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4504 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4508 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, in ca0132_select_out()
4510 snd_hda_set_pin_ctl(codec, spec->out_pins[1], in ca0132_select_out()
4513 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, in ca0132_select_out()
4515 snd_hda_set_pin_ctl(codec, spec->out_pins[0], in ca0132_select_out()
4531 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4533 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4535 snd_hda_codec_write(codec, spec->out_pins[1], 0, in ca0132_select_out()
4537 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4541 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, in ca0132_select_out()
4543 snd_hda_set_pin_ctl(codec, spec->out_pins[0], in ca0132_select_out()
4546 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, in ca0132_select_out()
4548 snd_hda_set_pin_ctl(codec, spec->out_pins[1], in ca0132_select_out()
4564 struct ca0132_spec *spec = codec->spec; in ae5_mmio_select_out()
4574 ca0113_mmio_command_set(codec, out_cmds->group[i], in ae5_mmio_select_out()
4575 out_cmds->target[i], in ae5_mmio_select_out()
4576 out_cmds->vals[spec->cur_out_type][i]); in ae5_mmio_select_out()
4581 struct ca0132_spec *spec = codec->spec; in ca0132_alt_set_full_range_speaker()
4586 /* 2.0/4.0 setup has no LFE channel, so setting full-range does nothing. */ in ca0132_alt_set_full_range_speaker()
4587 if (spec->channel_cfg_val == SPEAKER_CHANNELS_4_0 in ca0132_alt_set_full_range_speaker()
4588 || spec->channel_cfg_val == SPEAKER_CHANNELS_2_0) in ca0132_alt_set_full_range_speaker()
4591 /* Set front L/R full range. Zero for full-range, one for redirection. */ in ca0132_alt_set_full_range_speaker()
4592 tmp = spec->speaker_range_val[0] ? FLOAT_ZERO : FLOAT_ONE; in ca0132_alt_set_full_range_speaker()
4598 /* When setting full-range rear, both rear and center/lfe are set. */ in ca0132_alt_set_full_range_speaker()
4599 tmp = spec->speaker_range_val[1] ? FLOAT_ZERO : FLOAT_ONE; in ca0132_alt_set_full_range_speaker()
4611 * Only the AE series cards set this value when setting full-range, in ca0132_alt_set_full_range_speaker()
4627 struct ca0132_spec *spec = codec->spec; in ca0132_alt_surround_set_bass_redirection()
4631 if (val && spec->channel_cfg_val != SPEAKER_CHANNELS_4_0 && in ca0132_alt_surround_set_bass_redirection()
4632 spec->channel_cfg_val != SPEAKER_CHANNELS_2_0) in ca0132_alt_surround_set_bass_redirection()
4643 tmp = float_xbass_xover_lookup[spec->xbass_xover_freq]; in ca0132_alt_surround_set_bass_redirection()
4660 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out_get_quirk_data()
4677 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out_quirk_set()
4685 out_info = &quirk_data->out_set_info[spec->cur_out_type]; in ca0132_alt_select_out_quirk_set()
4686 if (quirk_data->is_ae_series) in ca0132_alt_select_out_quirk_set()
4689 if (out_info->has_hda_gpio) { in ca0132_alt_select_out_quirk_set()
4690 gpio_data = snd_hda_codec_read(codec, codec->core.afg, 0, in ca0132_alt_select_out_quirk_set()
4693 if (out_info->hda_gpio_set) in ca0132_alt_select_out_quirk_set()
4694 gpio_data |= (1 << out_info->hda_gpio_pin); in ca0132_alt_select_out_quirk_set()
4696 gpio_data &= ~(1 << out_info->hda_gpio_pin); in ca0132_alt_select_out_quirk_set()
4698 snd_hda_codec_write(codec, codec->core.afg, 0, in ca0132_alt_select_out_quirk_set()
4702 if (out_info->mmio_gpio_count) { in ca0132_alt_select_out_quirk_set()
4703 for (i = 0; i < out_info->mmio_gpio_count; i++) { in ca0132_alt_select_out_quirk_set()
4704 ca0113_mmio_gpio_set(codec, out_info->mmio_gpio_pin[i], in ca0132_alt_select_out_quirk_set()
4705 out_info->mmio_gpio_set[i]); in ca0132_alt_select_out_quirk_set()
4709 if (out_info->scp_cmds_count) { in ca0132_alt_select_out_quirk_set()
4710 for (i = 0; i < out_info->scp_cmds_count; i++) { in ca0132_alt_select_out_quirk_set()
4712 out_info->scp_cmd_mid[i], in ca0132_alt_select_out_quirk_set()
4713 out_info->scp_cmd_req[i], in ca0132_alt_select_out_quirk_set()
4714 out_info->scp_cmd_val[i]); in ca0132_alt_select_out_quirk_set()
4720 chipio_set_control_param(codec, 0x0d, out_info->dac2port); in ca0132_alt_select_out_quirk_set()
4722 if (out_info->has_chipio_write) { in ca0132_alt_select_out_quirk_set()
4723 chipio_write(codec, out_info->chipio_write_addr, in ca0132_alt_select_out_quirk_set()
4724 out_info->chipio_write_data); in ca0132_alt_select_out_quirk_set()
4727 if (quirk_data->has_headphone_gain) { in ca0132_alt_select_out_quirk_set()
4728 if (spec->cur_out_type != HEADPHONE_OUT) { in ca0132_alt_select_out_quirk_set()
4729 if (quirk_data->is_ae_series) in ca0132_alt_select_out_quirk_set()
4734 if (quirk_data->is_ae_series) in ca0132_alt_select_out_quirk_set()
4736 spec->ae5_headphone_gain_val); in ca0132_alt_select_out_quirk_set()
4739 spec->zxr_gain_set); in ca0132_alt_select_out_quirk_set()
4765 * It also adds the ability to auto-detect the front headphone port.
4769 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out()
4775 hda_nid_t headphone_nid = spec->out_pins[1]; in ca0132_alt_select_out()
4781 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_alt_select_out()
4789 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_hp) || in ca0132_alt_select_out()
4790 snd_hda_jack_detect(codec, spec->unsol_tag_front_hp); in ca0132_alt_select_out()
4793 spec->cur_out_type = HEADPHONE_OUT; in ca0132_alt_select_out()
4795 spec->cur_out_type = SPEAKER_OUT; in ca0132_alt_select_out()
4797 spec->cur_out_type = spec->out_enum_val; in ca0132_alt_select_out()
4799 outfx_set = spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]; in ca0132_alt_select_out()
4809 switch (spec->cur_out_type) { in ca0132_alt_select_out()
4814 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_alt_select_out()
4818 ca0132_set_out_node_pincfg(codec, spec->out_pins[1], 0, 0); in ca0132_alt_select_out()
4819 /* Set front L-R to output. */ in ca0132_alt_select_out()
4820 ca0132_set_out_node_pincfg(codec, spec->out_pins[0], 1, 0); in ca0132_alt_select_out()
4822 ca0132_set_out_node_pincfg(codec, spec->out_pins[2], 1, 0); in ca0132_alt_select_out()
4824 ca0132_set_out_node_pincfg(codec, spec->out_pins[3], 1, 0); in ca0132_alt_select_out()
4831 if (!outfx_set && spec->channel_cfg_val == SPEAKER_CHANNELS_2_0) in ca0132_alt_select_out()
4834 tmp = speaker_channel_cfgs[spec->channel_cfg_val].val; in ca0132_alt_select_out()
4843 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_alt_select_out()
4847 ca0132_set_out_node_pincfg(codec, spec->out_pins[0], 0, 0); in ca0132_alt_select_out()
4848 ca0132_set_out_node_pincfg(codec, spec->out_pins[2], 0, 0); in ca0132_alt_select_out()
4849 ca0132_set_out_node_pincfg(codec, spec->out_pins[3], 0, 0); in ca0132_alt_select_out()
4852 if (snd_hda_jack_detect(codec, spec->unsol_tag_front_hp)) in ca0132_alt_select_out()
4853 headphone_nid = spec->out_pins[2]; in ca0132_alt_select_out()
4854 else if (snd_hda_jack_detect(codec, spec->unsol_tag_hp)) in ca0132_alt_select_out()
4855 headphone_nid = spec->out_pins[1]; in ca0132_alt_select_out()
4869 * If output effects are enabled, set the X-Bass effect value again to in ca0132_alt_select_out()
4871 * configurations with an LFE channel. in ca0132_alt_select_out()
4875 spec->effects_switch[X_BASS - EFFECT_START_NID]); in ca0132_alt_select_out()
4891 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_alt_select_out()
4893 spec->bass_redirection_val); in ca0132_alt_select_out()
4903 if (spec->cur_out_type == SPEAKER_OUT) { in ca0132_alt_select_out()
4922 ca0132_alt_select_out(spec->codec); in ca0132_unsol_hp_delayed()
4924 ca0132_select_out(spec->codec); in ca0132_unsol_hp_delayed()
4926 jack = snd_hda_jack_tbl_get(spec->codec, spec->unsol_tag_hp); in ca0132_unsol_hp_delayed()
4928 jack->block_report = 0; in ca0132_unsol_hp_delayed()
4929 snd_hda_jack_report_sync(spec->codec); in ca0132_unsol_hp_delayed()
4945 struct ca0132_spec *spec = codec->spec; in ca0132_set_vipsource()
4948 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_set_vipsource()
4952 if (!spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] || in ca0132_set_vipsource()
4957 if (spec->cur_mic_type == DIGITAL_MIC) in ca0132_set_vipsource()
4967 if (spec->cur_mic_type == DIGITAL_MIC) in ca0132_set_vipsource()
4983 struct ca0132_spec *spec = codec->spec; in ca0132_alt_set_vipsource()
4986 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_alt_set_vipsource()
4995 if (!spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] || in ca0132_alt_set_vipsource()
4996 (val == 0) || spec->in_enum_val == REAR_LINE_IN) { in ca0132_alt_set_vipsource()
5009 if (spec->in_enum_val == REAR_LINE_IN) in ca0132_alt_set_vipsource()
5027 if (spec->effects_switch[VOICE_FOCUS - EFFECT_START_NID]) in ca0132_alt_set_vipsource()
5049 * If jack inserted, ext.mic will be selected, else built-in mic
5054 struct ca0132_spec *spec = codec->spec; in ca0132_select_mic()
5062 auto_jack = spec->vnode_lswitch[VNID_AMIC1_ASEL - VNODE_START_NID]; in ca0132_select_mic()
5065 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_amic1); in ca0132_select_mic()
5068 spec->vnode_lswitch[VNID_AMIC1_SEL - VNODE_START_NID]; in ca0132_select_mic()
5071 spec->cur_mic_type = LINE_MIC_IN; in ca0132_select_mic()
5073 spec->cur_mic_type = DIGITAL_MIC; in ca0132_select_mic()
5075 if (spec->cur_mic_type == DIGITAL_MIC) { in ca0132_select_mic()
5082 spec->effects_switch in ca0132_select_mic()
5083 [VOICE_FOCUS - EFFECT_START_NID]); in ca0132_select_mic()
5088 ca0132_mic_boost_set(codec, spec->cur_mic_boost); in ca0132_select_mic()
5101 * The front mic has no jack-detection, so the only way to switch to it
5106 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_in()
5116 spec->cur_mic_type = spec->in_enum_val; in ca0132_alt_select_in()
5118 switch (spec->cur_mic_type) { in ca0132_alt_select_in()
5176 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_select_in()
5269 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_select_in()
5285 struct ca0132_spec *spec = codec->spec; in ca0132_is_vnode_effective()
5290 nid = spec->shared_out_nid; in ca0132_is_vnode_effective()
5293 nid = spec->shared_mic_nid; in ca0132_is_vnode_effective()
5311 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_set()
5316 tmp = spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] ? in ca0132_voicefx_set()
5333 struct ca0132_spec *spec = codec->spec; in ca0132_effects_set()
5337 int idx = nid - EFFECT_START_NID; in ca0132_effects_set()
5345 if (!spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]) in ca0132_effects_set()
5347 if (spec->cur_out_type == SPEAKER_OUT && nid == X_BASS) { in ca0132_effects_set()
5348 channel_cfg = spec->channel_cfg_val; in ca0132_effects_set()
5358 if (!spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]) in ca0132_effects_set()
5361 /* Voice Focus applies to 2-ch Mic, Digital Mic */ in ca0132_effects_set()
5362 if ((nid == VOICE_FOCUS) && (spec->cur_mic_type != DIGITAL_MIC)) in ca0132_effects_set()
5365 /* If Voice Focus on SBZ, set to two channel. */ in ca0132_effects_set()
5367 && (spec->cur_mic_type != REAR_LINE_IN)) { in ca0132_effects_set()
5368 if (spec->effects_switch[CRYSTAL_VOICE - in ca0132_effects_set()
5371 if (spec->effects_switch[VOICE_FOCUS - in ca0132_effects_set()
5386 && (spec->cur_mic_type != REAR_LINE_IN)) { in ca0132_effects_set()
5387 if (spec->effects_switch[CRYSTAL_VOICE - in ca0132_effects_set()
5389 if (spec->effects_switch[NOISE_REDUCTION - in ca0132_effects_set()
5402 spec->in_enum_val == REAR_LINE_IN) in ca0132_effects_set()
5424 struct ca0132_spec *spec = codec->spec; in ca0132_pe_switch_set()
5429 spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]); in ca0132_pe_switch_set()
5434 i = OUT_EFFECT_START_NID - EFFECT_START_NID; in ca0132_pe_switch_set()
5438 ret |= ca0132_effects_set(codec, nid, spec->effects_switch[i]); in ca0132_pe_switch_set()
5446 struct ca0132_spec *spec = codec->spec; in stop_mic1()
5447 unsigned int oldval = snd_hda_codec_read(codec, spec->adcs[0], 0, in stop_mic1()
5450 snd_hda_codec_write(codec, spec->adcs[0], 0, in stop_mic1()
5459 struct ca0132_spec *spec = codec->spec; in resume_mic1()
5460 /* Restore the previous stream and channel */ in resume_mic1()
5462 snd_hda_codec_write(codec, spec->adcs[0], 0, in resume_mic1()
5472 struct ca0132_spec *spec = codec->spec; in ca0132_cvoice_switch_set()
5478 spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]); in ca0132_cvoice_switch_set()
5480 i = IN_EFFECT_START_NID - EFFECT_START_NID; in ca0132_cvoice_switch_set()
5484 ret |= ca0132_effects_set(codec, nid, spec->effects_switch[i]); in ca0132_cvoice_switch_set()
5487 ret |= ca0132_voicefx_set(codec, (spec->voicefx_val ? 1 : 0)); in ca0132_cvoice_switch_set()
5501 struct ca0132_spec *spec = codec->spec; in ca0132_mic_boost_set()
5505 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_mic_boost_set()
5508 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_mic_boost_set()
5516 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_set()
5519 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_alt_mic_boost_set()
5553 struct ca0132_spec *spec = codec->spec; in ca0132_vnode_switch_set()
5558 spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_vnode_switch_set()
5570 spec->vnode_lswitch[VNID_AMIC1_ASEL - VNODE_START_NID]; in ca0132_vnode_switch_set()
5596 mutex_lock(&codec->control_mutex); in ca0132_vnode_switch_set()
5597 pval = kcontrol->private_value; in ca0132_vnode_switch_set()
5598 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(shared_nid, ch, in ca0132_vnode_switch_set()
5601 kcontrol->private_value = pval; in ca0132_vnode_switch_set()
5602 mutex_unlock(&codec->control_mutex); in ca0132_vnode_switch_set()
5651 &(lookup[idx - 1]), sizeof(unsigned int)); in ca0132_alt_slider_ctl_set()
5672 struct ca0132_spec *spec = codec->spec; in ca0132_alt_xbass_xover_slider_ctl_get()
5673 long *valp = ucontrol->value.integer.value; in ca0132_alt_xbass_xover_slider_ctl_get()
5677 *valp = spec->bass_redirect_xover_freq; in ca0132_alt_xbass_xover_slider_ctl_get()
5679 *valp = spec->xbass_xover_freq; in ca0132_alt_xbass_xover_slider_ctl_get()
5688 struct ca0132_spec *spec = codec->spec; in ca0132_alt_slider_ctl_get()
5690 long *valp = ucontrol->value.integer.value; in ca0132_alt_slider_ctl_get()
5691 int idx = nid - OUT_EFFECT_START_NID; in ca0132_alt_slider_ctl_get()
5693 *valp = spec->fx_ctl_val[idx]; in ca0132_alt_slider_ctl_get()
5698 * The X-bass crossover starts at 10hz, so the min is 1. The
5704 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in ca0132_alt_xbass_xover_slider_info()
5705 uinfo->count = 1; in ca0132_alt_xbass_xover_slider_info()
5706 uinfo->value.integer.min = 1; in ca0132_alt_xbass_xover_slider_info()
5707 uinfo->value.integer.max = 100; in ca0132_alt_xbass_xover_slider_info()
5708 uinfo->value.integer.step = 1; in ca0132_alt_xbass_xover_slider_info()
5718 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in ca0132_alt_effect_slider_info()
5719 uinfo->count = chs == 3 ? 2 : 1; in ca0132_alt_effect_slider_info()
5720 uinfo->value.integer.min = 0; in ca0132_alt_effect_slider_info()
5721 uinfo->value.integer.max = 100; in ca0132_alt_effect_slider_info()
5722 uinfo->value.integer.step = 1; in ca0132_alt_effect_slider_info()
5731 struct ca0132_spec *spec = codec->spec; in ca0132_alt_xbass_xover_slider_put()
5733 long *valp = ucontrol->value.integer.value; in ca0132_alt_xbass_xover_slider_put()
5738 cur_val = &spec->bass_redirect_xover_freq; in ca0132_alt_xbass_xover_slider_put()
5740 cur_val = &spec->xbass_xover_freq; in ca0132_alt_xbass_xover_slider_put()
5761 struct ca0132_spec *spec = codec->spec; in ca0132_alt_effect_slider_put()
5763 long *valp = ucontrol->value.integer.value; in ca0132_alt_effect_slider_put()
5766 idx = nid - EFFECT_START_NID; in ca0132_alt_effect_slider_put()
5768 if (spec->fx_ctl_val[idx] == *valp) in ca0132_alt_effect_slider_put()
5771 spec->fx_ctl_val[idx] = *valp; in ca0132_alt_effect_slider_put()
5783 * traditional 0-100 in alsamixer that goes in big steps. I like enum better.
5794 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_mic_boost_info()
5795 uinfo->count = 1; in ca0132_alt_mic_boost_info()
5796 uinfo->value.enumerated.items = MIC_BOOST_NUM_OF_STEPS; in ca0132_alt_mic_boost_info()
5797 if (uinfo->value.enumerated.item >= MIC_BOOST_NUM_OF_STEPS) in ca0132_alt_mic_boost_info()
5798 uinfo->value.enumerated.item = MIC_BOOST_NUM_OF_STEPS - 1; in ca0132_alt_mic_boost_info()
5799 sprintf(namestr, "%d %s", (uinfo->value.enumerated.item * 10), sfx); in ca0132_alt_mic_boost_info()
5800 strcpy(uinfo->value.enumerated.name, namestr); in ca0132_alt_mic_boost_info()
5808 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_get()
5810 ucontrol->value.enumerated.item[0] = spec->mic_boost_enum_val; in ca0132_alt_mic_boost_get()
5818 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_put()
5819 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_mic_boost_put()
5828 spec->mic_boost_enum_val = sel; in ca0132_alt_mic_boost_put()
5830 if (spec->in_enum_val != REAR_LINE_IN) in ca0132_alt_mic_boost_put()
5831 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_mic_boost_put()
5837 * Sound BlasterX AE-5 Headphone Gain Controls.
5846 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ae5_headphone_gain_info()
5847 uinfo->count = 1; in ae5_headphone_gain_info()
5848 uinfo->value.enumerated.items = AE5_HEADPHONE_GAIN_MAX; in ae5_headphone_gain_info()
5849 if (uinfo->value.enumerated.item >= AE5_HEADPHONE_GAIN_MAX) in ae5_headphone_gain_info()
5850 uinfo->value.enumerated.item = AE5_HEADPHONE_GAIN_MAX - 1; in ae5_headphone_gain_info()
5852 ae5_headphone_gain_presets[uinfo->value.enumerated.item].name, in ae5_headphone_gain_info()
5854 strcpy(uinfo->value.enumerated.name, namestr); in ae5_headphone_gain_info()
5862 struct ca0132_spec *spec = codec->spec; in ae5_headphone_gain_get()
5864 ucontrol->value.enumerated.item[0] = spec->ae5_headphone_gain_val; in ae5_headphone_gain_get()
5872 struct ca0132_spec *spec = codec->spec; in ae5_headphone_gain_put()
5873 int sel = ucontrol->value.enumerated.item[0]; in ae5_headphone_gain_put()
5882 spec->ae5_headphone_gain_val = sel; in ae5_headphone_gain_put()
5884 if (spec->out_enum_val == HEADPHONE_OUT) in ae5_headphone_gain_put()
5885 ae5_headphone_gain_set(codec, spec->ae5_headphone_gain_val); in ae5_headphone_gain_put()
5891 * Sound BlasterX AE-5 sound filter enumerated control.
5900 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ae5_sound_filter_info()
5901 uinfo->count = 1; in ae5_sound_filter_info()
5902 uinfo->value.enumerated.items = AE5_SOUND_FILTER_MAX; in ae5_sound_filter_info()
5903 if (uinfo->value.enumerated.item >= AE5_SOUND_FILTER_MAX) in ae5_sound_filter_info()
5904 uinfo->value.enumerated.item = AE5_SOUND_FILTER_MAX - 1; in ae5_sound_filter_info()
5906 ae5_filter_presets[uinfo->value.enumerated.item].name); in ae5_sound_filter_info()
5907 strcpy(uinfo->value.enumerated.name, namestr); in ae5_sound_filter_info()
5915 struct ca0132_spec *spec = codec->spec; in ae5_sound_filter_get()
5917 ucontrol->value.enumerated.item[0] = spec->ae5_filter_val; in ae5_sound_filter_get()
5925 struct ca0132_spec *spec = codec->spec; in ae5_sound_filter_put()
5926 int sel = ucontrol->value.enumerated.item[0]; in ae5_sound_filter_put()
5935 spec->ae5_filter_val = sel; in ae5_sound_filter_put()
5945 * front microphone has no auto-detect, and we need a way to set the rear
5946 * as line-in
5951 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_input_source_info()
5952 uinfo->count = 1; in ca0132_alt_input_source_info()
5953 uinfo->value.enumerated.items = IN_SRC_NUM_OF_INPUTS; in ca0132_alt_input_source_info()
5954 if (uinfo->value.enumerated.item >= IN_SRC_NUM_OF_INPUTS) in ca0132_alt_input_source_info()
5955 uinfo->value.enumerated.item = IN_SRC_NUM_OF_INPUTS - 1; in ca0132_alt_input_source_info()
5956 strcpy(uinfo->value.enumerated.name, in ca0132_alt_input_source_info()
5957 in_src_str[uinfo->value.enumerated.item]); in ca0132_alt_input_source_info()
5965 struct ca0132_spec *spec = codec->spec; in ca0132_alt_input_source_get()
5967 ucontrol->value.enumerated.item[0] = spec->in_enum_val; in ca0132_alt_input_source_get()
5975 struct ca0132_spec *spec = codec->spec; in ca0132_alt_input_source_put()
5976 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_input_source_put()
5980 * The AE-7 has no front microphone, so limit items to 2: rear mic and in ca0132_alt_input_source_put()
5981 * line-in. in ca0132_alt_input_source_put()
5992 spec->in_enum_val = sel; in ca0132_alt_input_source_put()
6003 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_output_select_get_info()
6004 uinfo->count = 1; in ca0132_alt_output_select_get_info()
6005 uinfo->value.enumerated.items = NUM_OF_OUTPUTS; in ca0132_alt_output_select_get_info()
6006 if (uinfo->value.enumerated.item >= NUM_OF_OUTPUTS) in ca0132_alt_output_select_get_info()
6007 uinfo->value.enumerated.item = NUM_OF_OUTPUTS - 1; in ca0132_alt_output_select_get_info()
6008 strcpy(uinfo->value.enumerated.name, in ca0132_alt_output_select_get_info()
6009 out_type_str[uinfo->value.enumerated.item]); in ca0132_alt_output_select_get_info()
6017 struct ca0132_spec *spec = codec->spec; in ca0132_alt_output_select_get()
6019 ucontrol->value.enumerated.item[0] = spec->out_enum_val; in ca0132_alt_output_select_get()
6027 struct ca0132_spec *spec = codec->spec; in ca0132_alt_output_select_put()
6028 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_output_select_put()
6038 spec->out_enum_val = sel; in ca0132_alt_output_select_put()
6040 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; in ca0132_alt_output_select_put()
6054 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_speaker_channel_cfg_get_info()
6055 uinfo->count = 1; in ca0132_alt_speaker_channel_cfg_get_info()
6056 uinfo->value.enumerated.items = items; in ca0132_alt_speaker_channel_cfg_get_info()
6057 if (uinfo->value.enumerated.item >= items) in ca0132_alt_speaker_channel_cfg_get_info()
6058 uinfo->value.enumerated.item = items - 1; in ca0132_alt_speaker_channel_cfg_get_info()
6059 strcpy(uinfo->value.enumerated.name, in ca0132_alt_speaker_channel_cfg_get_info()
6060 speaker_channel_cfgs[uinfo->value.enumerated.item].name); in ca0132_alt_speaker_channel_cfg_get_info()
6068 struct ca0132_spec *spec = codec->spec; in ca0132_alt_speaker_channel_cfg_get()
6070 ucontrol->value.enumerated.item[0] = spec->channel_cfg_val; in ca0132_alt_speaker_channel_cfg_get()
6078 struct ca0132_spec *spec = codec->spec; in ca0132_alt_speaker_channel_cfg_put()
6079 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_speaker_channel_cfg_put()
6088 spec->channel_cfg_val = sel; in ca0132_alt_speaker_channel_cfg_put()
6090 if (spec->out_enum_val == SPEAKER_OUT) in ca0132_alt_speaker_channel_cfg_put()
6107 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_svm_setting_info()
6108 uinfo->count = 1; in ca0132_alt_svm_setting_info()
6109 uinfo->value.enumerated.items = NUM_OF_SVM_SETTINGS; in ca0132_alt_svm_setting_info()
6110 if (uinfo->value.enumerated.item >= NUM_OF_SVM_SETTINGS) in ca0132_alt_svm_setting_info()
6111 uinfo->value.enumerated.item = NUM_OF_SVM_SETTINGS - 1; in ca0132_alt_svm_setting_info()
6112 strcpy(uinfo->value.enumerated.name, in ca0132_alt_svm_setting_info()
6113 out_svm_set_enum_str[uinfo->value.enumerated.item]); in ca0132_alt_svm_setting_info()
6121 struct ca0132_spec *spec = codec->spec; in ca0132_alt_svm_setting_get()
6123 ucontrol->value.enumerated.item[0] = spec->smart_volume_setting; in ca0132_alt_svm_setting_get()
6131 struct ca0132_spec *spec = codec->spec; in ca0132_alt_svm_setting_put()
6132 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_svm_setting_put()
6134 unsigned int idx = SMART_VOLUME - EFFECT_START_NID; in ca0132_alt_svm_setting_put()
6143 spec->smart_volume_setting = sel; in ca0132_alt_svm_setting_put()
6171 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_alt_eq_preset_info()
6172 uinfo->count = 1; in ca0132_alt_eq_preset_info()
6173 uinfo->value.enumerated.items = items; in ca0132_alt_eq_preset_info()
6174 if (uinfo->value.enumerated.item >= items) in ca0132_alt_eq_preset_info()
6175 uinfo->value.enumerated.item = items - 1; in ca0132_alt_eq_preset_info()
6176 strcpy(uinfo->value.enumerated.name, in ca0132_alt_eq_preset_info()
6177 ca0132_alt_eq_presets[uinfo->value.enumerated.item].name); in ca0132_alt_eq_preset_info()
6185 struct ca0132_spec *spec = codec->spec; in ca0132_alt_eq_preset_get()
6187 ucontrol->value.enumerated.item[0] = spec->eq_preset_val; in ca0132_alt_eq_preset_get()
6195 struct ca0132_spec *spec = codec->spec; in ca0132_alt_eq_preset_put()
6197 int sel = ucontrol->value.enumerated.item[0]; in ca0132_alt_eq_preset_put()
6218 spec->eq_preset_val = sel; in ca0132_alt_eq_preset_put()
6228 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; in ca0132_voicefx_info()
6229 uinfo->count = 1; in ca0132_voicefx_info()
6230 uinfo->value.enumerated.items = items; in ca0132_voicefx_info()
6231 if (uinfo->value.enumerated.item >= items) in ca0132_voicefx_info()
6232 uinfo->value.enumerated.item = items - 1; in ca0132_voicefx_info()
6233 strcpy(uinfo->value.enumerated.name, in ca0132_voicefx_info()
6234 ca0132_voicefx_presets[uinfo->value.enumerated.item].name); in ca0132_voicefx_info()
6242 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_get()
6244 ucontrol->value.enumerated.item[0] = spec->voicefx_val; in ca0132_voicefx_get()
6252 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_put()
6254 int sel = ucontrol->value.enumerated.item[0]; in ca0132_voicefx_put()
6275 spec->voicefx_val = sel; in ca0132_voicefx_put()
6287 struct ca0132_spec *spec = codec->spec; in ca0132_switch_get()
6290 long *valp = ucontrol->value.integer.value; in ca0132_switch_get()
6295 *valp = spec->vnode_lswitch[nid - VNODE_START_NID]; in ca0132_switch_get()
6299 *valp = spec->vnode_rswitch[nid - VNODE_START_NID]; in ca0132_switch_get()
6307 *valp = spec->effects_switch[nid - EFFECT_START_NID]; in ca0132_switch_get()
6312 if (nid == spec->input_pins[0]) { in ca0132_switch_get()
6313 *valp = spec->cur_mic_boost; in ca0132_switch_get()
6318 *valp = spec->zxr_gain_set; in ca0132_switch_get()
6323 *valp = spec->speaker_range_val[nid - SPEAKER_FULL_RANGE_FRONT]; in ca0132_switch_get()
6328 *valp = spec->bass_redirection_val; in ca0132_switch_get()
6339 struct ca0132_spec *spec = codec->spec; in ca0132_switch_put()
6342 long *valp = ucontrol->value.integer.value; in ca0132_switch_put()
6352 spec->vnode_lswitch[nid - VNODE_START_NID] = *valp; in ca0132_switch_put()
6356 spec->vnode_rswitch[nid - VNODE_START_NID] = *valp; in ca0132_switch_put()
6365 spec->effects_switch[nid - EFFECT_START_NID] = *valp; in ca0132_switch_put()
6372 spec->effects_switch[nid - EFFECT_START_NID] = *valp; in ca0132_switch_put()
6380 spec->effects_switch[nid - EFFECT_START_NID] = *valp; in ca0132_switch_put()
6386 if (nid == spec->input_pins[0]) { in ca0132_switch_put()
6387 spec->cur_mic_boost = *valp; in ca0132_switch_put()
6389 if (spec->in_enum_val != REAR_LINE_IN) in ca0132_switch_put()
6393 if (spec->cur_mic_type != DIGITAL_MIC) in ca0132_switch_put()
6401 spec->zxr_gain_set = *valp; in ca0132_switch_put()
6402 if (spec->cur_out_type == HEADPHONE_OUT) in ca0132_switch_put()
6411 spec->speaker_range_val[nid - SPEAKER_FULL_RANGE_FRONT] = *valp; in ca0132_switch_put()
6412 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_switch_put()
6419 spec->bass_redirection_val = *valp; in ca0132_switch_put()
6420 if (spec->cur_out_type == SPEAKER_OUT) in ca0132_switch_put()
6436 * ADC for input. Currently only the SBZ sets dsp capture volume level, and
6441 struct ca0132_spec *spec = codec->spec; in ca0132_alt_dsp_volume_put()
6450 lookup_val = spec->vnode_lvol[nid - VNODE_START_NID]; in ca0132_alt_dsp_volume_put()
6457 lookup_val = spec->vnode_rvol[nid - VNODE_START_NID]; in ca0132_alt_dsp_volume_put()
6473 struct ca0132_spec *spec = codec->spec; in ca0132_volume_info()
6483 nid = spec->shared_out_nid; in ca0132_volume_info()
6484 mutex_lock(&codec->control_mutex); in ca0132_volume_info()
6485 pval = kcontrol->private_value; in ca0132_volume_info()
6486 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_info()
6488 kcontrol->private_value = pval; in ca0132_volume_info()
6489 mutex_unlock(&codec->control_mutex); in ca0132_volume_info()
6493 nid = spec->shared_mic_nid; in ca0132_volume_info()
6494 mutex_lock(&codec->control_mutex); in ca0132_volume_info()
6495 pval = kcontrol->private_value; in ca0132_volume_info()
6496 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_info()
6498 kcontrol->private_value = pval; in ca0132_volume_info()
6499 mutex_unlock(&codec->control_mutex); in ca0132_volume_info()
6511 struct ca0132_spec *spec = codec->spec; in ca0132_volume_get()
6514 long *valp = ucontrol->value.integer.value; in ca0132_volume_get()
6518 *valp = spec->vnode_lvol[nid - VNODE_START_NID]; in ca0132_volume_get()
6522 *valp = spec->vnode_rvol[nid - VNODE_START_NID]; in ca0132_volume_get()
6532 struct ca0132_spec *spec = codec->spec; in ca0132_volume_put()
6535 long *valp = ucontrol->value.integer.value; in ca0132_volume_put()
6542 spec->vnode_lvol[nid - VNODE_START_NID] = *valp; in ca0132_volume_put()
6546 spec->vnode_rvol[nid - VNODE_START_NID] = *valp; in ca0132_volume_put()
6557 mutex_lock(&codec->control_mutex); in ca0132_volume_put()
6558 pval = kcontrol->private_value; in ca0132_volume_put()
6559 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(shared_nid, ch, in ca0132_volume_put()
6562 kcontrol->private_value = pval; in ca0132_volume_put()
6563 mutex_unlock(&codec->control_mutex); in ca0132_volume_put()
6579 struct ca0132_spec *spec = codec->spec; in ca0132_alt_volume_put()
6582 long *valp = ucontrol->value.integer.value; in ca0132_alt_volume_put()
6597 spec->vnode_lvol[vnid - VNODE_START_NID] = *valp; in ca0132_alt_volume_put()
6601 spec->vnode_rvol[vnid - VNODE_START_NID] = *valp; in ca0132_alt_volume_put()
6607 mutex_lock(&codec->control_mutex); in ca0132_alt_volume_put()
6609 mutex_unlock(&codec->control_mutex); in ca0132_alt_volume_put()
6619 struct ca0132_spec *spec = codec->spec; in ca0132_volume_tlv()
6629 nid = spec->shared_out_nid; in ca0132_volume_tlv()
6630 mutex_lock(&codec->control_mutex); in ca0132_volume_tlv()
6631 pval = kcontrol->private_value; in ca0132_volume_tlv()
6632 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_tlv()
6634 kcontrol->private_value = pval; in ca0132_volume_tlv()
6635 mutex_unlock(&codec->control_mutex); in ca0132_volume_tlv()
6639 nid = spec->shared_mic_nid; in ca0132_volume_tlv()
6640 mutex_lock(&codec->control_mutex); in ca0132_volume_tlv()
6641 pval = kcontrol->private_value; in ca0132_volume_tlv()
6642 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(nid, ch, 0, dir); in ca0132_volume_tlv()
6644 kcontrol->private_value = pval; in ca0132_volume_tlv()
6645 mutex_unlock(&codec->control_mutex); in ca0132_volume_tlv()
6692 struct ca0132_spec *spec = codec->spec; in add_fx_switch()
6767 * Add a control for selecting channel count on speaker output. Setting this
6768 * allows the DSP to do bass redirection and channel upmixing on surround
6774 HDA_CODEC_MUTE_MONO("Surround Channel Config", in ca0132_alt_add_speaker_channel_cfg_enum()
6786 * redirected to the LFE channel.
6791 CA0132_CODEC_MUTE_MONO("Full-Range Front Speakers", in ca0132_alt_add_front_full_range_switch()
6801 CA0132_CODEC_MUTE_MONO("Full-Range Rear Speakers", in ca0132_alt_add_rear_full_range_switch()
6810 * channel on speakers that are set as not being full-range. On configurations
6811 * without an LFE channel, it does nothing. Bass redirection seems to be the
6812 * replacement for X-Bass on configurations with an LFE channel.
6843 * because the front microphone has no auto-detect, and Line-in has to be set
6876 * Add headphone gain enumerated control for the AE-5. This switches between
6877 * three modes, low, medium, and high. When non-headphone outputs are selected,
6883 HDA_CODEC_MUTE_MONO("AE-5: Headphone Gain", in ae5_add_headphone_gain_enum()
6893 * Add sound filter enumerated control for the AE-5. This adds three different
6900 HDA_CODEC_MUTE_MONO("AE-5: Sound Filter", in ae5_add_sound_filter_enum()
6928 * Also need special channel map, because the default one is incorrect.
6951 list_for_each_entry(pcm, &codec->pcm_list_head, list) { in ca0132_alt_add_chmap_ctls()
6953 &pcm->stream[SNDRV_PCM_STREAM_PLAYBACK]; in ca0132_alt_add_chmap_ctls()
6958 if (hinfo->channels_max == 6) { in ca0132_alt_add_chmap_ctls()
6959 err = snd_pcm_add_chmap_ctls(pcm->pcm, in ca0132_alt_add_chmap_ctls()
6961 elem, hinfo->channels_max, 0, &chmap); in ca0132_alt_add_chmap_ctls()
6977 HDA_CODEC_VOLUME("Analog-Mic2 Capture Volume", 0x08, 0, HDA_INPUT),
6978 HDA_CODEC_MUTE("Analog-Mic2 Capture Switch", 0x08, 0, HDA_INPUT),
6981 CA0132_CODEC_MUTE_MONO("Mic1-Boost (30dB) Capture Switch",
6995 * Desktop specific control mixer. Removes auto-detect for mic, and adds
6997 * controls to alt so they set the DSP's decibel level.
7018 * Same as the Sound Blaster Z, except doesn't use the alt volume for capture
7041 struct ca0132_spec *spec = codec->spec; in ca0132_build_controls()
7046 for (i = 0; i < spec->num_mixers; i++) { in ca0132_build_controls()
7047 err = snd_hda_add_new_ctls(codec, spec->mixers[i]); in ca0132_build_controls()
7053 snd_hda_set_vmaster_tlv(codec, spec->dacs[0], HDA_OUTPUT, in ca0132_build_controls()
7054 spec->tlv); in ca0132_build_controls()
7056 spec->tlv, ca0132_alt_follower_pfxs, in ca0132_build_controls()
7061 true, 0, &spec->vmaster_mute.sw_kctl); in ca0132_build_controls()
7073 if (i == (ECHO_CANCELLATION - IN_EFFECT_START_NID + in ca0132_build_controls()
7108 num_sliders = OUT_EFFECTS_COUNT - 1; in ca0132_build_controls()
7119 "X-Bass Crossover", EFX_DIR_OUT); in ca0132_build_controls()
7167 * header on the card, and aux-in is handled by the DBPro board. in ca0132_build_controls()
7199 err = snd_hda_jack_add_kctls(codec, &spec->autocfg); in ca0132_build_controls()
7203 if (spec->dig_out) { in ca0132_build_controls()
7204 err = snd_hda_create_spdif_out_ctls(codec, spec->dig_out, in ca0132_build_controls()
7205 spec->dig_out); in ca0132_build_controls()
7208 err = snd_hda_create_spdif_share_sw(codec, &spec->multiout); in ca0132_build_controls()
7211 /* spec->multiout.share_spdif = 1; */ in ca0132_build_controls()
7214 if (spec->dig_in) { in ca0132_build_controls()
7215 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); in ca0132_build_controls()
7228 struct ca0132_spec *spec = codec->spec; in dbpro_build_controls()
7231 if (spec->dig_out) { in dbpro_build_controls()
7232 err = snd_hda_create_spdif_out_ctls(codec, spec->dig_out, in dbpro_build_controls()
7233 spec->dig_out); in dbpro_build_controls()
7238 if (spec->dig_in) { in dbpro_build_controls()
7239 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); in dbpro_build_controls()
7292 struct ca0132_spec *spec = codec->spec; in ca0132_build_pcms()
7297 return -ENOMEM; in ca0132_build_pcms()
7299 info->own_chmap = true; in ca0132_build_pcms()
7300 info->stream[SNDRV_PCM_STREAM_PLAYBACK].chmap in ca0132_build_pcms()
7303 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = ca0132_pcm_analog_playback; in ca0132_build_pcms()
7304 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->dacs[0]; in ca0132_build_pcms()
7305 info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = in ca0132_build_pcms()
7306 spec->multiout.max_channels; in ca0132_build_pcms()
7307 info->stream[SNDRV_PCM_STREAM_CAPTURE] = ca0132_pcm_analog_capture; in ca0132_build_pcms()
7308 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in ca0132_build_pcms()
7309 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0]; in ca0132_build_pcms()
7311 /* With the DSP enabled, desktops don't use this ADC. */ in ca0132_build_pcms()
7313 info = snd_hda_codec_pcm_new(codec, "CA0132 Analog Mic-In2"); in ca0132_build_pcms()
7315 return -ENOMEM; in ca0132_build_pcms()
7316 info->stream[SNDRV_PCM_STREAM_CAPTURE] = in ca0132_build_pcms()
7318 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in ca0132_build_pcms()
7319 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[1]; in ca0132_build_pcms()
7324 return -ENOMEM; in ca0132_build_pcms()
7325 info->stream[SNDRV_PCM_STREAM_CAPTURE] = ca0132_pcm_analog_capture; in ca0132_build_pcms()
7326 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in ca0132_build_pcms()
7327 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[2]; in ca0132_build_pcms()
7329 if (!spec->dig_out && !spec->dig_in) in ca0132_build_pcms()
7334 return -ENOMEM; in ca0132_build_pcms()
7335 info->pcm_type = HDA_PCM_TYPE_SPDIF; in ca0132_build_pcms()
7336 if (spec->dig_out) { in ca0132_build_pcms()
7337 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = in ca0132_build_pcms()
7339 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->dig_out; in ca0132_build_pcms()
7341 if (spec->dig_in) { in ca0132_build_pcms()
7342 info->stream[SNDRV_PCM_STREAM_CAPTURE] = in ca0132_build_pcms()
7344 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in; in ca0132_build_pcms()
7352 struct ca0132_spec *spec = codec->spec; in dbpro_build_pcms()
7355 info = snd_hda_codec_pcm_new(codec, "CA0132 Alt Analog"); in dbpro_build_pcms()
7357 return -ENOMEM; in dbpro_build_pcms()
7358 info->stream[SNDRV_PCM_STREAM_CAPTURE] = ca0132_pcm_analog_capture; in dbpro_build_pcms()
7359 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = 1; in dbpro_build_pcms()
7360 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0]; in dbpro_build_pcms()
7363 if (!spec->dig_out && !spec->dig_in) in dbpro_build_pcms()
7368 return -ENOMEM; in dbpro_build_pcms()
7369 info->pcm_type = HDA_PCM_TYPE_SPDIF; in dbpro_build_pcms()
7370 if (spec->dig_out) { in dbpro_build_pcms()
7371 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = in dbpro_build_pcms()
7373 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->dig_out; in dbpro_build_pcms()
7375 if (spec->dig_in) { in dbpro_build_pcms()
7376 info->stream[SNDRV_PCM_STREAM_CAPTURE] = in dbpro_build_pcms()
7378 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in; in dbpro_build_pcms()
7398 static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc) in init_input() argument
7407 if (adc && (get_wcaps(codec, adc) & AC_WCAP_IN_AMP)) { in init_input()
7408 snd_hda_codec_write(codec, adc, 0, AC_VERB_SET_AMP_GAIN_MUTE, in init_input()
7412 snd_hda_codec_amp_stereo(codec, adc, HDA_INPUT, 0, in init_input()
7414 snd_hda_codec_amp_stereo(codec, adc, HDA_INPUT, 0, in init_input()
7429 * Switch between Digital built-in mic and analog mic.
7433 struct ca0132_spec *spec = codec->spec; in ca0132_set_dmic()
7443 /* set DMic input as 2-ch */ in ca0132_set_dmic()
7447 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()
7459 val = spec->dmic_ctl; in ca0132_set_dmic()
7462 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_set_dmic()
7465 if (!(spec->dmic_ctl & 0x20)) in ca0132_set_dmic()
7477 struct ca0132_spec *spec = codec->spec; in ca0132_init_dmic()
7485 * Bit 2-0: MPIO select in ca0132_init_dmic()
7487 * Bit 7-4: reserved in ca0132_init_dmic()
7490 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7494 * Bit 2-0: Data1 MPIO select in ca0132_init_dmic()
7496 * Bit 6-4: Data2 MPIO select in ca0132_init_dmic()
7500 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7503 /* Use Ch-0 and Ch-1. Rate is 48K, mode 1. Disable DMic first. in ca0132_init_dmic()
7504 * Bit 3-0: Channel mask in ca0132_init_dmic()
7515 spec->dmic_ctl = val; in ca0132_init_dmic()
7516 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7525 struct ca0132_spec *spec = codec->spec; in ca0132_init_analog_mic2()
7527 mutex_lock(&spec->chipio_mutex); in ca0132_init_analog_mic2()
7532 mutex_unlock(&spec->chipio_mutex); in ca0132_init_analog_mic2()
7537 struct ca0132_spec *spec = codec->spec; in ca0132_refresh_widget_caps()
7543 for (i = 0; i < spec->multiout.num_dacs; i++) in ca0132_refresh_widget_caps()
7544 refresh_amp_caps(codec, spec->dacs[i], HDA_OUTPUT); in ca0132_refresh_widget_caps()
7546 for (i = 0; i < spec->num_outputs; i++) in ca0132_refresh_widget_caps()
7547 refresh_amp_caps(codec, spec->out_pins[i], HDA_OUTPUT); in ca0132_refresh_widget_caps()
7549 for (i = 0; i < spec->num_inputs; i++) { in ca0132_refresh_widget_caps()
7550 refresh_amp_caps(codec, spec->adcs[i], HDA_INPUT); in ca0132_refresh_widget_caps()
7551 refresh_amp_caps(codec, spec->input_pins[i], HDA_INPUT); in ca0132_refresh_widget_caps()
7556 /* If there is an active channel for some reason, find it and free it. */
7562 /* Read active DSPDMAC channel register. */ in ca0132_alt_free_active_dma_channels()
7565 /* AND against 0xfff to get the active channel bits. */ in ca0132_alt_free_active_dma_channels()
7572 codec_dbg(codec, "%s: Failed to read active DSP DMA channel register.\n", in ca0132_alt_free_active_dma_channels()
7578 * Check each DSP DMA channel for activity, and if the channel is in ca0132_alt_free_active_dma_channels()
7585 codec_dbg(codec, "%s: Failed to free active DSP DMA channel %d.\n", in ca0132_alt_free_active_dma_channels()
7593 * use, audio is no longer routed directly to the DAC/ADC from the HDA stream.
7596 * cause of most of the no-audio on startup issues were due to improperly
7605 * channel being sandwiched between the mic1 and mic2 dma channels.
7615 struct ca0132_spec *spec = codec->spec; in ca0132_alt_start_dsp_audio_streams()
7622 mutex_lock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7633 mutex_unlock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7642 mutex_lock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7651 /* Give the DSP some time to setup the DMA channel. */ in ca0132_alt_start_dsp_audio_streams()
7655 mutex_unlock(&spec->chipio_mutex); in ca0132_alt_start_dsp_audio_streams()
7659 * The region of ChipIO memory from 0x190000-0x1903fc is a sort of 'audio
7660 * router', where each entry represents a 48khz audio channel, with a format
7661 * of an 8-bit destination, an 8-bit source, and an unknown 2-bit number
7662 * value. The 2-bit number value is seemingly 0 if inactive, 1 if active,
7669 * the region of exram memory from 0x1477-0x1575 has each byte represent an
7682 * 0x00-0x1f: HDA audio stream input/output ports.
7683 * 0x80-0xbf: Sample rate converter input/outputs. Only valid ports seem to
7684 * have the lower-nibble set to 0x1, 0x2, and 0x9.
7685 * 0xc0-0xdf: DSP DMA input/output ports. Dynamically assigned.
7686 * 0xe0-0xff: DAC/ADC audio input/output ports.
7689 * 0x03: Mic1 ADC to DSP.
7690 * 0x04: Mic2 ADC to DSP.
7708 chipio_8051_read_exram(codec, 0x1578 + remap_data->stream_id, in chipio_remap_stream()
7720 chipio_8051_read_exram(codec, 0x1578 + remap_data->stream_id, in chipio_remap_stream()
7730 __func__, remap_data->stream_id); in chipio_remap_stream()
7734 /* Offset isn't in bytes, its in 32-bit words, so multiply it by 4. */ in chipio_remap_stream()
7738 for (i = 0; i < remap_data->count; i++) { in chipio_remap_stream()
7740 stream_offset + remap_data->offset[i], in chipio_remap_stream()
7741 remap_data->value[i]); in chipio_remap_stream()
7752 /* Non-zero values are floating point 0.000198. */
7757 /* Non-zero values are floating point 0.000220. */
7762 /* Non-zero values are floating point 0.000100. */
7771 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init_speaker_tuning()
7811 * Initialize mic for non-chromebook ca0132 implementations.
7815 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init_analog_mics()
7845 struct ca0132_spec *spec = codec->spec; in sbz_connect_streams()
7847 mutex_lock(&spec->chipio_mutex); in sbz_connect_streams()
7863 mutex_unlock(&spec->chipio_mutex); in sbz_connect_streams()
7875 struct ca0132_spec *spec = codec->spec; in sbz_chipio_startup_data()
7877 mutex_lock(&spec->chipio_mutex); in sbz_chipio_startup_data()
7902 mutex_unlock(&spec->chipio_mutex); in sbz_chipio_startup_data()
7907 struct ca0132_spec *spec = codec->spec; in ca0132_alt_dsp_initial_mic_setup()
7938 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_register_set()
7943 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7944 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7945 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7946 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7947 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7948 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7949 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7950 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7951 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7952 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7953 writeb(0x00, spec->mem_base + 0x100); in ae5_post_dsp_register_set()
7954 writeb(0xff, spec->mem_base + 0x304); in ae5_post_dsp_register_set()
7966 * AE-5's registry values in Windows. in ae5_post_dsp_param_setup()
7971 * change colors on the external LED strip connected to the AE-5. in ae5_post_dsp_param_setup()
7992 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_stream_setup()
7994 mutex_lock(&spec->chipio_mutex); in ae5_post_dsp_stream_setup()
8013 mutex_unlock(&spec->chipio_mutex); in ae5_post_dsp_stream_setup()
8018 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_startup_data()
8020 mutex_lock(&spec->chipio_mutex); in ae5_post_dsp_startup_data()
8045 mutex_unlock(&spec->chipio_mutex); in ae5_post_dsp_startup_data()
8050 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_setup_ports()
8052 mutex_lock(&spec->chipio_mutex); in ae7_post_dsp_setup_ports()
8066 mutex_unlock(&spec->chipio_mutex); in ae7_post_dsp_setup_ports()
8071 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_asi_stream_setup()
8073 mutex_lock(&spec->chipio_mutex); in ae7_post_dsp_asi_stream_setup()
8089 mutex_unlock(&spec->chipio_mutex); in ae7_post_dsp_asi_stream_setup()
8108 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_asi_setup_ports()
8117 mutex_lock(&spec->chipio_mutex); in ae7_post_dsp_asi_setup_ports()
8154 * know what data is being sent. Interestingly, the AE-5 seems to go in ae7_post_dsp_asi_setup_ports()
8156 * step, but the AE-7 does. in ae7_post_dsp_asi_setup_ports()
8180 mutex_unlock(&spec->chipio_mutex); in ae7_post_dsp_asi_setup_ports()
8219 struct ca0132_spec *spec = codec->spec; in ca0132_setup_defaults()
8224 if (spec->dsp_state != DSP_DOWNLOADED) in ca0132_setup_defaults()
8264 struct ca0132_spec *spec = codec->spec; in r3d_setup_defaults()
8269 if (spec->dsp_state != DSP_DOWNLOADED) in r3d_setup_defaults()
8314 struct ca0132_spec *spec = codec->spec; in sbz_setup_defaults()
8319 if (spec->dsp_state != DSP_DOWNLOADED) in sbz_setup_defaults()
8364 * Setup default parameters for the Sound BlasterX AE-5 DSP.
8368 struct ca0132_spec *spec = codec->spec; in ae5_setup_defaults()
8373 if (spec->dsp_state != DSP_DOWNLOADED) in ae5_setup_defaults()
8429 * Setup default parameters for the Sound Blaster AE-7 DSP.
8433 struct ca0132_spec *spec = codec->spec; in ae7_setup_defaults()
8438 if (spec->dsp_state != DSP_DOWNLOADED) in ae7_setup_defaults()
8516 struct ca0132_spec *spec = codec->spec; in ca0132_init_flags()
8549 struct ca0132_spec *spec = codec->spec; in ca0132_init_params()
8580 struct ca0132_spec *spec = codec->spec; in ca0132_download_dsp_images()
8593 codec->card->dev) != 0) in ca0132_download_dsp_images()
8600 codec->card->dev) != 0) in ca0132_download_dsp_images()
8601 codec_dbg(codec, "Recon3Di alt firmware not detected."); in ca0132_download_dsp_images()
8609 * Use default ctefx.bin if no alt firmware is detected, or if none in ca0132_download_dsp_images()
8615 codec->card->dev) != 0) in ca0132_download_dsp_images()
8619 dsp_os_image = (struct dsp_image_seg *)(fw_entry->data); in ca0132_download_dsp_images()
8635 struct ca0132_spec *spec = codec->spec; in ca0132_download_dsp()
8641 if (spec->dsp_state == DSP_DOWNLOAD_FAILED) in ca0132_download_dsp()
8645 if (spec->dsp_state != DSP_DOWNLOADED) { in ca0132_download_dsp()
8646 spec->dsp_state = DSP_DOWNLOADING; in ca0132_download_dsp()
8649 spec->dsp_state = DSP_DOWNLOAD_FAILED; in ca0132_download_dsp()
8651 spec->dsp_state = DSP_DOWNLOADED; in ca0132_download_dsp()
8654 /* For codecs using alt functions, this is already done earlier */ in ca0132_download_dsp()
8655 if (spec->dsp_state == DSP_DOWNLOADED && !ca0132_use_alt_functions(spec)) in ca0132_download_dsp()
8662 struct ca0132_spec *spec = codec->spec; in ca0132_process_dsp_response()
8666 if (spec->wait_scp) { in ca0132_process_dsp_response()
8668 spec->wait_scp = 0; in ca0132_process_dsp_response()
8677 struct ca0132_spec *spec = codec->spec; in hp_callback()
8680 /* Delay enabling the HP amp, to let the mic-detection in hp_callback()
8683 tbl = snd_hda_jack_tbl_get(codec, cb->nid); in hp_callback()
8685 tbl->block_report = 1; in hp_callback()
8686 schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(500)); in hp_callback()
8691 struct ca0132_spec *spec = codec->spec; in amic_callback()
8701 struct ca0132_spec *spec = codec->spec; in ca0132_setup_unsol()
8702 snd_hda_jack_detect_enable_callback(codec, spec->unsol_tag_hp, hp_callback); in ca0132_setup_unsol()
8703 snd_hda_jack_detect_enable_callback(codec, spec->unsol_tag_amic1, in ca0132_setup_unsol()
8710 spec->unsol_tag_front_hp, hp_callback); in ca0132_setup_unsol()
8790 struct ca0132_spec *spec = codec->spec; in ca0132_init_chip()
8795 mutex_init(&spec->chipio_mutex); in ca0132_init_chip()
8807 snd_hda_codec_write(codec, codec->core.afg, 0, in ca0132_init_chip()
8809 snd_hda_codec_write(codec, codec->core.afg, 0, in ca0132_init_chip()
8813 spec->cur_out_type = SPEAKER_OUT; in ca0132_init_chip()
8815 spec->cur_mic_type = DIGITAL_MIC; in ca0132_init_chip()
8817 spec->cur_mic_type = REAR_MIC; in ca0132_init_chip()
8819 spec->cur_mic_boost = 0; in ca0132_init_chip()
8822 spec->vnode_lvol[i] = 0x5a; in ca0132_init_chip()
8823 spec->vnode_rvol[i] = 0x5a; in ca0132_init_chip()
8824 spec->vnode_lswitch[i] = 0; in ca0132_init_chip()
8825 spec->vnode_rswitch[i] = 0; in ca0132_init_chip()
8834 spec->effects_switch[i] = on ? 1 : 0; in ca0132_init_chip()
8838 * ca0132 codecs. Also sets x-bass crossover frequency to 80hz. in ca0132_init_chip()
8842 spec->speaker_range_val[0] = 1; in ca0132_init_chip()
8843 spec->speaker_range_val[1] = 1; in ca0132_init_chip()
8845 spec->xbass_xover_freq = 8; in ca0132_init_chip()
8847 spec->fx_ctl_val[i] = effect_slider_defaults[i]; in ca0132_init_chip()
8849 spec->bass_redirect_xover_freq = 8; in ca0132_init_chip()
8852 spec->voicefx_val = 0; in ca0132_init_chip()
8853 spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID] = 1; in ca0132_init_chip()
8854 spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID] = 0; in ca0132_init_chip()
8857 * The ZxR doesn't have a front panel header, and it's line-in is on in ca0132_init_chip()
8859 * to make sure that spec->in_enum_val is set properly. in ca0132_init_chip()
8862 spec->in_enum_val = REAR_MIC; in ca0132_init_chip()
8883 struct ca0132_spec *spec = codec->spec; in sbz_region2_exit()
8887 writeb(0x0, spec->mem_base + 0x100); in sbz_region2_exit()
8889 writeb(0xb3, spec->mem_base + 0x304); in sbz_region2_exit()
8954 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, -1); in sbz_exit_chip()
9089 struct ca0132_spec *spec = codec->spec; in sbz_dsp_startup_check()
9096 if (spec->startup_check_entered) in sbz_dsp_startup_check()
9099 spec->startup_check_entered = true; in sbz_dsp_startup_check()
9121 spec->dsp_state = DSP_DOWNLOAD_INIT; in sbz_dsp_startup_check()
9122 codec->patch_ops.init(codec); in sbz_dsp_startup_check()
9132 reload--; in sbz_dsp_startup_check()
9169 struct ca0132_spec *spec = codec->spec; in sbz_pre_dsp_setup()
9171 writel(0x00820680, spec->mem_base + 0x01C); in sbz_pre_dsp_setup()
9172 writel(0x00820680, spec->mem_base + 0x01C); in sbz_pre_dsp_setup()
9282 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init_sbz()
9288 writel(0x00000000, spec->mem_base + addr[i]); in ca0132_mmio_init_sbz()
9311 writel(tmp[i], spec->mem_base + addr[cur_addr + i]); in ca0132_mmio_init_sbz()
9327 writel(data[i], spec->mem_base + addr[cur_addr + i]); in ca0132_mmio_init_sbz()
9332 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init_ae5()
9341 writel(0x00000680, spec->mem_base + 0x1c); in ca0132_mmio_init_ae5()
9342 writel(0x00880680, spec->mem_base + 0x1c); in ca0132_mmio_init_ae5()
9347 * AE-7 shares all writes with the AE-5, except that it writes in ca0132_mmio_init_ae5()
9351 writel(0x00800001, spec->mem_base + addr[i]); in ca0132_mmio_init_ae5()
9355 writel(data[i], spec->mem_base + addr[i]); in ca0132_mmio_init_ae5()
9359 writel(0x00880680, spec->mem_base + 0x1c); in ca0132_mmio_init_ae5()
9364 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init()
9397 struct ca0132_spec *spec = codec->spec; in ae5_register_set()
9421 writeb(tmp[i], spec->mem_base + addr[cur_addr]); in ae5_register_set()
9428 writeb(data[i], spec->mem_base + addr[cur_addr]); in ae5_register_set()
9431 writel(data[i], spec->mem_base + addr[cur_addr]); in ae5_register_set()
9433 writel(0x00800001, spec->mem_base + 0x20c); in ae5_register_set()
9456 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init()
9465 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9466 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9474 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9479 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9480 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9486 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9487 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9493 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9494 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9502 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9503 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9513 struct ca0132_spec *spec = codec->spec; in ca0132_init()
9514 struct auto_pin_cfg *cfg = &spec->autocfg; in ca0132_init()
9528 if (spec->dsp_state == DSP_DOWNLOADED) { in ca0132_init()
9531 spec->dsp_reload = true; in ca0132_init()
9532 spec->dsp_state = DSP_DOWNLOAD_INIT; in ca0132_init()
9540 if (spec->dsp_state != DSP_DOWNLOAD_FAILED) in ca0132_init()
9541 spec->dsp_state = DSP_DOWNLOAD_INIT; in ca0132_init()
9542 spec->curr_chip_addx = INVALID_CHIP_ADDRESS; in ca0132_init()
9555 snd_hda_sequence_write(codec, spec->base_init_verbs); in ca0132_init()
9586 for (i = 0; i < spec->num_outputs; i++) in ca0132_init()
9587 init_output(codec, spec->out_pins[i], spec->dacs[0]); in ca0132_init()
9589 init_output(codec, cfg->dig_out_pins[0], spec->dig_out); in ca0132_init()
9591 for (i = 0; i < spec->num_inputs; i++) in ca0132_init()
9592 init_input(codec, spec->input_pins[i], spec->adcs[i]); in ca0132_init()
9594 init_input(codec, cfg->dig_in_pin, spec->dig_in); in ca0132_init()
9597 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_init()
9607 snd_hda_sequence_write(codec, spec->spec_init_verbs); in ca0132_init()
9622 if (spec->dsp_reload) { in ca0132_init()
9623 spec->dsp_reload = false; in ca0132_init()
9634 struct ca0132_spec *spec = codec->spec; in dbpro_init()
9635 struct auto_pin_cfg *cfg = &spec->autocfg; in dbpro_init()
9638 init_output(codec, cfg->dig_out_pins[0], spec->dig_out); in dbpro_init()
9639 init_input(codec, cfg->dig_in_pin, spec->dig_in); in dbpro_init()
9641 for (i = 0; i < spec->num_inputs; i++) in dbpro_init()
9642 init_input(codec, spec->input_pins[i], spec->adcs[i]); in dbpro_init()
9649 struct ca0132_spec *spec = codec->spec; in ca0132_free()
9651 cancel_delayed_work_sync(&spec->unsol_hp_work); in ca0132_free()
9676 snd_hda_sequence_write(codec, spec->base_exit_verbs); in ca0132_free()
9681 if (spec->mem_base) in ca0132_free()
9682 pci_iounmap(codec->bus->pci, spec->mem_base); in ca0132_free()
9684 kfree(spec->spec_init_verbs); in ca0132_free()
9685 kfree(codec->spec); in ca0132_free()
9690 struct ca0132_spec *spec = codec->spec; in dbpro_free()
9694 kfree(spec->spec_init_verbs); in dbpro_free()
9695 kfree(codec->spec); in dbpro_free()
9701 struct ca0132_spec *spec = codec->spec; in ca0132_suspend()
9703 cancel_delayed_work_sync(&spec->unsol_hp_work); in ca0132_suspend()
9728 struct ca0132_spec *spec = codec->spec; in ca0132_config()
9730 spec->dacs[0] = 0x2; in ca0132_config()
9731 spec->dacs[1] = 0x3; in ca0132_config()
9732 spec->dacs[2] = 0x4; in ca0132_config()
9734 spec->multiout.dac_nids = spec->dacs; in ca0132_config()
9735 spec->multiout.num_dacs = 3; in ca0132_config()
9738 spec->multiout.max_channels = 2; in ca0132_config()
9740 spec->multiout.max_channels = 6; in ca0132_config()
9777 spec->num_outputs = 2; in ca0132_config()
9778 spec->out_pins[0] = 0x0b; /* speaker out */ in ca0132_config()
9779 spec->out_pins[1] = 0x0f; in ca0132_config()
9780 spec->shared_out_nid = 0x2; in ca0132_config()
9781 spec->unsol_tag_hp = 0x0f; in ca0132_config()
9783 spec->adcs[0] = 0x7; /* digital mic / analog mic1 */ in ca0132_config()
9784 spec->adcs[1] = 0x8; /* analog mic2 */ in ca0132_config()
9785 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9787 spec->num_inputs = 3; in ca0132_config()
9788 spec->input_pins[0] = 0x12; in ca0132_config()
9789 spec->input_pins[1] = 0x11; in ca0132_config()
9790 spec->input_pins[2] = 0x13; in ca0132_config()
9791 spec->shared_mic_nid = 0x7; in ca0132_config()
9792 spec->unsol_tag_amic1 = 0x11; in ca0132_config()
9796 spec->num_outputs = 2; in ca0132_config()
9797 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9798 spec->out_pins[1] = 0x0F; /* Rear headphone out */ in ca0132_config()
9799 spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ in ca0132_config()
9800 spec->out_pins[3] = 0x11; /* Rear surround */ in ca0132_config()
9801 spec->shared_out_nid = 0x2; in ca0132_config()
9802 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9803 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9805 spec->adcs[0] = 0x7; /* Rear Mic / Line-in */ in ca0132_config()
9806 spec->adcs[1] = 0x8; /* Front Mic, but only if no DSP */ in ca0132_config()
9807 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9809 spec->num_inputs = 2; in ca0132_config()
9810 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9811 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9812 spec->shared_mic_nid = 0x7; in ca0132_config()
9813 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9816 spec->dig_out = 0x05; in ca0132_config()
9817 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9818 spec->dig_in = 0x09; in ca0132_config()
9821 spec->num_outputs = 2; in ca0132_config()
9822 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9823 spec->out_pins[1] = 0x0F; /* Rear headphone out */ in ca0132_config()
9824 spec->out_pins[2] = 0x10; /* Center/LFE */ in ca0132_config()
9825 spec->out_pins[3] = 0x11; /* Rear surround */ in ca0132_config()
9826 spec->shared_out_nid = 0x2; in ca0132_config()
9827 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9828 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9830 spec->adcs[0] = 0x7; /* Rear Mic / Line-in */ in ca0132_config()
9831 spec->adcs[1] = 0x8; /* Not connected, no front mic */ in ca0132_config()
9832 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9834 spec->num_inputs = 2; in ca0132_config()
9835 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9836 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9837 spec->shared_mic_nid = 0x7; in ca0132_config()
9838 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9841 spec->adcs[0] = 0x8; /* ZxR DBPro Aux In */ in ca0132_config()
9843 spec->num_inputs = 1; in ca0132_config()
9844 spec->input_pins[0] = 0x11; /* RCA Line-in */ in ca0132_config()
9846 spec->dig_out = 0x05; in ca0132_config()
9847 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9849 spec->dig_in = 0x09; in ca0132_config()
9853 spec->num_outputs = 2; in ca0132_config()
9854 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9855 spec->out_pins[1] = 0x11; /* Rear headphone out */ in ca0132_config()
9856 spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ in ca0132_config()
9857 spec->out_pins[3] = 0x0F; /* Rear surround */ in ca0132_config()
9858 spec->shared_out_nid = 0x2; in ca0132_config()
9859 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9860 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9862 spec->adcs[0] = 0x7; /* Rear Mic / Line-in */ in ca0132_config()
9863 spec->adcs[1] = 0x8; /* Front Mic, but only if no DSP */ in ca0132_config()
9864 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9866 spec->num_inputs = 2; in ca0132_config()
9867 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9868 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9869 spec->shared_mic_nid = 0x7; in ca0132_config()
9870 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9873 spec->dig_out = 0x05; in ca0132_config()
9874 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9877 spec->num_outputs = 2; in ca0132_config()
9878 spec->out_pins[0] = 0x0B; /* Line out */ in ca0132_config()
9879 spec->out_pins[1] = 0x0F; /* Rear headphone out */ in ca0132_config()
9880 spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ in ca0132_config()
9881 spec->out_pins[3] = 0x11; /* Rear surround */ in ca0132_config()
9882 spec->shared_out_nid = 0x2; in ca0132_config()
9883 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9884 spec->unsol_tag_front_hp = spec->out_pins[2]; in ca0132_config()
9886 spec->adcs[0] = 0x07; /* Rear Mic / Line-in */ in ca0132_config()
9887 spec->adcs[1] = 0x08; /* Front Mic, but only if no DSP */ in ca0132_config()
9888 spec->adcs[2] = 0x0a; /* what u hear */ in ca0132_config()
9890 spec->num_inputs = 2; in ca0132_config()
9891 spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ in ca0132_config()
9892 spec->input_pins[1] = 0x13; /* What U Hear */ in ca0132_config()
9893 spec->shared_mic_nid = 0x7; in ca0132_config()
9894 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9897 spec->dig_out = 0x05; in ca0132_config()
9898 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9901 spec->num_outputs = 2; in ca0132_config()
9902 spec->out_pins[0] = 0x0b; /* speaker out */ in ca0132_config()
9903 spec->out_pins[1] = 0x10; /* headphone out */ in ca0132_config()
9904 spec->shared_out_nid = 0x2; in ca0132_config()
9905 spec->unsol_tag_hp = spec->out_pins[1]; in ca0132_config()
9907 spec->adcs[0] = 0x7; /* digital mic / analog mic1 */ in ca0132_config()
9908 spec->adcs[1] = 0x8; /* analog mic2 */ in ca0132_config()
9909 spec->adcs[2] = 0xa; /* what u hear */ in ca0132_config()
9911 spec->num_inputs = 3; in ca0132_config()
9912 spec->input_pins[0] = 0x12; in ca0132_config()
9913 spec->input_pins[1] = 0x11; in ca0132_config()
9914 spec->input_pins[2] = 0x13; in ca0132_config()
9915 spec->shared_mic_nid = 0x7; in ca0132_config()
9916 spec->unsol_tag_amic1 = spec->input_pins[0]; in ca0132_config()
9919 spec->dig_out = 0x05; in ca0132_config()
9920 spec->multiout.dig_out_nid = spec->dig_out; in ca0132_config()
9921 spec->dig_in = 0x09; in ca0132_config()
9930 struct ca0132_spec *spec = codec->spec; in ca0132_prepare_verbs()
9932 spec->chip_init_verbs = ca0132_init_verbs0; in ca0132_prepare_verbs()
9938 spec->desktop_init_verbs = ca0132_init_verbs1; in ca0132_prepare_verbs()
9939 spec->spec_init_verbs = kcalloc(NUM_SPEC_VERBS, in ca0132_prepare_verbs()
9942 if (!spec->spec_init_verbs) in ca0132_prepare_verbs()
9943 return -ENOMEM; in ca0132_prepare_verbs()
9946 spec->spec_init_verbs[0].nid = 0x0b; in ca0132_prepare_verbs()
9947 spec->spec_init_verbs[0].param = 0x78D; in ca0132_prepare_verbs()
9948 spec->spec_init_verbs[0].verb = 0x00; in ca0132_prepare_verbs()
9952 spec->spec_init_verbs[2].nid = 0x0b; in ca0132_prepare_verbs()
9953 spec->spec_init_verbs[2].param = AC_VERB_SET_EAPD_BTLENABLE; in ca0132_prepare_verbs()
9954 spec->spec_init_verbs[2].verb = 0x02; in ca0132_prepare_verbs()
9956 spec->spec_init_verbs[3].nid = 0x10; in ca0132_prepare_verbs()
9957 spec->spec_init_verbs[3].param = 0x78D; in ca0132_prepare_verbs()
9958 spec->spec_init_verbs[3].verb = 0x02; in ca0132_prepare_verbs()
9960 spec->spec_init_verbs[4].nid = 0x10; in ca0132_prepare_verbs()
9961 spec->spec_init_verbs[4].param = AC_VERB_SET_EAPD_BTLENABLE; in ca0132_prepare_verbs()
9962 spec->spec_init_verbs[4].verb = 0x02; in ca0132_prepare_verbs()
9965 /* Terminator: spec->spec_init_verbs[NUM_SPEC_VERBS-1] */ in ca0132_prepare_verbs()
9977 switch (codec->core.subsystem_id) { in sbz_detect_quirk()
9979 codec->fixup_id = QUIRK_ZXR; in sbz_detect_quirk()
9982 codec->fixup_id = QUIRK_ZXR_DBPRO; in sbz_detect_quirk()
9985 codec->fixup_id = QUIRK_SBZ; in sbz_detect_quirk()
9999 return -ENOMEM; in patch_ca0132()
10000 codec->spec = spec; in patch_ca0132()
10001 spec->codec = codec; in patch_ca0132()
10009 codec->patch_ops = dbpro_patch_ops; in patch_ca0132()
10011 codec->patch_ops = ca0132_patch_ops; in patch_ca0132()
10013 codec->pcm_format_first = 1; in patch_ca0132()
10014 codec->no_sticky_stream = 1; in patch_ca0132()
10017 spec->dsp_state = DSP_DOWNLOAD_INIT; in patch_ca0132()
10018 spec->num_mixers = 1; in patch_ca0132()
10023 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10027 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10033 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10037 spec->mixers[0] = r3di_mixer; in patch_ca0132()
10041 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10042 snd_hda_codec_set_name(codec, "Sound BlasterX AE-5"); in patch_ca0132()
10045 spec->mixers[0] = desktop_mixer; in patch_ca0132()
10046 snd_hda_codec_set_name(codec, "Sound Blaster AE-7"); in patch_ca0132()
10049 spec->mixers[0] = ca0132_mixer; in patch_ca0132()
10053 /* Setup whether or not to use alt functions/controls/pci_mmio */ in patch_ca0132()
10060 spec->use_alt_controls = true; in patch_ca0132()
10061 spec->use_alt_functions = true; in patch_ca0132()
10062 spec->use_pci_mmio = true; in patch_ca0132()
10065 spec->use_alt_controls = true; in patch_ca0132()
10066 spec->use_alt_functions = true; in patch_ca0132()
10067 spec->use_pci_mmio = false; in patch_ca0132()
10070 spec->use_alt_controls = false; in patch_ca0132()
10071 spec->use_alt_functions = false; in patch_ca0132()
10072 spec->use_pci_mmio = false; in patch_ca0132()
10077 if (spec->use_pci_mmio) { in patch_ca0132()
10078 spec->mem_base = pci_iomap(codec->bus->pci, 2, 0xC20); in patch_ca0132()
10079 if (spec->mem_base == NULL) { in patch_ca0132()
10081 codec->fixup_id = QUIRK_NONE; in patch_ca0132()
10086 spec->base_init_verbs = ca0132_base_init_verbs; in patch_ca0132()
10087 spec->base_exit_verbs = ca0132_base_exit_verbs; in patch_ca0132()
10089 INIT_DELAYED_WORK(&spec->unsol_hp_work, ca0132_unsol_hp_delayed); in patch_ca0132()
10099 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); in patch_ca0132()