Lines Matching +full:spec +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
24 struct cs8409_spec *spec = codec->spec; in cs8409_parse_auto_config() local
28 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); in cs8409_parse_auto_config()
32 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in cs8409_parse_auto_config()
37 if (spec->gen.dyn_adc_switch) { in cs8409_parse_auto_config()
40 for (i = 0; i < spec->gen.input_mux.num_items; i++) { in cs8409_parse_auto_config()
41 int idx = spec->gen.dyn_adc_idx[i]; in cs8409_parse_auto_config()
45 snd_hda_gen_fix_pin_power(codec, spec->gen.adc_nids[idx]); in cs8409_parse_auto_config()
57 struct cs8409_spec *spec; in cs8409_alloc_spec() local
59 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in cs8409_alloc_spec()
60 if (!spec) in cs8409_alloc_spec()
62 codec->spec = spec; in cs8409_alloc_spec()
63 spec->codec = codec; in cs8409_alloc_spec()
64 codec->power_save_node = 1; in cs8409_alloc_spec()
65 mutex_init(&spec->i2c_mux); in cs8409_alloc_spec()
66 INIT_DELAYED_WORK(&spec->i2c_clk_work, cs8409_disable_i2c_clock_worker); in cs8409_alloc_spec()
67 snd_hda_gen_spec_init(&spec->gen); in cs8409_alloc_spec()
69 return spec; in cs8409_alloc_spec()
86 * cs8409_enable_i2c_clock - Disable I2C clocks
93 struct cs8409_spec *spec = codec->spec; in cs8409_disable_i2c_clock() local
95 mutex_lock(&spec->i2c_mux); in cs8409_disable_i2c_clock()
96 if (spec->i2c_clck_enabled) { in cs8409_disable_i2c_clock()
97 cs8409_vendor_coef_set(spec->codec, 0x0, in cs8409_disable_i2c_clock()
98 cs8409_vendor_coef_get(spec->codec, 0x0) & 0xfffffff7); in cs8409_disable_i2c_clock()
99 spec->i2c_clck_enabled = 0; in cs8409_disable_i2c_clock()
101 mutex_unlock(&spec->i2c_mux); in cs8409_disable_i2c_clock()
105 * cs8409_disable_i2c_clock_worker - Worker that disable the I2C Clock after 25ms without use
109 struct cs8409_spec *spec = container_of(work, struct cs8409_spec, i2c_clk_work.work); in cs8409_disable_i2c_clock_worker() local
111 cs8409_disable_i2c_clock(spec->codec); in cs8409_disable_i2c_clock_worker()
115 * cs8409_enable_i2c_clock - Enable I2C clocks
122 struct cs8409_spec *spec = codec->spec; in cs8409_enable_i2c_clock() local
128 * afterwards in the scenario. The next enable call will re-enable the clock, regardless. in cs8409_enable_i2c_clock()
130 cancel_delayed_work(&spec->i2c_clk_work); in cs8409_enable_i2c_clock()
132 if (!spec->i2c_clck_enabled) { in cs8409_enable_i2c_clock()
134 spec->i2c_clck_enabled = 1; in cs8409_enable_i2c_clock()
136 queue_delayed_work(system_power_efficient_wq, &spec->i2c_clk_work, msecs_to_jiffies(25)); in cs8409_enable_i2c_clock()
140 * cs8409_i2c_wait_complete - Wait for I2C transaction
144 * Return -ETIMEDOUT if transaction wait times out.
155 * cs8409_set_i2c_dev_addr - Set i2c address for transaction
161 struct cs8409_spec *spec = codec->spec; in cs8409_set_i2c_dev_addr() local
163 if (spec->dev_addr != addr) { in cs8409_set_i2c_dev_addr()
165 spec->dev_addr = addr; in cs8409_set_i2c_dev_addr()
170 * cs8409_i2c_set_page - CS8409 I2C set page register.
178 struct hda_codec *codec = scodec->codec; in cs8409_i2c_set_page()
180 if (scodec->paged && (scodec->last_page != (i2c_reg >> 8))) { in cs8409_i2c_set_page()
183 return -EIO; in cs8409_i2c_set_page()
184 scodec->last_page = i2c_reg >> 8; in cs8409_i2c_set_page()
191 * cs8409_i2c_read - CS8409 I2C Read.
195 * Returns negative on error, otherwise returns read value in bits 0-7.
199 struct hda_codec *codec = scodec->codec; in cs8409_i2c_read()
200 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_read() local
204 if (scodec->suspended) in cs8409_i2c_read()
205 return -EPERM; in cs8409_i2c_read()
207 mutex_lock(&spec->i2c_mux); in cs8409_i2c_read()
209 cs8409_set_i2c_dev_addr(codec, scodec->addr); in cs8409_i2c_read()
219 /* Register in bits 15-8 and the data in 7-0 */ in cs8409_i2c_read()
222 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_read()
227 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_read()
228 codec_err(codec, "%s() Failed 0x%02x : 0x%04x\n", __func__, scodec->addr, addr); in cs8409_i2c_read()
229 return -EIO; in cs8409_i2c_read()
233 * cs8409_i2c_bulk_read - CS8409 I2C Read Sequence.
242 struct hda_codec *codec = scodec->codec; in cs8409_i2c_bulk_read()
243 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_bulk_read() local
247 if (scodec->suspended) in cs8409_i2c_bulk_read()
248 return -EPERM; in cs8409_i2c_bulk_read()
250 mutex_lock(&spec->i2c_mux); in cs8409_i2c_bulk_read()
251 cs8409_set_i2c_dev_addr(codec, scodec->addr); in cs8409_i2c_bulk_read()
267 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_bulk_read()
272 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_bulk_read()
273 codec_err(codec, "I2C Bulk Write Failed 0x%02x\n", scodec->addr); in cs8409_i2c_bulk_read()
274 return -EIO; in cs8409_i2c_bulk_read()
278 * cs8409_i2c_write - CS8409 I2C Write.
287 struct hda_codec *codec = scodec->codec; in cs8409_i2c_write()
288 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_write() local
291 if (scodec->suspended) in cs8409_i2c_write()
292 return -EPERM; in cs8409_i2c_write()
294 mutex_lock(&spec->i2c_mux); in cs8409_i2c_write()
297 cs8409_set_i2c_dev_addr(codec, scodec->addr); in cs8409_i2c_write()
308 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_write()
312 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_write()
313 codec_err(codec, "%s() Failed 0x%02x : 0x%04x\n", __func__, scodec->addr, addr); in cs8409_i2c_write()
314 return -EIO; in cs8409_i2c_write()
318 * cs8409_i2c_bulk_write - CS8409 I2C Write Sequence.
328 struct hda_codec *codec = scodec->codec; in cs8409_i2c_bulk_write()
329 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_bulk_write() local
333 if (scodec->suspended) in cs8409_i2c_bulk_write()
334 return -EPERM; in cs8409_i2c_bulk_write()
336 mutex_lock(&spec->i2c_mux); in cs8409_i2c_bulk_write()
337 cs8409_set_i2c_dev_addr(codec, scodec->addr); in cs8409_i2c_bulk_write()
351 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_bulk_write()
356 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_bulk_write()
357 codec_err(codec, "I2C Bulk Write Failed 0x%02x\n", scodec->addr); in cs8409_i2c_bulk_write()
358 return -EIO; in cs8409_i2c_bulk_write()
386 struct cs8409_spec *spec = codec->spec; in cs8409_enable_ur() local
390 for (i = 0; i < spec->num_scodecs; i++) in cs8409_enable_ur()
391 ur_gpios |= spec->scodecs[i]->irq_mask; in cs8409_enable_ur()
414 caps = snd_hdac_read_parm(&codec->core, nid, AC_PAR_PIN_CAP); in cs8409_fix_caps()
416 snd_hdac_override_parm(&codec->core, nid, AC_PAR_PIN_CAP, in cs8409_fix_caps()
426 struct cs8409_spec *spec = codec->spec; in cs8409_spk_sw_gpio_get() local
428 ucontrol->value.integer.value[0] = !!(spec->gpio_data & spec->speaker_pdn_gpio); in cs8409_spk_sw_gpio_get()
436 struct cs8409_spec *spec = codec->spec; in cs8409_spk_sw_gpio_put() local
439 gpio_data = (spec->gpio_data & ~spec->speaker_pdn_gpio) | in cs8409_spk_sw_gpio_put()
440 (ucontrol->value.integer.value[0] ? spec->speaker_pdn_gpio : 0); in cs8409_spk_sw_gpio_put()
441 if (gpio_data == spec->gpio_data) in cs8409_spk_sw_gpio_put()
443 spec->gpio_data = gpio_data; in cs8409_spk_sw_gpio_put()
444 snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_data); in cs8409_spk_sw_gpio_put()
464 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in cs42l42_volume_info()
465 uinfo->value.integer.step = 1; in cs42l42_volume_info()
466 uinfo->count = chs == 3 ? 2 : 1; in cs42l42_volume_info()
470 uinfo->value.integer.min = CS42L42_HP_VOL_REAL_MIN; in cs42l42_volume_info()
471 uinfo->value.integer.max = CS42L42_HP_VOL_REAL_MAX; in cs42l42_volume_info()
474 uinfo->value.integer.min = CS42L42_AMIC_VOL_REAL_MIN; in cs42l42_volume_info()
475 uinfo->value.integer.max = CS42L42_AMIC_VOL_REAL_MAX; in cs42l42_volume_info()
487 struct cs8409_spec *spec = codec->spec; in cs42l42_volume_get() local
488 struct sub_codec *cs42l42 = spec->scodecs[get_amp_index(kctrl)]; in cs42l42_volume_get()
491 long *valp = uctrl->value.integer.value; in cs42l42_volume_get()
496 *valp++ = cs42l42->vol[ofs]; in cs42l42_volume_get()
498 *valp = cs42l42->vol[ofs+1]; in cs42l42_volume_get()
502 *valp = cs42l42->vol[ofs]; in cs42l42_volume_get()
528 -(cs42l42->vol[CS42L42_DAC_CH0_VOL_OFFSET]) in cs42l42_mute()
532 -(cs42l42->vol[CS42L42_DAC_CH1_VOL_OFFSET]) in cs42l42_mute()
537 cs42l42->vol[CS42L42_ADC_VOL_OFFSET] in cs42l42_mute()
546 struct cs8409_spec *spec = codec->spec; in cs42l42_volume_put() local
547 struct sub_codec *cs42l42 = spec->scodecs[get_amp_index(kctrl)]; in cs42l42_volume_put()
550 long *valp = uctrl->value.integer.value; in cs42l42_volume_put()
555 cs42l42->vol[ofs] = *valp; in cs42l42_volume_put()
558 cs42l42->vol[ofs + 1] = *valp; in cs42l42_volume_put()
560 if (spec->playback_started) in cs42l42_volume_put()
565 cs42l42->vol[ofs] = *valp; in cs42l42_volume_put()
566 if (spec->capture_started) in cs42l42_volume_put()
581 struct cs8409_spec *spec = codec->spec; in cs42l42_playback_pcm_hook() local
589 spec->playback_started = 1; in cs42l42_playback_pcm_hook()
593 spec->playback_started = 0; in cs42l42_playback_pcm_hook()
599 for (i = 0; i < spec->num_scodecs; i++) { in cs42l42_playback_pcm_hook()
600 cs42l42 = spec->scodecs[i]; in cs42l42_playback_pcm_hook()
610 struct cs8409_spec *spec = codec->spec; in cs42l42_capture_pcm_hook() local
618 spec->capture_started = 1; in cs42l42_capture_pcm_hook()
622 spec->capture_started = 0; in cs42l42_capture_pcm_hook()
628 for (i = 0; i < spec->num_scodecs; i++) { in cs42l42_capture_pcm_hook()
629 cs42l42 = spec->scodecs[i]; in cs42l42_capture_pcm_hook()
637 cs8409_i2c_write(cs42l42, CS42L42_HSBIAS_SC_AUTOCTL, cs42l42->hsbias_hiz); in cs42l42_enable_jack_detect()
771 if (cs42l42->no_type_dect) { in cs42l42_handle_tip_sense()
773 cs42l42->hp_jack_in = 1; in cs42l42_handle_tip_sense()
774 cs42l42->mic_jack_in = 0; in cs42l42_handle_tip_sense()
782 cs42l42->hp_jack_in = 0; in cs42l42_handle_tip_sense()
783 cs42l42->mic_jack_in = 0; in cs42l42_handle_tip_sense()
790 codec_dbg(cs42l42->codec, "Tip Sense Detection: (%d)\n", reg_ts_status); in cs42l42_handle_tip_sense()
811 return -EIO; in cs42l42_jack_unsol_event()
827 if (cs42l42->no_type_dect) { in cs42l42_jack_unsol_event()
831 codec_dbg(cs42l42->codec, in cs42l42_jack_unsol_event()
841 cs42l42->hp_jack_in = 1; in cs42l42_jack_unsol_event()
842 cs42l42->mic_jack_in = 1; in cs42l42_jack_unsol_event()
846 cs42l42->hp_jack_in = 1; in cs42l42_jack_unsol_event()
847 cs42l42->mic_jack_in = 0; in cs42l42_jack_unsol_event()
851 cs42l42->hp_jack_in = 0; in cs42l42_jack_unsol_event()
852 cs42l42->mic_jack_in = 0; in cs42l42_jack_unsol_event()
855 codec_dbg(cs42l42->codec, "Detection done (%d)\n", type); in cs42l42_jack_unsol_event()
858 /* Enable the HPOUT ground clamp and configure the HP pull-down */ in cs42l42_jack_unsol_event()
860 /* Re-Enable Tip Sense Interrupt */ in cs42l42_jack_unsol_event()
871 struct hda_codec *codec = cs42l42->codec; in cs42l42_resume()
872 struct cs8409_spec *spec = codec->spec; in cs42l42_resume() local
882 spec->gpio_data = snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_GET_GPIO_DATA, 0); in cs42l42_resume()
883 spec->gpio_data |= cs42l42->reset_gpio; in cs42l42_resume()
884 snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_data); in cs42l42_resume()
887 cs42l42->suspended = 0; in cs42l42_resume()
890 cs8409_i2c_bulk_write(cs42l42, cs42l42->init_seq, cs42l42->init_seq_num); in cs42l42_resume()
897 if (cs42l42->full_scale_vol == CS42L42_FULL_SCALE_VOL_0DB) in cs42l42_resume()
907 snd_hda_codec_allow_unsol_events(cs42l42->codec); in cs42l42_resume()
914 struct hda_codec *codec = cs42l42->codec; in cs42l42_suspend()
915 struct cs8409_spec *spec = codec->spec; in cs42l42_suspend() local
940 cs42l42->suspended = 1; in cs42l42_suspend()
941 cs42l42->last_page = 0; in cs42l42_suspend()
942 cs42l42->hp_jack_in = 0; in cs42l42_suspend()
943 cs42l42->mic_jack_in = 0; in cs42l42_suspend()
946 spec->gpio_data = snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_GET_GPIO_DATA, 0); in cs42l42_suspend()
947 spec->gpio_data &= ~cs42l42->reset_gpio; in cs42l42_suspend()
948 snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_data); in cs42l42_suspend()
953 struct cs8409_spec *spec = codec->spec; in cs8409_free() local
956 cancel_delayed_work_sync(&spec->i2c_clk_work); in cs8409_free()
976 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_jack_unsol_event() local
977 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in cs8409_cs42l42_jack_unsol_event()
985 if (res & cs42l42->irq_mask) in cs8409_cs42l42_jack_unsol_event()
990 cs42l42->hp_jack_in ? 0 : PIN_OUT); in cs8409_cs42l42_jack_unsol_event()
994 snd_hda_jack_unsol_event(codec, (jk->tag << AC_UNSOL_RES_TAG_SHIFT) & in cs8409_cs42l42_jack_unsol_event()
999 snd_hda_jack_unsol_event(codec, (jk->tag << AC_UNSOL_RES_TAG_SHIFT) & in cs8409_cs42l42_jack_unsol_event()
1007 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_suspend() local
1010 spec->init_done = 0; in cs8409_cs42l42_suspend()
1014 for (i = 0; i < spec->num_scodecs; i++) in cs8409_cs42l42_suspend()
1015 cs42l42_suspend(spec->scodecs[i]); in cs8409_cs42l42_suspend()
1018 cancel_delayed_work_sync(&spec->i2c_clk_work); in cs8409_cs42l42_suspend()
1033 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_hw_init() local
1034 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in cs8409_cs42l42_hw_init()
1036 if (spec->gpio_mask) { in cs8409_cs42l42_hw_init()
1038 spec->gpio_mask); in cs8409_cs42l42_hw_init()
1040 spec->gpio_dir); in cs8409_cs42l42_hw_init()
1042 spec->gpio_data); in cs8409_cs42l42_hw_init()
1045 for (; seq->nid; seq++) in cs8409_cs42l42_hw_init()
1046 cs8409_vendor_coef_set(codec, seq->cir, seq->coeff); in cs8409_cs42l42_hw_init()
1048 if (codec->fixup_id == CS8409_BULLSEYE) { in cs8409_cs42l42_hw_init()
1049 for (; seq_bullseye->nid; seq_bullseye++) in cs8409_cs42l42_hw_init()
1050 cs8409_vendor_coef_set(codec, seq_bullseye->cir, seq_bullseye->coeff); in cs8409_cs42l42_hw_init()
1053 switch (codec->fixup_id) { in cs8409_cs42l42_hw_init()
1086 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_exec_verb() local
1087 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in cs8409_cs42l42_exec_verb()
1100 *res = (cs42l42->hp_jack_in) ? AC_PINSENSE_PRESENCE : 0; in cs8409_cs42l42_exec_verb()
1106 *res = (cs42l42->mic_jack_in) ? AC_PINSENSE_PRESENCE : 0; in cs8409_cs42l42_exec_verb()
1114 return spec->exec_verb(dev, cmd, flags, res); in cs8409_cs42l42_exec_verb()
1119 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_fixups() local
1125 spec->exec_verb = codec->core.exec_verb; in cs8409_cs42l42_fixups()
1126 codec->core.exec_verb = cs8409_cs42l42_exec_verb; in cs8409_cs42l42_fixups()
1128 spec->scodecs[CS8409_CODEC0] = &cs8409_cs42l42_codec; in cs8409_cs42l42_fixups()
1129 spec->num_scodecs = 1; in cs8409_cs42l42_fixups()
1130 spec->scodecs[CS8409_CODEC0]->codec = codec; in cs8409_cs42l42_fixups()
1131 codec->patch_ops = cs8409_cs42l42_patch_ops; in cs8409_cs42l42_fixups()
1133 spec->gen.suppress_auto_mute = 1; in cs8409_cs42l42_fixups()
1134 spec->gen.no_primary_hp = 1; in cs8409_cs42l42_fixups()
1135 spec->gen.suppress_vmaster = 1; in cs8409_cs42l42_fixups()
1137 spec->speaker_pdn_gpio = 0; in cs8409_cs42l42_fixups()
1140 spec->gpio_dir = spec->scodecs[CS8409_CODEC0]->reset_gpio; in cs8409_cs42l42_fixups()
1141 spec->gpio_data = 0; in cs8409_cs42l42_fixups()
1142 spec->gpio_mask = 0x03f; in cs8409_cs42l42_fixups()
1150 spec->scodecs[CS8409_CODEC0]->hsbias_hiz = 0x0020; in cs8409_cs42l42_fixups()
1152 switch (codec->fixup_id) { in cs8409_cs42l42_fixups()
1154 spec->scodecs[CS8409_CODEC0]->full_scale_vol = in cs8409_cs42l42_fixups()
1156 spec->speaker_pdn_gpio = CS8409_CYBORG_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1159 spec->scodecs[CS8409_CODEC0]->full_scale_vol = CS42L42_FULL_SCALE_VOL_0DB; in cs8409_cs42l42_fixups()
1160 spec->speaker_pdn_gpio = CS8409_CYBORG_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1164 spec->scodecs[CS8409_CODEC0]->full_scale_vol = CS42L42_FULL_SCALE_VOL_0DB; in cs8409_cs42l42_fixups()
1165 spec->speaker_pdn_gpio = CS8409_WARLOCK_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1168 spec->scodecs[CS8409_CODEC0]->full_scale_vol = in cs8409_cs42l42_fixups()
1170 spec->speaker_pdn_gpio = CS8409_WARLOCK_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1174 if (spec->speaker_pdn_gpio > 0) { in cs8409_cs42l42_fixups()
1175 spec->gpio_dir |= spec->speaker_pdn_gpio; in cs8409_cs42l42_fixups()
1176 spec->gpio_data |= spec->speaker_pdn_gpio; in cs8409_cs42l42_fixups()
1182 spec->gen.stream_analog_playback = &cs42l42_48k_pcm_analog_playback; in cs8409_cs42l42_fixups()
1183 spec->gen.stream_analog_capture = &cs42l42_48k_pcm_analog_capture; in cs8409_cs42l42_fixups()
1185 spec->gen.pcm_playback_hook = cs42l42_playback_pcm_hook; in cs8409_cs42l42_fixups()
1186 spec->gen.pcm_capture_hook = cs42l42_capture_pcm_hook; in cs8409_cs42l42_fixups()
1187 if (codec->fixup_id != CS8409_ODIN) in cs8409_cs42l42_fixups()
1188 /* Set initial DMIC volume to -26 dB */ in cs8409_cs42l42_fixups()
1191 snd_hda_gen_add_kctl(&spec->gen, "Headphone Playback Volume", in cs8409_cs42l42_fixups()
1193 snd_hda_gen_add_kctl(&spec->gen, "Mic Capture Volume", in cs8409_cs42l42_fixups()
1195 if (spec->speaker_pdn_gpio > 0) in cs8409_cs42l42_fixups()
1196 snd_hda_gen_add_kctl(&spec->gen, "Speaker Playback Switch", in cs8409_cs42l42_fixups()
1204 spec->init_done = 1; in cs8409_cs42l42_fixups()
1205 if (spec->init_done && spec->build_ctrl_done in cs8409_cs42l42_fixups()
1206 && !spec->scodecs[CS8409_CODEC0]->hp_jack_in) in cs8409_cs42l42_fixups()
1207 cs42l42_run_jack_detect(spec->scodecs[CS8409_CODEC0]); in cs8409_cs42l42_fixups()
1210 spec->build_ctrl_done = 1; in cs8409_cs42l42_fixups()
1216 if (spec->init_done && spec->build_ctrl_done in cs8409_cs42l42_fixups()
1217 && !spec->scodecs[CS8409_CODEC0]->hp_jack_in) in cs8409_cs42l42_fixups()
1218 cs42l42_run_jack_detect(spec->scodecs[CS8409_CODEC0]); in cs8409_cs42l42_fixups()
1239 struct cs8409_spec *spec = codec->spec; in dolphin_jack_unsol_event() local
1243 cs42l42 = spec->scodecs[CS8409_CODEC0]; in dolphin_jack_unsol_event()
1244 if (!cs42l42->suspended && (~res & cs42l42->irq_mask) && in dolphin_jack_unsol_event()
1249 (jk->tag << AC_UNSOL_RES_TAG_SHIFT) & in dolphin_jack_unsol_event()
1255 (jk->tag << AC_UNSOL_RES_TAG_SHIFT) & in dolphin_jack_unsol_event()
1259 cs42l42 = spec->scodecs[CS8409_CODEC1]; in dolphin_jack_unsol_event()
1260 if (!cs42l42->suspended && (~res & cs42l42->irq_mask) && in dolphin_jack_unsol_event()
1265 (jk->tag << AC_UNSOL_RES_TAG_SHIFT) & in dolphin_jack_unsol_event()
1276 struct cs8409_spec *spec = codec->spec; in dolphin_hw_init() local
1280 if (spec->gpio_mask) { in dolphin_hw_init()
1282 spec->gpio_mask); in dolphin_hw_init()
1284 spec->gpio_dir); in dolphin_hw_init()
1286 spec->gpio_data); in dolphin_hw_init()
1289 for (; seq->nid; seq++) in dolphin_hw_init()
1290 cs8409_vendor_coef_set(codec, seq->cir, seq->coeff); in dolphin_hw_init()
1292 for (i = 0; i < spec->num_scodecs; i++) { in dolphin_hw_init()
1293 cs42l42 = spec->scodecs[i]; in dolphin_hw_init()
1314 struct cs8409_spec *spec = codec->spec; in dolphin_exec_verb() local
1315 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in dolphin_exec_verb()
1329 cs42l42 = spec->scodecs[CS8409_CODEC1]; in dolphin_exec_verb()
1331 *res = (cs42l42->hp_jack_in) ? AC_PINSENSE_PRESENCE : 0; in dolphin_exec_verb()
1337 *res = (cs42l42->mic_jack_in) ? AC_PINSENSE_PRESENCE : 0; in dolphin_exec_verb()
1345 return spec->exec_verb(dev, cmd, flags, res); in dolphin_exec_verb()
1350 struct cs8409_spec *spec = codec->spec; in dolphin_fixups() local
1358 spec->exec_verb = codec->core.exec_verb; in dolphin_fixups()
1359 codec->core.exec_verb = dolphin_exec_verb; in dolphin_fixups()
1361 spec->scodecs[CS8409_CODEC0] = &dolphin_cs42l42_0; in dolphin_fixups()
1362 spec->scodecs[CS8409_CODEC0]->codec = codec; in dolphin_fixups()
1363 spec->scodecs[CS8409_CODEC1] = &dolphin_cs42l42_1; in dolphin_fixups()
1364 spec->scodecs[CS8409_CODEC1]->codec = codec; in dolphin_fixups()
1365 spec->num_scodecs = 2; in dolphin_fixups()
1366 spec->gen.suppress_vmaster = 1; in dolphin_fixups()
1368 codec->patch_ops = cs8409_dolphin_patch_ops; in dolphin_fixups()
1371 spec->gpio_dir = spec->scodecs[CS8409_CODEC0]->reset_gpio | in dolphin_fixups()
1372 spec->scodecs[CS8409_CODEC1]->reset_gpio; in dolphin_fixups()
1373 spec->gpio_data = 0; in dolphin_fixups()
1374 spec->gpio_mask = 0x03f; in dolphin_fixups()
1389 spec->scodecs[CS8409_CODEC0]->full_scale_vol = CS42L42_FULL_SCALE_VOL_MINUS6DB; in dolphin_fixups()
1390 spec->scodecs[CS8409_CODEC1]->full_scale_vol = CS42L42_FULL_SCALE_VOL_MINUS6DB; in dolphin_fixups()
1395 spec->gen.stream_analog_playback = &cs42l42_48k_pcm_analog_playback; in dolphin_fixups()
1396 spec->gen.stream_analog_capture = &cs42l42_48k_pcm_analog_capture; in dolphin_fixups()
1398 spec->gen.pcm_playback_hook = cs42l42_playback_pcm_hook; in dolphin_fixups()
1399 spec->gen.pcm_capture_hook = cs42l42_capture_pcm_hook; in dolphin_fixups()
1400 snd_hda_gen_add_kctl(&spec->gen, "Headphone Playback Volume", in dolphin_fixups()
1402 snd_hda_gen_add_kctl(&spec->gen, "Mic Capture Volume", &cs42l42_adc_volume_mixer); in dolphin_fixups()
1403 kctrl = snd_hda_gen_add_kctl(&spec->gen, "Line Out Playback Volume", in dolphin_fixups()
1407 kctrl->private_value = HDA_COMPOSE_AMP_VAL_OFS(DOLPHIN_HP_PIN_NID, 3, CS8409_CODEC1, in dolphin_fixups()
1414 spec->init_done = 1; in dolphin_fixups()
1415 if (spec->init_done && spec->build_ctrl_done) { in dolphin_fixups()
1416 for (i = 0; i < spec->num_scodecs; i++) { in dolphin_fixups()
1417 if (!spec->scodecs[i]->hp_jack_in) in dolphin_fixups()
1418 cs42l42_run_jack_detect(spec->scodecs[i]); in dolphin_fixups()
1423 spec->build_ctrl_done = 1; in dolphin_fixups()
1429 if (spec->init_done && spec->build_ctrl_done) { in dolphin_fixups()
1430 for (i = 0; i < spec->num_scodecs; i++) { in dolphin_fixups()
1431 if (!spec->scodecs[i]->hp_jack_in) in dolphin_fixups()
1432 cs42l42_run_jack_detect(spec->scodecs[i]); in dolphin_fixups()
1446 return -ENOMEM; in patch_cs8409()
1450 codec_dbg(codec, "Picked ID=%d, VID=%08x, DEV=%08x\n", codec->fixup_id, in patch_cs8409()
1451 codec->bus->pci->subsystem_vendor, in patch_cs8409()
1452 codec->bus->pci->subsystem_device); in patch_cs8409()