Lines Matching full:spec

77 	struct hdmi_pcm *pcm; /* pointer to spec->pcm_rec[n] dynamically*/
182 struct hdmi_spec *spec = codec->spec; in codec_has_acomp() local
183 return spec->use_acomp_notifier; in codec_has_acomp()
225 #define get_pin(spec, idx) \ argument
226 ((struct hdmi_spec_per_pin *)snd_array_elem(&spec->pins, idx))
227 #define get_cvt(spec, idx) \ argument
228 ((struct hdmi_spec_per_cvt *)snd_array_elem(&spec->cvts, idx))
230 #define get_hdmi_pcm(spec, idx) (&(spec)->pcm_rec[idx]) argument
232 #define get_pcm_rec(spec, idx) (get_hdmi_pcm(spec, idx)->pcm) argument
237 struct hdmi_spec *spec = codec->spec; in pin_id_to_pin_index() local
248 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in pin_id_to_pin_index()
249 per_pin = get_pin(spec, pin_idx); in pin_id_to_pin_index()
262 struct hdmi_spec *spec = codec->spec; in hinfo_to_pcm_index() local
265 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) in hinfo_to_pcm_index()
266 if (get_pcm_rec(spec, pcm_idx)->stream == hinfo) in hinfo_to_pcm_index()
276 struct hdmi_spec *spec = codec->spec; in hinfo_to_pin_index() local
280 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in hinfo_to_pin_index()
281 per_pin = get_pin(spec, pin_idx); in hinfo_to_pin_index()
292 static struct hdmi_spec_per_pin *pcm_idx_to_pin(struct hdmi_spec *spec, in pcm_idx_to_pin() argument
298 for (i = 0; i < spec->num_pins; i++) { in pcm_idx_to_pin()
299 per_pin = get_pin(spec, i); in pcm_idx_to_pin()
308 struct hdmi_spec *spec = codec->spec; in cvt_nid_to_cvt_index() local
311 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) in cvt_nid_to_cvt_index()
312 if (get_cvt(spec, cvt_idx)->cvt_nid == cvt_nid) in cvt_nid_to_cvt_index()
323 struct hdmi_spec *spec = codec->spec; in hdmi_eld_ctl_info() local
331 mutex_lock(&spec->pcm_lock); in hdmi_eld_ctl_info()
332 per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_eld_ctl_info()
342 mutex_unlock(&spec->pcm_lock); in hdmi_eld_ctl_info()
350 struct hdmi_spec *spec = codec->spec; in hdmi_eld_ctl_get() local
357 mutex_lock(&spec->pcm_lock); in hdmi_eld_ctl_get()
358 per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_eld_ctl_get()
381 mutex_unlock(&spec->pcm_lock); in hdmi_eld_ctl_get()
398 struct hdmi_spec *spec = codec->spec; in hdmi_create_eld_ctl() local
414 get_hdmi_pcm(spec, pcm_idx)->eld_ctl = kctl; in hdmi_create_eld_ctl()
450 struct hdmi_spec *spec = codec->spec; in hdmi_init_pin() local
458 if (spec->dyn_pin_out) in hdmi_init_pin()
718 struct hdmi_spec *spec = codec->spec; in hdmi_setup_audio_infoframe() local
719 struct hdac_chmap *chmap = &spec->chmap; in hdmi_setup_audio_infoframe()
753 snd_hdac_setup_channel_mapping(&spec->chmap, in hdmi_setup_audio_infoframe()
757 spec->ops.pin_setup_infoframe(codec, pin_nid, dev_id, in hdmi_setup_audio_infoframe()
772 struct hdmi_spec *spec = codec->spec; in check_presence_and_report() local
777 mutex_lock(&spec->pcm_lock); in check_presence_and_report()
778 hdmi_present_sense(get_pin(spec, pin_idx), 1); in check_presence_and_report()
779 mutex_unlock(&spec->pcm_lock); in check_presence_and_report()
927 struct hdmi_spec *spec = codec->spec; in hdmi_setup_stream() local
931 err = spec->ops.pin_hbr_setup(codec, pin_nid, dev_id, in hdmi_setup_stream()
939 if (spec->intel_hsw_fixup) { in hdmi_setup_stream()
971 struct hdmi_spec *spec = codec->spec; in hdmi_choose_cvt() local
980 per_pin = get_pin(spec, pin_idx); in hdmi_choose_cvt()
983 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) { in hdmi_choose_cvt()
984 per_cvt = get_cvt(spec, cvt_idx); in hdmi_choose_cvt()
1002 if (cvt_idx == spec->num_cvts) in hdmi_choose_cvt()
1033 static int intel_cvt_id_to_mux_idx(struct hdmi_spec *spec, in intel_cvt_id_to_mux_idx() argument
1038 for (i = 0; i < spec->num_cvts; i++) in intel_cvt_id_to_mux_idx()
1039 if (spec->cvt_nids[i] == cvt_nid) in intel_cvt_id_to_mux_idx()
1057 struct hdmi_spec *spec = codec->spec; in intel_not_share_assigned_cvt() local
1065 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in intel_not_share_assigned_cvt()
1069 per_pin = get_pin(spec, pin_idx); in intel_not_share_assigned_cvt()
1112 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) { in intel_not_share_assigned_cvt()
1113 per_cvt = get_cvt(spec, cvt_idx); in intel_not_share_assigned_cvt()
1133 struct hdmi_spec *spec = codec->spec; in intel_not_share_assigned_cvt_nid() local
1140 mux_idx = intel_cvt_id_to_mux_idx(spec, cvt_nid); in intel_not_share_assigned_cvt_nid()
1150 struct hdmi_spec *spec = codec->spec; in pin_cvt_fixup() local
1152 if (spec->ops.pin_cvt_fixup) in pin_cvt_fixup()
1153 spec->ops.pin_cvt_fixup(codec, per_pin, cvt_nid); in pin_cvt_fixup()
1163 struct hdmi_spec *spec = codec->spec; in hdmi_pcm_open_no_pin() local
1177 per_cvt = get_cvt(spec, cvt_idx); in hdmi_pcm_open_no_pin()
1183 set_bit(pcm_idx, &spec->pcm_in_use); in hdmi_pcm_open_no_pin()
1211 struct hdmi_spec *spec = codec->spec; in hdmi_pcm_open() local
1224 mutex_lock(&spec->pcm_lock); in hdmi_pcm_open()
1226 if (!spec->dyn_pcm_assign) { in hdmi_pcm_open()
1245 per_cvt = get_cvt(spec, cvt_idx); in hdmi_pcm_open()
1249 set_bit(pcm_idx, &spec->pcm_in_use); in hdmi_pcm_open()
1250 per_pin = get_pin(spec, pin_idx); in hdmi_pcm_open()
1298 mutex_unlock(&spec->pcm_lock); in hdmi_pcm_open()
1307 struct hdmi_spec *spec = codec->spec; in hdmi_read_pin_conn() local
1308 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); in hdmi_read_pin_conn()
1322 if (spec->intel_hsw_fixup) { in hdmi_read_pin_conn()
1323 conns = spec->num_cvts; in hdmi_read_pin_conn()
1324 memcpy(per_pin->mux_nids, spec->cvt_nids, in hdmi_read_pin_conn()
1338 static int hdmi_find_pcm_slot(struct hdmi_spec *spec, in hdmi_find_pcm_slot() argument
1357 if (per_pin->dev_id == 0 || spec->intel_hsw_fixup) { in hdmi_find_pcm_slot()
1358 if (!test_bit(per_pin->pin_nid_idx, &spec->pcm_bitmap)) in hdmi_find_pcm_slot()
1361 i = spec->num_nids + (per_pin->dev_id - 1); in hdmi_find_pcm_slot()
1362 if (i < spec->pcm_used && !(test_bit(i, &spec->pcm_bitmap))) in hdmi_find_pcm_slot()
1367 for (i = spec->num_nids; i < spec->pcm_used; i++) { in hdmi_find_pcm_slot()
1368 if (!test_bit(i, &spec->pcm_bitmap)) in hdmi_find_pcm_slot()
1373 for (i = 0; i < spec->num_nids; i++) { in hdmi_find_pcm_slot()
1374 if (!test_bit(i, &spec->pcm_bitmap)) in hdmi_find_pcm_slot()
1380 static void hdmi_attach_hda_pcm(struct hdmi_spec *spec, in hdmi_attach_hda_pcm() argument
1388 idx = hdmi_find_pcm_slot(spec, per_pin); in hdmi_attach_hda_pcm()
1392 per_pin->pcm = get_hdmi_pcm(spec, idx); in hdmi_attach_hda_pcm()
1393 set_bit(idx, &spec->pcm_bitmap); in hdmi_attach_hda_pcm()
1396 static void hdmi_detach_hda_pcm(struct hdmi_spec *spec, in hdmi_detach_hda_pcm() argument
1407 if (idx >= 0 && idx < spec->pcm_used) in hdmi_detach_hda_pcm()
1408 clear_bit(idx, &spec->pcm_bitmap); in hdmi_detach_hda_pcm()
1411 static int hdmi_get_pin_cvt_mux(struct hdmi_spec *spec, in hdmi_get_pin_cvt_mux() argument
1424 static void hdmi_pcm_setup_pin(struct hdmi_spec *spec, in hdmi_pcm_setup_pin() argument
1434 if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used) in hdmi_pcm_setup_pin()
1435 pcm = get_pcm_rec(spec, per_pin->pcm_idx); in hdmi_pcm_setup_pin()
1440 if (!test_bit(per_pin->pcm_idx, &spec->pcm_in_use)) in hdmi_pcm_setup_pin()
1449 mux_idx = hdmi_get_pin_cvt_mux(spec, per_pin, hinfo->nid); in hdmi_pcm_setup_pin()
1468 static void hdmi_pcm_reset_pin(struct hdmi_spec *spec, in hdmi_pcm_reset_pin() argument
1471 if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used) in hdmi_pcm_reset_pin()
1484 struct hdmi_spec *spec = codec->spec; in pin_idx_to_pcm_jack() local
1487 return spec->pcm_rec[per_pin->pcm_idx].jack; in pin_idx_to_pcm_jack()
1502 struct hdmi_spec *spec = codec->spec; in update_eld() local
1535 if (spec->dyn_pcm_assign) { in update_eld()
1537 hdmi_attach_hda_pcm(spec, per_pin); in update_eld()
1538 hdmi_pcm_setup_pin(spec, per_pin); in update_eld()
1540 hdmi_pcm_reset_pin(spec, per_pin); in update_eld()
1541 hdmi_detach_hda_pcm(spec, per_pin); in update_eld()
1588 &get_hdmi_pcm(spec, pcm_idx)->eld_ctl->id); in update_eld()
1601 struct hdmi_spec *spec = codec->spec; in hdmi_present_sense_via_verbs() local
1602 struct hdmi_eld *eld = &spec->temp_eld; in hdmi_present_sense_via_verbs()
1634 if (spec->ops.pin_get_eld(codec, pin_nid, dev_id, in hdmi_present_sense_via_verbs()
1673 struct hdmi_spec *spec = codec->spec; in sync_eld_via_acomp() local
1674 struct hdmi_eld *eld = &spec->temp_eld; in sync_eld_via_acomp()
1693 if (spec->send_silent_stream) { in sync_eld_via_acomp()
1728 struct hdmi_spec *spec = codec->spec; in hdmi_repoll_eld() local
1739 mutex_lock(&spec->pcm_lock); in hdmi_repoll_eld()
1741 mutex_unlock(&spec->pcm_lock); in hdmi_repoll_eld()
1746 struct hdmi_spec *spec = codec->spec; in hdmi_add_pin() local
1763 !spec->force_connect) in hdmi_add_pin()
1770 if (spec->intel_hsw_fixup) { in hdmi_add_pin()
1781 spec->dev_num = 3; in hdmi_add_pin()
1782 } else if (spec->dyn_pcm_assign && codec->dp_mst) { in hdmi_add_pin()
1785 * spec->dev_num is the maxinum number of device entries in hdmi_add_pin()
1788 spec->dev_num = (spec->dev_num > dev_num) ? in hdmi_add_pin()
1789 spec->dev_num : dev_num; in hdmi_add_pin()
1797 spec->dev_num = 1; in hdmi_add_pin()
1801 pin_idx = spec->num_pins; in hdmi_add_pin()
1802 per_pin = snd_array_new(&spec->pins); in hdmi_add_pin()
1807 if (spec->dyn_pcm_assign) { in hdmi_add_pin()
1811 per_pin->pcm = get_hdmi_pcm(spec, pin_idx); in hdmi_add_pin()
1815 per_pin->pin_nid_idx = spec->num_nids; in hdmi_add_pin()
1822 spec->num_pins++; in hdmi_add_pin()
1824 spec->num_nids++; in hdmi_add_pin()
1831 struct hdmi_spec *spec = codec->spec; in hdmi_add_cvt() local
1839 per_cvt = snd_array_new(&spec->cvts); in hdmi_add_cvt()
1847 if (chans > spec->chmap.channels_max) in hdmi_add_cvt()
1848 spec->chmap.channels_max = chans; in hdmi_add_cvt()
1858 if (spec->num_cvts < ARRAY_SIZE(spec->cvt_nids)) in hdmi_add_cvt()
1859 spec->cvt_nids[spec->num_cvts] = cvt_nid; in hdmi_add_cvt()
1860 spec->num_cvts++; in hdmi_add_cvt()
1873 struct hdmi_spec *spec = codec->spec; in hdmi_parse_codec() local
1888 spec->force_connect = true; in hdmi_parse_codec()
1954 struct hdmi_spec *spec = codec->spec; in generic_hdmi_playback_pcm_prepare() local
1962 mutex_lock(&spec->pcm_lock); in generic_hdmi_playback_pcm_prepare()
1964 if (spec->dyn_pcm_assign && pin_idx < 0) { in generic_hdmi_playback_pcm_prepare()
1979 per_pin = get_pin(spec, pin_idx); in generic_hdmi_playback_pcm_prepare()
2012 if (spec->dyn_pin_out) { in generic_hdmi_playback_pcm_prepare()
2023 err = spec->ops.setup_stream(codec, cvt_nid, per_pin->pin_nid, in generic_hdmi_playback_pcm_prepare()
2026 mutex_unlock(&spec->pcm_lock); in generic_hdmi_playback_pcm_prepare()
2042 struct hdmi_spec *spec = codec->spec; in hdmi_pcm_close() local
2049 mutex_lock(&spec->pcm_lock); in hdmi_pcm_close()
2061 per_cvt = get_cvt(spec, cvt_idx); in hdmi_pcm_close()
2069 clear_bit(pcm_idx, &spec->pcm_in_use); in hdmi_pcm_close()
2071 if (spec->dyn_pcm_assign && pin_idx < 0) in hdmi_pcm_close()
2078 per_pin = get_pin(spec, pin_idx); in hdmi_pcm_close()
2080 if (spec->dyn_pin_out) { in hdmi_pcm_close()
2100 mutex_unlock(&spec->pcm_lock); in hdmi_pcm_close()
2115 struct hdmi_spec *spec = codec->spec; in hdmi_get_spk_alloc() local
2116 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_get_spk_alloc()
2128 struct hdmi_spec *spec = codec->spec; in hdmi_get_chmap() local
2129 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_get_chmap()
2142 struct hdmi_spec *spec = codec->spec; in hdmi_set_chmap() local
2143 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in hdmi_set_chmap()
2158 struct hdmi_spec *spec = codec->spec; in is_hdmi_pcm_attached() local
2159 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); in is_hdmi_pcm_attached()
2166 struct hdmi_spec *spec = codec->spec; in generic_hdmi_build_pcms() local
2178 pcm_num = spec->num_nids; in generic_hdmi_build_pcms()
2180 pcm_num = spec->num_nids + spec->dev_num - 1; in generic_hdmi_build_pcms()
2192 spec->pcm_rec[idx].pcm = info; in generic_hdmi_build_pcms()
2193 spec->pcm_used++; in generic_hdmi_build_pcms()
2201 if (spec->pcm_used >= 16) in generic_hdmi_build_pcms()
2219 struct hdmi_spec *spec = codec->spec; in generic_hdmi_build_jack() local
2220 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pcm_idx); in generic_hdmi_build_jack()
2222 int pcmdev = get_pcm_rec(spec, pcm_idx)->device; in generic_hdmi_build_jack()
2227 if (!spec->dyn_pcm_assign && in generic_hdmi_build_jack()
2237 spec->pcm_rec[pcm_idx].jack = jack; in generic_hdmi_build_jack()
2238 jack->private_data = &spec->pcm_rec[pcm_idx]; in generic_hdmi_build_jack()
2245 struct hdmi_spec *spec = codec->spec; in generic_hdmi_build_controls() local
2249 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) { in generic_hdmi_build_controls()
2250 if (!get_pcm_rec(spec, pcm_idx)->pcm) { in generic_hdmi_build_controls()
2252 set_bit(pcm_idx, &spec->pcm_bitmap); in generic_hdmi_build_controls()
2263 if (spec->dyn_pcm_assign) in generic_hdmi_build_controls()
2265 0, spec->cvt_nids[0], in generic_hdmi_build_controls()
2269 get_pin(spec, pcm_idx); in generic_hdmi_build_controls()
2279 dev = get_pcm_rec(spec, pcm_idx)->device; in generic_hdmi_build_controls()
2288 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in generic_hdmi_build_controls()
2289 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); in generic_hdmi_build_controls()
2297 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) { in generic_hdmi_build_controls()
2300 pcm = get_pcm_rec(spec, pcm_idx); in generic_hdmi_build_controls()
2303 err = snd_hdac_add_chmap_ctls(pcm->pcm, pcm_idx, &spec->chmap); in generic_hdmi_build_controls()
2313 struct hdmi_spec *spec = codec->spec; in generic_hdmi_init_per_pins() local
2316 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in generic_hdmi_init_per_pins()
2317 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); in generic_hdmi_init_per_pins()
2329 struct hdmi_spec *spec = codec->spec; in generic_hdmi_init() local
2332 mutex_lock(&spec->bind_lock); in generic_hdmi_init()
2333 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in generic_hdmi_init()
2334 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); in generic_hdmi_init()
2345 mutex_unlock(&spec->bind_lock); in generic_hdmi_init()
2349 static void hdmi_array_init(struct hdmi_spec *spec, int nums) in hdmi_array_init() argument
2351 snd_array_init(&spec->pins, sizeof(struct hdmi_spec_per_pin), nums); in hdmi_array_init()
2352 snd_array_init(&spec->cvts, sizeof(struct hdmi_spec_per_cvt), nums); in hdmi_array_init()
2355 static void hdmi_array_free(struct hdmi_spec *spec) in hdmi_array_free() argument
2357 snd_array_free(&spec->pins); in hdmi_array_free()
2358 snd_array_free(&spec->cvts); in hdmi_array_free()
2363 struct hdmi_spec *spec = codec->spec; in generic_spec_free() local
2365 if (spec) { in generic_spec_free()
2366 hdmi_array_free(spec); in generic_spec_free()
2367 kfree(spec); in generic_spec_free()
2368 codec->spec = NULL; in generic_spec_free()
2375 struct hdmi_spec *spec = codec->spec; in generic_hdmi_free() local
2378 if (spec->acomp_registered) { in generic_hdmi_free()
2385 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in generic_hdmi_free()
2386 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); in generic_hdmi_free()
2391 for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) { in generic_hdmi_free()
2392 if (spec->pcm_rec[pcm_idx].jack == NULL) in generic_hdmi_free()
2394 if (spec->dyn_pcm_assign) in generic_hdmi_free()
2396 spec->pcm_rec[pcm_idx].jack); in generic_hdmi_free()
2398 spec->pcm_rec[pcm_idx].jack = NULL; in generic_hdmi_free()
2407 struct hdmi_spec *spec = codec->spec; in generic_hdmi_resume() local
2413 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in generic_hdmi_resume()
2414 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); in generic_hdmi_resume()
2439 /* allocate codec->spec and assign/initialize generic parser ops */
2442 struct hdmi_spec *spec; in alloc_generic_hdmi() local
2444 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in alloc_generic_hdmi()
2445 if (!spec) in alloc_generic_hdmi()
2448 spec->codec = codec; in alloc_generic_hdmi()
2449 spec->ops = generic_standard_hdmi_ops; in alloc_generic_hdmi()
2450 spec->dev_num = 1; /* initialize to 1 */ in alloc_generic_hdmi()
2451 mutex_init(&spec->pcm_lock); in alloc_generic_hdmi()
2452 mutex_init(&spec->bind_lock); in alloc_generic_hdmi()
2453 snd_hdac_register_chmap_ops(&codec->core, &spec->chmap); in alloc_generic_hdmi()
2455 spec->chmap.ops.get_chmap = hdmi_get_chmap; in alloc_generic_hdmi()
2456 spec->chmap.ops.set_chmap = hdmi_set_chmap; in alloc_generic_hdmi()
2457 spec->chmap.ops.is_pcm_attached = is_hdmi_pcm_attached; in alloc_generic_hdmi()
2458 spec->chmap.ops.get_spk_alloc = hdmi_get_spk_alloc; in alloc_generic_hdmi()
2460 codec->spec = spec; in alloc_generic_hdmi()
2461 hdmi_array_init(spec, 4); in alloc_generic_hdmi()
2512 struct hdmi_spec *spec; in generic_acomp_notifier_set() local
2515 spec = container_of(acomp->audio_ops, struct hdmi_spec, drm_audio_ops); in generic_acomp_notifier_set()
2516 mutex_lock(&spec->bind_lock); in generic_acomp_notifier_set()
2517 spec->use_acomp_notifier = use_acomp; in generic_acomp_notifier_set()
2518 spec->codec->relaxed_resume = use_acomp; in generic_acomp_notifier_set()
2519 spec->codec->bus->keep_power = 0; in generic_acomp_notifier_set()
2521 for (i = 0; i < spec->num_pins; i++) in generic_acomp_notifier_set()
2522 reprogram_jack_detect(spec->codec, in generic_acomp_notifier_set()
2523 get_pin(spec, i)->pin_nid, in generic_acomp_notifier_set()
2524 get_pin(spec, i)->dev_id, in generic_acomp_notifier_set()
2526 mutex_unlock(&spec->bind_lock); in generic_acomp_notifier_set()
2560 struct hdmi_spec *spec = codec->spec; in generic_acomp_pin_eld_notify() local
2561 hda_nid_t pin_nid = spec->port2pin(codec, port); in generic_acomp_pin_eld_notify()
2583 struct hdmi_spec *spec = codec->spec; in setup_drm_audio_ops() local
2585 spec->drm_audio_ops.audio_ptr = codec; in setup_drm_audio_ops()
2591 spec->drm_audio_ops.pin2port = ops->pin2port; in setup_drm_audio_ops()
2592 spec->drm_audio_ops.pin_eld_notify = ops->pin_eld_notify; in setup_drm_audio_ops()
2593 spec->drm_audio_ops.master_bind = ops->master_bind; in setup_drm_audio_ops()
2594 spec->drm_audio_ops.master_unbind = ops->master_unbind; in setup_drm_audio_ops()
2602 struct hdmi_spec *spec = codec->spec; in generic_acomp_init() local
2609 spec->port2pin = port2pin; in generic_acomp_init()
2611 if (!snd_hdac_acomp_init(&codec->bus->core, &spec->drm_audio_ops, in generic_acomp_init()
2613 spec->acomp_registered = true; in generic_acomp_init()
2630 struct hdmi_spec *spec = codec->spec; in intel_haswell_enable_all_pins() local
2632 vendor_param = snd_hda_codec_read(codec, spec->vendor_nid, 0, in intel_haswell_enable_all_pins()
2638 vendor_param = snd_hda_codec_read(codec, spec->vendor_nid, 0, in intel_haswell_enable_all_pins()
2650 struct hdmi_spec *spec = codec->spec; in intel_haswell_fixup_enable_dp12() local
2652 vendor_param = snd_hda_codec_read(codec, spec->vendor_nid, 0, in intel_haswell_fixup_enable_dp12()
2660 snd_hda_codec_write_cache(codec, spec->vendor_nid, 0, in intel_haswell_fixup_enable_dp12()
2705 struct hdmi_spec *spec = codec->spec; in intel_pin2port() local
2708 if (!spec->port_num) { in intel_pin2port()
2719 for (i = 0; i < spec->port_num; i++) { in intel_pin2port()
2720 if (pin_nid == spec->port_map[i]) in intel_pin2port()
2730 struct hdmi_spec *spec = codec->spec; in intel_port2pin() local
2732 if (!spec->port_num) { in intel_port2pin()
2739 if (port < 0 || port >= spec->port_num) in intel_port2pin()
2741 return spec->port_map[port]; in intel_port2pin()
2774 struct hdmi_spec *spec = codec->spec; in register_i915_notifier() local
2776 spec->use_acomp_notifier = true; in register_i915_notifier()
2777 spec->port2pin = intel_port2pin; in register_i915_notifier()
2780 &spec->drm_audio_ops); in register_i915_notifier()
2856 struct hdmi_spec *spec; in intel_hsw_common_init() local
2862 spec = codec->spec; in intel_hsw_common_init()
2864 spec->dyn_pcm_assign = true; in intel_hsw_common_init()
2865 spec->vendor_nid = vendor_nid; in intel_hsw_common_init()
2866 spec->port_map = port_map; in intel_hsw_common_init()
2867 spec->port_num = port_num; in intel_hsw_common_init()
2868 spec->intel_hsw_fixup = true; in intel_hsw_common_init()
2879 spec->ops.setup_stream = i915_hsw_setup_stream; in intel_hsw_common_init()
2880 spec->ops.pin_cvt_fixup = i915_pin_cvt_fixup; in intel_hsw_common_init()
2887 spec->send_silent_stream = true; in intel_hsw_common_init()
2927 struct hdmi_spec *spec; in patch_i915_byt_hdmi() local
2933 spec = codec->spec; in patch_i915_byt_hdmi()
2943 spec->ops.pin_cvt_fixup = i915_pin_cvt_fixup; in patch_i915_byt_hdmi()
2965 struct hdmi_spec *spec = codec->spec; in simple_playback_build_pcms() local
2971 per_cvt = get_cvt(spec, 0); in simple_playback_build_pcms()
2978 spec->pcm_rec[0].pcm = info; in simple_playback_build_pcms()
2981 *pstr = spec->pcm_playback; in simple_playback_build_pcms()
2998 * as long as spec->pins[] is set correctly
3004 struct hdmi_spec *spec = codec->spec; in simple_playback_build_controls() local
3008 per_cvt = get_cvt(spec, 0); in simple_playback_build_controls()
3019 struct hdmi_spec *spec = codec->spec; in simple_playback_init() local
3020 struct hdmi_spec_per_pin *per_pin = get_pin(spec, 0); in simple_playback_init()
3035 struct hdmi_spec *spec = codec->spec; in simple_playback_free() local
3037 hdmi_array_free(spec); in simple_playback_free()
3038 kfree(spec); in simple_playback_free()
3130 struct hdmi_spec *spec = codec->spec; in simple_playback_pcm_open() local
3156 return snd_hda_multi_out_dig_open(codec, &spec->multiout); in simple_playback_pcm_open()
3163 struct hdmi_spec *spec = codec->spec; in simple_playback_pcm_close() local
3164 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in simple_playback_pcm_close()
3173 struct hdmi_spec *spec = codec->spec; in simple_playback_pcm_prepare() local
3174 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, in simple_playback_pcm_prepare()
3200 struct hdmi_spec *spec; in patch_simple_hdmi() local
3204 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in patch_simple_hdmi()
3205 if (!spec) in patch_simple_hdmi()
3208 spec->codec = codec; in patch_simple_hdmi()
3209 codec->spec = spec; in patch_simple_hdmi()
3210 hdmi_array_init(spec, 1); in patch_simple_hdmi()
3212 spec->multiout.num_dacs = 0; /* no analog */ in patch_simple_hdmi()
3213 spec->multiout.max_channels = 2; in patch_simple_hdmi()
3214 spec->multiout.dig_out_nid = cvt_nid; in patch_simple_hdmi()
3215 spec->num_cvts = 1; in patch_simple_hdmi()
3216 spec->num_pins = 1; in patch_simple_hdmi()
3217 per_pin = snd_array_new(&spec->pins); in patch_simple_hdmi()
3218 per_cvt = snd_array_new(&spec->cvts); in patch_simple_hdmi()
3225 spec->pcm_playback = simple_pcm_playback; in patch_simple_hdmi()
3269 struct hdmi_spec *spec = codec->spec; in nvhdmi_8ch_7x_pcm_close() local
3287 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in nvhdmi_8ch_7x_pcm_close()
3299 struct hdmi_spec *spec = codec->spec; in nvhdmi_8ch_7x_pcm_prepare() local
3304 per_cvt = get_cvt(spec, 0); in nvhdmi_8ch_7x_pcm_prepare()
3408 struct hdmi_spec *spec; in patch_nvhdmi_2ch() local
3416 spec = codec->spec; in patch_nvhdmi_2ch()
3417 spec->pcm_playback.rates = SUPPORTED_RATES; in patch_nvhdmi_2ch()
3418 spec->pcm_playback.maxbps = SUPPORTED_MAXBPS; in patch_nvhdmi_2ch()
3419 spec->pcm_playback.formats = SUPPORTED_FORMATS; in patch_nvhdmi_2ch()
3425 struct hdmi_spec *spec = codec->spec; in nvhdmi_7x_8ch_build_pcms() local
3428 struct hda_pcm *info = get_pcm_rec(spec, 0); in nvhdmi_7x_8ch_build_pcms()
3436 struct hdmi_spec *spec = codec->spec; in nvhdmi_7x_8ch_build_controls() local
3446 info = get_pcm_rec(spec, 0); in nvhdmi_7x_8ch_build_controls()
3467 struct hdmi_spec *spec; in patch_nvhdmi_8ch_7x() local
3471 spec = codec->spec; in patch_nvhdmi_8ch_7x()
3472 spec->multiout.max_channels = 8; in patch_nvhdmi_8ch_7x()
3473 spec->pcm_playback = nvhdmi_pcm_playback_8ch_7x; in patch_nvhdmi_8ch_7x()
3535 struct hdmi_spec *spec; in patch_nvhdmi() local
3543 spec = codec->spec; in patch_nvhdmi()
3544 spec->dyn_pcm_assign = true; in patch_nvhdmi()
3554 spec->dyn_pin_out = true; in patch_nvhdmi()
3556 spec->chmap.ops.chmap_cea_alloc_validate_get_type = in patch_nvhdmi()
3558 spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; in patch_nvhdmi()
3569 struct hdmi_spec *spec; in patch_nvhdmi_legacy() local
3576 spec = codec->spec; in patch_nvhdmi_legacy()
3577 spec->dyn_pin_out = true; in patch_nvhdmi_legacy()
3579 spec->chmap.ops.chmap_cea_alloc_validate_get_type = in patch_nvhdmi_legacy()
3581 spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; in patch_nvhdmi_legacy()
3702 struct hdmi_spec *spec = codec->spec; in hda_find_pcm_by_type() local
3705 for (i = 0; i < spec->num_pins; i++) { in hda_find_pcm_by_type()
3706 struct hda_pcm *pcm = get_pcm_rec(spec, i); in hda_find_pcm_by_type()
3742 struct hdmi_spec *spec; in patch_tegra_hdmi() local
3750 spec = codec->spec; in patch_tegra_hdmi()
3751 spec->chmap.ops.chmap_cea_alloc_validate_get_type = in patch_tegra_hdmi()
3753 spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; in patch_tegra_hdmi()
4044 int ramp_rate = 180; /* default as per AMD spec */ in atihdmi_setup_stream()
4045 /* disable ramp-up/down for non-pcm as per AMD spec */ in atihdmi_setup_stream()
4059 struct hdmi_spec *spec = codec->spec; in atihdmi_init() local
4067 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in atihdmi_init()
4068 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); in atihdmi_init()
4106 struct hdmi_spec *spec; in patch_atihdmi() local
4117 spec = codec->spec; in patch_atihdmi()
4119 spec->ops.pin_get_eld = atihdmi_pin_get_eld; in patch_atihdmi()
4120 spec->ops.pin_setup_infoframe = atihdmi_pin_setup_infoframe; in patch_atihdmi()
4121 spec->ops.pin_hbr_setup = atihdmi_pin_hbr_setup; in patch_atihdmi()
4122 spec->ops.setup_stream = atihdmi_setup_stream; in patch_atihdmi()
4124 spec->chmap.ops.pin_get_slot_channel = atihdmi_pin_get_slot_channel; in patch_atihdmi()
4125 spec->chmap.ops.pin_set_slot_channel = atihdmi_pin_set_slot_channel; in patch_atihdmi()
4129 spec->chmap.ops.chmap_cea_alloc_validate_get_type = in patch_atihdmi()
4131 spec->chmap.ops.cea_alloc_to_tlv_chmap = in patch_atihdmi()
4133 spec->chmap.ops.chmap_validate = atihdmi_paired_chmap_validate; in patch_atihdmi()
4137 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) { in patch_atihdmi()
4138 per_cvt = get_cvt(spec, cvt_idx); in patch_atihdmi()
4145 spec->chmap.channels_max = max(spec->chmap.channels_max, 8u); in patch_atihdmi()