Lines Matching full:codec

1101 	struct hda_codec *codec;  member
1476 * CA0132 codec access
1478 static unsigned int codec_send_command(struct hda_codec *codec, hda_nid_t nid, in codec_send_command() argument
1482 response = snd_hda_codec_read(codec, nid, 0, verb, parm); in codec_send_command()
1488 static int codec_set_converter_format(struct hda_codec *codec, hda_nid_t nid, in codec_set_converter_format() argument
1491 return codec_send_command(codec, nid, VENDOR_CHIPIO_STREAM_FORMAT, in codec_set_converter_format()
1495 static int codec_set_converter_stream_channel(struct hda_codec *codec, in codec_set_converter_stream_channel() argument
1502 return codec_send_command(codec, nid, AC_VERB_SET_CHANNEL_STREAMID, in codec_set_converter_stream_channel()
1507 static int chipio_send(struct hda_codec *codec, in chipio_send() argument
1516 res = snd_hda_codec_read(codec, WIDGET_CHIP_CTRL, 0, in chipio_send()
1529 static int chipio_write_address(struct hda_codec *codec, in chipio_write_address() argument
1532 struct ca0132_spec *spec = codec->spec; in chipio_write_address()
1539 res = chipio_send(codec, VENDOR_CHIPIO_ADDRESS_LOW, in chipio_write_address()
1544 res = chipio_send(codec, VENDOR_CHIPIO_ADDRESS_HIGH, in chipio_write_address()
1556 static int chipio_write_data(struct hda_codec *codec, unsigned int data) in chipio_write_data() argument
1558 struct ca0132_spec *spec = codec->spec; in chipio_write_data()
1562 res = chipio_send(codec, VENDOR_CHIPIO_DATA_LOW, data & 0xffff); in chipio_write_data()
1566 res = chipio_send(codec, VENDOR_CHIPIO_DATA_HIGH, in chipio_write_data()
1580 static int chipio_write_data_multiple(struct hda_codec *codec, in chipio_write_data_multiple() argument
1587 codec_dbg(codec, "chipio_write_data null ptr\n"); in chipio_write_data_multiple()
1592 status = chipio_write_data(codec, *data++); in chipio_write_data_multiple()
1601 static int chipio_read_data(struct hda_codec *codec, unsigned int *data) in chipio_read_data() argument
1603 struct ca0132_spec *spec = codec->spec; in chipio_read_data()
1607 res = chipio_send(codec, VENDOR_CHIPIO_HIC_POST_READ, 0); in chipio_read_data()
1611 res = chipio_send(codec, VENDOR_CHIPIO_STATUS, 0); in chipio_read_data()
1616 *data = snd_hda_codec_read(codec, WIDGET_CHIP_CTRL, 0, in chipio_read_data()
1632 static int chipio_write(struct hda_codec *codec, in chipio_write() argument
1635 struct ca0132_spec *spec = codec->spec; in chipio_write()
1641 err = chipio_write_address(codec, chip_addx); in chipio_write()
1645 err = chipio_write_data(codec, data); in chipio_write()
1658 static int chipio_write_no_mutex(struct hda_codec *codec, in chipio_write_no_mutex() argument
1665 err = chipio_write_address(codec, chip_addx); in chipio_write_no_mutex()
1669 err = chipio_write_data(codec, data); in chipio_write_no_mutex()
1681 static int chipio_write_multiple(struct hda_codec *codec, in chipio_write_multiple() argument
1686 struct ca0132_spec *spec = codec->spec; in chipio_write_multiple()
1690 status = chipio_write_address(codec, chip_addx); in chipio_write_multiple()
1694 status = chipio_write_data_multiple(codec, data, count); in chipio_write_multiple()
1705 static int chipio_read(struct hda_codec *codec, in chipio_read() argument
1708 struct ca0132_spec *spec = codec->spec; in chipio_read()
1714 err = chipio_write_address(codec, chip_addx); in chipio_read()
1718 err = chipio_read_data(codec, data); in chipio_read()
1730 static void chipio_set_control_flag(struct hda_codec *codec, in chipio_set_control_flag() argument
1739 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_set_control_flag()
1746 static void chipio_set_control_param(struct hda_codec *codec, in chipio_set_control_param() argument
1749 struct ca0132_spec *spec = codec->spec; in chipio_set_control_param()
1754 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_set_control_param()
1758 if (chipio_send(codec, VENDOR_CHIPIO_STATUS, 0) == 0) { in chipio_set_control_param()
1759 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_set_control_param()
1762 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_set_control_param()
1773 static void chipio_set_control_param_no_mutex(struct hda_codec *codec, in chipio_set_control_param_no_mutex() argument
1780 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_set_control_param_no_mutex()
1783 if (chipio_send(codec, VENDOR_CHIPIO_STATUS, 0) == 0) { in chipio_set_control_param_no_mutex()
1784 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_set_control_param_no_mutex()
1787 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_set_control_param_no_mutex()
1797 static void chipio_set_stream_source_dest(struct hda_codec *codec, in chipio_set_stream_source_dest() argument
1800 chipio_set_control_param_no_mutex(codec, in chipio_set_stream_source_dest()
1802 chipio_set_control_param_no_mutex(codec, in chipio_set_stream_source_dest()
1804 chipio_set_control_param_no_mutex(codec, in chipio_set_stream_source_dest()
1811 static void chipio_set_stream_channels(struct hda_codec *codec, in chipio_set_stream_channels() argument
1814 chipio_set_control_param_no_mutex(codec, in chipio_set_stream_channels()
1816 chipio_set_control_param_no_mutex(codec, in chipio_set_stream_channels()
1823 static void chipio_set_stream_control(struct hda_codec *codec, in chipio_set_stream_control() argument
1826 chipio_set_control_param_no_mutex(codec, in chipio_set_stream_control()
1828 chipio_set_control_param_no_mutex(codec, in chipio_set_stream_control()
1836 static void chipio_set_conn_rate_no_mutex(struct hda_codec *codec, in chipio_set_conn_rate_no_mutex() argument
1839 chipio_set_control_param_no_mutex(codec, in chipio_set_conn_rate_no_mutex()
1841 chipio_set_control_param_no_mutex(codec, in chipio_set_conn_rate_no_mutex()
1848 static void chipio_set_conn_rate(struct hda_codec *codec, in chipio_set_conn_rate() argument
1851 chipio_set_control_param(codec, CONTROL_PARAM_CONN_POINT_ID, connid); in chipio_set_conn_rate()
1852 chipio_set_control_param(codec, CONTROL_PARAM_CONN_POINT_SAMPLE_RATE, in chipio_set_conn_rate()
1861 static void chipio_8051_write_direct(struct hda_codec *codec, in chipio_8051_write_direct() argument
1867 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, verb, addr); in chipio_8051_write_direct()
1873 static void chipio_enable_clocks(struct hda_codec *codec) in chipio_enable_clocks() argument
1875 struct ca0132_spec *spec = codec->spec; in chipio_enable_clocks()
1878 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_enable_clocks()
1880 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_enable_clocks()
1882 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_enable_clocks()
1884 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_enable_clocks()
1886 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_enable_clocks()
1888 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in chipio_enable_clocks()
1896 static int dspio_send(struct hda_codec *codec, unsigned int reg, in dspio_send() argument
1904 res = snd_hda_codec_read(codec, WIDGET_DSP_CTRL, 0, reg, data); in dspio_send()
1916 static void dspio_write_wait(struct hda_codec *codec) in dspio_write_wait() argument
1922 status = snd_hda_codec_read(codec, WIDGET_DSP_CTRL, 0, in dspio_write_wait()
1934 static int dspio_write(struct hda_codec *codec, unsigned int scp_data) in dspio_write() argument
1936 struct ca0132_spec *spec = codec->spec; in dspio_write()
1939 dspio_write_wait(codec); in dspio_write()
1942 status = dspio_send(codec, VENDOR_DSPIO_SCP_WRITE_DATA_LOW, in dspio_write()
1947 status = dspio_send(codec, VENDOR_DSPIO_SCP_WRITE_DATA_HIGH, in dspio_write()
1953 status = snd_hda_codec_read(codec, WIDGET_DSP_CTRL, 0, in dspio_write()
1965 static int dspio_write_multiple(struct hda_codec *codec, in dspio_write_multiple() argument
1976 status = dspio_write(codec, *buffer++); in dspio_write_multiple()
1985 static int dspio_read(struct hda_codec *codec, unsigned int *data) in dspio_read() argument
1989 status = dspio_send(codec, VENDOR_DSPIO_SCP_POST_READ_DATA, 0); in dspio_read()
1993 status = dspio_send(codec, VENDOR_DSPIO_STATUS, 0); in dspio_read()
1998 *data = snd_hda_codec_read(codec, WIDGET_DSP_CTRL, 0, in dspio_read()
2004 static int dspio_read_multiple(struct hda_codec *codec, unsigned int *buffer, in dspio_read_multiple() argument
2018 status = dspio_read(codec, buffer++); in dspio_read_multiple()
2027 status = dspio_read(codec, &dummy); in dspio_read_multiple()
2097 static void dspio_clear_response_queue(struct hda_codec *codec) in dspio_clear_response_queue() argument
2105 status = dspio_read(codec, &dummy); in dspio_clear_response_queue()
2109 static int dspio_get_response_data(struct hda_codec *codec) in dspio_get_response_data() argument
2111 struct ca0132_spec *spec = codec->spec; in dspio_get_response_data()
2115 if (dspio_read(codec, &data) < 0) in dspio_get_response_data()
2122 dspio_read_multiple(codec, spec->scp_resp_data, in dspio_get_response_data()
2133 static int dspio_send_scp_message(struct hda_codec *codec, in dspio_send_scp_message() argument
2140 struct ca0132_spec *spec = codec->spec; in dspio_send_scp_message()
2179 status = dspio_write_multiple(codec, (unsigned int *)send_buf, in dspio_send_scp_message()
2211 * @codec: the HDA codec
2223 static int dspio_scp(struct hda_codec *codec, in dspio_scp() argument
2240 codec_dbg(codec, "dspio_scp get but has no buffer\n"); in dspio_scp()
2245 codec_dbg(codec, "dspio_scp bad resp buf len parms\n"); in dspio_scp()
2258 status = dspio_send_scp_message(codec, (unsigned char *)&scp_send, in dspio_scp()
2263 codec_dbg(codec, "dspio_scp: send scp msg failed\n"); in dspio_scp()
2282 codec_dbg(codec, "reply too long for buf\n"); in dspio_scp()
2285 codec_dbg(codec, "RetLen and HdrLen .NE.\n"); in dspio_scp()
2288 codec_dbg(codec, "NULL reply\n"); in dspio_scp()
2295 codec_dbg(codec, "reply ill-formed or errflag set\n"); in dspio_scp()
2305 static int dspio_set_param(struct hda_codec *codec, int mod_id, in dspio_set_param() argument
2308 return dspio_scp(codec, mod_id, src_id, req, SCP_SET, data, len, NULL, in dspio_set_param()
2312 static int dspio_set_uint_param(struct hda_codec *codec, int mod_id, in dspio_set_uint_param() argument
2315 return dspio_set_param(codec, mod_id, 0x20, req, &data, in dspio_set_uint_param()
2319 static int dspio_set_uint_param_no_source(struct hda_codec *codec, int mod_id, in dspio_set_uint_param_no_source() argument
2322 return dspio_set_param(codec, mod_id, 0x00, req, &data, in dspio_set_uint_param_no_source()
2329 static int dspio_alloc_dma_chan(struct hda_codec *codec, unsigned int *dma_chan) in dspio_alloc_dma_chan() argument
2334 codec_dbg(codec, " dspio_alloc_dma_chan() -- begin\n"); in dspio_alloc_dma_chan()
2335 status = dspio_scp(codec, MASTERCONTROL, 0x20, in dspio_alloc_dma_chan()
2340 codec_dbg(codec, "dspio_alloc_dma_chan: SCP Failed\n"); in dspio_alloc_dma_chan()
2345 codec_dbg(codec, "no free dma channels to allocate\n"); in dspio_alloc_dma_chan()
2349 codec_dbg(codec, "dspio_alloc_dma_chan: chan=%d\n", *dma_chan); in dspio_alloc_dma_chan()
2350 codec_dbg(codec, " dspio_alloc_dma_chan() -- complete\n"); in dspio_alloc_dma_chan()
2358 static int dspio_free_dma_chan(struct hda_codec *codec, unsigned int dma_chan) in dspio_free_dma_chan() argument
2363 codec_dbg(codec, " dspio_free_dma_chan() -- begin\n"); in dspio_free_dma_chan()
2364 codec_dbg(codec, "dspio_free_dma_chan: chan=%d\n", dma_chan); in dspio_free_dma_chan()
2366 status = dspio_scp(codec, MASTERCONTROL, 0x20, in dspio_free_dma_chan()
2371 codec_dbg(codec, "dspio_free_dma_chan: SCP Failed\n"); in dspio_free_dma_chan()
2375 codec_dbg(codec, " dspio_free_dma_chan() -- complete\n"); in dspio_free_dma_chan()
2383 static int dsp_set_run_state(struct hda_codec *codec) in dsp_set_run_state() argument
2389 err = chipio_read(codec, DSP_DBGCNTL_INST_OFFSET, &dbg_ctrl_reg); in dsp_set_run_state()
2399 err = chipio_write(codec, DSP_DBGCNTL_INST_OFFSET, in dsp_set_run_state()
2406 err = chipio_write(codec, DSP_DBGCNTL_INST_OFFSET, in dsp_set_run_state()
2418 static int dsp_reset(struct hda_codec *codec) in dsp_reset() argument
2423 codec_dbg(codec, "dsp_reset\n"); in dsp_reset()
2425 res = dspio_send(codec, VENDOR_DSPIO_DSP_INIT, 0); in dsp_reset()
2430 codec_dbg(codec, "dsp_reset timeout\n"); in dsp_reset()
2461 static bool dsp_is_dma_active(struct hda_codec *codec, unsigned int dma_chan) in dsp_is_dma_active() argument
2465 chipio_read(codec, DSPDMAC_CHNLSTART_INST_OFFSET, &dma_chnlstart_reg); in dsp_is_dma_active()
2471 static int dsp_dma_setup_common(struct hda_codec *codec, in dsp_dma_setup_common() argument
2483 codec_dbg(codec, "-- dsp_dma_setup_common() -- Begin ---------\n"); in dsp_dma_setup_common()
2486 codec_dbg(codec, "dma chan num invalid\n"); in dsp_dma_setup_common()
2490 if (dsp_is_dma_active(codec, dma_chan)) { in dsp_dma_setup_common()
2491 codec_dbg(codec, "dma already active\n"); in dsp_dma_setup_common()
2498 codec_dbg(codec, "invalid chip addr\n"); in dsp_dma_setup_common()
2505 codec_dbg(codec, " dsp_dma_setup_common() start reg pgm\n"); in dsp_dma_setup_common()
2508 status = chipio_read(codec, DSPDMAC_CHNLPROP_INST_OFFSET, in dsp_dma_setup_common()
2512 codec_dbg(codec, "read CHNLPROP Reg fail\n"); in dsp_dma_setup_common()
2515 codec_dbg(codec, "dsp_dma_setup_common() Read CHNLPROP\n"); in dsp_dma_setup_common()
2525 status = chipio_write(codec, DSPDMAC_CHNLPROP_INST_OFFSET, chnl_prop); in dsp_dma_setup_common()
2527 codec_dbg(codec, "write CHNLPROP Reg fail\n"); in dsp_dma_setup_common()
2530 codec_dbg(codec, " dsp_dma_setup_common() Write CHNLPROP\n"); in dsp_dma_setup_common()
2533 status = chipio_read(codec, DSPDMAC_ACTIVE_INST_OFFSET, in dsp_dma_setup_common()
2537 codec_dbg(codec, "read ACTIVE Reg fail\n"); in dsp_dma_setup_common()
2540 codec_dbg(codec, "dsp_dma_setup_common() Read ACTIVE\n"); in dsp_dma_setup_common()
2546 status = chipio_write(codec, DSPDMAC_ACTIVE_INST_OFFSET, active); in dsp_dma_setup_common()
2548 codec_dbg(codec, "write ACTIVE Reg fail\n"); in dsp_dma_setup_common()
2552 codec_dbg(codec, " dsp_dma_setup_common() Write ACTIVE\n"); in dsp_dma_setup_common()
2554 status = chipio_write(codec, DSPDMAC_AUDCHSEL_INST_OFFSET(dma_chan), in dsp_dma_setup_common()
2557 codec_dbg(codec, "write AUDCHSEL Reg fail\n"); in dsp_dma_setup_common()
2560 codec_dbg(codec, " dsp_dma_setup_common() Write AUDCHSEL\n"); in dsp_dma_setup_common()
2562 status = chipio_write(codec, DSPDMAC_IRQCNT_INST_OFFSET(dma_chan), in dsp_dma_setup_common()
2565 codec_dbg(codec, "write IRQCNT Reg fail\n"); in dsp_dma_setup_common()
2568 codec_dbg(codec, " dsp_dma_setup_common() Write IRQCNT\n"); in dsp_dma_setup_common()
2570 codec_dbg(codec, in dsp_dma_setup_common()
2576 codec_dbg(codec, "-- dsp_dma_setup_common() -- Complete ------\n"); in dsp_dma_setup_common()
2584 static int dsp_dma_setup(struct hda_codec *codec, in dsp_dma_setup() argument
2602 codec_dbg(codec, "-- dsp_dma_setup() -- Begin ---------\n"); in dsp_dma_setup()
2605 codec_dbg(codec, "count too big\n"); in dsp_dma_setup()
2611 codec_dbg(codec, "invalid chip addr\n"); in dsp_dma_setup()
2615 codec_dbg(codec, " dsp_dma_setup() start reg pgm\n"); in dsp_dma_setup()
2629 status = chipio_write(codec, DSPDMAC_DMACFG_INST_OFFSET(dma_chan), in dsp_dma_setup()
2632 codec_dbg(codec, "write DMACFG Reg fail\n"); in dsp_dma_setup()
2635 codec_dbg(codec, " dsp_dma_setup() Write DMACFG\n"); in dsp_dma_setup()
2640 status = chipio_write(codec, DSPDMAC_DSPADROFS_INST_OFFSET(dma_chan), in dsp_dma_setup()
2643 codec_dbg(codec, "write DSPADROFS Reg fail\n"); in dsp_dma_setup()
2646 codec_dbg(codec, " dsp_dma_setup() Write DSPADROFS\n"); in dsp_dma_setup()
2654 status = chipio_write(codec, in dsp_dma_setup()
2657 codec_dbg(codec, "write XFRCNT Reg fail\n"); in dsp_dma_setup()
2660 codec_dbg(codec, " dsp_dma_setup() Write XFRCNT\n"); in dsp_dma_setup()
2662 codec_dbg(codec, in dsp_dma_setup()
2667 codec_dbg(codec, "-- dsp_dma_setup() -- Complete ---------\n"); in dsp_dma_setup()
2675 static int dsp_dma_start(struct hda_codec *codec, in dsp_dma_start() argument
2681 codec_dbg(codec, "-- dsp_dma_start() -- Begin ---------\n"); in dsp_dma_start()
2684 status = chipio_read(codec, in dsp_dma_start()
2688 codec_dbg(codec, "read CHNLSTART reg fail\n"); in dsp_dma_start()
2691 codec_dbg(codec, "-- dsp_dma_start() Read CHNLSTART\n"); in dsp_dma_start()
2697 status = chipio_write(codec, DSPDMAC_CHNLSTART_INST_OFFSET, in dsp_dma_start()
2700 codec_dbg(codec, "write CHNLSTART reg fail\n"); in dsp_dma_start()
2703 codec_dbg(codec, "-- dsp_dma_start() -- Complete ---------\n"); in dsp_dma_start()
2711 static int dsp_dma_stop(struct hda_codec *codec, in dsp_dma_stop() argument
2717 codec_dbg(codec, "-- dsp_dma_stop() -- Begin ---------\n"); in dsp_dma_stop()
2720 status = chipio_read(codec, in dsp_dma_stop()
2724 codec_dbg(codec, "read CHNLSTART reg fail\n"); in dsp_dma_stop()
2727 codec_dbg(codec, "-- dsp_dma_stop() Read CHNLSTART\n"); in dsp_dma_stop()
2732 status = chipio_write(codec, DSPDMAC_CHNLSTART_INST_OFFSET, in dsp_dma_stop()
2735 codec_dbg(codec, "write CHNLSTART reg fail\n"); in dsp_dma_stop()
2738 codec_dbg(codec, "-- dsp_dma_stop() -- Complete ---------\n"); in dsp_dma_stop()
2746 * @codec: the HDA codec
2754 static int dsp_allocate_router_ports(struct hda_codec *codec, in dsp_allocate_router_ports() argument
2764 status = chipio_send(codec, VENDOR_CHIPIO_STATUS, 0); in dsp_allocate_router_ports()
2772 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in dsp_allocate_router_ports()
2776 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in dsp_allocate_router_ports()
2780 status = chipio_send(codec, VENDOR_CHIPIO_STATUS, 0); in dsp_allocate_router_ports()
2784 res = snd_hda_codec_read(codec, WIDGET_CHIP_CTRL, 0, in dsp_allocate_router_ports()
2795 static int dsp_free_router_ports(struct hda_codec *codec) in dsp_free_router_ports() argument
2799 status = chipio_send(codec, VENDOR_CHIPIO_STATUS, 0); in dsp_free_router_ports()
2803 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in dsp_free_router_ports()
2807 status = chipio_send(codec, VENDOR_CHIPIO_STATUS, 0); in dsp_free_router_ports()
2815 static int dsp_allocate_ports(struct hda_codec *codec, in dsp_allocate_ports() argument
2821 codec_dbg(codec, " dsp_allocate_ports() -- begin\n"); in dsp_allocate_ports()
2824 codec_dbg(codec, "bad rate multiple\n"); in dsp_allocate_ports()
2828 status = dsp_allocate_router_ports(codec, num_chans, in dsp_allocate_ports()
2831 codec_dbg(codec, " dsp_allocate_ports() -- complete\n"); in dsp_allocate_ports()
2836 static int dsp_allocate_ports_format(struct hda_codec *codec, in dsp_allocate_ports_format() argument
2848 codec_dbg(codec, "bad rate multiple\n"); in dsp_allocate_ports_format()
2854 status = dsp_allocate_ports(codec, num_chans, rate_multi, port_map); in dsp_allocate_ports_format()
2862 static int dsp_free_ports(struct hda_codec *codec) in dsp_free_ports() argument
2866 codec_dbg(codec, " dsp_free_ports() -- begin\n"); in dsp_free_ports()
2868 status = dsp_free_router_ports(codec); in dsp_free_ports()
2870 codec_dbg(codec, "free router ports fail\n"); in dsp_free_ports()
2873 codec_dbg(codec, " dsp_free_ports() -- complete\n"); in dsp_free_ports()
2882 struct hda_codec *codec; member
2894 static int dma_convert_to_hda_format(struct hda_codec *codec, in dma_convert_to_hda_format() argument
2915 struct hda_codec *codec = dma->codec; in dma_reset() local
2916 struct ca0132_spec *spec = codec->spec; in dma_reset()
2920 snd_hda_codec_load_dsp_cleanup(codec, dma->dmab); in dma_reset()
2922 status = snd_hda_codec_load_dsp_prepare(codec, in dma_reset()
2947 snd_hda_codec_load_dsp_trigger(dma->codec, cmd); in dma_set_state()
2979 struct ca0132_spec *spec = dma->codec->spec; in dma_get_stream_id()
3030 static int dspxfr_hci_write(struct hda_codec *codec, in dspxfr_hci_write() argument
3038 codec_dbg(codec, "hci_write invalid params\n"); in dspxfr_hci_write()
3045 status = chipio_write(codec, data[0], data[1]); in dspxfr_hci_write()
3047 codec_dbg(codec, "hci_write chipio failed\n"); in dspxfr_hci_write()
3060 * @codec: the HDA codec
3071 static int dspxfr_one_seg(struct hda_codec *codec, in dspxfr_one_seg() argument
3107 codec_dbg(codec, "hci_write\n"); in dspxfr_one_seg()
3108 return dspxfr_hci_write(codec, hci_write); in dspxfr_one_seg()
3112 codec_dbg(codec, "Invalid Params\n"); in dspxfr_one_seg()
3121 return hci_write ? dspxfr_hci_write(codec, hci_write) : 0; in dspxfr_one_seg()
3128 codec_dbg(codec, "Invalid chip_addx Params\n"); in dspxfr_one_seg()
3138 codec_dbg(codec, "dma_engine buffer NULL\n"); in dspxfr_one_seg()
3151 codec_dbg(codec, "frmsz zero\n"); in dspxfr_one_seg()
3159 codec_dbg(codec, in dspxfr_one_seg()
3166 codec_dbg(codec, "dspxfr_one_seg:failed\n"); in dspxfr_one_seg()
3180 codec_dbg(codec, "dspxfr (seg loop)cnt=%u rs=%u remainder=%u\n", in dspxfr_one_seg()
3184 status = dsp_dma_stop(codec, dma_chan, ovly); in dspxfr_one_seg()
3187 status = dsp_dma_setup_common(codec, chip_addx, in dspxfr_one_seg()
3194 status = dsp_dma_setup(codec, chip_addx, in dspxfr_one_seg()
3198 status = dsp_dma_start(codec, dma_chan, ovly); in dspxfr_one_seg()
3201 if (!dsp_is_dma_active(codec, dma_chan)) { in dspxfr_one_seg()
3202 codec_dbg(codec, "dspxfr:DMA did not start\n"); in dspxfr_one_seg()
3209 status = chipio_write_multiple(codec, in dspxfr_one_seg()
3218 status = dspxfr_hci_write(codec, hci_write); in dspxfr_one_seg()
3226 dma_active = dsp_is_dma_active(codec, dma_chan); in dspxfr_one_seg()
3234 codec_dbg(codec, "+++++ DMA complete\n"); in dspxfr_one_seg()
3247 status = chipio_write_multiple(codec, chip_addx_remainder, in dspxfr_one_seg()
3257 * @codec: the HDA codec
3267 static int dspxfr_image(struct hda_codec *codec, in dspxfr_image() argument
3274 struct ca0132_spec *spec = codec->spec; in dspxfr_image()
3296 dma_engine->codec = codec; in dspxfr_image()
3297 dma_convert_to_hda_format(codec, sample_rate, channels, &hda_format); in dspxfr_image()
3304 status = codec_set_converter_format(codec, WIDGET_CHIP_CTRL, in dspxfr_image()
3308 codec_dbg(codec, "set converter format fail\n"); in dspxfr_image()
3312 status = snd_hda_codec_load_dsp_prepare(codec, in dspxfr_image()
3321 status = dspio_alloc_dma_chan(codec, &dma_chan); in dspxfr_image()
3323 codec_dbg(codec, "alloc dmachan fail\n"); in dspxfr_image()
3330 status = dsp_allocate_ports_format(codec, hda_format, in dspxfr_image()
3333 codec_dbg(codec, "alloc ports fail\n"); in dspxfr_image()
3338 status = codec_set_converter_stream_channel(codec, in dspxfr_image()
3341 codec_dbg(codec, "set stream chan fail\n"); in dspxfr_image()
3347 codec_dbg(codec, "FLS check fail\n"); in dspxfr_image()
3351 status = dspxfr_one_seg(codec, fls_data, reloc, in dspxfr_image()
3365 status = dsp_free_ports(codec); in dspxfr_image()
3370 status = codec_set_converter_stream_channel(codec, in dspxfr_image()
3375 dspio_free_dma_chan(codec, dma_chan); in dspxfr_image()
3378 snd_hda_codec_load_dsp_cleanup(codec, dma_engine->dmab); in dspxfr_image()
3388 static void dspload_post_setup(struct hda_codec *codec) in dspload_post_setup() argument
3390 struct ca0132_spec *spec = codec->spec; in dspload_post_setup()
3391 codec_dbg(codec, "---- dspload_post_setup ------\n"); in dspload_post_setup()
3394 chipio_write(codec, XRAM_XRAM_INST_OFFSET(0x18), 0x08080080); in dspload_post_setup()
3395 chipio_write(codec, XRAM_XRAM_INST_OFFSET(0x19), 0x3f800000); in dspload_post_setup()
3398 chipio_write(codec, XRAM_XRAM_INST_OFFSET(0x29), 0x00000002); in dspload_post_setup()
3405 * @codec: the HDA codec
3420 static int dspload_image(struct hda_codec *codec, in dspload_image() argument
3431 codec_dbg(codec, "---- dspload_image begin ------\n"); in dspload_image()
3448 codec_dbg(codec, "Ready to program DMA\n"); in dspload_image()
3450 status = dsp_reset(codec); in dspload_image()
3455 codec_dbg(codec, "dsp_reset() complete\n"); in dspload_image()
3456 status = dspxfr_image(codec, fls, reloc, sample_rate, channels, in dspload_image()
3462 codec_dbg(codec, "dspxfr_image() complete\n"); in dspload_image()
3464 dspload_post_setup(codec); in dspload_image()
3465 status = dsp_set_run_state(codec); in dspload_image()
3468 codec_dbg(codec, "LOAD FINISHED\n"); in dspload_image()
3475 static bool dspload_is_loaded(struct hda_codec *codec) in dspload_is_loaded() argument
3480 status = chipio_read(codec, 0x40004, &data); in dspload_is_loaded()
3487 #define dspload_is_loaded(codec) false argument
3490 static bool dspload_wait_loaded(struct hda_codec *codec) in dspload_wait_loaded() argument
3495 if (dspload_is_loaded(codec)) { in dspload_wait_loaded()
3496 codec_info(codec, "ca0132 DSP downloaded and running\n"); in dspload_wait_loaded()
3502 codec_err(codec, "ca0132 failed to download DSP\n"); in dspload_wait_loaded()
3521 static void ca0113_mmio_gpio_set(struct hda_codec *codec, unsigned int gpio_pin, in ca0113_mmio_gpio_set() argument
3524 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_gpio_set()
3541 static void ca0113_mmio_command_set(struct hda_codec *codec, unsigned int group, in ca0113_mmio_command_set() argument
3544 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_command_set()
3580 static void ca0113_mmio_command_set_type2(struct hda_codec *codec, in ca0113_mmio_command_set_type2() argument
3583 struct ca0132_spec *spec = codec->spec; in ca0113_mmio_command_set_type2()
3620 static void ca0132_gpio_init(struct hda_codec *codec) in ca0132_gpio_init() argument
3622 struct ca0132_spec *spec = codec->spec; in ca0132_gpio_init()
3628 snd_hda_codec_write(codec, 0x01, 0, 0x793, 0x00); in ca0132_gpio_init()
3629 snd_hda_codec_write(codec, 0x01, 0, 0x794, 0x53); in ca0132_gpio_init()
3630 snd_hda_codec_write(codec, 0x01, 0, 0x790, 0x23); in ca0132_gpio_init()
3633 snd_hda_codec_write(codec, 0x01, 0, 0x793, 0x00); in ca0132_gpio_init()
3634 snd_hda_codec_write(codec, 0x01, 0, 0x794, 0x5B); in ca0132_gpio_init()
3643 static void ca0132_gpio_setup(struct hda_codec *codec) in ca0132_gpio_setup() argument
3645 struct ca0132_spec *spec = codec->spec; in ca0132_gpio_setup()
3649 snd_hda_codec_write(codec, 0x01, 0, in ca0132_gpio_setup()
3651 snd_hda_codec_write(codec, 0x01, 0, in ca0132_gpio_setup()
3653 snd_hda_codec_write(codec, 0x01, 0, in ca0132_gpio_setup()
3655 snd_hda_codec_write(codec, 0x01, 0, in ca0132_gpio_setup()
3659 snd_hda_codec_write(codec, 0x01, 0, in ca0132_gpio_setup()
3661 snd_hda_codec_write(codec, 0x01, 0, in ca0132_gpio_setup()
3663 snd_hda_codec_write(codec, 0x01, 0, in ca0132_gpio_setup()
3713 static void r3di_gpio_mic_set(struct hda_codec *codec, in r3di_gpio_mic_set() argument
3719 cur_gpio = snd_hda_codec_read(codec, 0x01, 0, AC_VERB_GET_GPIO_DATA, 0); in r3di_gpio_mic_set()
3729 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_mic_set()
3733 static void r3di_gpio_dsp_status_set(struct hda_codec *codec, in r3di_gpio_dsp_status_set() argument
3739 cur_gpio = snd_hda_codec_read(codec, 0x01, 0, AC_VERB_GET_GPIO_DATA, 0); in r3di_gpio_dsp_status_set()
3744 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3751 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3758 snd_hda_codec_write(codec, codec->core.afg, 0, in r3di_gpio_dsp_status_set()
3766 struct hda_codec *codec, in ca0132_playback_pcm_prepare() argument
3771 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_prepare()
3773 snd_hda_codec_setup_stream(codec, spec->dacs[0], stream_tag, 0, format); in ca0132_playback_pcm_prepare()
3779 struct hda_codec *codec, in ca0132_playback_pcm_cleanup() argument
3782 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_cleanup()
3792 snd_hda_codec_cleanup_stream(codec, spec->dacs[0]); in ca0132_playback_pcm_cleanup()
3798 struct hda_codec *codec, in ca0132_playback_pcm_delay() argument
3801 struct ca0132_spec *spec = codec->spec; in ca0132_playback_pcm_delay()
3826 struct hda_codec *codec, in ca0132_dig_playback_pcm_open() argument
3829 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_open()
3830 return snd_hda_multi_out_dig_open(codec, &spec->multiout); in ca0132_dig_playback_pcm_open()
3834 struct hda_codec *codec, in ca0132_dig_playback_pcm_prepare() argument
3839 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_prepare()
3840 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, in ca0132_dig_playback_pcm_prepare()
3845 struct hda_codec *codec, in ca0132_dig_playback_pcm_cleanup() argument
3848 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_cleanup()
3849 return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); in ca0132_dig_playback_pcm_cleanup()
3853 struct hda_codec *codec, in ca0132_dig_playback_pcm_close() argument
3856 struct ca0132_spec *spec = codec->spec; in ca0132_dig_playback_pcm_close()
3857 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in ca0132_dig_playback_pcm_close()
3864 struct hda_codec *codec, in ca0132_capture_pcm_prepare() argument
3869 snd_hda_codec_setup_stream(codec, hinfo->nid, in ca0132_capture_pcm_prepare()
3876 struct hda_codec *codec, in ca0132_capture_pcm_cleanup() argument
3879 struct ca0132_spec *spec = codec->spec; in ca0132_capture_pcm_cleanup()
3884 snd_hda_codec_cleanup_stream(codec, hinfo->nid); in ca0132_capture_pcm_cleanup()
3889 struct hda_codec *codec, in ca0132_capture_pcm_delay() argument
3892 struct ca0132_spec *spec = codec->spec; in ca0132_capture_pcm_delay()
4102 static int tuning_ctl_set(struct hda_codec *codec, hda_nid_t nid, in tuning_ctl_set() argument
4111 snd_hda_power_up(codec); in tuning_ctl_set()
4112 dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20, in tuning_ctl_set()
4115 snd_hda_power_down(codec); in tuning_ctl_set()
4123 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in tuning_ctl_get() local
4124 struct ca0132_spec *spec = codec->spec; in tuning_ctl_get()
4149 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in voice_focus_ctl_put() local
4150 struct ca0132_spec *spec = codec->spec; in voice_focus_ctl_put()
4163 tuning_ctl_set(codec, nid, voice_focus_vals_lookup, idx); in voice_focus_ctl_put()
4184 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in mic_svm_ctl_put() local
4185 struct ca0132_spec *spec = codec->spec; in mic_svm_ctl_put()
4198 tuning_ctl_set(codec, nid, mic_svm_vals_lookup, idx); in mic_svm_ctl_put()
4219 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in equalizer_ctl_put() local
4220 struct ca0132_spec *spec = codec->spec; in equalizer_ctl_put()
4233 tuning_ctl_set(codec, nid, equalizer_vals_lookup, idx); in equalizer_ctl_put()
4241 static int add_tuning_control(struct hda_codec *codec, in add_tuning_control() argument
4278 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec)); in add_tuning_control()
4281 static int add_tuning_ctls(struct hda_codec *codec) in add_tuning_ctls() argument
4287 err = add_tuning_control(codec, in add_tuning_ctls()
4299 static void ca0132_init_tuning_defaults(struct hda_codec *codec) in ca0132_init_tuning_defaults() argument
4301 struct ca0132_spec *spec = codec->spec; in ca0132_init_tuning_defaults()
4321 static int ca0132_select_out(struct hda_codec *codec) in ca0132_select_out() argument
4323 struct ca0132_spec *spec = codec->spec; in ca0132_select_out()
4330 codec_dbg(codec, "ca0132_select_out\n"); in ca0132_select_out()
4332 snd_hda_power_up_pm(codec); in ca0132_select_out()
4337 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_hp); in ca0132_select_out()
4348 codec_dbg(codec, "ca0132_select_out speaker\n"); in ca0132_select_out()
4351 err = dspio_set_uint_param(codec, 0x80, 0x04, tmp); in ca0132_select_out()
4356 err = dspio_set_uint_param(codec, 0x8f, 0x00, tmp); in ca0132_select_out()
4361 snd_hda_codec_write(codec, spec->out_pins[1], 0, in ca0132_select_out()
4363 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4365 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4367 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4371 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, in ca0132_select_out()
4373 snd_hda_set_pin_ctl(codec, spec->out_pins[1], in ca0132_select_out()
4376 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, in ca0132_select_out()
4378 snd_hda_set_pin_ctl(codec, spec->out_pins[0], in ca0132_select_out()
4381 codec_dbg(codec, "ca0132_select_out hp\n"); in ca0132_select_out()
4384 err = dspio_set_uint_param(codec, 0x80, 0x04, tmp); in ca0132_select_out()
4389 err = dspio_set_uint_param(codec, 0x8f, 0x00, tmp); in ca0132_select_out()
4394 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4396 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4398 snd_hda_codec_write(codec, spec->out_pins[1], 0, in ca0132_select_out()
4400 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_select_out()
4404 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[0], 0, in ca0132_select_out()
4406 snd_hda_set_pin_ctl(codec, spec->out_pins[0], in ca0132_select_out()
4409 pin_ctl = snd_hda_codec_read(codec, spec->out_pins[1], 0, in ca0132_select_out()
4411 snd_hda_set_pin_ctl(codec, spec->out_pins[1], in ca0132_select_out()
4416 snd_hda_power_down_pm(codec); in ca0132_select_out()
4421 static int ae5_headphone_gain_set(struct hda_codec *codec, long val);
4422 static int zxr_headphone_gain_set(struct hda_codec *codec, long val);
4423 static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val);
4425 static void ae5_mmio_select_out(struct hda_codec *codec) in ae5_mmio_select_out() argument
4427 struct ca0132_spec *spec = codec->spec; in ae5_mmio_select_out()
4437 ca0113_mmio_command_set(codec, out_cmds->group[i], in ae5_mmio_select_out()
4442 static int ca0132_alt_set_full_range_speaker(struct hda_codec *codec) in ca0132_alt_set_full_range_speaker() argument
4444 struct ca0132_spec *spec = codec->spec; in ca0132_alt_set_full_range_speaker()
4456 err = dspio_set_uint_param(codec, 0x96, in ca0132_alt_set_full_range_speaker()
4463 err = dspio_set_uint_param(codec, 0x96, in ca0132_alt_set_full_range_speaker()
4468 err = dspio_set_uint_param(codec, 0x96, in ca0132_alt_set_full_range_speaker()
4478 err = dspio_set_uint_param(codec, 0x96, in ca0132_alt_set_full_range_speaker()
4487 static int ca0132_alt_surround_set_bass_redirection(struct hda_codec *codec, in ca0132_alt_surround_set_bass_redirection() argument
4490 struct ca0132_spec *spec = codec->spec; in ca0132_alt_surround_set_bass_redirection()
4500 err = dspio_set_uint_param(codec, 0x96, SPEAKER_BASS_REDIRECT, tmp); in ca0132_alt_surround_set_bass_redirection()
4507 err = dspio_set_uint_param(codec, 0x96, in ca0132_alt_surround_set_bass_redirection()
4520 static void ca0132_alt_select_out_get_quirk_data(struct hda_codec *codec, in ca0132_alt_select_out_get_quirk_data() argument
4523 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out_get_quirk_data()
4536 static int ca0132_alt_select_out_quirk_set(struct hda_codec *codec) in ca0132_alt_select_out_quirk_set() argument
4540 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out_quirk_set()
4544 ca0132_alt_select_out_get_quirk_data(codec, &quirk_data); in ca0132_alt_select_out_quirk_set()
4550 ae5_mmio_select_out(codec); in ca0132_alt_select_out_quirk_set()
4553 gpio_data = snd_hda_codec_read(codec, codec->core.afg, 0, in ca0132_alt_select_out_quirk_set()
4561 snd_hda_codec_write(codec, codec->core.afg, 0, in ca0132_alt_select_out_quirk_set()
4567 ca0113_mmio_gpio_set(codec, out_info->mmio_gpio_pin[i], in ca0132_alt_select_out_quirk_set()
4574 err = dspio_set_uint_param(codec, in ca0132_alt_select_out_quirk_set()
4583 chipio_set_control_param(codec, 0x0d, out_info->dac2port); in ca0132_alt_select_out_quirk_set()
4586 chipio_write(codec, out_info->chipio_write_addr, in ca0132_alt_select_out_quirk_set()
4593 ae5_headphone_gain_set(codec, 2); in ca0132_alt_select_out_quirk_set()
4595 zxr_headphone_gain_set(codec, 0); in ca0132_alt_select_out_quirk_set()
4598 ae5_headphone_gain_set(codec, in ca0132_alt_select_out_quirk_set()
4601 zxr_headphone_gain_set(codec, in ca0132_alt_select_out_quirk_set()
4609 static void ca0132_set_out_node_pincfg(struct hda_codec *codec, hda_nid_t nid, in ca0132_set_out_node_pincfg() argument
4614 pin_ctl = snd_hda_codec_read(codec, nid, 0, in ca0132_set_out_node_pincfg()
4619 snd_hda_set_pin_ctl(codec, nid, pin_ctl); in ca0132_set_out_node_pincfg()
4630 static int ca0132_alt_select_out(struct hda_codec *codec) in ca0132_alt_select_out() argument
4632 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_out()
4640 codec_dbg(codec, "%s\n", __func__); in ca0132_alt_select_out()
4642 snd_hda_power_up_pm(codec); in ca0132_alt_select_out()
4652 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_hp) || in ca0132_alt_select_out()
4653 snd_hda_jack_detect(codec, spec->unsol_tag_front_hp); in ca0132_alt_select_out()
4665 err = dspio_set_uint_param(codec, 0x96, SPEAKER_TUNING_MUTE, FLOAT_ONE); in ca0132_alt_select_out()
4669 if (ca0132_alt_select_out_quirk_set(codec) < 0) in ca0132_alt_select_out()
4674 codec_dbg(codec, "%s speaker\n", __func__); in ca0132_alt_select_out()
4677 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_alt_select_out()
4681 ca0132_set_out_node_pincfg(codec, spec->out_pins[1], 0, 0); in ca0132_alt_select_out()
4683 ca0132_set_out_node_pincfg(codec, spec->out_pins[0], 1, 0); in ca0132_alt_select_out()
4685 ca0132_set_out_node_pincfg(codec, spec->out_pins[2], 1, 0); in ca0132_alt_select_out()
4687 ca0132_set_out_node_pincfg(codec, spec->out_pins[3], 1, 0); in ca0132_alt_select_out()
4699 err = dspio_set_uint_param(codec, 0x80, 0x04, tmp); in ca0132_alt_select_out()
4705 codec_dbg(codec, "%s hp\n", __func__); in ca0132_alt_select_out()
4706 snd_hda_codec_write(codec, spec->out_pins[0], 0, in ca0132_alt_select_out()
4710 ca0132_set_out_node_pincfg(codec, spec->out_pins[0], 0, 0); in ca0132_alt_select_out()
4711 ca0132_set_out_node_pincfg(codec, spec->out_pins[2], 0, 0); in ca0132_alt_select_out()
4712 ca0132_set_out_node_pincfg(codec, spec->out_pins[3], 0, 0); in ca0132_alt_select_out()
4715 if (snd_hda_jack_detect(codec, spec->unsol_tag_front_hp)) in ca0132_alt_select_out()
4717 else if (snd_hda_jack_detect(codec, spec->unsol_tag_hp)) in ca0132_alt_select_out()
4720 ca0132_set_out_node_pincfg(codec, headphone_nid, 1, 1); in ca0132_alt_select_out()
4723 err = dspio_set_uint_param(codec, 0x80, 0x04, FLOAT_ONE); in ca0132_alt_select_out()
4725 err = dspio_set_uint_param(codec, 0x80, 0x04, FLOAT_ZERO); in ca0132_alt_select_out()
4737 ca0132_effects_set(codec, X_BASS, in ca0132_alt_select_out()
4741 err = dspio_set_uint_param(codec, 0x8f, 0x01, FLOAT_ZERO); in ca0132_alt_select_out()
4749 err = dspio_set_uint_param(codec, 0x96, in ca0132_alt_select_out()
4755 err = ca0132_alt_surround_set_bass_redirection(codec, in ca0132_alt_select_out()
4758 err = ca0132_alt_surround_set_bass_redirection(codec, 0); in ca0132_alt_select_out()
4761 err = dspio_set_uint_param(codec, 0x96, in ca0132_alt_select_out()
4767 err = ca0132_alt_set_full_range_speaker(codec); in ca0132_alt_select_out()
4773 snd_hda_power_down_pm(codec); in ca0132_alt_select_out()
4785 ca0132_alt_select_out(spec->codec); in ca0132_unsol_hp_delayed()
4787 ca0132_select_out(spec->codec); in ca0132_unsol_hp_delayed()
4789 jack = snd_hda_jack_tbl_get(spec->codec, spec->unsol_tag_hp); in ca0132_unsol_hp_delayed()
4792 snd_hda_jack_report_sync(spec->codec); in ca0132_unsol_hp_delayed()
4796 static void ca0132_set_dmic(struct hda_codec *codec, int enable);
4797 static int ca0132_mic_boost_set(struct hda_codec *codec, long val);
4798 static void resume_mic1(struct hda_codec *codec, unsigned int oldval);
4799 static int stop_mic1(struct hda_codec *codec);
4800 static int ca0132_cvoice_switch_set(struct hda_codec *codec);
4801 static int ca0132_alt_mic_boost_set(struct hda_codec *codec, long val);
4806 static int ca0132_set_vipsource(struct hda_codec *codec, int val) in ca0132_set_vipsource() argument
4808 struct ca0132_spec *spec = codec->spec; in ca0132_set_vipsource()
4817 chipio_set_control_param(codec, CONTROL_PARAM_VIP_SOURCE, 0); in ca0132_set_vipsource()
4818 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_set_vipsource()
4819 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_set_vipsource()
4824 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_set_vipsource()
4826 dspio_set_uint_param(codec, 0x80, 0x05, tmp); in ca0132_set_vipsource()
4828 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_16_000); in ca0132_set_vipsource()
4829 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_16_000); in ca0132_set_vipsource()
4834 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_set_vipsource()
4836 dspio_set_uint_param(codec, 0x80, 0x05, tmp); in ca0132_set_vipsource()
4838 chipio_set_control_param(codec, CONTROL_PARAM_VIP_SOURCE, val); in ca0132_set_vipsource()
4844 static int ca0132_alt_set_vipsource(struct hda_codec *codec, int val) in ca0132_alt_set_vipsource() argument
4846 struct ca0132_spec *spec = codec->spec; in ca0132_alt_set_vipsource()
4852 codec_dbg(codec, "%s\n", __func__); in ca0132_alt_set_vipsource()
4854 chipio_set_stream_control(codec, 0x03, 0); in ca0132_alt_set_vipsource()
4855 chipio_set_stream_control(codec, 0x04, 0); in ca0132_alt_set_vipsource()
4860 codec_dbg(codec, "%s: off.", __func__); in ca0132_alt_set_vipsource()
4861 chipio_set_control_param(codec, CONTROL_PARAM_VIP_SOURCE, 0); in ca0132_alt_set_vipsource()
4864 dspio_set_uint_param(codec, 0x80, 0x05, tmp); in ca0132_alt_set_vipsource()
4866 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_alt_set_vipsource()
4867 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_alt_set_vipsource()
4869 chipio_set_conn_rate(codec, 0x0F, SR_96_000); in ca0132_alt_set_vipsource()
4881 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_alt_set_vipsource()
4884 codec_dbg(codec, "%s: on.", __func__); in ca0132_alt_set_vipsource()
4885 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_16_000); in ca0132_alt_set_vipsource()
4886 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_16_000); in ca0132_alt_set_vipsource()
4888 chipio_set_conn_rate(codec, 0x0F, SR_16_000); in ca0132_alt_set_vipsource()
4894 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_alt_set_vipsource()
4897 dspio_set_uint_param(codec, 0x80, 0x05, tmp); in ca0132_alt_set_vipsource()
4900 chipio_set_control_param(codec, CONTROL_PARAM_VIP_SOURCE, val); in ca0132_alt_set_vipsource()
4903 chipio_set_stream_control(codec, 0x03, 1); in ca0132_alt_set_vipsource()
4904 chipio_set_stream_control(codec, 0x04, 1); in ca0132_alt_set_vipsource()
4915 static int ca0132_select_mic(struct hda_codec *codec) in ca0132_select_mic() argument
4917 struct ca0132_spec *spec = codec->spec; in ca0132_select_mic()
4921 codec_dbg(codec, "ca0132_select_mic\n"); in ca0132_select_mic()
4923 snd_hda_power_up_pm(codec); in ca0132_select_mic()
4928 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_amic1); in ca0132_select_mic()
4940 chipio_set_conn_rate(codec, MEM_CONNID_DMIC, SR_32_000); in ca0132_select_mic()
4941 ca0132_set_dmic(codec, 1); in ca0132_select_mic()
4942 ca0132_mic_boost_set(codec, 0); in ca0132_select_mic()
4944 ca0132_effects_set(codec, VOICE_FOCUS, in ca0132_select_mic()
4949 chipio_set_conn_rate(codec, MEM_CONNID_DMIC, SR_96_000); in ca0132_select_mic()
4950 ca0132_set_dmic(codec, 0); in ca0132_select_mic()
4951 ca0132_mic_boost_set(codec, spec->cur_mic_boost); in ca0132_select_mic()
4953 ca0132_effects_set(codec, VOICE_FOCUS, 0); in ca0132_select_mic()
4956 snd_hda_power_down_pm(codec); in ca0132_select_mic()
4967 static int ca0132_alt_select_in(struct hda_codec *codec) in ca0132_alt_select_in() argument
4969 struct ca0132_spec *spec = codec->spec; in ca0132_alt_select_in()
4972 codec_dbg(codec, "%s\n", __func__); in ca0132_alt_select_in()
4974 snd_hda_power_up_pm(codec); in ca0132_alt_select_in()
4976 chipio_set_stream_control(codec, 0x03, 0); in ca0132_alt_select_in()
4977 chipio_set_stream_control(codec, 0x04, 0); in ca0132_alt_select_in()
4986 ca0113_mmio_gpio_set(codec, 0, false); in ca0132_alt_select_in()
4993 r3di_gpio_mic_set(codec, R3DI_REAR_MIC); in ca0132_alt_select_in()
4997 ca0113_mmio_command_set(codec, 0x30, 0x28, 0x00); in ca0132_alt_select_in()
5001 ca0113_mmio_command_set(codec, 0x30, 0x28, 0x00); in ca0132_alt_select_in()
5003 chipio_set_conn_rate(codec, MEM_CONNID_MICIN2, in ca0132_alt_select_in()
5005 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT2, in ca0132_alt_select_in()
5007 dspio_set_uint_param(codec, 0x80, 0x01, FLOAT_ZERO); in ca0132_alt_select_in()
5014 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_alt_select_in()
5015 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_alt_select_in()
5017 chipio_set_conn_rate(codec, 0x0F, SR_96_000); in ca0132_alt_select_in()
5019 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_alt_select_in()
5021 chipio_set_stream_control(codec, 0x03, 1); in ca0132_alt_select_in()
5022 chipio_set_stream_control(codec, 0x04, 1); in ca0132_alt_select_in()
5025 chipio_write(codec, 0x18B098, 0x0000000C); in ca0132_alt_select_in()
5026 chipio_write(codec, 0x18B09C, 0x0000000C); in ca0132_alt_select_in()
5029 chipio_write(codec, 0x18B098, 0x0000000C); in ca0132_alt_select_in()
5030 chipio_write(codec, 0x18B09C, 0x000000CC); in ca0132_alt_select_in()
5033 chipio_write(codec, 0x18B098, 0x0000000C); in ca0132_alt_select_in()
5034 chipio_write(codec, 0x18B09C, 0x0000004C); in ca0132_alt_select_in()
5039 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_select_in()
5042 ca0132_mic_boost_set(codec, 0); in ca0132_alt_select_in()
5046 ca0113_mmio_gpio_set(codec, 0, false); in ca0132_alt_select_in()
5049 r3di_gpio_mic_set(codec, R3DI_REAR_MIC); in ca0132_alt_select_in()
5052 ca0113_mmio_command_set(codec, 0x30, 0x28, 0x00); in ca0132_alt_select_in()
5055 ca0113_mmio_command_set(codec, 0x30, 0x28, 0x3f); in ca0132_alt_select_in()
5056 chipio_set_conn_rate(codec, MEM_CONNID_MICIN2, in ca0132_alt_select_in()
5058 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT2, in ca0132_alt_select_in()
5060 dspio_set_uint_param(codec, 0x80, 0x01, FLOAT_ZERO); in ca0132_alt_select_in()
5066 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_alt_select_in()
5067 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_alt_select_in()
5069 chipio_set_conn_rate(codec, 0x0F, SR_96_000); in ca0132_alt_select_in()
5075 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_alt_select_in()
5080 chipio_write(codec, 0x18B098, 0x00000000); in ca0132_alt_select_in()
5081 chipio_write(codec, 0x18B09C, 0x00000000); in ca0132_alt_select_in()
5086 chipio_set_stream_control(codec, 0x03, 1); in ca0132_alt_select_in()
5087 chipio_set_stream_control(codec, 0x04, 1); in ca0132_alt_select_in()
5093 ca0113_mmio_gpio_set(codec, 0, true); in ca0132_alt_select_in()
5094 ca0113_mmio_gpio_set(codec, 5, false); in ca0132_alt_select_in()
5098 r3di_gpio_mic_set(codec, R3DI_FRONT_MIC); in ca0132_alt_select_in()
5102 ca0113_mmio_command_set(codec, 0x30, 0x28, 0x3f); in ca0132_alt_select_in()
5110 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_alt_select_in()
5111 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_alt_select_in()
5113 chipio_set_conn_rate(codec, 0x0F, SR_96_000); in ca0132_alt_select_in()
5115 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_alt_select_in()
5117 chipio_set_stream_control(codec, 0x03, 1); in ca0132_alt_select_in()
5118 chipio_set_stream_control(codec, 0x04, 1); in ca0132_alt_select_in()
5122 chipio_write(codec, 0x18B098, 0x0000000C); in ca0132_alt_select_in()
5123 chipio_write(codec, 0x18B09C, 0x000000CC); in ca0132_alt_select_in()
5126 chipio_write(codec, 0x18B098, 0x0000000C); in ca0132_alt_select_in()
5127 chipio_write(codec, 0x18B09C, 0x0000004C); in ca0132_alt_select_in()
5132 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_select_in()
5135 ca0132_cvoice_switch_set(codec); in ca0132_alt_select_in()
5137 snd_hda_power_down_pm(codec); in ca0132_alt_select_in()
5144 static bool ca0132_is_vnode_effective(struct hda_codec *codec, in ca0132_is_vnode_effective() argument
5148 struct ca0132_spec *spec = codec->spec; in ca0132_is_vnode_effective()
5172 static int ca0132_voicefx_set(struct hda_codec *codec, int enable) in ca0132_voicefx_set() argument
5174 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_set()
5185 dspio_set_uint_param(codec, ca0132_voicefx.mid, in ca0132_voicefx_set()
5194 static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val) in ca0132_effects_set() argument
5196 struct ca0132_spec *spec = codec->spec; in ca0132_effects_set()
5241 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_effects_set()
5260 dspio_set_uint_param(codec, 0x47, 0x00, tmp); in ca0132_effects_set()
5269 codec_dbg(codec, "ca0132_effect_set: nid=0x%x, val=%ld\n", in ca0132_effects_set()
5273 err = dspio_set_uint_param(codec, ca0132_effects[idx].mid, in ca0132_effects_set()
5285 static int ca0132_pe_switch_set(struct hda_codec *codec) in ca0132_pe_switch_set() argument
5287 struct ca0132_spec *spec = codec->spec; in ca0132_pe_switch_set()
5291 codec_dbg(codec, "ca0132_pe_switch_set: val=%ld\n", in ca0132_pe_switch_set()
5295 ca0132_alt_select_out(codec); in ca0132_pe_switch_set()
5301 ret |= ca0132_effects_set(codec, nid, spec->effects_switch[i]); in ca0132_pe_switch_set()
5307 static int stop_mic1(struct hda_codec *codec) in stop_mic1() argument
5309 struct ca0132_spec *spec = codec->spec; in stop_mic1()
5310 unsigned int oldval = snd_hda_codec_read(codec, spec->adcs[0], 0, in stop_mic1()
5313 snd_hda_codec_write(codec, spec->adcs[0], 0, in stop_mic1()
5320 static void resume_mic1(struct hda_codec *codec, unsigned int oldval) in resume_mic1() argument
5322 struct ca0132_spec *spec = codec->spec; in resume_mic1()
5325 snd_hda_codec_write(codec, spec->adcs[0], 0, in resume_mic1()
5333 static int ca0132_cvoice_switch_set(struct hda_codec *codec) in ca0132_cvoice_switch_set() argument
5335 struct ca0132_spec *spec = codec->spec; in ca0132_cvoice_switch_set()
5340 codec_dbg(codec, "ca0132_cvoice_switch_set: val=%ld\n", in ca0132_cvoice_switch_set()
5347 ret |= ca0132_effects_set(codec, nid, spec->effects_switch[i]); in ca0132_cvoice_switch_set()
5350 ret |= ca0132_voicefx_set(codec, (spec->voicefx_val ? 1 : 0)); in ca0132_cvoice_switch_set()
5353 oldval = stop_mic1(codec); in ca0132_cvoice_switch_set()
5355 ret |= ca0132_alt_set_vipsource(codec, 1); in ca0132_cvoice_switch_set()
5357 ret |= ca0132_set_vipsource(codec, 1); in ca0132_cvoice_switch_set()
5358 resume_mic1(codec, oldval); in ca0132_cvoice_switch_set()
5362 static int ca0132_mic_boost_set(struct hda_codec *codec, long val) in ca0132_mic_boost_set() argument
5364 struct ca0132_spec *spec = codec->spec; in ca0132_mic_boost_set()
5368 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_mic_boost_set()
5371 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_mic_boost_set()
5377 static int ca0132_alt_mic_boost_set(struct hda_codec *codec, long val) in ca0132_alt_mic_boost_set() argument
5379 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_set()
5382 ret = snd_hda_codec_amp_update(codec, spec->input_pins[0], 0, in ca0132_alt_mic_boost_set()
5387 static int ae5_headphone_gain_set(struct hda_codec *codec, long val) in ae5_headphone_gain_set() argument
5392 ca0113_mmio_command_set(codec, 0x48, 0x11 + i, in ae5_headphone_gain_set()
5401 static int zxr_headphone_gain_set(struct hda_codec *codec, long val) in zxr_headphone_gain_set() argument
5403 ca0113_mmio_gpio_set(codec, 1, val); in zxr_headphone_gain_set()
5411 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_vnode_switch_set() local
5416 struct ca0132_spec *spec = codec->spec; in ca0132_vnode_switch_set()
5424 ca0132_alt_select_out(codec); in ca0132_vnode_switch_set()
5426 ca0132_select_out(codec); in ca0132_vnode_switch_set()
5435 ca0132_select_mic(codec); in ca0132_vnode_switch_set()
5441 ca0132_alt_select_out(codec); in ca0132_vnode_switch_set()
5443 ca0132_select_out(codec); in ca0132_vnode_switch_set()
5448 ca0132_select_mic(codec); in ca0132_vnode_switch_set()
5453 effective = ca0132_is_vnode_effective(codec, nid, &shared_nid); in ca0132_vnode_switch_set()
5459 mutex_lock(&codec->control_mutex); in ca0132_vnode_switch_set()
5465 mutex_unlock(&codec->control_mutex); in ca0132_vnode_switch_set()
5472 static void ca0132_alt_bass_redirection_xover_set(struct hda_codec *codec, in ca0132_alt_bass_redirection_xover_set() argument
5475 snd_hda_power_up(codec); in ca0132_alt_bass_redirection_xover_set()
5477 dspio_set_param(codec, 0x96, 0x20, SPEAKER_BASS_REDIRECT_XOVER_FREQ, in ca0132_alt_bass_redirection_xover_set()
5480 snd_hda_power_down(codec); in ca0132_alt_bass_redirection_xover_set()
5492 static int ca0132_alt_slider_ctl_set(struct hda_codec *codec, hda_nid_t nid, in ca0132_alt_slider_ctl_set() argument
5506 snd_hda_power_up(codec); in ca0132_alt_slider_ctl_set()
5512 dspio_set_param(codec, ca0132_effects[i].mid, 0x20, in ca0132_alt_slider_ctl_set()
5521 dspio_set_param(codec, ca0132_effects[i].mid, 0x20, in ca0132_alt_slider_ctl_set()
5526 snd_hda_power_down(codec); in ca0132_alt_slider_ctl_set()
5534 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_xbass_xover_slider_ctl_get() local
5535 struct ca0132_spec *spec = codec->spec; in ca0132_alt_xbass_xover_slider_ctl_get()
5550 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_slider_ctl_get() local
5551 struct ca0132_spec *spec = codec->spec; in ca0132_alt_slider_ctl_get()
5593 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_xbass_xover_slider_put() local
5594 struct ca0132_spec *spec = codec->spec; in ca0132_alt_xbass_xover_slider_put()
5613 ca0132_alt_bass_redirection_xover_set(codec, *cur_val); in ca0132_alt_xbass_xover_slider_put()
5615 ca0132_alt_slider_ctl_set(codec, nid, float_xbass_xover_lookup, idx); in ca0132_alt_xbass_xover_slider_put()
5623 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_effect_slider_put() local
5624 struct ca0132_spec *spec = codec->spec; in ca0132_alt_effect_slider_put()
5637 ca0132_alt_slider_ctl_set(codec, nid, float_zero_to_one_lookup, idx); in ca0132_alt_effect_slider_put()
5670 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_mic_boost_get() local
5671 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_get()
5680 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_mic_boost_put() local
5681 struct ca0132_spec *spec = codec->spec; in ca0132_alt_mic_boost_put()
5688 codec_dbg(codec, "ca0132_alt_mic_boost: boost=%d\n", in ca0132_alt_mic_boost_put()
5694 ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val); in ca0132_alt_mic_boost_put()
5724 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ae5_headphone_gain_get() local
5725 struct ca0132_spec *spec = codec->spec; in ae5_headphone_gain_get()
5734 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ae5_headphone_gain_put() local
5735 struct ca0132_spec *spec = codec->spec; in ae5_headphone_gain_put()
5742 codec_dbg(codec, "ae5_headphone_gain: boost=%d\n", in ae5_headphone_gain_put()
5748 ae5_headphone_gain_set(codec, spec->ae5_headphone_gain_val); in ae5_headphone_gain_put()
5777 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ae5_sound_filter_get() local
5778 struct ca0132_spec *spec = codec->spec; in ae5_sound_filter_get()
5787 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ae5_sound_filter_put() local
5788 struct ca0132_spec *spec = codec->spec; in ae5_sound_filter_put()
5795 codec_dbg(codec, "ae5_sound_filter: %s\n", in ae5_sound_filter_put()
5800 ca0113_mmio_command_set_type2(codec, 0x48, 0x07, in ae5_sound_filter_put()
5827 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_input_source_get() local
5828 struct ca0132_spec *spec = codec->spec; in ca0132_alt_input_source_get()
5837 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_input_source_put() local
5838 struct ca0132_spec *spec = codec->spec; in ca0132_alt_input_source_put()
5852 codec_dbg(codec, "ca0132_alt_input_select: sel=%d, preset=%s\n", in ca0132_alt_input_source_put()
5857 ca0132_alt_select_in(codec); in ca0132_alt_input_source_put()
5879 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_output_select_get() local
5880 struct ca0132_spec *spec = codec->spec; in ca0132_alt_output_select_get()
5889 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_output_select_put() local
5890 struct ca0132_spec *spec = codec->spec; in ca0132_alt_output_select_put()
5898 codec_dbg(codec, "ca0132_alt_output_select: sel=%d, preset=%s\n", in ca0132_alt_output_select_put()
5906 ca0132_alt_select_out(codec); in ca0132_alt_output_select_put()
5930 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_speaker_channel_cfg_get() local
5931 struct ca0132_spec *spec = codec->spec; in ca0132_alt_speaker_channel_cfg_get()
5940 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_speaker_channel_cfg_put() local
5941 struct ca0132_spec *spec = codec->spec; in ca0132_alt_speaker_channel_cfg_put()
5948 codec_dbg(codec, "ca0132_alt_speaker_channels: sel=%d, channels=%s\n", in ca0132_alt_speaker_channel_cfg_put()
5954 ca0132_alt_select_out(codec); in ca0132_alt_speaker_channel_cfg_put()
5983 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_svm_setting_get() local
5984 struct ca0132_spec *spec = codec->spec; in ca0132_alt_svm_setting_get()
5993 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_svm_setting_put() local
5994 struct ca0132_spec *spec = codec->spec; in ca0132_alt_svm_setting_put()
6003 codec_dbg(codec, "ca0132_alt_svm_setting: sel=%d, preset=%s\n", in ca0132_alt_svm_setting_put()
6023 dspio_set_uint_param(codec, ca0132_effects[idx].mid, in ca0132_alt_svm_setting_put()
6047 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_eq_preset_get() local
6048 struct ca0132_spec *spec = codec->spec; in ca0132_alt_eq_preset_get()
6057 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_eq_preset_put() local
6058 struct ca0132_spec *spec = codec->spec; in ca0132_alt_eq_preset_put()
6066 codec_dbg(codec, "%s: sel=%d, preset=%s\n", __func__, sel, in ca0132_alt_eq_preset_put()
6073 err = dspio_set_uint_param(codec, ca0132_alt_eq_enum.mid, in ca0132_alt_eq_preset_put()
6104 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_voicefx_get() local
6105 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_get()
6114 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_voicefx_put() local
6115 struct ca0132_spec *spec = codec->spec; in ca0132_voicefx_put()
6122 codec_dbg(codec, "ca0132_voicefx_put: sel=%d, preset=%s\n", in ca0132_voicefx_put()
6130 err = dspio_set_uint_param(codec, ca0132_voicefx.mid, in ca0132_voicefx_put()
6140 ca0132_voicefx_set(codec, (sel ? 1 : 0)); in ca0132_voicefx_put()
6149 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_switch_get() local
6150 struct ca0132_spec *spec = codec->spec; in ca0132_switch_get()
6201 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_switch_put() local
6202 struct ca0132_spec *spec = codec->spec; in ca0132_switch_put()
6208 codec_dbg(codec, "ca0132_switch_put: nid=0x%x, val=%ld\n", in ca0132_switch_put()
6211 snd_hda_power_up(codec); in ca0132_switch_put()
6229 changed = ca0132_pe_switch_set(codec); in ca0132_switch_put()
6236 changed = ca0132_cvoice_switch_set(codec); in ca0132_switch_put()
6244 changed = ca0132_effects_set(codec, nid, *valp); in ca0132_switch_put()
6253 changed = ca0132_mic_boost_set(codec, *valp); in ca0132_switch_put()
6257 changed = ca0132_mic_boost_set(codec, *valp); in ca0132_switch_put()
6266 changed = zxr_headphone_gain_set(codec, *valp); in ca0132_switch_put()
6276 ca0132_alt_set_full_range_speaker(codec); in ca0132_switch_put()
6284 ca0132_alt_surround_set_bass_redirection(codec, *valp); in ca0132_switch_put()
6290 snd_hda_power_down(codec); in ca0132_switch_put()
6302 static void ca0132_alt_dsp_volume_put(struct hda_codec *codec, hda_nid_t nid) in ca0132_alt_dsp_volume_put() argument
6304 struct ca0132_spec *spec = codec->spec; in ca0132_alt_dsp_volume_put()
6315 dspio_set_uint_param(codec, in ca0132_alt_dsp_volume_put()
6322 dspio_set_uint_param(codec, in ca0132_alt_dsp_volume_put()
6327 dspio_set_uint_param(codec, in ca0132_alt_dsp_volume_put()
6335 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_volume_info() local
6336 struct ca0132_spec *spec = codec->spec; in ca0132_volume_info()
6347 mutex_lock(&codec->control_mutex); in ca0132_volume_info()
6352 mutex_unlock(&codec->control_mutex); in ca0132_volume_info()
6357 mutex_lock(&codec->control_mutex); in ca0132_volume_info()
6362 mutex_unlock(&codec->control_mutex); in ca0132_volume_info()
6373 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_volume_get() local
6374 struct ca0132_spec *spec = codec->spec; in ca0132_volume_get()
6394 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_volume_put() local
6395 struct ca0132_spec *spec = codec->spec; in ca0132_volume_put()
6414 effective = ca0132_is_vnode_effective(codec, nid, &shared_nid); in ca0132_volume_put()
6419 snd_hda_power_up(codec); in ca0132_volume_put()
6420 mutex_lock(&codec->control_mutex); in ca0132_volume_put()
6426 mutex_unlock(&codec->control_mutex); in ca0132_volume_put()
6427 snd_hda_power_down(codec); in ca0132_volume_put()
6441 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_alt_volume_put() local
6442 struct ca0132_spec *spec = codec->spec; in ca0132_alt_volume_put()
6468 snd_hda_power_up(codec); in ca0132_alt_volume_put()
6469 ca0132_alt_dsp_volume_put(codec, vnid); in ca0132_alt_volume_put()
6470 mutex_lock(&codec->control_mutex); in ca0132_alt_volume_put()
6472 mutex_unlock(&codec->control_mutex); in ca0132_alt_volume_put()
6473 snd_hda_power_down(codec); in ca0132_alt_volume_put()
6481 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in ca0132_volume_tlv() local
6482 struct ca0132_spec *spec = codec->spec; in ca0132_volume_tlv()
6493 mutex_lock(&codec->control_mutex); in ca0132_volume_tlv()
6498 mutex_unlock(&codec->control_mutex); in ca0132_volume_tlv()
6503 mutex_lock(&codec->control_mutex); in ca0132_volume_tlv()
6508 mutex_unlock(&codec->control_mutex); in ca0132_volume_tlv()
6517 static int ca0132_alt_add_effect_slider(struct hda_codec *codec, hda_nid_t nid, in ca0132_alt_add_effect_slider() argument
6544 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec)); in ca0132_alt_add_effect_slider()
6552 static int add_fx_switch(struct hda_codec *codec, hda_nid_t nid, in add_fx_switch() argument
6555 struct ca0132_spec *spec = codec->spec; in add_fx_switch()
6568 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec)); in add_fx_switch()
6571 static int add_voicefx(struct hda_codec *codec) in add_voicefx() argument
6579 return snd_hda_ctl_add(codec, VOICEFX, snd_ctl_new1(&knew, codec)); in add_voicefx()
6583 static int add_ca0132_alt_eq_presets(struct hda_codec *codec) in add_ca0132_alt_eq_presets() argument
6591 return snd_hda_ctl_add(codec, EQ_PRESET_ENUM, in add_ca0132_alt_eq_presets()
6592 snd_ctl_new1(&knew, codec)); in add_ca0132_alt_eq_presets()
6600 static int ca0132_alt_add_svm_enum(struct hda_codec *codec) in ca0132_alt_add_svm_enum() argument
6608 return snd_hda_ctl_add(codec, SMART_VOLUME_ENUM, in ca0132_alt_add_svm_enum()
6609 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_svm_enum()
6617 static int ca0132_alt_add_output_enum(struct hda_codec *codec) in ca0132_alt_add_output_enum() argument
6625 return snd_hda_ctl_add(codec, OUTPUT_SOURCE_ENUM, in ca0132_alt_add_output_enum()
6626 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_output_enum()
6634 static int ca0132_alt_add_speaker_channel_cfg_enum(struct hda_codec *codec) in ca0132_alt_add_speaker_channel_cfg_enum() argument
6642 return snd_hda_ctl_add(codec, SPEAKER_CHANNEL_CFG_ENUM, in ca0132_alt_add_speaker_channel_cfg_enum()
6643 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_speaker_channel_cfg_enum()
6651 static int ca0132_alt_add_front_full_range_switch(struct hda_codec *codec) in ca0132_alt_add_front_full_range_switch() argument
6657 return snd_hda_ctl_add(codec, SPEAKER_FULL_RANGE_FRONT, in ca0132_alt_add_front_full_range_switch()
6658 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_front_full_range_switch()
6661 static int ca0132_alt_add_rear_full_range_switch(struct hda_codec *codec) in ca0132_alt_add_rear_full_range_switch() argument
6667 return snd_hda_ctl_add(codec, SPEAKER_FULL_RANGE_REAR, in ca0132_alt_add_rear_full_range_switch()
6668 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_rear_full_range_switch()
6677 static int ca0132_alt_add_bass_redirection_crossover(struct hda_codec *codec) in ca0132_alt_add_bass_redirection_crossover() argument
6689 return snd_hda_ctl_add(codec, BASS_REDIRECTION_XOVER, in ca0132_alt_add_bass_redirection_crossover()
6690 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_bass_redirection_crossover()
6693 static int ca0132_alt_add_bass_redirection_switch(struct hda_codec *codec) in ca0132_alt_add_bass_redirection_switch() argument
6700 return snd_hda_ctl_add(codec, BASS_REDIRECTION, in ca0132_alt_add_bass_redirection_switch()
6701 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_bass_redirection_switch()
6709 static int ca0132_alt_add_input_enum(struct hda_codec *codec) in ca0132_alt_add_input_enum() argument
6717 return snd_hda_ctl_add(codec, INPUT_SOURCE_ENUM, in ca0132_alt_add_input_enum()
6718 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_input_enum()
6725 static int ca0132_alt_add_mic_boost_enum(struct hda_codec *codec) in ca0132_alt_add_mic_boost_enum() argument
6733 return snd_hda_ctl_add(codec, MIC_BOOST_ENUM, in ca0132_alt_add_mic_boost_enum()
6734 snd_ctl_new1(&knew, codec)); in ca0132_alt_add_mic_boost_enum()
6743 static int ae5_add_headphone_gain_enum(struct hda_codec *codec) in ae5_add_headphone_gain_enum() argument
6751 return snd_hda_ctl_add(codec, AE5_HEADPHONE_GAIN_ENUM, in ae5_add_headphone_gain_enum()
6752 snd_ctl_new1(&knew, codec)); in ae5_add_headphone_gain_enum()
6760 static int ae5_add_sound_filter_enum(struct hda_codec *codec) in ae5_add_sound_filter_enum() argument
6768 return snd_hda_ctl_add(codec, AE5_SOUND_FILTER_ENUM, in ae5_add_sound_filter_enum()
6769 snd_ctl_new1(&knew, codec)); in ae5_add_sound_filter_enum()
6772 static int zxr_add_headphone_gain_switch(struct hda_codec *codec) in zxr_add_headphone_gain_switch() argument
6778 return snd_hda_ctl_add(codec, ZXR_HEADPHONE_GAIN, in zxr_add_headphone_gain_switch()
6779 snd_ctl_new1(&knew, codec)); in zxr_add_headphone_gain_switch()
6809 static void ca0132_alt_add_chmap_ctls(struct hda_codec *codec) in ca0132_alt_add_chmap_ctls() argument
6814 list_for_each_entry(pcm, &codec->pcm_list_head, list) { in ca0132_alt_add_chmap_ctls()
6826 codec_dbg(codec, "snd_pcm_add_chmap_ctls failed!"); in ca0132_alt_add_chmap_ctls()
6902 static int ca0132_build_controls(struct hda_codec *codec) in ca0132_build_controls() argument
6904 struct ca0132_spec *spec = codec->spec; in ca0132_build_controls()
6910 err = snd_hda_add_new_ctls(codec, spec->mixers[i]); in ca0132_build_controls()
6916 snd_hda_set_vmaster_tlv(codec, spec->dacs[0], HDA_OUTPUT, in ca0132_build_controls()
6918 snd_hda_add_vmaster(codec, "Master Playback Volume", in ca0132_build_controls()
6921 err = __snd_hda_add_vmaster(codec, "Master Playback Switch", in ca0132_build_controls()
6941 err = add_fx_switch(codec, ca0132_effects[i].nid, in ca0132_build_controls()
6948 * If codec has use_alt_controls set to true, add effect level sliders, in ca0132_build_controls()
6953 err = ca0132_alt_add_svm_enum(codec); in ca0132_build_controls()
6957 err = add_ca0132_alt_eq_presets(codec); in ca0132_build_controls()
6961 err = add_fx_switch(codec, PLAY_ENHANCEMENT, in ca0132_build_controls()
6966 err = add_fx_switch(codec, CRYSTAL_VOICE, in ca0132_build_controls()
6973 err = ca0132_alt_add_effect_slider(codec, in ca0132_build_controls()
6981 err = ca0132_alt_add_effect_slider(codec, XBASS_XOVER, in ca0132_build_controls()
6987 err = add_fx_switch(codec, PLAY_ENHANCEMENT, in ca0132_build_controls()
6992 err = add_fx_switch(codec, CRYSTAL_VOICE, in ca0132_build_controls()
6997 err = add_voicefx(codec); in ca0132_build_controls()
7002 * If the codec uses alt_functions, you need the enumerated controls in ca0132_build_controls()
7007 err = ca0132_alt_add_output_enum(codec); in ca0132_build_controls()
7010 err = ca0132_alt_add_speaker_channel_cfg_enum(codec); in ca0132_build_controls()
7013 err = ca0132_alt_add_front_full_range_switch(codec); in ca0132_build_controls()
7016 err = ca0132_alt_add_rear_full_range_switch(codec); in ca0132_build_controls()
7019 err = ca0132_alt_add_bass_redirection_crossover(codec); in ca0132_build_controls()
7022 err = ca0132_alt_add_bass_redirection_switch(codec); in ca0132_build_controls()
7025 err = ca0132_alt_add_mic_boost_enum(codec); in ca0132_build_controls()
7033 err = ca0132_alt_add_input_enum(codec); in ca0132_build_controls()
7042 err = ae5_add_headphone_gain_enum(codec); in ca0132_build_controls()
7045 err = ae5_add_sound_filter_enum(codec); in ca0132_build_controls()
7050 err = zxr_add_headphone_gain_switch(codec); in ca0132_build_controls()
7059 add_tuning_ctls(codec); in ca0132_build_controls()
7062 err = snd_hda_jack_add_kctls(codec, &spec->autocfg); in ca0132_build_controls()
7067 err = snd_hda_create_spdif_out_ctls(codec, spec->dig_out, in ca0132_build_controls()
7071 err = snd_hda_create_spdif_share_sw(codec, &spec->multiout); in ca0132_build_controls()
7078 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); in ca0132_build_controls()
7084 ca0132_alt_add_chmap_ctls(codec); in ca0132_build_controls()
7089 static int dbpro_build_controls(struct hda_codec *codec) in dbpro_build_controls() argument
7091 struct ca0132_spec *spec = codec->spec; in dbpro_build_controls()
7095 err = snd_hda_create_spdif_out_ctls(codec, spec->dig_out, in dbpro_build_controls()
7102 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); in dbpro_build_controls()
7153 static int ca0132_build_pcms(struct hda_codec *codec) in ca0132_build_pcms() argument
7155 struct ca0132_spec *spec = codec->spec; in ca0132_build_pcms()
7158 info = snd_hda_codec_pcm_new(codec, "CA0132 Analog"); in ca0132_build_pcms()
7176 info = snd_hda_codec_pcm_new(codec, "CA0132 Analog Mic-In2"); in ca0132_build_pcms()
7185 info = snd_hda_codec_pcm_new(codec, "CA0132 What U Hear"); in ca0132_build_pcms()
7195 info = snd_hda_codec_pcm_new(codec, "CA0132 Digital"); in ca0132_build_pcms()
7213 static int dbpro_build_pcms(struct hda_codec *codec) in dbpro_build_pcms() argument
7215 struct ca0132_spec *spec = codec->spec; in dbpro_build_pcms()
7218 info = snd_hda_codec_pcm_new(codec, "CA0132 Alt Analog"); in dbpro_build_pcms()
7229 info = snd_hda_codec_pcm_new(codec, "CA0132 Digital"); in dbpro_build_pcms()
7247 static void init_output(struct hda_codec *codec, hda_nid_t pin, hda_nid_t dac) in init_output() argument
7250 snd_hda_set_pin_ctl(codec, pin, PIN_HP); in init_output()
7251 if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP) in init_output()
7252 snd_hda_codec_write(codec, pin, 0, in init_output()
7256 if (dac && (get_wcaps(codec, dac) & AC_WCAP_OUT_AMP)) in init_output()
7257 snd_hda_codec_write(codec, dac, 0, in init_output()
7261 static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc) in init_input() argument
7264 snd_hda_set_pin_ctl(codec, pin, PIN_VREF80); in init_input()
7265 if (get_wcaps(codec, pin) & AC_WCAP_IN_AMP) in init_input()
7266 snd_hda_codec_write(codec, pin, 0, in init_input()
7270 if (adc && (get_wcaps(codec, adc) & AC_WCAP_IN_AMP)) { in init_input()
7271 snd_hda_codec_write(codec, adc, 0, AC_VERB_SET_AMP_GAIN_MUTE, in init_input()
7275 snd_hda_codec_amp_stereo(codec, adc, HDA_INPUT, 0, in init_input()
7277 snd_hda_codec_amp_stereo(codec, adc, HDA_INPUT, 0, in init_input()
7282 static void refresh_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir) in refresh_amp_caps() argument
7286 caps = snd_hda_param_read(codec, nid, dir == HDA_OUTPUT ? in refresh_amp_caps()
7288 snd_hda_override_amp_caps(codec, nid, dir, caps); in refresh_amp_caps()
7294 static void ca0132_set_dmic(struct hda_codec *codec, int enable) in ca0132_set_dmic() argument
7296 struct ca0132_spec *spec = codec->spec; in ca0132_set_dmic()
7301 codec_dbg(codec, "ca0132_set_dmic: enable=%d\n", enable); in ca0132_set_dmic()
7303 oldval = stop_mic1(codec); in ca0132_set_dmic()
7304 ca0132_set_vipsource(codec, 0); in ca0132_set_dmic()
7308 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_set_dmic()
7312 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_set_dmic()
7316 chipio_set_control_flag(codec, CONTROL_FLAG_DMIC, 1); in ca0132_set_dmic()
7320 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_set_dmic()
7325 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_set_dmic()
7329 chipio_set_control_flag(codec, CONTROL_FLAG_DMIC, 0); in ca0132_set_dmic()
7331 ca0132_set_vipsource(codec, 1); in ca0132_set_dmic()
7332 resume_mic1(codec, oldval); in ca0132_set_dmic()
7338 static void ca0132_init_dmic(struct hda_codec *codec) in ca0132_init_dmic() argument
7340 struct ca0132_spec *spec = codec->spec; in ca0132_init_dmic()
7353 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7363 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7379 snd_hda_codec_write(codec, spec->input_pins[0], 0, in ca0132_init_dmic()
7386 static void ca0132_init_analog_mic2(struct hda_codec *codec) in ca0132_init_analog_mic2() argument
7388 struct ca0132_spec *spec = codec->spec; in ca0132_init_analog_mic2()
7391 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init_analog_mic2()
7393 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init_analog_mic2()
7395 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init_analog_mic2()
7397 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init_analog_mic2()
7399 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init_analog_mic2()
7401 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init_analog_mic2()
7406 static void ca0132_refresh_widget_caps(struct hda_codec *codec) in ca0132_refresh_widget_caps() argument
7408 struct ca0132_spec *spec = codec->spec; in ca0132_refresh_widget_caps()
7411 codec_dbg(codec, "ca0132_refresh_widget_caps.\n"); in ca0132_refresh_widget_caps()
7412 snd_hda_codec_update_widgets(codec); in ca0132_refresh_widget_caps()
7415 refresh_amp_caps(codec, spec->dacs[i], HDA_OUTPUT); in ca0132_refresh_widget_caps()
7418 refresh_amp_caps(codec, spec->out_pins[i], HDA_OUTPUT); in ca0132_refresh_widget_caps()
7421 refresh_amp_caps(codec, spec->adcs[i], HDA_INPUT); in ca0132_refresh_widget_caps()
7422 refresh_amp_caps(codec, spec->input_pins[i], HDA_INPUT); in ca0132_refresh_widget_caps()
7447 static void ca0132_alt_init_speaker_tuning(struct hda_codec *codec) in ca0132_alt_init_speaker_tuning() argument
7449 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init_speaker_tuning()
7470 dspio_set_uint_param(codec, 0x96, SPEAKER_TUNING_ENABLE_CENTER_EQ, tmp); in ca0132_alt_init_speaker_tuning()
7475 dspio_set_uint_param(codec, 0x96, i, tmp); in ca0132_alt_init_speaker_tuning()
7480 dspio_set_uint_param(codec, 0x96, i, tmp); in ca0132_alt_init_speaker_tuning()
7484 dspio_set_uint_param(codec, 0x96, in ca0132_alt_init_speaker_tuning()
7492 static void ca0132_alt_create_dummy_stream(struct hda_codec *codec) in ca0132_alt_create_dummy_stream() argument
7494 struct ca0132_spec *spec = codec->spec; in ca0132_alt_create_dummy_stream()
7500 snd_hda_codec_setup_stream(codec, spec->dacs[0], spec->dsp_stream_id, in ca0132_alt_create_dummy_stream()
7503 snd_hda_codec_cleanup_stream(codec, spec->dacs[0]); in ca0132_alt_create_dummy_stream()
7509 static void ca0132_alt_init_analog_mics(struct hda_codec *codec) in ca0132_alt_init_analog_mics() argument
7511 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init_analog_mics()
7515 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_alt_init_analog_mics()
7516 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_alt_init_analog_mics()
7518 chipio_set_conn_rate(codec, 0x0F, SR_96_000); in ca0132_alt_init_analog_mics()
7522 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_alt_init_analog_mics()
7525 chipio_set_conn_rate(codec, MEM_CONNID_MICIN2, SR_96_000); in ca0132_alt_init_analog_mics()
7526 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT2, SR_96_000); in ca0132_alt_init_analog_mics()
7528 chipio_set_conn_rate(codec, 0x0F, SR_96_000); in ca0132_alt_init_analog_mics()
7530 dspio_set_uint_param(codec, 0x80, 0x01, tmp); in ca0132_alt_init_analog_mics()
7539 static void sbz_connect_streams(struct hda_codec *codec) in sbz_connect_streams() argument
7541 struct ca0132_spec *spec = codec->spec; in sbz_connect_streams()
7545 codec_dbg(codec, "Connect Streams entered, mutex locked and loaded.\n"); in sbz_connect_streams()
7547 chipio_set_stream_channels(codec, 0x0C, 6); in sbz_connect_streams()
7548 chipio_set_stream_control(codec, 0x0C, 1); in sbz_connect_streams()
7551 chipio_write_no_mutex(codec, 0x18a020, 0x00000043); in sbz_connect_streams()
7554 chipio_set_stream_source_dest(codec, 0x14, 0x48, 0x91); in sbz_connect_streams()
7555 chipio_set_conn_rate_no_mutex(codec, 0x48, SR_96_000); in sbz_connect_streams()
7556 chipio_set_conn_rate_no_mutex(codec, 0x91, SR_96_000); in sbz_connect_streams()
7557 chipio_set_stream_channels(codec, 0x14, 2); in sbz_connect_streams()
7558 chipio_set_stream_control(codec, 0x14, 1); in sbz_connect_streams()
7560 codec_dbg(codec, "Connect Streams exited, mutex released.\n"); in sbz_connect_streams()
7571 static void sbz_chipio_startup_data(struct hda_codec *codec) in sbz_chipio_startup_data() argument
7573 struct ca0132_spec *spec = codec->spec; in sbz_chipio_startup_data()
7576 codec_dbg(codec, "Startup Data entered, mutex locked and loaded.\n"); in sbz_chipio_startup_data()
7579 chipio_write_no_mutex(codec, 0x190060, 0x0001f8c0); in sbz_chipio_startup_data()
7580 chipio_write_no_mutex(codec, 0x190064, 0x0001f9c1); in sbz_chipio_startup_data()
7581 chipio_write_no_mutex(codec, 0x190068, 0x0001fac6); in sbz_chipio_startup_data()
7582 chipio_write_no_mutex(codec, 0x19006c, 0x0001fbc7); in sbz_chipio_startup_data()
7584 chipio_write_no_mutex(codec, 0x19042c, 0x00000001); in sbz_chipio_startup_data()
7586 chipio_set_stream_channels(codec, 0x0C, 6); in sbz_chipio_startup_data()
7587 chipio_set_stream_control(codec, 0x0C, 1); in sbz_chipio_startup_data()
7590 chipio_write_no_mutex(codec, 0x190030, 0x0001e0c0); in sbz_chipio_startup_data()
7591 chipio_write_no_mutex(codec, 0x190034, 0x0001e1c1); in sbz_chipio_startup_data()
7592 chipio_write_no_mutex(codec, 0x190038, 0x0001e4c2); in sbz_chipio_startup_data()
7593 chipio_write_no_mutex(codec, 0x19003c, 0x0001e5c3); in sbz_chipio_startup_data()
7594 chipio_write_no_mutex(codec, 0x190040, 0x0001e2c4); in sbz_chipio_startup_data()
7595 chipio_write_no_mutex(codec, 0x190044, 0x0001e3c5); in sbz_chipio_startup_data()
7596 chipio_write_no_mutex(codec, 0x190048, 0x0001e8c6); in sbz_chipio_startup_data()
7597 chipio_write_no_mutex(codec, 0x19004c, 0x0001e9c7); in sbz_chipio_startup_data()
7598 chipio_write_no_mutex(codec, 0x190050, 0x0001ecc8); in sbz_chipio_startup_data()
7599 chipio_write_no_mutex(codec, 0x190054, 0x0001edc9); in sbz_chipio_startup_data()
7600 chipio_write_no_mutex(codec, 0x190058, 0x0001eaca); in sbz_chipio_startup_data()
7601 chipio_write_no_mutex(codec, 0x19005c, 0x0001ebcb); in sbz_chipio_startup_data()
7603 chipio_write_no_mutex(codec, 0x190038, 0x000140c2); in sbz_chipio_startup_data()
7604 chipio_write_no_mutex(codec, 0x19003c, 0x000141c3); in sbz_chipio_startup_data()
7605 chipio_write_no_mutex(codec, 0x190040, 0x000150c4); in sbz_chipio_startup_data()
7606 chipio_write_no_mutex(codec, 0x190044, 0x000151c5); in sbz_chipio_startup_data()
7607 chipio_write_no_mutex(codec, 0x190050, 0x000142c8); in sbz_chipio_startup_data()
7608 chipio_write_no_mutex(codec, 0x190054, 0x000143c9); in sbz_chipio_startup_data()
7609 chipio_write_no_mutex(codec, 0x190058, 0x000152ca); in sbz_chipio_startup_data()
7610 chipio_write_no_mutex(codec, 0x19005c, 0x000153cb); in sbz_chipio_startup_data()
7612 chipio_write_no_mutex(codec, 0x19042c, 0x00000001); in sbz_chipio_startup_data()
7614 codec_dbg(codec, "Startup Data exited, mutex released.\n"); in sbz_chipio_startup_data()
7622 static void ca0132_alt_dsp_scp_startup(struct hda_codec *codec) in ca0132_alt_dsp_scp_startup() argument
7624 struct ca0132_spec *spec = codec->spec; in ca0132_alt_dsp_scp_startup()
7637 dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp); in ca0132_alt_dsp_scp_startup()
7639 dspio_set_uint_param_no_source(codec, 0x80, 0x0A, tmp); in ca0132_alt_dsp_scp_startup()
7641 dspio_set_uint_param_no_source(codec, 0x80, 0x0B, tmp); in ca0132_alt_dsp_scp_startup()
7643 dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp); in ca0132_alt_dsp_scp_startup()
7645 dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp); in ca0132_alt_dsp_scp_startup()
7647 dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp); in ca0132_alt_dsp_scp_startup()
7652 dspio_set_uint_param_no_source(codec, 0x80, 0x0A, tmp); in ca0132_alt_dsp_scp_startup()
7654 dspio_set_uint_param_no_source(codec, 0x80, 0x0B, tmp); in ca0132_alt_dsp_scp_startup()
7656 dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp); in ca0132_alt_dsp_scp_startup()
7658 dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp); in ca0132_alt_dsp_scp_startup()
7660 dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp); in ca0132_alt_dsp_scp_startup()
7669 static void ca0132_alt_dsp_initial_mic_setup(struct hda_codec *codec) in ca0132_alt_dsp_initial_mic_setup() argument
7671 struct ca0132_spec *spec = codec->spec; in ca0132_alt_dsp_initial_mic_setup()
7674 chipio_set_stream_control(codec, 0x03, 0); in ca0132_alt_dsp_initial_mic_setup()
7675 chipio_set_stream_control(codec, 0x04, 0); in ca0132_alt_dsp_initial_mic_setup()
7677 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_alt_dsp_initial_mic_setup()
7678 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_alt_dsp_initial_mic_setup()
7681 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_alt_dsp_initial_mic_setup()
7683 chipio_set_stream_control(codec, 0x03, 1); in ca0132_alt_dsp_initial_mic_setup()
7684 chipio_set_stream_control(codec, 0x04, 1); in ca0132_alt_dsp_initial_mic_setup()
7688 chipio_write(codec, 0x18b098, 0x0000000c); in ca0132_alt_dsp_initial_mic_setup()
7689 chipio_write(codec, 0x18b09C, 0x0000000c); in ca0132_alt_dsp_initial_mic_setup()
7692 chipio_write(codec, 0x18b098, 0x0000000c); in ca0132_alt_dsp_initial_mic_setup()
7693 chipio_write(codec, 0x18b09c, 0x0000004c); in ca0132_alt_dsp_initial_mic_setup()
7700 static void ae5_post_dsp_register_set(struct hda_codec *codec) in ae5_post_dsp_register_set() argument
7702 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_register_set()
7704 chipio_8051_write_direct(codec, 0x93, 0x10); in ae5_post_dsp_register_set()
7705 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_register_set()
7707 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_register_set()
7723 ca0113_mmio_command_set(codec, 0x30, 0x2b, 0x3f); in ae5_post_dsp_register_set()
7724 ca0113_mmio_command_set(codec, 0x30, 0x2d, 0x3f); in ae5_post_dsp_register_set()
7725 ca0113_mmio_command_set(codec, 0x48, 0x07, 0x83); in ae5_post_dsp_register_set()
7728 static void ae5_post_dsp_param_setup(struct hda_codec *codec) in ae5_post_dsp_param_setup() argument
7735 chipio_set_control_param(codec, 3, 0); in ae5_post_dsp_param_setup()
7740 chipio_set_control_flag(codec, CONTROL_FLAG_ASI_96KHZ, 1); in ae5_post_dsp_param_setup()
7742 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, 0x724, 0x83); in ae5_post_dsp_param_setup()
7743 chipio_set_control_param(codec, CONTROL_PARAM_ASI, 0); in ae5_post_dsp_param_setup()
7745 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_param_setup()
7747 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_param_setup()
7749 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_param_setup()
7753 static void ae5_post_dsp_pll_setup(struct hda_codec *codec) in ae5_post_dsp_pll_setup() argument
7755 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7757 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7760 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7762 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7765 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7767 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7770 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7772 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7775 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7777 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_pll_setup()
7781 static void ae5_post_dsp_stream_setup(struct hda_codec *codec) in ae5_post_dsp_stream_setup() argument
7783 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_stream_setup()
7787 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, 0x725, 0x81); in ae5_post_dsp_stream_setup()
7789 chipio_set_conn_rate_no_mutex(codec, 0x70, SR_96_000); in ae5_post_dsp_stream_setup()
7791 chipio_set_stream_channels(codec, 0x0C, 6); in ae5_post_dsp_stream_setup()
7792 chipio_set_stream_control(codec, 0x0C, 1); in ae5_post_dsp_stream_setup()
7794 chipio_set_stream_source_dest(codec, 0x5, 0x43, 0x0); in ae5_post_dsp_stream_setup()
7796 chipio_set_stream_source_dest(codec, 0x18, 0x9, 0xd0); in ae5_post_dsp_stream_setup()
7797 chipio_set_conn_rate_no_mutex(codec, 0xd0, SR_96_000); in ae5_post_dsp_stream_setup()
7798 chipio_set_stream_channels(codec, 0x18, 6); in ae5_post_dsp_stream_setup()
7799 chipio_set_stream_control(codec, 0x18, 1); in ae5_post_dsp_stream_setup()
7801 chipio_set_control_param_no_mutex(codec, CONTROL_PARAM_ASI, 4); in ae5_post_dsp_stream_setup()
7803 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_stream_setup()
7805 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_post_dsp_stream_setup()
7808 ca0113_mmio_command_set(codec, 0x48, 0x01, 0x80); in ae5_post_dsp_stream_setup()
7813 static void ae5_post_dsp_startup_data(struct hda_codec *codec) in ae5_post_dsp_startup_data() argument
7815 struct ca0132_spec *spec = codec->spec; in ae5_post_dsp_startup_data()
7819 chipio_write_no_mutex(codec, 0x189000, 0x0001f101); in ae5_post_dsp_startup_data()
7820 chipio_write_no_mutex(codec, 0x189004, 0x0001f101); in ae5_post_dsp_startup_data()
7821 chipio_write_no_mutex(codec, 0x189024, 0x00014004); in ae5_post_dsp_startup_data()
7822 chipio_write_no_mutex(codec, 0x189028, 0x0002000f); in ae5_post_dsp_startup_data()
7824 ca0113_mmio_command_set(codec, 0x48, 0x0a, 0x05); in ae5_post_dsp_startup_data()
7825 chipio_set_control_param_no_mutex(codec, CONTROL_PARAM_ASI, 7); in ae5_post_dsp_startup_data()
7826 ca0113_mmio_command_set(codec, 0x48, 0x0b, 0x12); in ae5_post_dsp_startup_data()
7827 ca0113_mmio_command_set(codec, 0x48, 0x04, 0x00); in ae5_post_dsp_startup_data()
7828 ca0113_mmio_command_set(codec, 0x48, 0x06, 0x48); in ae5_post_dsp_startup_data()
7829 ca0113_mmio_command_set(codec, 0x48, 0x0a, 0x05); in ae5_post_dsp_startup_data()
7830 ca0113_mmio_command_set(codec, 0x48, 0x07, 0x83); in ae5_post_dsp_startup_data()
7831 ca0113_mmio_command_set(codec, 0x48, 0x0f, 0x00); in ae5_post_dsp_startup_data()
7832 ca0113_mmio_command_set(codec, 0x48, 0x10, 0x00); in ae5_post_dsp_startup_data()
7833 ca0113_mmio_gpio_set(codec, 0, true); in ae5_post_dsp_startup_data()
7834 ca0113_mmio_gpio_set(codec, 1, true); in ae5_post_dsp_startup_data()
7835 ca0113_mmio_command_set(codec, 0x48, 0x07, 0x80); in ae5_post_dsp_startup_data()
7837 chipio_write_no_mutex(codec, 0x18b03c, 0x00000012); in ae5_post_dsp_startup_data()
7839 ca0113_mmio_command_set(codec, 0x48, 0x0f, 0x00); in ae5_post_dsp_startup_data()
7840 ca0113_mmio_command_set(codec, 0x48, 0x10, 0x00); in ae5_post_dsp_startup_data()
7850 static void ae7_post_dsp_setup_ports(struct hda_codec *codec) in ae7_post_dsp_setup_ports() argument
7852 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_setup_ports()
7857 chipio_set_stream_channels(codec, 0x0c, 6); in ae7_post_dsp_setup_ports()
7858 chipio_set_stream_control(codec, 0x0c, 1); in ae7_post_dsp_setup_ports()
7863 chipio_write_no_mutex(codec, addr, ae7_port_set_data[i]); in ae7_post_dsp_setup_ports()
7872 chipio_write_no_mutex(codec, 0x19042c, 0x00000001); in ae7_post_dsp_setup_ports()
7874 ca0113_mmio_command_set(codec, 0x30, 0x30, 0x00); in ae7_post_dsp_setup_ports()
7875 ca0113_mmio_command_set(codec, 0x48, 0x0d, 0x40); in ae7_post_dsp_setup_ports()
7876 ca0113_mmio_command_set(codec, 0x48, 0x17, 0x00); in ae7_post_dsp_setup_ports()
7877 ca0113_mmio_command_set(codec, 0x48, 0x19, 0x00); in ae7_post_dsp_setup_ports()
7878 ca0113_mmio_command_set(codec, 0x48, 0x11, 0xff); in ae7_post_dsp_setup_ports()
7879 ca0113_mmio_command_set(codec, 0x48, 0x12, 0xff); in ae7_post_dsp_setup_ports()
7880 ca0113_mmio_command_set(codec, 0x48, 0x13, 0xff); in ae7_post_dsp_setup_ports()
7881 ca0113_mmio_command_set(codec, 0x48, 0x14, 0x7f); in ae7_post_dsp_setup_ports()
7886 static void ae7_post_dsp_asi_stream_setup(struct hda_codec *codec) in ae7_post_dsp_asi_stream_setup() argument
7888 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_asi_stream_setup()
7892 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, 0x725, 0x81); in ae7_post_dsp_asi_stream_setup()
7893 ca0113_mmio_command_set(codec, 0x30, 0x2b, 0x00); in ae7_post_dsp_asi_stream_setup()
7895 chipio_set_conn_rate_no_mutex(codec, 0x70, SR_96_000); in ae7_post_dsp_asi_stream_setup()
7896 chipio_set_stream_channels(codec, 0x0c, 6); in ae7_post_dsp_asi_stream_setup()
7897 chipio_set_stream_control(codec, 0x0c, 1); in ae7_post_dsp_asi_stream_setup()
7899 chipio_set_stream_source_dest(codec, 0x05, 0x43, 0x00); in ae7_post_dsp_asi_stream_setup()
7900 chipio_set_stream_source_dest(codec, 0x18, 0x09, 0xd0); in ae7_post_dsp_asi_stream_setup()
7902 chipio_set_conn_rate_no_mutex(codec, 0xd0, SR_96_000); in ae7_post_dsp_asi_stream_setup()
7903 chipio_set_stream_channels(codec, 0x18, 6); in ae7_post_dsp_asi_stream_setup()
7904 chipio_set_stream_control(codec, 0x18, 1); in ae7_post_dsp_asi_stream_setup()
7906 chipio_set_control_param_no_mutex(codec, CONTROL_PARAM_ASI, 4); in ae7_post_dsp_asi_stream_setup()
7911 static void ae7_post_dsp_pll_setup(struct hda_codec *codec) in ae7_post_dsp_pll_setup() argument
7922 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_pll_setup()
7924 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_pll_setup()
7929 static void ae7_post_dsp_asi_setup_ports(struct hda_codec *codec) in ae7_post_dsp_asi_setup_ports() argument
7931 struct ca0132_spec *spec = codec->spec; in ae7_post_dsp_asi_setup_ports()
7942 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup_ports()
7944 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup_ports()
7947 chipio_write_no_mutex(codec, 0x189000, 0x0001f101); in ae7_post_dsp_asi_setup_ports()
7948 chipio_write_no_mutex(codec, 0x189004, 0x0001f101); in ae7_post_dsp_asi_setup_ports()
7949 chipio_write_no_mutex(codec, 0x189024, 0x00014004); in ae7_post_dsp_asi_setup_ports()
7950 chipio_write_no_mutex(codec, 0x189028, 0x0002000f); in ae7_post_dsp_asi_setup_ports()
7952 ae7_post_dsp_pll_setup(codec); in ae7_post_dsp_asi_setup_ports()
7953 chipio_set_control_param_no_mutex(codec, CONTROL_PARAM_ASI, 7); in ae7_post_dsp_asi_setup_ports()
7956 ca0113_mmio_command_set(codec, 0x48, target[i], data[i]); in ae7_post_dsp_asi_setup_ports()
7958 ca0113_mmio_command_set_type2(codec, 0x48, 0x07, 0x83); in ae7_post_dsp_asi_setup_ports()
7959 ca0113_mmio_command_set(codec, 0x48, 0x0f, 0x00); in ae7_post_dsp_asi_setup_ports()
7960 ca0113_mmio_command_set(codec, 0x48, 0x10, 0x00); in ae7_post_dsp_asi_setup_ports()
7962 chipio_set_stream_source_dest(codec, 0x21, 0x64, 0x56); in ae7_post_dsp_asi_setup_ports()
7963 chipio_set_stream_channels(codec, 0x21, 2); in ae7_post_dsp_asi_setup_ports()
7964 chipio_set_conn_rate_no_mutex(codec, 0x56, SR_8_000); in ae7_post_dsp_asi_setup_ports()
7966 chipio_set_control_param_no_mutex(codec, CONTROL_PARAM_NODE_ID, 0x09); in ae7_post_dsp_asi_setup_ports()
7972 chipio_set_control_param_no_mutex(codec, 0x20, 0x21); in ae7_post_dsp_asi_setup_ports()
7974 chipio_write_no_mutex(codec, 0x18b038, 0x00000088); in ae7_post_dsp_asi_setup_ports()
7985 ca0113_mmio_gpio_set(codec, 0, 1); in ae7_post_dsp_asi_setup_ports()
7986 ca0113_mmio_gpio_set(codec, 1, 1); in ae7_post_dsp_asi_setup_ports()
7988 ca0113_mmio_command_set_type2(codec, 0x48, 0x07, 0x83); in ae7_post_dsp_asi_setup_ports()
7989 chipio_write_no_mutex(codec, 0x18b03c, 0x00000000); in ae7_post_dsp_asi_setup_ports()
7990 ca0113_mmio_command_set(codec, 0x48, 0x0f, 0x00); in ae7_post_dsp_asi_setup_ports()
7991 ca0113_mmio_command_set(codec, 0x48, 0x10, 0x00); in ae7_post_dsp_asi_setup_ports()
7993 chipio_set_stream_source_dest(codec, 0x05, 0x43, 0x00); in ae7_post_dsp_asi_setup_ports()
7994 chipio_set_stream_source_dest(codec, 0x18, 0x09, 0xd0); in ae7_post_dsp_asi_setup_ports()
7996 chipio_set_conn_rate_no_mutex(codec, 0xd0, SR_96_000); in ae7_post_dsp_asi_setup_ports()
7997 chipio_set_stream_channels(codec, 0x18, 6); in ae7_post_dsp_asi_setup_ports()
8003 ae7_post_dsp_pll_setup(codec); in ae7_post_dsp_asi_setup_ports()
8004 chipio_set_control_param_no_mutex(codec, CONTROL_PARAM_ASI, 7); in ae7_post_dsp_asi_setup_ports()
8014 static void ae7_post_dsp_asi_setup(struct hda_codec *codec) in ae7_post_dsp_asi_setup() argument
8016 chipio_8051_write_direct(codec, 0x93, 0x10); in ae7_post_dsp_asi_setup()
8018 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup()
8020 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup()
8023 ca0113_mmio_command_set_type2(codec, 0x48, 0x07, 0x83); in ae7_post_dsp_asi_setup()
8024 ca0113_mmio_command_set(codec, 0x30, 0x2e, 0x3f); in ae7_post_dsp_asi_setup()
8026 chipio_set_control_param(codec, 3, 3); in ae7_post_dsp_asi_setup()
8027 chipio_set_control_flag(codec, CONTROL_FLAG_ASI_96KHZ, 1); in ae7_post_dsp_asi_setup()
8029 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, 0x724, 0x83); in ae7_post_dsp_asi_setup()
8030 chipio_set_control_param(codec, CONTROL_PARAM_ASI, 0); in ae7_post_dsp_asi_setup()
8031 snd_hda_codec_write(codec, 0x17, 0, 0x794, 0x00); in ae7_post_dsp_asi_setup()
8033 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup()
8035 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup()
8037 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup()
8040 ae7_post_dsp_pll_setup(codec); in ae7_post_dsp_asi_setup()
8041 ae7_post_dsp_asi_stream_setup(codec); in ae7_post_dsp_asi_setup()
8043 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup()
8045 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae7_post_dsp_asi_setup()
8048 ae7_post_dsp_asi_setup_ports(codec); in ae7_post_dsp_asi_setup()
8054 static void ca0132_setup_defaults(struct hda_codec *codec) in ca0132_setup_defaults() argument
8056 struct ca0132_spec *spec = codec->spec; in ca0132_setup_defaults()
8068 dspio_set_uint_param(codec, ca0132_effects[idx].mid, in ca0132_setup_defaults()
8076 dspio_set_uint_param(codec, 0x96, 0x3C, tmp); in ca0132_setup_defaults()
8079 dspio_set_uint_param(codec, 0x8f, 0x01, tmp); in ca0132_setup_defaults()
8083 dspio_set_uint_param(codec, 0x80, 0x00, tmp); in ca0132_setup_defaults()
8084 dspio_set_uint_param(codec, 0x80, 0x01, tmp); in ca0132_setup_defaults()
8088 dspio_set_uint_param(codec, 0x80, 0x05, tmp); in ca0132_setup_defaults()
8092 dspio_set_uint_param(codec, 0x31, 0x00, tmp); in ca0132_setup_defaults()
8099 static void r3d_setup_defaults(struct hda_codec *codec) in r3d_setup_defaults() argument
8101 struct ca0132_spec *spec = codec->spec; in r3d_setup_defaults()
8109 ca0132_alt_dsp_scp_startup(codec); in r3d_setup_defaults()
8110 ca0132_alt_init_analog_mics(codec); in r3d_setup_defaults()
8114 dspio_set_uint_param(codec, 0x96, 0x3C, tmp); in r3d_setup_defaults()
8118 dspio_set_uint_param(codec, 0x31, 0x00, tmp); in r3d_setup_defaults()
8119 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000); in r3d_setup_defaults()
8122 dspio_set_uint_param(codec, 0x32, 0x00, tmp); in r3d_setup_defaults()
8125 r3di_gpio_dsp_status_set(codec, R3DI_DSP_DOWNLOADED); in r3d_setup_defaults()
8129 ca0113_mmio_gpio_set(codec, 2, false); in r3d_setup_defaults()
8130 ca0113_mmio_gpio_set(codec, 4, true); in r3d_setup_defaults()
8137 dspio_set_uint_param(codec, in r3d_setup_defaults()
8149 static void sbz_setup_defaults(struct hda_codec *codec) in sbz_setup_defaults() argument
8151 struct ca0132_spec *spec = codec->spec; in sbz_setup_defaults()
8159 ca0132_alt_dsp_scp_startup(codec); in sbz_setup_defaults()
8160 ca0132_alt_init_analog_mics(codec); in sbz_setup_defaults()
8161 sbz_connect_streams(codec); in sbz_setup_defaults()
8162 sbz_chipio_startup_data(codec); in sbz_setup_defaults()
8164 chipio_set_stream_control(codec, 0x03, 1); in sbz_setup_defaults()
8165 chipio_set_stream_control(codec, 0x04, 1); in sbz_setup_defaults()
8172 dspio_set_uint_param(codec, 0x37, 0x08, tmp); in sbz_setup_defaults()
8173 dspio_set_uint_param(codec, 0x37, 0x10, tmp); in sbz_setup_defaults()
8177 dspio_set_uint_param(codec, 0x96, 0x3C, tmp); in sbz_setup_defaults()
8181 dspio_set_uint_param(codec, 0x31, 0x00, tmp); in sbz_setup_defaults()
8182 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000); in sbz_setup_defaults()
8185 dspio_set_uint_param(codec, 0x32, 0x00, tmp); in sbz_setup_defaults()
8187 ca0132_alt_dsp_initial_mic_setup(codec); in sbz_setup_defaults()
8193 dspio_set_uint_param(codec, in sbz_setup_defaults()
8200 ca0132_alt_init_speaker_tuning(codec); in sbz_setup_defaults()
8202 ca0132_alt_create_dummy_stream(codec); in sbz_setup_defaults()
8208 static void ae5_setup_defaults(struct hda_codec *codec) in ae5_setup_defaults() argument
8210 struct ca0132_spec *spec = codec->spec; in ae5_setup_defaults()
8218 ca0132_alt_dsp_scp_startup(codec); in ae5_setup_defaults()
8219 ca0132_alt_init_analog_mics(codec); in ae5_setup_defaults()
8220 chipio_set_stream_control(codec, 0x03, 1); in ae5_setup_defaults()
8221 chipio_set_stream_control(codec, 0x04, 1); in ae5_setup_defaults()
8225 dspio_set_uint_param(codec, 0x96, 0x29, tmp); in ae5_setup_defaults()
8226 dspio_set_uint_param(codec, 0x96, 0x2a, tmp); in ae5_setup_defaults()
8227 dspio_set_uint_param(codec, 0x80, 0x0d, tmp); in ae5_setup_defaults()
8228 dspio_set_uint_param(codec, 0x80, 0x0e, tmp); in ae5_setup_defaults()
8230 ca0113_mmio_command_set(codec, 0x30, 0x2e, 0x3f); in ae5_setup_defaults()
8231 ca0113_mmio_gpio_set(codec, 0, false); in ae5_setup_defaults()
8232 ca0113_mmio_command_set(codec, 0x30, 0x28, 0x00); in ae5_setup_defaults()
8236 dspio_set_uint_param(codec, 0x37, 0x08, tmp); in ae5_setup_defaults()
8237 dspio_set_uint_param(codec, 0x37, 0x10, tmp); in ae5_setup_defaults()
8241 dspio_set_uint_param(codec, 0x96, 0x3C, tmp); in ae5_setup_defaults()
8245 dspio_set_uint_param(codec, 0x31, 0x00, tmp); in ae5_setup_defaults()
8246 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000); in ae5_setup_defaults()
8249 dspio_set_uint_param(codec, 0x32, 0x00, tmp); in ae5_setup_defaults()
8251 ca0132_alt_dsp_initial_mic_setup(codec); in ae5_setup_defaults()
8252 ae5_post_dsp_register_set(codec); in ae5_setup_defaults()
8253 ae5_post_dsp_param_setup(codec); in ae5_setup_defaults()
8254 ae5_post_dsp_pll_setup(codec); in ae5_setup_defaults()
8255 ae5_post_dsp_stream_setup(codec); in ae5_setup_defaults()
8256 ae5_post_dsp_startup_data(codec); in ae5_setup_defaults()
8262 dspio_set_uint_param(codec, in ae5_setup_defaults()
8269 ca0132_alt_init_speaker_tuning(codec); in ae5_setup_defaults()
8271 ca0132_alt_create_dummy_stream(codec); in ae5_setup_defaults()
8277 static void ae7_setup_defaults(struct hda_codec *codec) in ae7_setup_defaults() argument
8279 struct ca0132_spec *spec = codec->spec; in ae7_setup_defaults()
8287 ca0132_alt_dsp_scp_startup(codec); in ae7_setup_defaults()
8288 ca0132_alt_init_analog_mics(codec); in ae7_setup_defaults()
8289 ae7_post_dsp_setup_ports(codec); in ae7_setup_defaults()
8292 dspio_set_uint_param(codec, 0x96, in ae7_setup_defaults()
8294 dspio_set_uint_param(codec, 0x96, in ae7_setup_defaults()
8297 ca0113_mmio_command_set(codec, 0x30, 0x2e, 0x3f); in ae7_setup_defaults()
8300 dspio_set_uint_param(codec, 0x80, 0x0d, tmp); in ae7_setup_defaults()
8301 dspio_set_uint_param(codec, 0x80, 0x0e, tmp); in ae7_setup_defaults()
8303 ca0113_mmio_gpio_set(codec, 0, false); in ae7_setup_defaults()
8307 dspio_set_uint_param(codec, 0x37, 0x08, tmp); in ae7_setup_defaults()
8308 dspio_set_uint_param(codec, 0x37, 0x10, tmp); in ae7_setup_defaults()
8312 dspio_set_uint_param(codec, 0x96, 0x3C, tmp); in ae7_setup_defaults()
8316 dspio_set_uint_param(codec, 0x31, 0x00, tmp); in ae7_setup_defaults()
8317 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000); in ae7_setup_defaults()
8320 dspio_set_uint_param(codec, 0x32, 0x00, tmp); in ae7_setup_defaults()
8321 ca0113_mmio_command_set(codec, 0x30, 0x28, 0x00); in ae7_setup_defaults()
8327 ca0132_alt_init_analog_mics(codec); in ae7_setup_defaults()
8329 ae7_post_dsp_asi_setup(codec); in ae7_setup_defaults()
8335 ca0113_mmio_gpio_set(codec, 0, true); in ae7_setup_defaults()
8336 ca0113_mmio_gpio_set(codec, 1, true); in ae7_setup_defaults()
8339 ca0113_mmio_command_set(codec, 0x48, 0x0f, 0x04); in ae7_setup_defaults()
8340 ca0113_mmio_command_set(codec, 0x48, 0x10, 0x04); in ae7_setup_defaults()
8341 ca0113_mmio_command_set_type2(codec, 0x48, 0x07, 0x80); in ae7_setup_defaults()
8347 dspio_set_uint_param(codec, in ae7_setup_defaults()
8354 ca0132_alt_init_speaker_tuning(codec); in ae7_setup_defaults()
8356 ca0132_alt_create_dummy_stream(codec); in ae7_setup_defaults()
8362 static void ca0132_init_flags(struct hda_codec *codec) in ca0132_init_flags() argument
8364 struct ca0132_spec *spec = codec->spec; in ca0132_init_flags()
8367 chipio_set_control_flag(codec, CONTROL_FLAG_DSP_96KHZ, 1); in ca0132_init_flags()
8368 chipio_set_control_flag(codec, CONTROL_FLAG_DAC_96KHZ, 1); in ca0132_init_flags()
8369 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_B_96KHZ, 1); in ca0132_init_flags()
8370 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_C_96KHZ, 1); in ca0132_init_flags()
8371 chipio_set_control_flag(codec, CONTROL_FLAG_SRC_RATE_96KHZ, 1); in ca0132_init_flags()
8372 chipio_set_control_flag(codec, CONTROL_FLAG_IDLE_ENABLE, 0); in ca0132_init_flags()
8373 chipio_set_control_flag(codec, CONTROL_FLAG_SPDIF2OUT, 0); in ca0132_init_flags()
8374 chipio_set_control_flag(codec, in ca0132_init_flags()
8376 chipio_set_control_flag(codec, in ca0132_init_flags()
8379 chipio_set_control_flag(codec, CONTROL_FLAG_IDLE_ENABLE, 0); in ca0132_init_flags()
8380 chipio_set_control_flag(codec, in ca0132_init_flags()
8382 chipio_set_control_flag(codec, in ca0132_init_flags()
8384 chipio_set_control_flag(codec, in ca0132_init_flags()
8386 chipio_set_control_flag(codec, in ca0132_init_flags()
8388 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_C_HIGH_PASS, 1); in ca0132_init_flags()
8395 static void ca0132_init_params(struct hda_codec *codec) in ca0132_init_params() argument
8397 struct ca0132_spec *spec = codec->spec; in ca0132_init_params()
8400 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000); in ca0132_init_params()
8401 chipio_set_conn_rate(codec, 0x0B, SR_48_000); in ca0132_init_params()
8402 chipio_set_control_param(codec, CONTROL_PARAM_SPDIF1_SOURCE, 0); in ca0132_init_params()
8403 chipio_set_control_param(codec, 0, 0); in ca0132_init_params()
8404 chipio_set_control_param(codec, CONTROL_PARAM_VIP_SOURCE, 0); in ca0132_init_params()
8407 chipio_set_control_param(codec, CONTROL_PARAM_PORTA_160OHM_GAIN, 6); in ca0132_init_params()
8408 chipio_set_control_param(codec, CONTROL_PARAM_PORTD_160OHM_GAIN, 6); in ca0132_init_params()
8411 static void ca0132_set_dsp_msr(struct hda_codec *codec, bool is96k) in ca0132_set_dsp_msr() argument
8413 chipio_set_control_flag(codec, CONTROL_FLAG_DSP_96KHZ, is96k); in ca0132_set_dsp_msr()
8414 chipio_set_control_flag(codec, CONTROL_FLAG_DAC_96KHZ, is96k); in ca0132_set_dsp_msr()
8415 chipio_set_control_flag(codec, CONTROL_FLAG_SRC_RATE_96KHZ, is96k); in ca0132_set_dsp_msr()
8416 chipio_set_control_flag(codec, CONTROL_FLAG_SRC_CLOCK_196MHZ, is96k); in ca0132_set_dsp_msr()
8417 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_B_96KHZ, is96k); in ca0132_set_dsp_msr()
8418 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_C_96KHZ, is96k); in ca0132_set_dsp_msr()
8420 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000); in ca0132_set_dsp_msr()
8421 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000); in ca0132_set_dsp_msr()
8422 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000); in ca0132_set_dsp_msr()
8425 static bool ca0132_download_dsp_images(struct hda_codec *codec) in ca0132_download_dsp_images() argument
8428 struct ca0132_spec *spec = codec->spec; in ca0132_download_dsp_images()
8441 codec->card->dev) != 0) in ca0132_download_dsp_images()
8442 codec_dbg(codec, "Desktop firmware not found."); in ca0132_download_dsp_images()
8444 codec_dbg(codec, "Desktop firmware selected."); in ca0132_download_dsp_images()
8448 codec->card->dev) != 0) in ca0132_download_dsp_images()
8449 codec_dbg(codec, "Recon3Di alt firmware not detected."); in ca0132_download_dsp_images()
8451 codec_dbg(codec, "Recon3Di firmware selected."); in ca0132_download_dsp_images()
8458 * exists for your particular codec. in ca0132_download_dsp_images()
8461 codec_dbg(codec, "Default firmware selected."); in ca0132_download_dsp_images()
8463 codec->card->dev) != 0) in ca0132_download_dsp_images()
8468 if (dspload_image(codec, dsp_os_image, 0, 0, true, 0)) { in ca0132_download_dsp_images()
8469 codec_err(codec, "ca0132 DSP load image failed\n"); in ca0132_download_dsp_images()
8473 dsp_loaded = dspload_wait_loaded(codec); in ca0132_download_dsp_images()
8481 static void ca0132_download_dsp(struct hda_codec *codec) in ca0132_download_dsp() argument
8483 struct ca0132_spec *spec = codec->spec; in ca0132_download_dsp()
8492 chipio_enable_clocks(codec); in ca0132_download_dsp()
8496 if (!ca0132_download_dsp_images(codec)) in ca0132_download_dsp()
8504 ca0132_set_dsp_msr(codec, true); in ca0132_download_dsp()
8507 static void ca0132_process_dsp_response(struct hda_codec *codec, in ca0132_process_dsp_response() argument
8510 struct ca0132_spec *spec = codec->spec; in ca0132_process_dsp_response()
8512 codec_dbg(codec, "ca0132_process_dsp_response\n"); in ca0132_process_dsp_response()
8513 snd_hda_power_up_pm(codec); in ca0132_process_dsp_response()
8515 if (dspio_get_response_data(codec) >= 0) in ca0132_process_dsp_response()
8519 dspio_clear_response_queue(codec); in ca0132_process_dsp_response()
8520 snd_hda_power_down_pm(codec); in ca0132_process_dsp_response()
8523 static void hp_callback(struct hda_codec *codec, struct hda_jack_callback *cb) in hp_callback() argument
8525 struct ca0132_spec *spec = codec->spec; in hp_callback()
8531 tbl = snd_hda_jack_tbl_get(codec, cb->nid); in hp_callback()
8537 static void amic_callback(struct hda_codec *codec, struct hda_jack_callback *cb) in amic_callback() argument
8539 struct ca0132_spec *spec = codec->spec; in amic_callback()
8542 ca0132_alt_select_in(codec); in amic_callback()
8544 ca0132_select_mic(codec); in amic_callback()
8547 static void ca0132_init_unsol(struct hda_codec *codec) in ca0132_init_unsol() argument
8549 struct ca0132_spec *spec = codec->spec; in ca0132_init_unsol()
8550 snd_hda_jack_detect_enable_callback(codec, spec->unsol_tag_hp, hp_callback); in ca0132_init_unsol()
8551 snd_hda_jack_detect_enable_callback(codec, spec->unsol_tag_amic1, in ca0132_init_unsol()
8553 snd_hda_jack_detect_enable_callback(codec, UNSOL_TAG_DSP, in ca0132_init_unsol()
8557 snd_hda_jack_detect_enable_callback(codec, in ca0132_init_unsol()
8636 static void ca0132_init_chip(struct hda_codec *codec) in ca0132_init_chip() argument
8638 struct ca0132_spec *spec = codec->spec; in ca0132_init_chip()
8697 ca0132_init_tuning_defaults(codec); in ca0132_init_chip()
8705 static void r3di_gpio_shutdown(struct hda_codec *codec) in r3di_gpio_shutdown() argument
8707 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0x00); in r3di_gpio_shutdown()
8713 static void sbz_region2_exit(struct hda_codec *codec) in sbz_region2_exit() argument
8715 struct ca0132_spec *spec = codec->spec; in sbz_region2_exit()
8723 ca0113_mmio_gpio_set(codec, 0, false); in sbz_region2_exit()
8724 ca0113_mmio_gpio_set(codec, 1, false); in sbz_region2_exit()
8725 ca0113_mmio_gpio_set(codec, 4, true); in sbz_region2_exit()
8726 ca0113_mmio_gpio_set(codec, 5, false); in sbz_region2_exit()
8727 ca0113_mmio_gpio_set(codec, 7, false); in sbz_region2_exit()
8730 static void sbz_set_pin_ctl_default(struct hda_codec *codec) in sbz_set_pin_ctl_default() argument
8735 snd_hda_codec_write(codec, 0x11, 0, in sbz_set_pin_ctl_default()
8739 snd_hda_codec_write(codec, pins[i], 0, in sbz_set_pin_ctl_default()
8743 static void ca0132_clear_unsolicited(struct hda_codec *codec) in ca0132_clear_unsolicited() argument
8749 snd_hda_codec_write(codec, pins[i], 0, in ca0132_clear_unsolicited()
8755 static void sbz_gpio_shutdown_commands(struct hda_codec *codec, int dir, in sbz_gpio_shutdown_commands() argument
8759 snd_hda_codec_write(codec, 0x01, 0, in sbz_gpio_shutdown_commands()
8762 snd_hda_codec_write(codec, 0x01, 0, in sbz_gpio_shutdown_commands()
8766 snd_hda_codec_write(codec, 0x01, 0, in sbz_gpio_shutdown_commands()
8770 static void zxr_dbpro_power_state_shutdown(struct hda_codec *codec) in zxr_dbpro_power_state_shutdown() argument
8776 snd_hda_codec_write(codec, pins[i], 0, in zxr_dbpro_power_state_shutdown()
8780 static void sbz_exit_chip(struct hda_codec *codec) in sbz_exit_chip() argument
8782 chipio_set_stream_control(codec, 0x03, 0); in sbz_exit_chip()
8783 chipio_set_stream_control(codec, 0x04, 0); in sbz_exit_chip()
8786 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, -1); in sbz_exit_chip()
8787 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, 0x05); in sbz_exit_chip()
8788 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, 0x01); in sbz_exit_chip()
8790 chipio_set_stream_control(codec, 0x14, 0); in sbz_exit_chip()
8791 chipio_set_stream_control(codec, 0x0C, 0); in sbz_exit_chip()
8793 chipio_set_conn_rate(codec, 0x41, SR_192_000); in sbz_exit_chip()
8794 chipio_set_conn_rate(codec, 0x91, SR_192_000); in sbz_exit_chip()
8796 chipio_write(codec, 0x18a020, 0x00000083); in sbz_exit_chip()
8798 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, 0x03); in sbz_exit_chip()
8799 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, 0x07); in sbz_exit_chip()
8800 sbz_gpio_shutdown_commands(codec, 0x07, 0x07, 0x06); in sbz_exit_chip()
8802 chipio_set_stream_control(codec, 0x0C, 0); in sbz_exit_chip()
8804 chipio_set_control_param(codec, 0x0D, 0x24); in sbz_exit_chip()
8806 ca0132_clear_unsolicited(codec); in sbz_exit_chip()
8807 sbz_set_pin_ctl_default(codec); in sbz_exit_chip()
8809 snd_hda_codec_write(codec, 0x0B, 0, in sbz_exit_chip()
8812 sbz_region2_exit(codec); in sbz_exit_chip()
8815 static void r3d_exit_chip(struct hda_codec *codec) in r3d_exit_chip() argument
8817 ca0132_clear_unsolicited(codec); in r3d_exit_chip()
8818 snd_hda_codec_write(codec, 0x01, 0, 0x793, 0x00); in r3d_exit_chip()
8819 snd_hda_codec_write(codec, 0x01, 0, 0x794, 0x5b); in r3d_exit_chip()
8822 static void ae5_exit_chip(struct hda_codec *codec) in ae5_exit_chip() argument
8824 chipio_set_stream_control(codec, 0x03, 0); in ae5_exit_chip()
8825 chipio_set_stream_control(codec, 0x04, 0); in ae5_exit_chip()
8827 ca0113_mmio_command_set(codec, 0x30, 0x32, 0x3f); in ae5_exit_chip()
8828 ca0113_mmio_command_set(codec, 0x48, 0x07, 0x83); in ae5_exit_chip()
8829 ca0113_mmio_command_set(codec, 0x48, 0x07, 0x83); in ae5_exit_chip()
8830 ca0113_mmio_command_set(codec, 0x30, 0x30, 0x00); in ae5_exit_chip()
8831 ca0113_mmio_command_set(codec, 0x30, 0x2b, 0x00); in ae5_exit_chip()
8832 ca0113_mmio_command_set(codec, 0x30, 0x2d, 0x00); in ae5_exit_chip()
8833 ca0113_mmio_gpio_set(codec, 0, false); in ae5_exit_chip()
8834 ca0113_mmio_gpio_set(codec, 1, false); in ae5_exit_chip()
8836 snd_hda_codec_write(codec, 0x01, 0, 0x793, 0x00); in ae5_exit_chip()
8837 snd_hda_codec_write(codec, 0x01, 0, 0x794, 0x53); in ae5_exit_chip()
8839 chipio_set_control_param(codec, CONTROL_PARAM_ASI, 0); in ae5_exit_chip()
8841 chipio_set_stream_control(codec, 0x18, 0); in ae5_exit_chip()
8842 chipio_set_stream_control(codec, 0x0c, 0); in ae5_exit_chip()
8844 snd_hda_codec_write(codec, 0x01, 0, 0x724, 0x83); in ae5_exit_chip()
8847 static void ae7_exit_chip(struct hda_codec *codec) in ae7_exit_chip() argument
8849 chipio_set_stream_control(codec, 0x18, 0); in ae7_exit_chip()
8850 chipio_set_stream_source_dest(codec, 0x21, 0xc8, 0xc8); in ae7_exit_chip()
8851 chipio_set_stream_channels(codec, 0x21, 0); in ae7_exit_chip()
8852 chipio_set_control_param(codec, CONTROL_PARAM_NODE_ID, 0x09); in ae7_exit_chip()
8853 chipio_set_control_param(codec, 0x20, 0x01); in ae7_exit_chip()
8855 chipio_set_control_param(codec, CONTROL_PARAM_ASI, 0); in ae7_exit_chip()
8857 chipio_set_stream_control(codec, 0x18, 0); in ae7_exit_chip()
8858 chipio_set_stream_control(codec, 0x0c, 0); in ae7_exit_chip()
8860 ca0113_mmio_command_set(codec, 0x30, 0x2b, 0x00); in ae7_exit_chip()
8861 snd_hda_codec_write(codec, 0x15, 0, 0x724, 0x83); in ae7_exit_chip()
8862 ca0113_mmio_command_set_type2(codec, 0x48, 0x07, 0x83); in ae7_exit_chip()
8863 ca0113_mmio_command_set(codec, 0x30, 0x30, 0x00); in ae7_exit_chip()
8864 ca0113_mmio_command_set(codec, 0x30, 0x2e, 0x00); in ae7_exit_chip()
8865 ca0113_mmio_gpio_set(codec, 0, false); in ae7_exit_chip()
8866 ca0113_mmio_gpio_set(codec, 1, false); in ae7_exit_chip()
8867 ca0113_mmio_command_set(codec, 0x30, 0x32, 0x3f); in ae7_exit_chip()
8869 snd_hda_codec_write(codec, 0x01, 0, 0x793, 0x00); in ae7_exit_chip()
8870 snd_hda_codec_write(codec, 0x01, 0, 0x794, 0x53); in ae7_exit_chip()
8873 static void zxr_exit_chip(struct hda_codec *codec) in zxr_exit_chip() argument
8875 chipio_set_stream_control(codec, 0x03, 0); in zxr_exit_chip()
8876 chipio_set_stream_control(codec, 0x04, 0); in zxr_exit_chip()
8877 chipio_set_stream_control(codec, 0x14, 0); in zxr_exit_chip()
8878 chipio_set_stream_control(codec, 0x0C, 0); in zxr_exit_chip()
8880 chipio_set_conn_rate(codec, 0x41, SR_192_000); in zxr_exit_chip()
8881 chipio_set_conn_rate(codec, 0x91, SR_192_000); in zxr_exit_chip()
8883 chipio_write(codec, 0x18a020, 0x00000083); in zxr_exit_chip()
8885 snd_hda_codec_write(codec, 0x01, 0, 0x793, 0x00); in zxr_exit_chip()
8886 snd_hda_codec_write(codec, 0x01, 0, 0x794, 0x53); in zxr_exit_chip()
8888 ca0132_clear_unsolicited(codec); in zxr_exit_chip()
8889 sbz_set_pin_ctl_default(codec); in zxr_exit_chip()
8890 snd_hda_codec_write(codec, 0x0B, 0, AC_VERB_SET_EAPD_BTLENABLE, 0x00); in zxr_exit_chip()
8892 ca0113_mmio_gpio_set(codec, 5, false); in zxr_exit_chip()
8893 ca0113_mmio_gpio_set(codec, 2, false); in zxr_exit_chip()
8894 ca0113_mmio_gpio_set(codec, 3, false); in zxr_exit_chip()
8895 ca0113_mmio_gpio_set(codec, 0, false); in zxr_exit_chip()
8896 ca0113_mmio_gpio_set(codec, 4, true); in zxr_exit_chip()
8897 ca0113_mmio_gpio_set(codec, 0, true); in zxr_exit_chip()
8898 ca0113_mmio_gpio_set(codec, 5, true); in zxr_exit_chip()
8899 ca0113_mmio_gpio_set(codec, 2, false); in zxr_exit_chip()
8900 ca0113_mmio_gpio_set(codec, 3, false); in zxr_exit_chip()
8903 static void ca0132_exit_chip(struct hda_codec *codec) in ca0132_exit_chip() argument
8907 if (dspload_is_loaded(codec)) in ca0132_exit_chip()
8908 dsp_reset(codec); in ca0132_exit_chip()
8919 static void sbz_dsp_startup_check(struct hda_codec *codec) in sbz_dsp_startup_check() argument
8921 struct ca0132_spec *spec = codec->spec; in sbz_dsp_startup_check()
8934 chipio_read(codec, cur_address, &dsp_data_check[i]); in sbz_dsp_startup_check()
8942 codec_dbg(codec, "Startup Check: %d ", failure); in sbz_dsp_startup_check()
8944 codec_info(codec, "DSP not initialized properly. Attempting to fix."); in sbz_dsp_startup_check()
8951 codec_info(codec, "Reloading... Tries left: %d", reload); in sbz_dsp_startup_check()
8952 sbz_exit_chip(codec); in sbz_dsp_startup_check()
8954 codec->patch_ops.init(codec); in sbz_dsp_startup_check()
8957 chipio_read(codec, cur_address, &dsp_data_check[i]); in sbz_dsp_startup_check()
8968 codec_info(codec, "DSP fixed."); in sbz_dsp_startup_check()
8973 …codec_info(codec, "DSP failed to initialize properly. Either try a full shutdown or a suspend to c… in sbz_dsp_startup_check()
8984 static void ca0132_alt_vol_setup(struct hda_codec *codec) in ca0132_alt_vol_setup() argument
8986 snd_hda_codec_write(codec, 0x02, 0, 0x797, 0x00); in ca0132_alt_vol_setup()
8987 snd_hda_codec_write(codec, 0x02, 0, 0x798, 0x00); in ca0132_alt_vol_setup()
8988 snd_hda_codec_write(codec, 0x03, 0, 0x797, 0x00); in ca0132_alt_vol_setup()
8989 snd_hda_codec_write(codec, 0x03, 0, 0x798, 0x00); in ca0132_alt_vol_setup()
8990 snd_hda_codec_write(codec, 0x04, 0, 0x797, 0x00); in ca0132_alt_vol_setup()
8991 snd_hda_codec_write(codec, 0x04, 0, 0x798, 0x00); in ca0132_alt_vol_setup()
8992 snd_hda_codec_write(codec, 0x07, 0, 0x797, 0x00); in ca0132_alt_vol_setup()
8993 snd_hda_codec_write(codec, 0x07, 0, 0x798, 0x00); in ca0132_alt_vol_setup()
8999 static void sbz_pre_dsp_setup(struct hda_codec *codec) in sbz_pre_dsp_setup() argument
9001 struct ca0132_spec *spec = codec->spec; in sbz_pre_dsp_setup()
9006 chipio_write(codec, 0x18b0a4, 0x000000c2); in sbz_pre_dsp_setup()
9008 snd_hda_codec_write(codec, 0x11, 0, in sbz_pre_dsp_setup()
9012 static void r3d_pre_dsp_setup(struct hda_codec *codec) in r3d_pre_dsp_setup() argument
9014 chipio_write(codec, 0x18b0a4, 0x000000c2); in r3d_pre_dsp_setup()
9016 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3d_pre_dsp_setup()
9018 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3d_pre_dsp_setup()
9020 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3d_pre_dsp_setup()
9023 snd_hda_codec_write(codec, 0x11, 0, in r3d_pre_dsp_setup()
9027 static void r3di_pre_dsp_setup(struct hda_codec *codec) in r3di_pre_dsp_setup() argument
9029 chipio_write(codec, 0x18b0a4, 0x000000c2); in r3di_pre_dsp_setup()
9031 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3di_pre_dsp_setup()
9033 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3di_pre_dsp_setup()
9035 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3di_pre_dsp_setup()
9038 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3di_pre_dsp_setup()
9040 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3di_pre_dsp_setup()
9042 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3di_pre_dsp_setup()
9044 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in r3di_pre_dsp_setup()
9047 snd_hda_codec_write(codec, 0x11, 0, in r3di_pre_dsp_setup()
9091 static void ca0132_mmio_init_sbz(struct hda_codec *codec) in ca0132_mmio_init_sbz() argument
9093 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init_sbz()
9141 static void ca0132_mmio_init_ae5(struct hda_codec *codec) in ca0132_mmio_init_ae5() argument
9143 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init_ae5()
9173 static void ca0132_mmio_init(struct hda_codec *codec) in ca0132_mmio_init() argument
9175 struct ca0132_spec *spec = codec->spec; in ca0132_mmio_init()
9181 ca0132_mmio_init_sbz(codec); in ca0132_mmio_init()
9184 ca0132_mmio_init_ae5(codec); in ca0132_mmio_init()
9203 * eventually resets the codec with the 0x7ff verb. Not quite sure why it does
9206 static void ae5_register_set(struct hda_codec *codec) in ae5_register_set() argument
9208 struct ca0132_spec *spec = codec->spec; in ae5_register_set()
9216 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_register_set()
9218 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_register_set()
9222 chipio_8051_write_direct(codec, 0x93, 0x10); in ae5_register_set()
9223 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_register_set()
9225 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ae5_register_set()
9254 ca0113_mmio_command_set_type2(codec, 0x48, 0x07, 0x83); in ae5_register_set()
9255 ca0113_mmio_command_set(codec, 0x30, 0x2e, 0x3f); in ae5_register_set()
9257 ca0113_mmio_command_set(codec, 0x30, 0x2d, 0x3f); in ae5_register_set()
9260 chipio_8051_write_direct(codec, 0x90, 0x00); in ae5_register_set()
9261 chipio_8051_write_direct(codec, 0x90, 0x10); in ae5_register_set()
9264 ca0113_mmio_command_set(codec, 0x48, 0x07, 0x83); in ae5_register_set()
9266 chipio_write(codec, 0x18b0a4, 0x000000c2); in ae5_register_set()
9268 snd_hda_codec_write(codec, 0x01, 0, 0x7ff, 0x00); in ae5_register_set()
9269 snd_hda_codec_write(codec, 0x01, 0, 0x7ff, 0x00); in ae5_register_set()
9277 static void ca0132_alt_init(struct hda_codec *codec) in ca0132_alt_init() argument
9279 struct ca0132_spec *spec = codec->spec; in ca0132_alt_init()
9281 ca0132_alt_vol_setup(codec); in ca0132_alt_init()
9285 codec_dbg(codec, "SBZ alt_init"); in ca0132_alt_init()
9286 ca0132_gpio_init(codec); in ca0132_alt_init()
9287 sbz_pre_dsp_setup(codec); in ca0132_alt_init()
9288 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9289 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9292 codec_dbg(codec, "R3DI alt_init"); in ca0132_alt_init()
9293 ca0132_gpio_init(codec); in ca0132_alt_init()
9294 ca0132_gpio_setup(codec); in ca0132_alt_init()
9295 r3di_gpio_dsp_status_set(codec, R3DI_DSP_DOWNLOADING); in ca0132_alt_init()
9296 r3di_pre_dsp_setup(codec); in ca0132_alt_init()
9297 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9298 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, 0x6FF, 0xC4); in ca0132_alt_init()
9301 r3d_pre_dsp_setup(codec); in ca0132_alt_init()
9302 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9303 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9306 ca0132_gpio_init(codec); in ca0132_alt_init()
9307 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_alt_init()
9309 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_alt_init()
9311 chipio_write(codec, 0x18b030, 0x00000020); in ca0132_alt_init()
9312 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9313 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9314 ca0113_mmio_command_set(codec, 0x30, 0x32, 0x3f); in ca0132_alt_init()
9317 ca0132_gpio_init(codec); in ca0132_alt_init()
9318 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_alt_init()
9320 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_alt_init()
9322 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9323 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9324 chipio_write(codec, 0x18b008, 0x000000f8); in ca0132_alt_init()
9325 chipio_write(codec, 0x18b008, 0x000000f0); in ca0132_alt_init()
9326 chipio_write(codec, 0x18b030, 0x00000020); in ca0132_alt_init()
9327 ca0113_mmio_command_set(codec, 0x30, 0x32, 0x3f); in ca0132_alt_init()
9330 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_alt_init()
9331 snd_hda_sequence_write(codec, spec->desktop_init_verbs); in ca0132_alt_init()
9338 static int ca0132_init(struct hda_codec *codec) in ca0132_init() argument
9340 struct ca0132_spec *spec = codec->spec; in ca0132_init()
9347 * there's only two reasons for it. One, the codec has awaken from a in ca0132_init()
9356 dsp_loaded = dspload_is_loaded(codec); in ca0132_init()
9362 sbz_dsp_startup_check(codec); in ca0132_init()
9372 ca0132_mmio_init(codec); in ca0132_init()
9374 snd_hda_power_up_pm(codec); in ca0132_init()
9377 ae5_register_set(codec); in ca0132_init()
9379 ca0132_init_unsol(codec); in ca0132_init()
9380 ca0132_init_params(codec); in ca0132_init()
9381 ca0132_init_flags(codec); in ca0132_init()
9383 snd_hda_sequence_write(codec, spec->base_init_verbs); in ca0132_init()
9386 ca0132_alt_init(codec); in ca0132_init()
9388 ca0132_download_dsp(codec); in ca0132_init()
9390 ca0132_refresh_widget_caps(codec); in ca0132_init()
9395 r3d_setup_defaults(codec); in ca0132_init()
9399 sbz_setup_defaults(codec); in ca0132_init()
9402 ae5_setup_defaults(codec); in ca0132_init()
9405 ae7_setup_defaults(codec); in ca0132_init()
9408 ca0132_setup_defaults(codec); in ca0132_init()
9409 ca0132_init_analog_mic2(codec); in ca0132_init()
9410 ca0132_init_dmic(codec); in ca0132_init()
9415 init_output(codec, spec->out_pins[i], spec->dacs[0]); in ca0132_init()
9417 init_output(codec, cfg->dig_out_pins[0], spec->dig_out); in ca0132_init()
9420 init_input(codec, spec->input_pins[i], spec->adcs[i]); in ca0132_init()
9422 init_input(codec, cfg->dig_in_pin, spec->dig_in); in ca0132_init()
9425 snd_hda_sequence_write(codec, spec->chip_init_verbs); in ca0132_init()
9426 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init()
9428 snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, in ca0132_init()
9433 ca0132_gpio_setup(codec); in ca0132_init()
9435 snd_hda_sequence_write(codec, spec->spec_init_verbs); in ca0132_init()
9437 ca0132_alt_select_out(codec); in ca0132_init()
9438 ca0132_alt_select_in(codec); in ca0132_init()
9440 ca0132_select_out(codec); in ca0132_init()
9441 ca0132_select_mic(codec); in ca0132_init()
9444 snd_hda_jack_report_sync(codec); in ca0132_init()
9452 ca0132_pe_switch_set(codec); in ca0132_init()
9455 snd_hda_power_down_pm(codec); in ca0132_init()
9460 static int dbpro_init(struct hda_codec *codec) in dbpro_init() argument
9462 struct ca0132_spec *spec = codec->spec; in dbpro_init()
9466 init_output(codec, cfg->dig_out_pins[0], spec->dig_out); in dbpro_init()
9467 init_input(codec, cfg->dig_in_pin, spec->dig_in); in dbpro_init()
9470 init_input(codec, spec->input_pins[i], spec->adcs[i]); in dbpro_init()
9475 static void ca0132_free(struct hda_codec *codec) in ca0132_free() argument
9477 struct ca0132_spec *spec = codec->spec; in ca0132_free()
9480 snd_hda_power_up(codec); in ca0132_free()
9483 sbz_exit_chip(codec); in ca0132_free()
9486 zxr_exit_chip(codec); in ca0132_free()
9489 r3d_exit_chip(codec); in ca0132_free()
9492 ae5_exit_chip(codec); in ca0132_free()
9495 ae7_exit_chip(codec); in ca0132_free()
9498 r3di_gpio_shutdown(codec); in ca0132_free()
9504 snd_hda_sequence_write(codec, spec->base_exit_verbs); in ca0132_free()
9505 ca0132_exit_chip(codec); in ca0132_free()
9507 snd_hda_power_down(codec); in ca0132_free()
9510 pci_iounmap(codec->bus->pci, spec->mem_base); in ca0132_free()
9513 kfree(codec->spec); in ca0132_free()
9516 static void dbpro_free(struct hda_codec *codec) in dbpro_free() argument
9518 struct ca0132_spec *spec = codec->spec; in dbpro_free()
9520 zxr_dbpro_power_state_shutdown(codec); in dbpro_free()
9523 kfree(codec->spec); in dbpro_free()
9526 static void ca0132_reboot_notify(struct hda_codec *codec) in ca0132_reboot_notify() argument
9528 codec->patch_ops.free(codec); in ca0132_reboot_notify()
9532 static int ca0132_suspend(struct hda_codec *codec) in ca0132_suspend() argument
9534 struct ca0132_spec *spec = codec->spec; in ca0132_suspend()
9560 static void ca0132_config(struct hda_codec *codec) in ca0132_config() argument
9562 struct ca0132_spec *spec = codec->spec; in ca0132_config()
9578 codec_dbg(codec, "%s: QUIRK_ALIENWARE applied.\n", __func__); in ca0132_config()
9579 snd_hda_apply_pincfgs(codec, alienware_pincfgs); in ca0132_config()
9582 codec_dbg(codec, "%s: QUIRK_SBZ applied.\n", __func__); in ca0132_config()
9583 snd_hda_apply_pincfgs(codec, sbz_pincfgs); in ca0132_config()
9586 codec_dbg(codec, "%s: QUIRK_ZXR applied.\n", __func__); in ca0132_config()
9587 snd_hda_apply_pincfgs(codec, zxr_pincfgs); in ca0132_config()
9590 codec_dbg(codec, "%s: QUIRK_R3D applied.\n", __func__); in ca0132_config()
9591 snd_hda_apply_pincfgs(codec, r3d_pincfgs); in ca0132_config()
9594 codec_dbg(codec, "%s: QUIRK_R3DI applied.\n", __func__); in ca0132_config()
9595 snd_hda_apply_pincfgs(codec, r3di_pincfgs); in ca0132_config()
9598 codec_dbg(codec, "%s: QUIRK_AE5 applied.\n", __func__); in ca0132_config()
9599 snd_hda_apply_pincfgs(codec, ae5_pincfgs); in ca0132_config()
9602 codec_dbg(codec, "%s: QUIRK_AE7 applied.\n", __func__); in ca0132_config()
9603 snd_hda_apply_pincfgs(codec, ae7_pincfgs); in ca0132_config()
9760 static int ca0132_prepare_verbs(struct hda_codec *codec) in ca0132_prepare_verbs() argument
9764 struct ca0132_spec *spec = codec->spec; in ca0132_prepare_verbs()
9805 * Sound Blaster Z cards. However, they have different HDA codec subsystem
9809 static void sbz_detect_quirk(struct hda_codec *codec) in sbz_detect_quirk() argument
9811 struct ca0132_spec *spec = codec->spec; in sbz_detect_quirk()
9813 switch (codec->core.subsystem_id) { in sbz_detect_quirk()
9826 static int patch_ca0132(struct hda_codec *codec) in patch_ca0132() argument
9832 codec_dbg(codec, "patch_ca0132\n"); in patch_ca0132()
9837 codec->spec = spec; in patch_ca0132()
9838 spec->codec = codec; in patch_ca0132()
9840 /* Detect codec quirk */ in patch_ca0132()
9841 quirk = snd_pci_quirk_lookup(codec->bus->pci, ca0132_quirks); in patch_ca0132()
9847 sbz_detect_quirk(codec); in patch_ca0132()
9850 codec->patch_ops = dbpro_patch_ops; in patch_ca0132()
9852 codec->patch_ops = ca0132_patch_ops; in patch_ca0132()
9854 codec->pcm_format_first = 1; in patch_ca0132()
9855 codec->no_sticky_stream = 1; in patch_ca0132()
9865 snd_hda_codec_set_name(codec, "Sound Blaster Z"); in patch_ca0132()
9869 snd_hda_codec_set_name(codec, "Sound Blaster ZxR"); in patch_ca0132()
9875 snd_hda_codec_set_name(codec, "Recon3D"); in patch_ca0132()
9879 snd_hda_codec_set_name(codec, "Recon3Di"); in patch_ca0132()
9883 snd_hda_codec_set_name(codec, "Sound BlasterX AE-5"); in patch_ca0132()
9887 snd_hda_codec_set_name(codec, "Sound Blaster AE-7"); in patch_ca0132()
9919 spec->mem_base = pci_iomap(codec->bus->pci, 2, 0xC20); in patch_ca0132()
9921 codec_warn(codec, "pci_iomap failed! Setting quirk to QUIRK_NONE."); in patch_ca0132()
9932 ca0132_init_chip(codec); in patch_ca0132()
9934 ca0132_config(codec); in patch_ca0132()
9936 err = ca0132_prepare_verbs(codec); in patch_ca0132()
9940 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); in patch_ca0132()
9947 ca0132_free(codec); in patch_ca0132()
9961 MODULE_DESCRIPTION("Creative Sound Core3D codec");