Lines Matching full:spec
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()
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()
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()
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()
122 struct cs8409_spec *spec = codec->spec; in cs8409_enable_i2c_clock() local
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()
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()
200 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_read() local
207 mutex_lock(&spec->i2c_mux); in cs8409_i2c_read()
222 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_read()
227 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_read()
243 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_bulk_read() local
250 mutex_lock(&spec->i2c_mux); 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()
288 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_write() local
294 mutex_lock(&spec->i2c_mux); in cs8409_i2c_write()
308 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_write()
312 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_write()
329 struct cs8409_spec *spec = codec->spec; in cs8409_i2c_bulk_write() local
336 mutex_lock(&spec->i2c_mux); in cs8409_i2c_bulk_write()
356 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_bulk_write()
361 mutex_unlock(&spec->i2c_mux); in cs8409_i2c_bulk_write()
391 struct cs8409_spec *spec = codec->spec; in cs8409_enable_ur() local
395 for (i = 0; i < spec->num_scodecs; i++) in cs8409_enable_ur()
396 ur_gpios |= spec->scodecs[i]->irq_mask; in cs8409_enable_ur()
431 struct cs8409_spec *spec = codec->spec; in cs8409_spk_sw_gpio_get() local
433 ucontrol->value.integer.value[0] = !!(spec->gpio_data & spec->speaker_pdn_gpio); in cs8409_spk_sw_gpio_get()
441 struct cs8409_spec *spec = codec->spec; in cs8409_spk_sw_gpio_put() local
444 gpio_data = (spec->gpio_data & ~spec->speaker_pdn_gpio) | in cs8409_spk_sw_gpio_put()
445 (ucontrol->value.integer.value[0] ? spec->speaker_pdn_gpio : 0); in cs8409_spk_sw_gpio_put()
446 if (gpio_data == spec->gpio_data) in cs8409_spk_sw_gpio_put()
448 spec->gpio_data = gpio_data; in cs8409_spk_sw_gpio_put()
449 snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_data); in cs8409_spk_sw_gpio_put()
492 struct cs8409_spec *spec = codec->spec; in cs42l42_volume_get() local
493 struct sub_codec *cs42l42 = spec->scodecs[get_amp_index(kctrl)]; in cs42l42_volume_get()
551 struct cs8409_spec *spec = codec->spec; in cs42l42_volume_put() local
552 struct sub_codec *cs42l42 = spec->scodecs[get_amp_index(kctrl)]; in cs42l42_volume_put()
565 if (spec->playback_started) in cs42l42_volume_put()
571 if (spec->capture_started) in cs42l42_volume_put()
586 struct cs8409_spec *spec = codec->spec; in cs42l42_playback_pcm_hook() local
594 spec->playback_started = 1; in cs42l42_playback_pcm_hook()
598 spec->playback_started = 0; in cs42l42_playback_pcm_hook()
604 for (i = 0; i < spec->num_scodecs; i++) { in cs42l42_playback_pcm_hook()
605 cs42l42 = spec->scodecs[i]; in cs42l42_playback_pcm_hook()
615 struct cs8409_spec *spec = codec->spec; in cs42l42_capture_pcm_hook() local
623 spec->capture_started = 1; in cs42l42_capture_pcm_hook()
627 spec->capture_started = 0; in cs42l42_capture_pcm_hook()
633 for (i = 0; i < spec->num_scodecs; i++) { in cs42l42_capture_pcm_hook()
634 cs42l42 = spec->scodecs[i]; in cs42l42_capture_pcm_hook()
877 struct cs8409_spec *spec = codec->spec; in cs42l42_resume() local
887 spec->gpio_data = snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_GET_GPIO_DATA, 0); in cs42l42_resume()
888 spec->gpio_data |= cs42l42->reset_gpio; in cs42l42_resume()
889 snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_data); in cs42l42_resume()
921 struct cs8409_spec *spec = codec->spec; in cs42l42_suspend() local
952 spec->gpio_data = snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_GET_GPIO_DATA, 0); in cs42l42_suspend()
953 spec->gpio_data &= ~cs42l42->reset_gpio; in cs42l42_suspend()
954 snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_data); in cs42l42_suspend()
959 struct cs8409_spec *spec = codec->spec; in cs8409_free() local
962 cancel_delayed_work_sync(&spec->i2c_clk_work); in cs8409_free()
982 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_jack_unsol_event() local
983 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in cs8409_cs42l42_jack_unsol_event()
1013 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_suspend() local
1016 spec->init_done = 0; in cs8409_cs42l42_suspend()
1020 for (i = 0; i < spec->num_scodecs; i++) in cs8409_cs42l42_suspend()
1021 cs42l42_suspend(spec->scodecs[i]); in cs8409_cs42l42_suspend()
1024 cancel_delayed_work_sync(&spec->i2c_clk_work); in cs8409_cs42l42_suspend()
1039 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_hw_init() local
1040 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in cs8409_cs42l42_hw_init()
1042 if (spec->gpio_mask) { in cs8409_cs42l42_hw_init()
1044 spec->gpio_mask); in cs8409_cs42l42_hw_init()
1046 spec->gpio_dir); in cs8409_cs42l42_hw_init()
1048 spec->gpio_data); in cs8409_cs42l42_hw_init()
1092 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_exec_verb() local
1093 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in cs8409_cs42l42_exec_verb()
1120 return spec->exec_verb(dev, cmd, flags, res); in cs8409_cs42l42_exec_verb()
1125 struct cs8409_spec *spec = codec->spec; in cs8409_cs42l42_fixups() local
1131 spec->exec_verb = codec->core.exec_verb; in cs8409_cs42l42_fixups()
1134 spec->scodecs[CS8409_CODEC0] = &cs8409_cs42l42_codec; in cs8409_cs42l42_fixups()
1135 spec->num_scodecs = 1; in cs8409_cs42l42_fixups()
1136 spec->scodecs[CS8409_CODEC0]->codec = codec; in cs8409_cs42l42_fixups()
1139 spec->gen.suppress_auto_mute = 1; in cs8409_cs42l42_fixups()
1140 spec->gen.no_primary_hp = 1; in cs8409_cs42l42_fixups()
1141 spec->gen.suppress_vmaster = 1; in cs8409_cs42l42_fixups()
1143 spec->speaker_pdn_gpio = 0; in cs8409_cs42l42_fixups()
1146 spec->gpio_dir = spec->scodecs[CS8409_CODEC0]->reset_gpio; in cs8409_cs42l42_fixups()
1147 spec->gpio_data = 0; in cs8409_cs42l42_fixups()
1148 spec->gpio_mask = 0x03f; in cs8409_cs42l42_fixups()
1156 spec->scodecs[CS8409_CODEC0]->hsbias_hiz = 0x0020; in cs8409_cs42l42_fixups()
1160 spec->scodecs[CS8409_CODEC0]->full_scale_vol = in cs8409_cs42l42_fixups()
1162 spec->speaker_pdn_gpio = CS8409_CYBORG_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1165 spec->scodecs[CS8409_CODEC0]->full_scale_vol = CS42L42_FULL_SCALE_VOL_0DB; in cs8409_cs42l42_fixups()
1166 spec->speaker_pdn_gpio = CS8409_CYBORG_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1170 spec->scodecs[CS8409_CODEC0]->full_scale_vol = CS42L42_FULL_SCALE_VOL_0DB; in cs8409_cs42l42_fixups()
1171 spec->speaker_pdn_gpio = CS8409_WARLOCK_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1174 spec->scodecs[CS8409_CODEC0]->full_scale_vol = in cs8409_cs42l42_fixups()
1176 spec->speaker_pdn_gpio = CS8409_WARLOCK_SPEAKER_PDN; in cs8409_cs42l42_fixups()
1180 if (spec->speaker_pdn_gpio > 0) { in cs8409_cs42l42_fixups()
1181 spec->gpio_dir |= spec->speaker_pdn_gpio; in cs8409_cs42l42_fixups()
1182 spec->gpio_data |= spec->speaker_pdn_gpio; in cs8409_cs42l42_fixups()
1188 spec->gen.stream_analog_playback = &cs42l42_48k_pcm_analog_playback; in cs8409_cs42l42_fixups()
1189 spec->gen.stream_analog_capture = &cs42l42_48k_pcm_analog_capture; in cs8409_cs42l42_fixups()
1191 spec->gen.pcm_playback_hook = cs42l42_playback_pcm_hook; in cs8409_cs42l42_fixups()
1192 spec->gen.pcm_capture_hook = cs42l42_capture_pcm_hook; in cs8409_cs42l42_fixups()
1197 snd_hda_gen_add_kctl(&spec->gen, "Headphone Playback Volume", in cs8409_cs42l42_fixups()
1199 snd_hda_gen_add_kctl(&spec->gen, "Mic Capture Volume", in cs8409_cs42l42_fixups()
1201 if (spec->speaker_pdn_gpio > 0) in cs8409_cs42l42_fixups()
1202 snd_hda_gen_add_kctl(&spec->gen, "Speaker Playback Switch", in cs8409_cs42l42_fixups()
1210 spec->init_done = 1; in cs8409_cs42l42_fixups()
1211 if (spec->init_done && spec->build_ctrl_done in cs8409_cs42l42_fixups()
1212 && !spec->scodecs[CS8409_CODEC0]->hp_jack_in) in cs8409_cs42l42_fixups()
1213 cs42l42_run_jack_detect(spec->scodecs[CS8409_CODEC0]); in cs8409_cs42l42_fixups()
1216 spec->build_ctrl_done = 1; in cs8409_cs42l42_fixups()
1222 if (spec->init_done && spec->build_ctrl_done in cs8409_cs42l42_fixups()
1223 && !spec->scodecs[CS8409_CODEC0]->hp_jack_in) in cs8409_cs42l42_fixups()
1224 cs42l42_run_jack_detect(spec->scodecs[CS8409_CODEC0]); in cs8409_cs42l42_fixups()
1245 struct cs8409_spec *spec = codec->spec; in dolphin_jack_unsol_event() local
1249 cs42l42 = spec->scodecs[CS8409_CODEC0]; in dolphin_jack_unsol_event()
1265 cs42l42 = spec->scodecs[CS8409_CODEC1]; in dolphin_jack_unsol_event()
1282 struct cs8409_spec *spec = codec->spec; in dolphin_hw_init() local
1286 if (spec->gpio_mask) { in dolphin_hw_init()
1288 spec->gpio_mask); in dolphin_hw_init()
1290 spec->gpio_dir); in dolphin_hw_init()
1292 spec->gpio_data); in dolphin_hw_init()
1298 for (i = 0; i < spec->num_scodecs; i++) { in dolphin_hw_init()
1299 cs42l42 = spec->scodecs[i]; in dolphin_hw_init()
1320 struct cs8409_spec *spec = codec->spec; in dolphin_exec_verb() local
1321 struct sub_codec *cs42l42 = spec->scodecs[CS8409_CODEC0]; in dolphin_exec_verb()
1335 cs42l42 = spec->scodecs[CS8409_CODEC1]; in dolphin_exec_verb()
1351 return spec->exec_verb(dev, cmd, flags, res); in dolphin_exec_verb()
1356 struct cs8409_spec *spec = codec->spec; in dolphin_fixups() local
1364 spec->exec_verb = codec->core.exec_verb; in dolphin_fixups()
1367 spec->scodecs[CS8409_CODEC0] = &dolphin_cs42l42_0; in dolphin_fixups()
1368 spec->scodecs[CS8409_CODEC0]->codec = codec; in dolphin_fixups()
1369 spec->scodecs[CS8409_CODEC1] = &dolphin_cs42l42_1; in dolphin_fixups()
1370 spec->scodecs[CS8409_CODEC1]->codec = codec; in dolphin_fixups()
1371 spec->num_scodecs = 2; in dolphin_fixups()
1372 spec->gen.suppress_vmaster = 1; in dolphin_fixups()
1377 spec->gpio_dir = spec->scodecs[CS8409_CODEC0]->reset_gpio | in dolphin_fixups()
1378 spec->scodecs[CS8409_CODEC1]->reset_gpio; in dolphin_fixups()
1379 spec->gpio_data = 0; in dolphin_fixups()
1380 spec->gpio_mask = 0x03f; in dolphin_fixups()
1395 spec->scodecs[CS8409_CODEC0]->full_scale_vol = CS42L42_FULL_SCALE_VOL_MINUS6DB; in dolphin_fixups()
1396 spec->scodecs[CS8409_CODEC1]->full_scale_vol = CS42L42_FULL_SCALE_VOL_MINUS6DB; in dolphin_fixups()
1401 spec->gen.stream_analog_playback = &cs42l42_48k_pcm_analog_playback; in dolphin_fixups()
1402 spec->gen.stream_analog_capture = &cs42l42_48k_pcm_analog_capture; in dolphin_fixups()
1404 spec->gen.pcm_playback_hook = cs42l42_playback_pcm_hook; in dolphin_fixups()
1405 spec->gen.pcm_capture_hook = cs42l42_capture_pcm_hook; in dolphin_fixups()
1406 snd_hda_gen_add_kctl(&spec->gen, "Headphone Playback Volume", in dolphin_fixups()
1408 snd_hda_gen_add_kctl(&spec->gen, "Mic Capture Volume", &cs42l42_adc_volume_mixer); in dolphin_fixups()
1409 kctrl = snd_hda_gen_add_kctl(&spec->gen, "Line Out Playback Volume", in dolphin_fixups()
1420 spec->init_done = 1; in dolphin_fixups()
1421 if (spec->init_done && spec->build_ctrl_done) { in dolphin_fixups()
1422 for (i = 0; i < spec->num_scodecs; i++) { in dolphin_fixups()
1423 if (!spec->scodecs[i]->hp_jack_in) in dolphin_fixups()
1424 cs42l42_run_jack_detect(spec->scodecs[i]); in dolphin_fixups()
1429 spec->build_ctrl_done = 1; in dolphin_fixups()
1435 if (spec->init_done && spec->build_ctrl_done) { in dolphin_fixups()
1436 for (i = 0; i < spec->num_scodecs; i++) { in dolphin_fixups()
1437 if (!spec->scodecs[i]->hp_jack_in) in dolphin_fixups()
1438 cs42l42_run_jack_detect(spec->scodecs[i]); in dolphin_fixups()