Lines Matching refs:codec
50 #define is_haswell(codec) ((codec)->core.vendor_id == 0x80862807) argument
51 #define is_broadwell(codec) ((codec)->core.vendor_id == 0x80862808) argument
52 #define is_skylake(codec) ((codec)->core.vendor_id == 0x80862809) argument
53 #define is_broxton(codec) ((codec)->core.vendor_id == 0x8086280a) argument
54 #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ argument
55 || is_skylake(codec) || is_broxton(codec))
57 #define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) argument
58 #define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) argument
59 #define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) argument
81 struct hda_codec *codec; member
101 int (*pin_get_eld)(struct hda_codec *codec, hda_nid_t pin_nid,
105 int (*pin_get_slot_channel)(struct hda_codec *codec, hda_nid_t pin_nid,
107 int (*pin_set_slot_channel)(struct hda_codec *codec, hda_nid_t pin_nid,
110 void (*pin_setup_infoframe)(struct hda_codec *codec, hda_nid_t pin_nid,
114 int (*pin_hbr_setup)(struct hda_codec *codec, hda_nid_t pin_nid, bool hbr);
116 int (*setup_stream)(struct hda_codec *codec, hda_nid_t cvt_nid,
365 static int pin_nid_to_pin_index(struct hda_codec *codec, hda_nid_t pin_nid) in pin_nid_to_pin_index() argument
367 struct hdmi_spec *spec = codec->spec; in pin_nid_to_pin_index()
374 codec_warn(codec, "HDMI: pin nid %d not registered\n", pin_nid); in pin_nid_to_pin_index()
378 static int hinfo_to_pin_index(struct hda_codec *codec, in hinfo_to_pin_index() argument
381 struct hdmi_spec *spec = codec->spec; in hinfo_to_pin_index()
388 codec_warn(codec, "HDMI: hinfo %p not registered\n", hinfo); in hinfo_to_pin_index()
392 static int cvt_nid_to_cvt_index(struct hda_codec *codec, hda_nid_t cvt_nid) in cvt_nid_to_cvt_index() argument
394 struct hdmi_spec *spec = codec->spec; in cvt_nid_to_cvt_index()
401 codec_warn(codec, "HDMI: cvt nid %d not registered\n", cvt_nid); in cvt_nid_to_cvt_index()
408 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in hdmi_eld_ctl_info() local
409 struct hdmi_spec *spec = codec->spec; in hdmi_eld_ctl_info()
430 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); in hdmi_eld_ctl_get() local
431 struct hdmi_spec *spec = codec->spec; in hdmi_eld_ctl_get()
466 static int hdmi_create_eld_ctl(struct hda_codec *codec, int pin_idx, in hdmi_create_eld_ctl() argument
470 struct hdmi_spec *spec = codec->spec; in hdmi_create_eld_ctl()
473 kctl = snd_ctl_new1(&eld_bytes_ctl, codec); in hdmi_create_eld_ctl()
479 err = snd_hda_ctl_add(codec, get_pin(spec, pin_idx)->pin_nid, kctl); in hdmi_create_eld_ctl()
488 static void hdmi_get_dip_index(struct hda_codec *codec, hda_nid_t pin_nid, in hdmi_get_dip_index() argument
493 val = snd_hda_codec_read(codec, pin_nid, 0, in hdmi_get_dip_index()
501 static void hdmi_set_dip_index(struct hda_codec *codec, hda_nid_t pin_nid, in hdmi_set_dip_index() argument
508 snd_hda_codec_write(codec, pin_nid, 0, AC_VERB_SET_HDMI_DIP_INDEX, val); in hdmi_set_dip_index()
511 static void hdmi_write_dip_byte(struct hda_codec *codec, hda_nid_t pin_nid, in hdmi_write_dip_byte() argument
514 snd_hda_codec_write(codec, pin_nid, 0, AC_VERB_SET_HDMI_DIP_DATA, val); in hdmi_write_dip_byte()
517 static void hdmi_init_pin(struct hda_codec *codec, hda_nid_t pin_nid) in hdmi_init_pin() argument
519 struct hdmi_spec *spec = codec->spec; in hdmi_init_pin()
523 if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP) in hdmi_init_pin()
524 snd_hda_codec_write(codec, pin_nid, 0, in hdmi_init_pin()
536 snd_hda_codec_write(codec, pin_nid, 0, in hdmi_init_pin()
540 static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t cvt_nid) in hdmi_get_channel_count() argument
542 return 1 + snd_hda_codec_read(codec, cvt_nid, 0, in hdmi_get_channel_count()
546 static void hdmi_set_channel_count(struct hda_codec *codec, in hdmi_set_channel_count() argument
549 if (chs != hdmi_get_channel_count(codec, cvt_nid)) in hdmi_set_channel_count()
550 snd_hda_codec_write(codec, cvt_nid, 0, in hdmi_set_channel_count()
582 struct hda_codec *codec = per_pin->codec; in eld_proc_new() local
586 snprintf(name, sizeof(name), "eld#%d.%d", codec->addr, index); in eld_proc_new()
587 err = snd_card_proc_new(codec->card, name, &entry); in eld_proc_new()
601 if (!per_pin->codec->bus->shutdown) { in eld_proc_free()
660 static int hdmi_channel_allocation(struct hda_codec *codec, in hdmi_channel_allocation() argument
707 codec_dbg(codec, "HDMI: select CA 0x%x for %d-channel allocation: %s\n", in hdmi_channel_allocation()
713 static void hdmi_debug_channel_mapping(struct hda_codec *codec, in hdmi_debug_channel_mapping() argument
717 struct hdmi_spec *spec = codec->spec; in hdmi_debug_channel_mapping()
722 channel = spec->ops.pin_get_slot_channel(codec, pin_nid, i); in hdmi_debug_channel_mapping()
723 codec_dbg(codec, "HDMI: ASP channel %d => slot %d\n", in hdmi_debug_channel_mapping()
729 static void hdmi_std_setup_channel_mapping(struct hda_codec *codec, in hdmi_std_setup_channel_mapping() argument
734 struct hdmi_spec *spec = codec->spec; in hdmi_std_setup_channel_mapping()
770 err = spec->ops.pin_set_slot_channel(codec, pin_nid, hdmi_slot, channel); in hdmi_std_setup_channel_mapping()
772 codec_dbg(codec, "HDMI: channel mapping failed\n"); in hdmi_std_setup_channel_mapping()
874 static int hdmi_manual_setup_channel_mapping(struct hda_codec *codec, in hdmi_manual_setup_channel_mapping() argument
879 struct hdmi_spec *spec = codec->spec; in hdmi_manual_setup_channel_mapping()
897 err = spec->ops.pin_set_slot_channel(codec, pin_nid, hdmi_slot, in hdmi_manual_setup_channel_mapping()
918 static void hdmi_setup_channel_mapping(struct hda_codec *codec, in hdmi_setup_channel_mapping() argument
924 hdmi_manual_setup_channel_mapping(codec, pin_nid, in hdmi_setup_channel_mapping()
927 hdmi_std_setup_channel_mapping(codec, pin_nid, non_pcm, ca); in hdmi_setup_channel_mapping()
931 hdmi_debug_channel_mapping(codec, pin_nid); in hdmi_setup_channel_mapping()
934 static int hdmi_pin_set_slot_channel(struct hda_codec *codec, hda_nid_t pin_nid, in hdmi_pin_set_slot_channel() argument
937 return snd_hda_codec_write(codec, pin_nid, 0, in hdmi_pin_set_slot_channel()
942 static int hdmi_pin_get_slot_channel(struct hda_codec *codec, hda_nid_t pin_nid, in hdmi_pin_get_slot_channel() argument
945 return (snd_hda_codec_read(codec, pin_nid, 0, in hdmi_pin_get_slot_channel()
957 static void hdmi_start_infoframe_trans(struct hda_codec *codec, in hdmi_start_infoframe_trans() argument
960 hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0); in hdmi_start_infoframe_trans()
961 snd_hda_codec_write(codec, pin_nid, 0, AC_VERB_SET_HDMI_DIP_XMIT, in hdmi_start_infoframe_trans()
968 static void hdmi_stop_infoframe_trans(struct hda_codec *codec, in hdmi_stop_infoframe_trans() argument
971 hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0); in hdmi_stop_infoframe_trans()
972 snd_hda_codec_write(codec, pin_nid, 0, AC_VERB_SET_HDMI_DIP_XMIT, in hdmi_stop_infoframe_trans()
976 static void hdmi_debug_dip_size(struct hda_codec *codec, hda_nid_t pin_nid) in hdmi_debug_dip_size() argument
982 size = snd_hdmi_get_eld_size(codec, pin_nid); in hdmi_debug_dip_size()
983 codec_dbg(codec, "HDMI: ELD buf size is %d\n", size); in hdmi_debug_dip_size()
986 size = snd_hda_codec_read(codec, pin_nid, 0, in hdmi_debug_dip_size()
988 codec_dbg(codec, "HDMI: DIP GP[%d] buf size is %d\n", i, size); in hdmi_debug_dip_size()
993 static void hdmi_clear_dip_buffers(struct hda_codec *codec, hda_nid_t pin_nid) in hdmi_clear_dip_buffers() argument
1000 size = snd_hda_codec_read(codec, pin_nid, 0, in hdmi_clear_dip_buffers()
1005 hdmi_set_dip_index(codec, pin_nid, i, 0x0); in hdmi_clear_dip_buffers()
1007 hdmi_write_dip_byte(codec, pin_nid, 0x0); in hdmi_clear_dip_buffers()
1008 hdmi_get_dip_index(codec, pin_nid, &pi, &bi); in hdmi_clear_dip_buffers()
1010 codec_dbg(codec, "dip index %d: %d != %d\n", in hdmi_clear_dip_buffers()
1015 codec_dbg(codec, in hdmi_clear_dip_buffers()
1036 static void hdmi_fill_audio_infoframe(struct hda_codec *codec, in hdmi_fill_audio_infoframe() argument
1042 hdmi_debug_dip_size(codec, pin_nid); in hdmi_fill_audio_infoframe()
1043 hdmi_clear_dip_buffers(codec, pin_nid); /* be paranoid */ in hdmi_fill_audio_infoframe()
1045 hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0); in hdmi_fill_audio_infoframe()
1047 hdmi_write_dip_byte(codec, pin_nid, dip[i]); in hdmi_fill_audio_infoframe()
1050 static bool hdmi_infoframe_uptodate(struct hda_codec *codec, hda_nid_t pin_nid, in hdmi_infoframe_uptodate() argument
1056 if (snd_hda_codec_read(codec, pin_nid, 0, AC_VERB_GET_HDMI_DIP_XMIT, 0) in hdmi_infoframe_uptodate()
1060 hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0); in hdmi_infoframe_uptodate()
1062 val = snd_hda_codec_read(codec, pin_nid, 0, in hdmi_infoframe_uptodate()
1071 static void hdmi_pin_setup_infoframe(struct hda_codec *codec, in hdmi_pin_setup_infoframe() argument
1097 codec_dbg(codec, "HDMI: unknown connection type at pin %d\n", in hdmi_pin_setup_infoframe()
1107 if (!hdmi_infoframe_uptodate(codec, pin_nid, ai.bytes, in hdmi_pin_setup_infoframe()
1109 codec_dbg(codec, in hdmi_pin_setup_infoframe()
1113 hdmi_stop_infoframe_trans(codec, pin_nid); in hdmi_pin_setup_infoframe()
1114 hdmi_fill_audio_infoframe(codec, pin_nid, in hdmi_pin_setup_infoframe()
1116 hdmi_start_infoframe_trans(codec, pin_nid); in hdmi_pin_setup_infoframe()
1120 static void hdmi_setup_audio_infoframe(struct hda_codec *codec, in hdmi_setup_audio_infoframe() argument
1124 struct hdmi_spec *spec = codec->spec; in hdmi_setup_audio_infoframe()
1134 if (is_haswell_plus(codec)) in hdmi_setup_audio_infoframe()
1135 snd_hda_codec_write(codec, pin_nid, 0, in hdmi_setup_audio_infoframe()
1144 ca = hdmi_channel_allocation(codec, eld, channels); in hdmi_setup_audio_infoframe()
1151 hdmi_set_channel_count(codec, per_pin->cvt_nid, active_channels); in hdmi_setup_audio_infoframe()
1157 hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca, in hdmi_setup_audio_infoframe()
1161 spec->ops.pin_setup_infoframe(codec, pin_nid, ca, active_channels, in hdmi_setup_audio_infoframe()
1173 static void check_presence_and_report(struct hda_codec *codec, hda_nid_t nid) in check_presence_and_report() argument
1175 struct hdmi_spec *spec = codec->spec; in check_presence_and_report()
1176 int pin_idx = pin_nid_to_pin_index(codec, nid); in check_presence_and_report()
1181 snd_hda_jack_report_sync(codec); in check_presence_and_report()
1184 static void jack_callback(struct hda_codec *codec, in jack_callback() argument
1187 check_presence_and_report(codec, jack->nid); in jack_callback()
1190 static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) in hdmi_intrinsic_event() argument
1196 jack = snd_hda_jack_tbl_get_from_tag(codec, tag); in hdmi_intrinsic_event()
1201 codec_dbg(codec, in hdmi_intrinsic_event()
1203 codec->addr, jack->nid, dev_entry, !!(res & AC_UNSOL_RES_IA), in hdmi_intrinsic_event()
1206 check_presence_and_report(codec, jack->nid); in hdmi_intrinsic_event()
1209 static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) in hdmi_non_intrinsic_event() argument
1216 codec_info(codec, in hdmi_non_intrinsic_event()
1218 codec->addr, in hdmi_non_intrinsic_event()
1232 static void hdmi_unsol_event(struct hda_codec *codec, unsigned int res) in hdmi_unsol_event() argument
1237 if (!snd_hda_jack_tbl_get_from_tag(codec, tag)) { in hdmi_unsol_event()
1238 codec_dbg(codec, "Unexpected HDMI event tag 0x%x\n", tag); in hdmi_unsol_event()
1243 hdmi_intrinsic_event(codec, res); in hdmi_unsol_event()
1245 hdmi_non_intrinsic_event(codec, res); in hdmi_unsol_event()
1248 static void haswell_verify_D0(struct hda_codec *codec, in haswell_verify_D0() argument
1256 if (!snd_hda_check_power_state(codec, cvt_nid, AC_PWRST_D0)) in haswell_verify_D0()
1257 snd_hda_codec_write(codec, cvt_nid, 0, AC_VERB_SET_POWER_STATE, AC_PWRST_D0); in haswell_verify_D0()
1259 if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D0)) { in haswell_verify_D0()
1260 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE, in haswell_verify_D0()
1263 pwr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0); in haswell_verify_D0()
1265 codec_dbg(codec, "Haswell HDMI audio: Power for pin 0x%x is now D%d\n", nid, pwr); in haswell_verify_D0()
1277 static int hdmi_pin_hbr_setup(struct hda_codec *codec, hda_nid_t pin_nid, in hdmi_pin_hbr_setup() argument
1282 if (snd_hda_query_pin_caps(codec, pin_nid) & AC_PINCAP_HBR) { in hdmi_pin_hbr_setup()
1283 pinctl = snd_hda_codec_read(codec, pin_nid, 0, in hdmi_pin_hbr_setup()
1295 codec_dbg(codec, in hdmi_pin_hbr_setup()
1302 snd_hda_codec_write(codec, pin_nid, 0, in hdmi_pin_hbr_setup()
1311 static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid, in hdmi_setup_stream() argument
1314 struct hdmi_spec *spec = codec->spec; in hdmi_setup_stream()
1317 if (is_haswell_plus(codec)) in hdmi_setup_stream()
1318 haswell_verify_D0(codec, cvt_nid, pin_nid); in hdmi_setup_stream()
1320 err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format)); in hdmi_setup_stream()
1323 codec_dbg(codec, "hdmi_setup_stream: HBR is not supported\n"); in hdmi_setup_stream()
1327 snd_hda_codec_setup_stream(codec, cvt_nid, stream_tag, 0, format); in hdmi_setup_stream()
1331 static int hdmi_choose_cvt(struct hda_codec *codec, in hdmi_choose_cvt() argument
1334 struct hdmi_spec *spec = codec->spec; in hdmi_choose_cvt()
1373 static void intel_verify_pin_cvt_connect(struct hda_codec *codec, in intel_verify_pin_cvt_connect() argument
1380 curr = snd_hda_codec_read(codec, pin_nid, 0, in intel_verify_pin_cvt_connect()
1383 snd_hda_codec_write_cache(codec, pin_nid, 0, in intel_verify_pin_cvt_connect()
1397 static void intel_not_share_assigned_cvt(struct hda_codec *codec, in intel_not_share_assigned_cvt() argument
1400 struct hdmi_spec *spec = codec->spec; in intel_not_share_assigned_cvt()
1406 for_each_hda_codec_node(nid, codec) { in intel_not_share_assigned_cvt()
1407 unsigned int wid_caps = get_wcaps(codec, nid); in intel_not_share_assigned_cvt()
1416 curr = snd_hda_codec_read(codec, nid, 0, in intel_not_share_assigned_cvt()
1427 codec_dbg(codec, in intel_not_share_assigned_cvt()
1430 snd_hda_codec_write_cache(codec, nid, 0, in intel_not_share_assigned_cvt()
1443 struct hda_codec *codec, in hdmi_pcm_open() argument
1446 struct hdmi_spec *spec = codec->spec; in hdmi_pcm_open()
1455 pin_idx = hinfo_to_pin_index(codec, hinfo); in hdmi_pcm_open()
1461 err = hdmi_choose_cvt(codec, pin_idx, &cvt_idx, &mux_idx); in hdmi_pcm_open()
1471 snd_hda_codec_write_cache(codec, per_pin->pin_nid, 0, in hdmi_pcm_open()
1476 if (is_haswell_plus(codec) || is_valleyview_plus(codec)) in hdmi_pcm_open()
1477 intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx); in hdmi_pcm_open()
1479 snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); in hdmi_pcm_open()
1495 snd_hda_spdif_ctls_unassign(codec, pin_idx); in hdmi_pcm_open()
1514 static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx) in hdmi_read_pin_conn() argument
1516 struct hdmi_spec *spec = codec->spec; in hdmi_read_pin_conn()
1520 if (!(get_wcaps(codec, pin_nid) & AC_WCAP_CONN_LIST)) { in hdmi_read_pin_conn()
1521 codec_warn(codec, in hdmi_read_pin_conn()
1523 pin_nid, get_wcaps(codec, pin_nid)); in hdmi_read_pin_conn()
1527 per_pin->num_mux_nids = snd_hda_get_connections(codec, pin_nid, in hdmi_read_pin_conn()
1537 struct hda_codec *codec = per_pin->codec; in hdmi_present_sense() local
1538 struct hdmi_spec *spec = codec->spec; in hdmi_present_sense()
1555 snd_hda_power_up_pm(codec); in hdmi_present_sense()
1556 present = snd_hda_pin_sense(codec, pin_nid); in hdmi_present_sense()
1565 codec_dbg(codec, in hdmi_present_sense()
1567 codec->addr, pin_nid, pin_eld->monitor_present, eld->eld_valid); in hdmi_present_sense()
1570 if (spec->ops.pin_get_eld(codec, pin_nid, eld->eld_buffer, in hdmi_present_sense()
1575 if (snd_hdmi_parse_eld(codec, &eld->info, eld->eld_buffer, in hdmi_present_sense()
1581 snd_hdmi_show_eld(codec, &eld->info); in hdmi_present_sense()
1617 if (is_haswell_plus(codec) || in hdmi_present_sense()
1618 is_valleyview_plus(codec)) { in hdmi_present_sense()
1619 intel_verify_pin_cvt_connect(codec, per_pin); in hdmi_present_sense()
1620 intel_not_share_assigned_cvt(codec, pin_nid, in hdmi_present_sense()
1624 hdmi_setup_audio_infoframe(codec, per_pin, in hdmi_present_sense()
1630 snd_ctl_notify(codec->card, in hdmi_present_sense()
1636 jack = snd_hda_jack_tbl_get(codec, pin_nid); in hdmi_present_sense()
1641 snd_hda_power_down_pm(codec); in hdmi_present_sense()
1654 snd_hda_jack_report_sync(per_pin->codec); in hdmi_repoll_eld()
1657 static void intel_haswell_fixup_connect_list(struct hda_codec *codec,
1660 static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) in hdmi_add_pin() argument
1662 struct hdmi_spec *spec = codec->spec; in hdmi_add_pin()
1668 caps = snd_hda_query_pin_caps(codec, pin_nid); in hdmi_add_pin()
1672 config = snd_hda_codec_get_pincfg(codec, pin_nid); in hdmi_add_pin()
1676 if (is_haswell_plus(codec)) in hdmi_add_pin()
1677 intel_haswell_fixup_connect_list(codec, pin_nid); in hdmi_add_pin()
1687 err = hdmi_read_pin_conn(codec, pin_idx); in hdmi_add_pin()
1696 static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t cvt_nid) in hdmi_add_cvt() argument
1698 struct hdmi_spec *spec = codec->spec; in hdmi_add_cvt()
1703 chans = get_wcaps(codec, cvt_nid); in hdmi_add_cvt()
1718 err = snd_hda_query_supported_pcm(codec, cvt_nid, in hdmi_add_cvt()
1732 static int hdmi_parse_codec(struct hda_codec *codec) in hdmi_parse_codec() argument
1737 nodes = snd_hda_get_sub_nodes(codec, codec->core.afg, &nid); in hdmi_parse_codec()
1739 codec_warn(codec, "HDMI: failed to get afg sub nodes\n"); in hdmi_parse_codec()
1747 caps = get_wcaps(codec, nid); in hdmi_parse_codec()
1755 hdmi_add_cvt(codec, nid); in hdmi_parse_codec()
1758 hdmi_add_pin(codec, nid); in hdmi_parse_codec()
1768 static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid) in check_non_pcm_per_cvt() argument
1773 mutex_lock(&codec->spdif_mutex); in check_non_pcm_per_cvt()
1774 spdif = snd_hda_spdif_out_of_nid(codec, cvt_nid); in check_non_pcm_per_cvt()
1776 mutex_unlock(&codec->spdif_mutex); in check_non_pcm_per_cvt()
1796 struct hda_codec *codec, in generic_hdmi_playback_pcm_prepare() argument
1802 struct hdmi_spec *spec = codec->spec; in generic_hdmi_playback_pcm_prepare()
1803 int pin_idx = hinfo_to_pin_index(codec, hinfo); in generic_hdmi_playback_pcm_prepare()
1807 struct i915_audio_component *acomp = codec->bus->core.audio_component; in generic_hdmi_playback_pcm_prepare()
1811 if (is_haswell_plus(codec) || is_valleyview_plus(codec)) { in generic_hdmi_playback_pcm_prepare()
1820 intel_verify_pin_cvt_connect(codec, per_pin); in generic_hdmi_playback_pcm_prepare()
1821 intel_not_share_assigned_cvt(codec, pin_nid, per_pin->mux_idx); in generic_hdmi_playback_pcm_prepare()
1831 non_pcm = check_non_pcm_per_cvt(codec, cvt_nid); in generic_hdmi_playback_pcm_prepare()
1836 hdmi_setup_audio_infoframe(codec, per_pin, non_pcm); in generic_hdmi_playback_pcm_prepare()
1840 pinctl = snd_hda_codec_read(codec, pin_nid, 0, in generic_hdmi_playback_pcm_prepare()
1842 snd_hda_codec_write(codec, pin_nid, 0, in generic_hdmi_playback_pcm_prepare()
1847 return spec->ops.setup_stream(codec, cvt_nid, pin_nid, stream_tag, format); in generic_hdmi_playback_pcm_prepare()
1851 struct hda_codec *codec, in generic_hdmi_playback_pcm_cleanup() argument
1854 snd_hda_codec_cleanup_stream(codec, hinfo->nid); in generic_hdmi_playback_pcm_cleanup()
1859 struct hda_codec *codec, in hdmi_pcm_close() argument
1862 struct hdmi_spec *spec = codec->spec; in hdmi_pcm_close()
1869 cvt_idx = cvt_nid_to_cvt_index(codec, hinfo->nid); in hdmi_pcm_close()
1878 pin_idx = hinfo_to_pin_index(codec, hinfo); in hdmi_pcm_close()
1884 pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0, in hdmi_pcm_close()
1886 snd_hda_codec_write(codec, per_pin->pin_nid, 0, in hdmi_pcm_close()
1891 snd_hda_spdif_ctls_unassign(codec, pin_idx); in hdmi_pcm_close()
1919 struct hda_codec *codec = info->private_data; in hdmi_chmap_ctl_info() local
1920 struct hdmi_spec *spec = codec->spec; in hdmi_chmap_ctl_info()
1960 struct hda_codec *codec = info->private_data; in hdmi_chmap_ctl_tlv() local
1961 struct hdmi_spec *spec = codec->spec; in hdmi_chmap_ctl_tlv()
2009 struct hda_codec *codec = info->private_data; in hdmi_chmap_ctl_get() local
2010 struct hdmi_spec *spec = codec->spec; in hdmi_chmap_ctl_get()
2024 struct hda_codec *codec = info->private_data; in hdmi_chmap_ctl_put() local
2025 struct hdmi_spec *spec = codec->spec; in hdmi_chmap_ctl_put()
2064 hdmi_setup_audio_infoframe(codec, per_pin, per_pin->non_pcm); in hdmi_chmap_ctl_put()
2070 static int generic_hdmi_build_pcms(struct hda_codec *codec) in generic_hdmi_build_pcms() argument
2072 struct hdmi_spec *spec = codec->spec; in generic_hdmi_build_pcms()
2079 info = snd_hda_codec_pcm_new(codec, "HDMI %d", pin_idx); in generic_hdmi_build_pcms()
2095 static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx) in generic_hdmi_build_jack() argument
2098 struct hdmi_spec *spec = codec->spec; in generic_hdmi_build_jack()
2105 phantom_jack = !is_jack_detectable(codec, per_pin->pin_nid); in generic_hdmi_build_jack()
2110 return snd_hda_jack_add_kctl(codec, per_pin->pin_nid, hdmi_str, in generic_hdmi_build_jack()
2114 static int generic_hdmi_build_controls(struct hda_codec *codec) in generic_hdmi_build_controls() argument
2116 struct hdmi_spec *spec = codec->spec; in generic_hdmi_build_controls()
2123 err = generic_hdmi_build_jack(codec, pin_idx); in generic_hdmi_build_controls()
2127 err = snd_hda_create_dig_out_ctls(codec, in generic_hdmi_build_controls()
2133 snd_hda_spdif_ctls_unassign(codec, pin_idx); in generic_hdmi_build_controls()
2136 err = hdmi_create_eld_ctl(codec, pin_idx, in generic_hdmi_build_controls()
2161 chmap->private_data = codec; in generic_hdmi_build_controls()
2174 static int generic_hdmi_init_per_pins(struct hda_codec *codec) in generic_hdmi_init_per_pins() argument
2176 struct hdmi_spec *spec = codec->spec; in generic_hdmi_init_per_pins()
2182 per_pin->codec = codec; in generic_hdmi_init_per_pins()
2190 static int generic_hdmi_init(struct hda_codec *codec) in generic_hdmi_init() argument
2192 struct hdmi_spec *spec = codec->spec; in generic_hdmi_init()
2199 hdmi_init_pin(codec, pin_nid); in generic_hdmi_init()
2200 snd_hda_jack_detect_enable_callback(codec, pin_nid, in generic_hdmi_init()
2201 codec->jackpoll_interval > 0 ? jack_callback : NULL); in generic_hdmi_init()
2218 static void generic_hdmi_free(struct hda_codec *codec) in generic_hdmi_free() argument
2220 struct hdmi_spec *spec = codec->spec; in generic_hdmi_free()
2223 if (is_haswell_plus(codec) || is_valleyview_plus(codec)) in generic_hdmi_free()
2238 static int generic_hdmi_resume(struct hda_codec *codec) in generic_hdmi_resume() argument
2240 struct hdmi_spec *spec = codec->spec; in generic_hdmi_resume()
2243 codec->patch_ops.init(codec); in generic_hdmi_resume()
2244 regcache_sync(codec->core.regmap); in generic_hdmi_resume()
2277 static void intel_haswell_fixup_connect_list(struct hda_codec *codec, in intel_haswell_fixup_connect_list() argument
2280 struct hdmi_spec *spec = codec->spec; in intel_haswell_fixup_connect_list()
2284 nconns = snd_hda_get_connections(codec, nid, conns, ARRAY_SIZE(conns)); in intel_haswell_fixup_connect_list()
2290 codec_dbg(codec, "hdmi: haswell: override pin connection 0x%x\n", nid); in intel_haswell_fixup_connect_list()
2291 snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids); in intel_haswell_fixup_connect_list()
2300 static void intel_haswell_enable_all_pins(struct hda_codec *codec, in intel_haswell_enable_all_pins() argument
2305 vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, in intel_haswell_enable_all_pins()
2311 vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, in intel_haswell_enable_all_pins()
2317 snd_hda_codec_update_widgets(codec); in intel_haswell_enable_all_pins()
2320 static void intel_haswell_fixup_enable_dp12(struct hda_codec *codec) in intel_haswell_fixup_enable_dp12() argument
2324 vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, in intel_haswell_fixup_enable_dp12()
2331 snd_hdac_regmap_add_vendor_verb(&codec->core, INTEL_SET_VENDOR_VERB); in intel_haswell_fixup_enable_dp12()
2332 snd_hda_codec_write_cache(codec, INTEL_VENDOR_NID, 0, in intel_haswell_fixup_enable_dp12()
2339 static void haswell_set_power_state(struct hda_codec *codec, hda_nid_t fg, in haswell_set_power_state() argument
2343 intel_haswell_enable_all_pins(codec, false); in haswell_set_power_state()
2344 intel_haswell_fixup_enable_dp12(codec); in haswell_set_power_state()
2347 snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, power_state); in haswell_set_power_state()
2348 snd_hda_codec_set_power_to_all(codec, fg, power_state); in haswell_set_power_state()
2353 struct hda_codec *codec = audio_ptr; in intel_pin_eld_notify() local
2363 if (snd_power_get_state(codec->card) != SNDRV_CTL_POWER_D0) in intel_pin_eld_notify()
2366 check_presence_and_report(codec, pin_nid); in intel_pin_eld_notify()
2369 static int patch_generic_hdmi(struct hda_codec *codec) in patch_generic_hdmi() argument
2378 codec->spec = spec; in patch_generic_hdmi()
2381 if (is_haswell_plus(codec)) { in patch_generic_hdmi()
2382 intel_haswell_enable_all_pins(codec, true); in patch_generic_hdmi()
2383 intel_haswell_fixup_enable_dp12(codec); in patch_generic_hdmi()
2392 if (is_valleyview_plus(codec) || is_skylake(codec) || in patch_generic_hdmi()
2393 is_broxton(codec)) in patch_generic_hdmi()
2394 codec->core.link_power_control = 1; in patch_generic_hdmi()
2396 if (is_haswell_plus(codec) || is_valleyview_plus(codec)) { in patch_generic_hdmi()
2397 codec->depop_delay = 0; in patch_generic_hdmi()
2398 spec->i915_audio_ops.audio_ptr = codec; in patch_generic_hdmi()
2403 if (hdmi_parse_codec(codec) < 0) { in patch_generic_hdmi()
2404 codec->spec = NULL; in patch_generic_hdmi()
2408 codec->patch_ops = generic_hdmi_patch_ops; in patch_generic_hdmi()
2409 if (is_haswell_plus(codec)) { in patch_generic_hdmi()
2410 codec->patch_ops.set_power_state = haswell_set_power_state; in patch_generic_hdmi()
2411 codec->dp_mst = true; in patch_generic_hdmi()
2415 if (is_haswell_plus(codec) || is_valleyview_plus(codec)) in patch_generic_hdmi()
2416 codec->auto_runtime_pm = 1; in patch_generic_hdmi()
2418 generic_hdmi_init_per_pins(codec); in patch_generic_hdmi()
2429 static int simple_playback_build_pcms(struct hda_codec *codec) in simple_playback_build_pcms() argument
2431 struct hdmi_spec *spec = codec->spec; in simple_playback_build_pcms()
2438 chans = get_wcaps(codec, per_cvt->cvt_nid); in simple_playback_build_pcms()
2441 info = snd_hda_codec_pcm_new(codec, "HDMI 0"); in simple_playback_build_pcms()
2456 static void simple_hdmi_unsol_event(struct hda_codec *codec, in simple_hdmi_unsol_event() argument
2459 snd_hda_jack_set_dirty_all(codec); in simple_hdmi_unsol_event()
2460 snd_hda_jack_report_sync(codec); in simple_hdmi_unsol_event()
2468 static int simple_playback_build_controls(struct hda_codec *codec) in simple_playback_build_controls() argument
2470 struct hdmi_spec *spec = codec->spec; in simple_playback_build_controls()
2475 err = snd_hda_create_dig_out_ctls(codec, per_cvt->cvt_nid, in simple_playback_build_controls()
2480 return simple_hdmi_build_jack(codec, 0); in simple_playback_build_controls()
2483 static int simple_playback_init(struct hda_codec *codec) in simple_playback_init() argument
2485 struct hdmi_spec *spec = codec->spec; in simple_playback_init()
2489 snd_hda_codec_write(codec, pin, 0, in simple_playback_init()
2492 if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP) in simple_playback_init()
2493 snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, in simple_playback_init()
2495 snd_hda_jack_detect_enable(codec, pin); in simple_playback_init()
2499 static void simple_playback_free(struct hda_codec *codec) in simple_playback_free() argument
2501 struct hdmi_spec *spec = codec->spec; in simple_playback_free()
2560 static int nvhdmi_7x_init_2ch(struct hda_codec *codec) in nvhdmi_7x_init_2ch() argument
2562 snd_hda_sequence_write(codec, nvhdmi_basic_init_7x_2ch); in nvhdmi_7x_init_2ch()
2566 static int nvhdmi_7x_init_8ch(struct hda_codec *codec) in nvhdmi_7x_init_8ch() argument
2568 snd_hda_sequence_write(codec, nvhdmi_basic_init_7x_8ch); in nvhdmi_7x_init_8ch()
2593 struct hda_codec *codec, in simple_playback_pcm_open() argument
2596 struct hdmi_spec *spec = codec->spec; in simple_playback_pcm_open()
2599 switch (codec->preset->vendor_id) { in simple_playback_pcm_open()
2622 return snd_hda_multi_out_dig_open(codec, &spec->multiout); in simple_playback_pcm_open()
2626 struct hda_codec *codec, in simple_playback_pcm_close() argument
2629 struct hdmi_spec *spec = codec->spec; in simple_playback_pcm_close()
2630 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in simple_playback_pcm_close()
2634 struct hda_codec *codec, in simple_playback_pcm_prepare() argument
2639 struct hdmi_spec *spec = codec->spec; in simple_playback_pcm_prepare()
2640 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, in simple_playback_pcm_prepare()
2663 static int patch_simple_hdmi(struct hda_codec *codec, in patch_simple_hdmi() argument
2674 codec->spec = spec; in patch_simple_hdmi()
2685 simple_playback_free(codec); in patch_simple_hdmi()
2692 codec->patch_ops = simple_hdmi_patch_ops; in patch_simple_hdmi()
2697 static void nvhdmi_8ch_7x_set_info_frame_parameters(struct hda_codec *codec, in nvhdmi_8ch_7x_set_info_frame_parameters() argument
2722 snd_hda_codec_write(codec, 0x1, 0, in nvhdmi_8ch_7x_set_info_frame_parameters()
2725 snd_hda_codec_write(codec, 0x1, 0, in nvhdmi_8ch_7x_set_info_frame_parameters()
2731 struct hda_codec *codec, in nvhdmi_8ch_7x_pcm_close() argument
2734 struct hdmi_spec *spec = codec->spec; in nvhdmi_8ch_7x_pcm_close()
2737 snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, in nvhdmi_8ch_7x_pcm_close()
2741 snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0, in nvhdmi_8ch_7x_pcm_close()
2744 snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0, in nvhdmi_8ch_7x_pcm_close()
2750 nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8); in nvhdmi_8ch_7x_pcm_close()
2752 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in nvhdmi_8ch_7x_pcm_close()
2756 struct hda_codec *codec, in nvhdmi_8ch_7x_pcm_prepare() argument
2764 struct hdmi_spec *spec = codec->spec; in nvhdmi_8ch_7x_pcm_prepare()
2768 mutex_lock(&codec->spdif_mutex); in nvhdmi_8ch_7x_pcm_prepare()
2770 spdif = snd_hda_spdif_out_of_nid(codec, per_cvt->cvt_nid); in nvhdmi_8ch_7x_pcm_prepare()
2777 if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE)) in nvhdmi_8ch_7x_pcm_prepare()
2778 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2785 snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0, in nvhdmi_8ch_7x_pcm_prepare()
2789 snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0, in nvhdmi_8ch_7x_pcm_prepare()
2794 if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE)) { in nvhdmi_8ch_7x_pcm_prepare()
2795 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2800 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2815 if (codec->spdif_status_reset && in nvhdmi_8ch_7x_pcm_prepare()
2817 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2823 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2829 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2836 if (codec->spdif_status_reset && in nvhdmi_8ch_7x_pcm_prepare()
2838 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2843 snd_hda_codec_write(codec, in nvhdmi_8ch_7x_pcm_prepare()
2850 nvhdmi_8ch_7x_set_info_frame_parameters(codec, chs); in nvhdmi_8ch_7x_pcm_prepare()
2852 mutex_unlock(&codec->spdif_mutex); in nvhdmi_8ch_7x_pcm_prepare()
2871 static int patch_nvhdmi_2ch(struct hda_codec *codec) in patch_nvhdmi_2ch() argument
2874 int err = patch_simple_hdmi(codec, nvhdmi_master_con_nid_7x, in patch_nvhdmi_2ch()
2879 codec->patch_ops.init = nvhdmi_7x_init_2ch; in patch_nvhdmi_2ch()
2881 spec = codec->spec; in patch_nvhdmi_2ch()
2888 static int nvhdmi_7x_8ch_build_pcms(struct hda_codec *codec) in nvhdmi_7x_8ch_build_pcms() argument
2890 struct hdmi_spec *spec = codec->spec; in nvhdmi_7x_8ch_build_pcms()
2891 int err = simple_playback_build_pcms(codec); in nvhdmi_7x_8ch_build_pcms()
2899 static int nvhdmi_7x_8ch_build_controls(struct hda_codec *codec) in nvhdmi_7x_8ch_build_controls() argument
2901 struct hdmi_spec *spec = codec->spec; in nvhdmi_7x_8ch_build_controls()
2906 err = simple_playback_build_controls(codec); in nvhdmi_7x_8ch_build_controls()
2917 switch (codec->preset->vendor_id) { in nvhdmi_7x_8ch_build_controls()
2930 static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) in patch_nvhdmi_8ch_7x() argument
2933 int err = patch_nvhdmi_2ch(codec); in patch_nvhdmi_8ch_7x()
2936 spec = codec->spec; in patch_nvhdmi_8ch_7x()
2939 codec->patch_ops.init = nvhdmi_7x_init_8ch; in patch_nvhdmi_8ch_7x()
2940 codec->patch_ops.build_pcms = nvhdmi_7x_8ch_build_pcms; in patch_nvhdmi_8ch_7x()
2941 codec->patch_ops.build_controls = nvhdmi_7x_8ch_build_controls; in patch_nvhdmi_8ch_7x()
2945 nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8); in patch_nvhdmi_8ch_7x()
2972 static int patch_nvhdmi(struct hda_codec *codec) in patch_nvhdmi() argument
2977 err = patch_generic_hdmi(codec); in patch_nvhdmi()
2981 spec = codec->spec; in patch_nvhdmi()
3033 static void tegra_hdmi_set_format(struct hda_codec *codec, unsigned int format) in tegra_hdmi_set_format() argument
3038 value = snd_hda_codec_read(codec, NVIDIA_AFG_NID, 0, in tegra_hdmi_set_format()
3043 snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0, in tegra_hdmi_set_format()
3046 snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0, in tegra_hdmi_set_format()
3051 snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0, in tegra_hdmi_set_format()
3070 snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0, in tegra_hdmi_set_format()
3075 struct hda_codec *codec, in tegra_hdmi_pcm_prepare() argument
3082 err = generic_hdmi_playback_pcm_prepare(hinfo, codec, stream_tag, in tegra_hdmi_pcm_prepare()
3088 tegra_hdmi_set_format(codec, format); in tegra_hdmi_pcm_prepare()
3094 struct hda_codec *codec, in tegra_hdmi_pcm_cleanup() argument
3098 tegra_hdmi_set_format(codec, 0); in tegra_hdmi_pcm_cleanup()
3100 return generic_hdmi_playback_pcm_cleanup(hinfo, codec, substream); in tegra_hdmi_pcm_cleanup()
3103 static struct hda_pcm *hda_find_pcm_by_type(struct hda_codec *codec, int type) in hda_find_pcm_by_type() argument
3105 struct hdmi_spec *spec = codec->spec; in hda_find_pcm_by_type()
3118 static int tegra_hdmi_build_pcms(struct hda_codec *codec) in tegra_hdmi_build_pcms() argument
3124 err = generic_hdmi_build_pcms(codec); in tegra_hdmi_build_pcms()
3128 pcm = hda_find_pcm_by_type(codec, HDA_PCM_TYPE_HDMI); in tegra_hdmi_build_pcms()
3143 static int patch_tegra_hdmi(struct hda_codec *codec) in patch_tegra_hdmi() argument
3147 err = patch_generic_hdmi(codec); in patch_tegra_hdmi()
3151 codec->patch_ops.build_pcms = tegra_hdmi_build_pcms; in patch_tegra_hdmi()
3160 #define is_amdhdmi_rev3_or_later(codec) \ argument
3161 ((codec)->core.vendor_id == 0x1002aa01 && \
3162 ((codec)->core.revision_id & 0xff00) >= 0x0300)
3163 #define has_amd_full_remap_support(codec) is_amdhdmi_rev3_or_later(codec) argument
3203 static int atihdmi_pin_get_eld(struct hda_codec *codec, hda_nid_t nid, in atihdmi_pin_get_eld() argument
3207 return snd_hdmi_get_eld_ati(codec, nid, buf, eld_size, in atihdmi_pin_get_eld()
3208 is_amdhdmi_rev3_or_later(codec)); in atihdmi_pin_get_eld()
3211 static void atihdmi_pin_setup_infoframe(struct hda_codec *codec, hda_nid_t pin_nid, int ca, in atihdmi_pin_setup_infoframe() argument
3214 snd_hda_codec_write(codec, pin_nid, 0, ATI_VERB_SET_CHANNEL_ALLOCATION, ca); in atihdmi_pin_setup_infoframe()
3281 static int atihdmi_pin_set_slot_channel(struct hda_codec *codec, hda_nid_t pin_nid, in atihdmi_pin_set_slot_channel() argument
3290 if (!has_amd_full_remap_support(codec)) { in atihdmi_pin_set_slot_channel()
3313 return snd_hda_codec_write(codec, pin_nid, 0, verb, ati_channel_setup); in atihdmi_pin_set_slot_channel()
3316 static int atihdmi_pin_get_slot_channel(struct hda_codec *codec, hda_nid_t pin_nid, in atihdmi_pin_get_slot_channel() argument
3327 if (!has_amd_full_remap_support(codec)) { in atihdmi_pin_get_slot_channel()
3337 ati_channel_setup = snd_hda_codec_read(codec, pin_nid, 0, verb, 0); in atihdmi_pin_get_slot_channel()
3397 static int atihdmi_pin_hbr_setup(struct hda_codec *codec, hda_nid_t pin_nid, in atihdmi_pin_hbr_setup() argument
3402 hbr_ctl = snd_hda_codec_read(codec, pin_nid, 0, ATI_VERB_GET_HBR_CONTROL, 0); in atihdmi_pin_hbr_setup()
3409 codec_dbg(codec, in atihdmi_pin_hbr_setup()
3416 snd_hda_codec_write(codec, pin_nid, 0, in atihdmi_pin_hbr_setup()
3426 static int atihdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid, in atihdmi_setup_stream() argument
3430 if (is_amdhdmi_rev3_or_later(codec)) { in atihdmi_setup_stream()
3436 snd_hda_codec_write(codec, cvt_nid, 0, ATI_VERB_SET_RAMP_RATE, ramp_rate); in atihdmi_setup_stream()
3439 return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format); in atihdmi_setup_stream()
3443 static int atihdmi_init(struct hda_codec *codec) in atihdmi_init() argument
3445 struct hdmi_spec *spec = codec->spec; in atihdmi_init()
3448 err = generic_hdmi_init(codec); in atihdmi_init()
3457 snd_hda_codec_write(codec, per_pin->pin_nid, 0, ATI_VERB_SET_DOWNMIX_INFO, 0); in atihdmi_init()
3460 if (has_amd_full_remap_support(codec)) in atihdmi_init()
3461 snd_hda_codec_write(codec, per_pin->pin_nid, 0, in atihdmi_init()
3469 static int patch_atihdmi(struct hda_codec *codec) in patch_atihdmi() argument
3475 err = patch_generic_hdmi(codec); in patch_atihdmi()
3480 codec->patch_ops.init = atihdmi_init; in patch_atihdmi()
3482 spec = codec->spec; in patch_atihdmi()
3491 if (!has_amd_full_remap_support(codec)) { in patch_atihdmi()
3517 static int patch_via_hdmi(struct hda_codec *codec) in patch_via_hdmi() argument
3519 return patch_simple_hdmi(codec, VIAHDMI_CVT_NID, VIAHDMI_PIN_NID); in patch_via_hdmi()