162810dbdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2352f7f91STakashi Iwai /* 3352f7f91STakashi Iwai * Generic BIOS auto-parser helper functions for HD-audio 4352f7f91STakashi Iwai * 5352f7f91STakashi Iwai * Copyright (c) 2012 Takashi Iwai <tiwai@suse.de> 6352f7f91STakashi Iwai */ 7352f7f91STakashi Iwai 8352f7f91STakashi Iwai #ifndef __SOUND_HDA_GENERIC_H 9352f7f91STakashi Iwai #define __SOUND_HDA_GENERIC_H 10352f7f91STakashi Iwai 117cdf8c49STakashi Iwai #include <linux/leds.h> 127cdf8c49STakashi Iwai 13352f7f91STakashi Iwai /* table entry for multi-io paths */ 14352f7f91STakashi Iwai struct hda_multi_io { 15352f7f91STakashi Iwai hda_nid_t pin; /* multi-io widget pin NID */ 16352f7f91STakashi Iwai hda_nid_t dac; /* DAC to be connected */ 17352f7f91STakashi Iwai unsigned int ctl_in; /* cached input-pin control value */ 18352f7f91STakashi Iwai }; 19352f7f91STakashi Iwai 20352f7f91STakashi Iwai /* Widget connection path 21352f7f91STakashi Iwai * 22352f7f91STakashi Iwai * For output, stored in the order of DAC -> ... -> pin, 23352f7f91STakashi Iwai * for input, pin -> ... -> ADC. 24352f7f91STakashi Iwai * 25352f7f91STakashi Iwai * idx[i] contains the source index number to select on of the widget path[i]; 26352f7f91STakashi Iwai * e.g. idx[1] is the index of the DAC (path[0]) selected by path[1] widget 27352f7f91STakashi Iwai * multi[] indicates whether it's a selector widget with multi-connectors 28352f7f91STakashi Iwai * (i.e. the connection selection is mandatory) 29352f7f91STakashi Iwai * vol_ctl and mute_ctl contains the NIDs for the assigned mixers 30352f7f91STakashi Iwai */ 31352f7f91STakashi Iwai 32d94ddd85STakashi Iwai #define MAX_NID_PATH_DEPTH 10 33352f7f91STakashi Iwai 34352f7f91STakashi Iwai enum { 35352f7f91STakashi Iwai NID_PATH_VOL_CTL, 36352f7f91STakashi Iwai NID_PATH_MUTE_CTL, 37352f7f91STakashi Iwai NID_PATH_BOOST_CTL, 38352f7f91STakashi Iwai NID_PATH_NUM_CTLS 39352f7f91STakashi Iwai }; 40352f7f91STakashi Iwai 41352f7f91STakashi Iwai struct nid_path { 42352f7f91STakashi Iwai int depth; 43352f7f91STakashi Iwai hda_nid_t path[MAX_NID_PATH_DEPTH]; 44352f7f91STakashi Iwai unsigned char idx[MAX_NID_PATH_DEPTH]; 45352f7f91STakashi Iwai unsigned char multi[MAX_NID_PATH_DEPTH]; 46352f7f91STakashi Iwai unsigned int ctls[NID_PATH_NUM_CTLS]; /* NID_PATH_XXX_CTL */ 47e6feb5d0STakashi Iwai bool active:1; /* activated by driver */ 48e6feb5d0STakashi Iwai bool pin_enabled:1; /* pins are enabled */ 496b275b14STakashi Iwai bool pin_fixed:1; /* path with fixed pin */ 50e6feb5d0STakashi Iwai bool stream_enabled:1; /* stream is active */ 51352f7f91STakashi Iwai }; 52352f7f91STakashi Iwai 53352f7f91STakashi Iwai /* mic/line-in auto switching entry */ 54352f7f91STakashi Iwai 55352f7f91STakashi Iwai #define MAX_AUTO_MIC_PINS 3 56352f7f91STakashi Iwai 57352f7f91STakashi Iwai struct automic_entry { 58352f7f91STakashi Iwai hda_nid_t pin; /* pin */ 59352f7f91STakashi Iwai int idx; /* imux index, -1 = invalid */ 60352f7f91STakashi Iwai unsigned int attr; /* pin attribute (INPUT_PIN_ATTR_*) */ 61352f7f91STakashi Iwai }; 62352f7f91STakashi Iwai 6338cf6f1aSTakashi Iwai /* active stream id */ 6438cf6f1aSTakashi Iwai enum { STREAM_MULTI_OUT, STREAM_INDEP_HP }; 6538cf6f1aSTakashi Iwai 66e6b85f3cSTakashi Iwai /* PCM hook action */ 67e6b85f3cSTakashi Iwai enum { 68e6b85f3cSTakashi Iwai HDA_GEN_PCM_ACT_OPEN, 69e6b85f3cSTakashi Iwai HDA_GEN_PCM_ACT_PREPARE, 70e6b85f3cSTakashi Iwai HDA_GEN_PCM_ACT_CLEANUP, 71e6b85f3cSTakashi Iwai HDA_GEN_PCM_ACT_CLOSE, 72e6b85f3cSTakashi Iwai }; 73e6b85f3cSTakashi Iwai 7498bd1115STakashi Iwai /* DAC assignment badness table */ 7598bd1115STakashi Iwai struct badness_table { 7698bd1115STakashi Iwai int no_primary_dac; /* no primary DAC */ 7798bd1115STakashi Iwai int no_dac; /* no secondary DACs */ 7898bd1115STakashi Iwai int shared_primary; /* primary DAC is shared with main output */ 7998bd1115STakashi Iwai int shared_surr; /* secondary DAC shared with main or primary */ 8098bd1115STakashi Iwai int shared_clfe; /* third DAC shared with main or primary */ 8198bd1115STakashi Iwai int shared_surr_main; /* secondary DAC sahred with main/DAC0 */ 8298bd1115STakashi Iwai }; 8398bd1115STakashi Iwai 8498bd1115STakashi Iwai extern const struct badness_table hda_main_out_badness; 8598bd1115STakashi Iwai extern const struct badness_table hda_extra_out_badness; 8698bd1115STakashi Iwai 87352f7f91STakashi Iwai struct hda_gen_spec { 88352f7f91STakashi Iwai char stream_name_analog[32]; /* analog PCM stream */ 89352f7f91STakashi Iwai const struct hda_pcm_stream *stream_analog_playback; 90352f7f91STakashi Iwai const struct hda_pcm_stream *stream_analog_capture; 91a607148fSTakashi Iwai 92a607148fSTakashi Iwai char stream_name_alt_analog[32]; /* alternative analog PCM stream */ 93352f7f91STakashi Iwai const struct hda_pcm_stream *stream_analog_alt_playback; 94352f7f91STakashi Iwai const struct hda_pcm_stream *stream_analog_alt_capture; 95352f7f91STakashi Iwai 96352f7f91STakashi Iwai char stream_name_digital[32]; /* digital PCM stream */ 97352f7f91STakashi Iwai const struct hda_pcm_stream *stream_digital_playback; 98352f7f91STakashi Iwai const struct hda_pcm_stream *stream_digital_capture; 99352f7f91STakashi Iwai 10038cf6f1aSTakashi Iwai /* PCM */ 10138cf6f1aSTakashi Iwai unsigned int active_streams; 10238cf6f1aSTakashi Iwai struct mutex pcm_mutex; 10338cf6f1aSTakashi Iwai 104352f7f91STakashi Iwai /* playback */ 105352f7f91STakashi Iwai struct hda_multi_out multiout; /* playback set-up 106352f7f91STakashi Iwai * max_channels, dacs must be set 107352f7f91STakashi Iwai * dig_out_nid and hp_nid are optional 108352f7f91STakashi Iwai */ 109352f7f91STakashi Iwai hda_nid_t alt_dac_nid; 1109ab0cb30STakashi Iwai hda_nid_t follower_dig_outs[3]; /* optional - for auto-parsing */ 111352f7f91STakashi Iwai int dig_out_type; 112352f7f91STakashi Iwai 113352f7f91STakashi Iwai /* capture */ 114352f7f91STakashi Iwai unsigned int num_adc_nids; 115cf799aa3STakashi Iwai hda_nid_t adc_nids[AUTO_CFG_MAX_INS]; 116352f7f91STakashi Iwai hda_nid_t dig_in_nid; /* digital-in NID; optional */ 117352f7f91STakashi Iwai hda_nid_t mixer_nid; /* analog-mixer NID */ 118e4a395e7STakashi Iwai hda_nid_t mixer_merge_nid; /* aamix merge-point NID (optional) */ 119cf799aa3STakashi Iwai const char *input_labels[HDA_MAX_NUM_INPUTS]; 120cf799aa3STakashi Iwai int input_label_idxs[HDA_MAX_NUM_INPUTS]; 121352f7f91STakashi Iwai 122352f7f91STakashi Iwai /* capture setup for dynamic dual-adc switch */ 123352f7f91STakashi Iwai hda_nid_t cur_adc; 124352f7f91STakashi Iwai unsigned int cur_adc_stream_tag; 125352f7f91STakashi Iwai unsigned int cur_adc_format; 126352f7f91STakashi Iwai 127352f7f91STakashi Iwai /* capture source */ 128352f7f91STakashi Iwai struct hda_input_mux input_mux; 129352f7f91STakashi Iwai unsigned int cur_mux[3]; 130352f7f91STakashi Iwai 131352f7f91STakashi Iwai /* channel model */ 132a07a949bSTakashi Iwai /* min_channel_count contains the minimum channel count for primary 133a07a949bSTakashi Iwai * outputs. When multi_ios is set, the channels can be configured 134a07a949bSTakashi Iwai * between min_channel_count and (min_channel_count + multi_ios * 2). 135a07a949bSTakashi Iwai * 136a07a949bSTakashi Iwai * ext_channel_count contains the current channel count of the primary 137a07a949bSTakashi Iwai * out. This varies in the range above. 138a07a949bSTakashi Iwai * 139a07a949bSTakashi Iwai * Meanwhile, const_channel_count is the channel count for all outputs 140a07a949bSTakashi Iwai * including headphone and speakers. It's a constant value, and the 141a07a949bSTakashi Iwai * PCM is set up as max(ext_channel_count, const_channel_count). 142a07a949bSTakashi Iwai */ 143a07a949bSTakashi Iwai int min_channel_count; /* min. channel count for primary out */ 144a07a949bSTakashi Iwai int ext_channel_count; /* current channel count for primary */ 145a07a949bSTakashi Iwai int const_channel_count; /* channel count for all */ 146352f7f91STakashi Iwai 147352f7f91STakashi Iwai /* PCM information */ 148bbbc7e85STakashi Iwai struct hda_pcm *pcm_rec[3]; /* used in build_pcms() */ 149352f7f91STakashi Iwai 150352f7f91STakashi Iwai /* dynamic controls, init_verbs and input_mux */ 151352f7f91STakashi Iwai struct auto_pin_cfg autocfg; 152352f7f91STakashi Iwai struct snd_array kctls; 153352f7f91STakashi Iwai hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; 154352f7f91STakashi Iwai hda_nid_t imux_pins[HDA_MAX_NUM_INPUTS]; 155352f7f91STakashi Iwai unsigned int dyn_adc_idx[HDA_MAX_NUM_INPUTS]; 156967303daSTakashi Iwai /* shared hp/mic */ 157352f7f91STakashi Iwai hda_nid_t shared_mic_vref_pin; 158967303daSTakashi Iwai hda_nid_t hp_mic_pin; 159967303daSTakashi Iwai int hp_mic_mux_idx; 160352f7f91STakashi Iwai 1610ffd534eSTakashi Iwai /* DAC/ADC lists */ 162352f7f91STakashi Iwai int num_all_dacs; 163352f7f91STakashi Iwai hda_nid_t all_dacs[16]; 1640ffd534eSTakashi Iwai int num_all_adcs; 165cf799aa3STakashi Iwai hda_nid_t all_adcs[AUTO_CFG_MAX_INS]; 166352f7f91STakashi Iwai 167352f7f91STakashi Iwai /* path list */ 168352f7f91STakashi Iwai struct snd_array paths; 169352f7f91STakashi Iwai 170196c1766STakashi Iwai /* path indices */ 171196c1766STakashi Iwai int out_paths[AUTO_CFG_MAX_OUTS]; 172196c1766STakashi Iwai int hp_paths[AUTO_CFG_MAX_OUTS]; 173196c1766STakashi Iwai int speaker_paths[AUTO_CFG_MAX_OUTS]; 174c30aa7b2STakashi Iwai int aamix_out_paths[3]; 175196c1766STakashi Iwai int digout_paths[AUTO_CFG_MAX_OUTS]; 176d3d982f7SDavid Henningsson int input_paths[HDA_MAX_NUM_INPUTS][AUTO_CFG_MAX_INS]; 177196c1766STakashi Iwai int loopback_paths[HDA_MAX_NUM_INPUTS]; 178e4a395e7STakashi Iwai int loopback_merge_path; 1792430d7b7STakashi Iwai int digin_path; 180196c1766STakashi Iwai 181352f7f91STakashi Iwai /* auto-mic stuff */ 182352f7f91STakashi Iwai int am_num_entries; 183352f7f91STakashi Iwai struct automic_entry am_entry[MAX_AUTO_MIC_PINS]; 184352f7f91STakashi Iwai 185352f7f91STakashi Iwai /* for pin sensing */ 186*d13a8f6dSChristophe JAILLET /* current status; set in hda_generic.c */ 187352f7f91STakashi Iwai unsigned int hp_jack_present:1; 188352f7f91STakashi Iwai unsigned int line_jack_present:1; 189acc47aafSTakashi Iwai unsigned int speaker_muted:1; /* current status of speaker mute */ 190acc47aafSTakashi Iwai unsigned int line_out_muted:1; /* current status of LO mute */ 191acc47aafSTakashi Iwai 192acc47aafSTakashi Iwai /* internal states of automute / autoswitch behavior */ 193352f7f91STakashi Iwai unsigned int auto_mic:1; 194352f7f91STakashi Iwai unsigned int automute_speaker:1; /* automute speaker outputs */ 195352f7f91STakashi Iwai unsigned int automute_lo:1; /* automute LO outputs */ 196acc47aafSTakashi Iwai 197acc47aafSTakashi Iwai /* capabilities detected by parser */ 198352f7f91STakashi Iwai unsigned int detect_hp:1; /* Headphone detection enabled */ 199352f7f91STakashi Iwai unsigned int detect_lo:1; /* Line-out detection enabled */ 200352f7f91STakashi Iwai unsigned int automute_speaker_possible:1; /* there are speakers and either LO or HP */ 201352f7f91STakashi Iwai unsigned int automute_lo_possible:1; /* there are line outs and HP */ 202acc47aafSTakashi Iwai 203acc47aafSTakashi Iwai /* additional parameters set by codec drivers */ 204acc47aafSTakashi Iwai unsigned int master_mute:1; /* master mute over all */ 205352f7f91STakashi Iwai unsigned int keep_vref_in_automute:1; /* Don't clear VREF in automute */ 206352f7f91STakashi Iwai unsigned int line_in_auto_switch:1; /* allow line-in auto switch */ 2077eebffd3STakashi Iwai unsigned int auto_mute_via_amp:1; /* auto-mute via amp instead of pinctl */ 208352f7f91STakashi Iwai 209acc47aafSTakashi Iwai /* parser behavior flags; set before snd_hda_gen_parse_auto_config() */ 210acc47aafSTakashi Iwai unsigned int suppress_auto_mute:1; /* suppress input jack auto mute */ 211acc47aafSTakashi Iwai unsigned int suppress_auto_mic:1; /* suppress input jack auto switch */ 212acc47aafSTakashi Iwai 213acc47aafSTakashi Iwai /* other parse behavior flags */ 214352f7f91STakashi Iwai unsigned int need_dac_fix:1; /* need to limit DACs for multi channels */ 215967303daSTakashi Iwai unsigned int hp_mic:1; /* Allow HP as a mic-in */ 216967303daSTakashi Iwai unsigned int suppress_hp_mic_detect:1; /* Don't detect HP/mic */ 217352f7f91STakashi Iwai unsigned int no_primary_hp:1; /* Don't prefer HP pins to speaker pins */ 218da96fb5bSTakashi Iwai unsigned int no_multi_io:1; /* Don't try multi I/O config */ 219352f7f91STakashi Iwai unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */ 220352f7f91STakashi Iwai unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */ 221731dc301STakashi Iwai unsigned int own_eapd_ctl:1; /* set EAPD by own function */ 22205909d5cSTakashi Iwai unsigned int keep_eapd_on:1; /* don't turn off EAPD automatically */ 223e65bf997SJaroslav Kysela unsigned int vmaster_mute_led:1; /* add SPK-LED flag to vmaster mute switch */ 224e65bf997SJaroslav Kysela unsigned int mic_mute_led:1; /* add MIC-LED flag to capture mute switch */ 22538cf6f1aSTakashi Iwai unsigned int indep_hp:1; /* independent HP supported */ 226ea46c3c8STakashi Iwai unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */ 22774f14b36STakashi Iwai unsigned int add_stereo_mix_input:2; /* add aamix as a capture src */ 228f811c3cfSTakashi Iwai unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */ 22955196fffSTakashi Iwai unsigned int power_down_unused:1; /* power down unused widgets */ 230d89c6c0cSTakashi Iwai unsigned int dac_min_mute:1; /* minimal = mute for DACs */ 2317480316cSTakashi Iwai unsigned int suppress_vmaster:1; /* don't create vmaster kctls */ 232242d990cSTakashi Iwai unsigned int obey_preferred_dacs:1; /* obey preferred_dacs assignment */ 233352f7f91STakashi Iwai 234acc47aafSTakashi Iwai /* other internal flags */ 235acc47aafSTakashi Iwai unsigned int no_analog:1; /* digital I/O only */ 236acc47aafSTakashi Iwai unsigned int dyn_adc_switch:1; /* switch ADCs (for ALC275) */ 237acc47aafSTakashi Iwai unsigned int indep_hp_enabled:1; /* independent HP enabled */ 238a1e908edSTakashi Iwai unsigned int have_aamix_ctl:1; 2398ba955ceSTakashi Iwai unsigned int hp_mic_jack_modes:1; 24089781d08STakashi Iwai unsigned int skip_verbs:1; /* don't apply verbs at snd_hda_gen_init() */ 241acc47aafSTakashi Iwai 2427eebffd3STakashi Iwai /* additional mute flags (only effective with auto_mute_via_amp=1) */ 2437eebffd3STakashi Iwai u64 mute_bits; 2447eebffd3STakashi Iwai 245a1114a8cSTakashi Iwai /* bitmask for skipping volume controls */ 246a1114a8cSTakashi Iwai u64 out_vol_mask; 247a1114a8cSTakashi Iwai 24898bd1115STakashi Iwai /* badness tables for output path evaluations */ 24998bd1115STakashi Iwai const struct badness_table *main_out_badness; 25098bd1115STakashi Iwai const struct badness_table *extra_out_badness; 25198bd1115STakashi Iwai 2523690739bSTakashi Iwai /* preferred pin/DAC pairs; an array of paired NIDs */ 2533690739bSTakashi Iwai const hda_nid_t *preferred_dacs; 2543690739bSTakashi Iwai 255c30aa7b2STakashi Iwai /* loopback mixing mode */ 256c30aa7b2STakashi Iwai bool aamix_mode; 257c30aa7b2STakashi Iwai 2587504b6cdSTakashi Iwai /* digital beep */ 2597504b6cdSTakashi Iwai hda_nid_t beep_nid; 2607504b6cdSTakashi Iwai 261352f7f91STakashi Iwai /* for virtual master */ 262352f7f91STakashi Iwai hda_nid_t vmaster_nid; 2637a71bbf3STakashi Iwai unsigned int vmaster_tlv[4]; 264352f7f91STakashi Iwai struct hda_vmaster_mute_hook vmaster_mute; 26546a14481STakashi Iwai 266352f7f91STakashi Iwai struct hda_loopback_check loopback; 2670186f4f4STakashi Iwai struct snd_array loopback_list; 268352f7f91STakashi Iwai 269352f7f91STakashi Iwai /* multi-io */ 270352f7f91STakashi Iwai int multi_ios; 271352f7f91STakashi Iwai struct hda_multi_io multi_io[4]; 272352f7f91STakashi Iwai 273352f7f91STakashi Iwai /* hooks */ 274352f7f91STakashi Iwai void (*init_hook)(struct hda_codec *codec); 275352f7f91STakashi Iwai void (*automute_hook)(struct hda_codec *codec); 276a90229e0STakashi Iwai void (*cap_sync_hook)(struct hda_codec *codec, 2777fe30711STakashi Iwai struct snd_kcontrol *kcontrol, 278a90229e0STakashi Iwai struct snd_ctl_elem_value *ucontrol); 2792e03e952STakashi Iwai 280ac2e8736STakashi Iwai /* PCM hooks */ 281e6b85f3cSTakashi Iwai void (*pcm_playback_hook)(struct hda_pcm_stream *hinfo, 282e6b85f3cSTakashi Iwai struct hda_codec *codec, 283e6b85f3cSTakashi Iwai struct snd_pcm_substream *substream, 284e6b85f3cSTakashi Iwai int action); 285ac2e8736STakashi Iwai void (*pcm_capture_hook)(struct hda_pcm_stream *hinfo, 286ac2e8736STakashi Iwai struct hda_codec *codec, 287ac2e8736STakashi Iwai struct snd_pcm_substream *substream, 288ac2e8736STakashi Iwai int action); 289e6b85f3cSTakashi Iwai 2902e03e952STakashi Iwai /* automute / autoswitch hooks */ 2912e03e952STakashi Iwai void (*hp_automute_hook)(struct hda_codec *codec, 2921a4f69d5STakashi Iwai struct hda_jack_callback *cb); 2932e03e952STakashi Iwai void (*line_automute_hook)(struct hda_codec *codec, 2941a4f69d5STakashi Iwai struct hda_jack_callback *cb); 2952e03e952STakashi Iwai void (*mic_autoswitch_hook)(struct hda_codec *codec, 2961a4f69d5STakashi Iwai struct hda_jack_callback *cb); 297352f7f91STakashi Iwai }; 298352f7f91STakashi Iwai 29974f14b36STakashi Iwai /* values for add_stereo_mix_input flag */ 30074f14b36STakashi Iwai enum { 30174f14b36STakashi Iwai HDA_HINT_STEREO_MIX_DISABLE, /* No stereo mix input */ 30274f14b36STakashi Iwai HDA_HINT_STEREO_MIX_ENABLE, /* Add stereo mix input */ 30374f14b36STakashi Iwai HDA_HINT_STEREO_MIX_AUTO, /* Add only if auto-mic is disabled */ 30474f14b36STakashi Iwai }; 30574f14b36STakashi Iwai 306352f7f91STakashi Iwai int snd_hda_gen_spec_init(struct hda_gen_spec *spec); 307352f7f91STakashi Iwai 308352f7f91STakashi Iwai int snd_hda_gen_init(struct hda_codec *codec); 309fce52a3bSTakashi Iwai void snd_hda_gen_free(struct hda_codec *codec); 310352f7f91STakashi Iwai 311196c1766STakashi Iwai int snd_hda_get_path_idx(struct hda_codec *codec, struct nid_path *path); 312196c1766STakashi Iwai struct nid_path *snd_hda_get_path_from_idx(struct hda_codec *codec, int idx); 313352f7f91STakashi Iwai struct nid_path * 314352f7f91STakashi Iwai snd_hda_add_new_path(struct hda_codec *codec, hda_nid_t from_nid, 3153ca529d3STakashi Iwai hda_nid_t to_nid, int anchor_nid); 316352f7f91STakashi Iwai void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path, 317352f7f91STakashi Iwai bool enable, bool add_aamix); 318352f7f91STakashi Iwai 31912c93df6STakashi Iwai struct snd_kcontrol_new * 32012c93df6STakashi Iwai snd_hda_gen_add_kctl(struct hda_gen_spec *spec, const char *name, 32112c93df6STakashi Iwai const struct snd_kcontrol_new *temp); 32212c93df6STakashi Iwai 323352f7f91STakashi Iwai int snd_hda_gen_parse_auto_config(struct hda_codec *codec, 3249eb413e5STakashi Iwai struct auto_pin_cfg *cfg); 325352f7f91STakashi Iwai int snd_hda_gen_build_controls(struct hda_codec *codec); 326352f7f91STakashi Iwai int snd_hda_gen_build_pcms(struct hda_codec *codec); 327352f7f91STakashi Iwai 3285d550e15STakashi Iwai /* standard jack event callbacks */ 3295d550e15STakashi Iwai void snd_hda_gen_hp_automute(struct hda_codec *codec, 3301a4f69d5STakashi Iwai struct hda_jack_callback *jack); 3315d550e15STakashi Iwai void snd_hda_gen_line_automute(struct hda_codec *codec, 3321a4f69d5STakashi Iwai struct hda_jack_callback *jack); 3335d550e15STakashi Iwai void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, 3341a4f69d5STakashi Iwai struct hda_jack_callback *jack); 3355d550e15STakashi Iwai void snd_hda_gen_update_outputs(struct hda_codec *codec); 3365d550e15STakashi Iwai 337fce52a3bSTakashi Iwai #ifdef CONFIG_PM 338fce52a3bSTakashi Iwai int snd_hda_gen_check_power_status(struct hda_codec *codec, hda_nid_t nid); 339fce52a3bSTakashi Iwai #endif 340dfc6e469STakashi Iwai unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec, 341dfc6e469STakashi Iwai hda_nid_t nid, 342dfc6e469STakashi Iwai unsigned int power_state); 343e6feb5d0STakashi Iwai void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on); 3446b275b14STakashi Iwai int snd_hda_gen_fix_pin_power(struct hda_codec *codec, hda_nid_t pin); 345fce52a3bSTakashi Iwai 34615509b63STakashi Iwai int snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec, 34715509b63STakashi Iwai int (*callback)(struct led_classdev *, 34815509b63STakashi Iwai enum led_brightness)); 3497cdf8c49STakashi Iwai int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec, 3507cdf8c49STakashi Iwai int (*callback)(struct led_classdev *, 3517cdf8c49STakashi Iwai enum led_brightness)); 352f567b788STakashi Iwai 353352f7f91STakashi Iwai #endif /* __SOUND_HDA_GENERIC_H */ 354