Lines Matching +full:even +full:- +full:numbered
1 // SPDX-License-Identifier: GPL-2.0-or-later
18 ((codec)->core.vendor_id == 0x1002aa01 && \
19 ((codec)->core.revision_id & 0xff00) >= 0x0300)
106 return -EINVAL; in get_eld_ati()
170 /* format is supported, copy SAD as-is */ in get_eld_ati()
189 return -EINVAL; in get_eld_ati()
196 * [1..251] msecs = (x-1)*2 (max 500ms with x = 251 = 0xfb) in get_eld_ati()
212 buf[6] = video_latency_hdmi - audio_latency_hdmi; in get_eld_ati()
217 buf[5] |= ((pos - ELD_FIXED_BYTES - sink_desc_len) / 3) << 4; in get_eld_ati()
219 /* Baseline ELD block length is 4-byte aligned */ in get_eld_ati()
222 /* Baseline ELD length (4-byte header is not counted in) */ in get_eld_ati()
223 buf[2] = (pos - 4) / 4; in get_eld_ati()
234 /* call hda_eld.c ATI/AMD-specific function */ in atihdmi_pin_get_eld()
250 * ATI/AMD have automatic FC/LFE swap built-in in atihdmi_paired_swap_fc_lfe()
268 /* check that only channel pairs need to be remapped on old pre-rev3 ATI/AMD */ in atihdmi_paired_chmap_validate()
280 int chan_idx = 7 - atihdmi_paired_swap_fc_lfe(j); in atihdmi_paired_chmap_validate()
282 if (cap->speakers[chan_idx] == mask) { in atihdmi_paired_chmap_validate()
287 /* even channel, check the odd companion */ in atihdmi_paired_chmap_validate()
288 int comp_chan_idx = 7 - atihdmi_paired_swap_fc_lfe(j + 1); in atihdmi_paired_chmap_validate()
290 int comp_mask_act = cap->speakers[comp_chan_idx]; in atihdmi_paired_chmap_validate()
295 return -EINVAL; in atihdmi_paired_chmap_validate()
302 return -EINVAL; in atihdmi_paired_chmap_validate()
319 return -EINVAL; in atihdmi_pin_set_slot_channel()
325 * disable the slot since the corresponding even slot could have a in atihdmi_pin_set_slot_channel()
327 * disabled when this function is called for the even slot. in atihdmi_pin_set_slot_channel()
332 hdmi_slot -= hdmi_slot % 2; in atihdmi_pin_set_slot_channel()
335 stream_channel -= stream_channel % 2; in atihdmi_pin_set_slot_channel()
358 return -EINVAL; in atihdmi_pin_get_slot_channel()
363 ati_asp_slot -= 1; in atihdmi_pin_get_slot_channel()
386 * Pre-rev3 ATI/AMD codecs operate in a paired channel mode, so in atihdmi_paired_chmap_cea_alloc_validate_get_type()
393 /* We only produce even-numbered channel count TLVs */ in atihdmi_paired_chmap_cea_alloc_validate_get_type()
395 return -1; in atihdmi_paired_chmap_cea_alloc_validate_get_type()
398 if (cap->speakers[c] || cap->speakers[c+1]) in atihdmi_paired_chmap_cea_alloc_validate_get_type()
403 return -1; in atihdmi_paired_chmap_cea_alloc_validate_get_type()
412 /* produce paired maps for pre-rev3 ATI/AMD codecs */ in atihdmi_paired_cea_alloc_to_tlv_chmap()
416 for (c = 7; c >= 0; c--) { in atihdmi_paired_cea_alloc_to_tlv_chmap()
417 int chan = 7 - atihdmi_paired_swap_fc_lfe(7 - c); in atihdmi_paired_cea_alloc_to_tlv_chmap()
418 int spk = cap->speakers[chan]; in atihdmi_paired_cea_alloc_to_tlv_chmap()
422 if (cap->speakers[chan + (chan % 2 ? -1 : 1)]) in atihdmi_paired_cea_alloc_to_tlv_chmap()
449 "%s: NID=0x%x, %shbr-ctl=0x%x\n", in atihdmi_pin_hbr_setup()
452 hbr_ctl == hbr_ctl_new ? "" : "new-", in atihdmi_pin_hbr_setup()
461 return -EINVAL; in atihdmi_pin_hbr_setup()
472 /* disable ramp-up/down for non-pcm as per AMD spec */ in atihdmi_setup_stream()
486 struct hdmi_spec *spec = codec->spec; in atihdmi_init()
494 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { in atihdmi_init()
498 snd_hda_codec_write(codec, per_pin->pin_nid, 0, ATI_VERB_SET_DOWNMIX_INFO, 0); in atihdmi_init()
500 /* enable channel-wise remap mode if supported */ in atihdmi_init()
502 snd_hda_codec_write(codec, per_pin->pin_nid, 0, in atihdmi_init()
506 codec->auto_runtime_pm = 1; in atihdmi_init()
511 /* map from pin NID to port; port is 0-based */
515 return pin_nid / 2 - 1; in atihdmi_pin2port()
518 /* reverse-map from port to pin NID: see above */
541 spec = codec->spec; in atihdmi_probe()
543 spec->static_pcm_mapping = true; in atihdmi_probe()
545 spec->ops.pin_get_eld = atihdmi_pin_get_eld; in atihdmi_probe()
546 spec->ops.pin_setup_infoframe = atihdmi_pin_setup_infoframe; in atihdmi_probe()
547 spec->ops.pin_hbr_setup = atihdmi_pin_hbr_setup; in atihdmi_probe()
548 spec->ops.setup_stream = atihdmi_setup_stream; in atihdmi_probe()
550 spec->chmap.ops.pin_get_slot_channel = atihdmi_pin_get_slot_channel; in atihdmi_probe()
551 spec->chmap.ops.pin_set_slot_channel = atihdmi_pin_set_slot_channel; in atihdmi_probe()
554 /* override to ATI/AMD-specific versions with pairwise mapping */ in atihdmi_probe()
555 spec->chmap.ops.chmap_cea_alloc_validate_get_type = in atihdmi_probe()
557 spec->chmap.ops.cea_alloc_to_tlv_chmap = in atihdmi_probe()
559 spec->chmap.ops.chmap_validate = atihdmi_paired_chmap_validate; in atihdmi_probe()
563 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) { in atihdmi_probe()
565 per_cvt->channels_max = max(per_cvt->channels_max, 8u); in atihdmi_probe()
566 per_cvt->rates |= SUPPORTED_RATES; in atihdmi_probe()
567 per_cvt->formats |= SUPPORTED_FORMATS; in atihdmi_probe()
568 per_cvt->maxbps = max(per_cvt->maxbps, 24u); in atihdmi_probe()
571 spec->chmap.channels_max = max(spec->chmap.channels_max, 8u); in atihdmi_probe()
574 * the link-down as is. Tell the core to allow it. in atihdmi_probe()
576 codec->link_down_at_suspend = 1; in atihdmi_probe()
607 MODULE_DESCRIPTION("AMD/ATI HDMI HD-audio codec");