11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * Universal Interface for Intel High Definition Audio Codec 31da177e4SLinus Torvalds * 41da177e4SLinus Torvalds * Local helper functions 51da177e4SLinus Torvalds * 61da177e4SLinus Torvalds * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de> 71da177e4SLinus Torvalds * 81da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify it 91da177e4SLinus Torvalds * under the terms of the GNU General Public License as published by the Free 101da177e4SLinus Torvalds * Software Foundation; either version 2 of the License, or (at your option) 111da177e4SLinus Torvalds * any later version. 121da177e4SLinus Torvalds * 131da177e4SLinus Torvalds * This program is distributed in the hope that it will be useful, but WITHOUT 141da177e4SLinus Torvalds * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 151da177e4SLinus Torvalds * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 161da177e4SLinus Torvalds * more details. 171da177e4SLinus Torvalds * 181da177e4SLinus Torvalds * You should have received a copy of the GNU General Public License along with 191da177e4SLinus Torvalds * this program; if not, write to the Free Software Foundation, Inc., 59 201da177e4SLinus Torvalds * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 211da177e4SLinus Torvalds */ 221da177e4SLinus Torvalds 231da177e4SLinus Torvalds #ifndef __SOUND_HDA_LOCAL_H 241da177e4SLinus Torvalds #define __SOUND_HDA_LOCAL_H 251da177e4SLinus Torvalds 261da177e4SLinus Torvalds /* 271da177e4SLinus Torvalds * for mixer controls 281da177e4SLinus Torvalds */ 29*d01ce99fSTakashi Iwai #define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) \ 30*d01ce99fSTakashi Iwai ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19)) 31985be54bSTakashi Iwai /* mono volume with index (index=0,1,...) (channel=1,2) */ 321da177e4SLinus Torvalds #define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 331da177e4SLinus Torvalds { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 34302e9c5aSJaroslav Kysela .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ 35302e9c5aSJaroslav Kysela SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 36302e9c5aSJaroslav Kysela SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \ 371da177e4SLinus Torvalds .info = snd_hda_mixer_amp_volume_info, \ 381da177e4SLinus Torvalds .get = snd_hda_mixer_amp_volume_get, \ 391da177e4SLinus Torvalds .put = snd_hda_mixer_amp_volume_put, \ 407cf0a953STakashi Iwai .tlv = { .c = snd_hda_mixer_amp_tlv }, \ 411da177e4SLinus Torvalds .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } 42985be54bSTakashi Iwai /* stereo volume with index */ 431da177e4SLinus Torvalds #define HDA_CODEC_VOLUME_IDX(xname, xcidx, nid, xindex, direction) \ 441da177e4SLinus Torvalds HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, 3, xindex, direction) 45985be54bSTakashi Iwai /* mono volume */ 461da177e4SLinus Torvalds #define HDA_CODEC_VOLUME_MONO(xname, nid, channel, xindex, direction) \ 471da177e4SLinus Torvalds HDA_CODEC_VOLUME_MONO_IDX(xname, 0, nid, channel, xindex, direction) 48985be54bSTakashi Iwai /* stereo volume */ 491da177e4SLinus Torvalds #define HDA_CODEC_VOLUME(xname, nid, xindex, direction) \ 501da177e4SLinus Torvalds HDA_CODEC_VOLUME_MONO(xname, nid, 3, xindex, direction) 51985be54bSTakashi Iwai /* mono mute switch with index (index=0,1,...) (channel=1,2) */ 521da177e4SLinus Torvalds #define HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 531da177e4SLinus Torvalds { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 541da177e4SLinus Torvalds .info = snd_hda_mixer_amp_switch_info, \ 551da177e4SLinus Torvalds .get = snd_hda_mixer_amp_switch_get, \ 561da177e4SLinus Torvalds .put = snd_hda_mixer_amp_switch_put, \ 571da177e4SLinus Torvalds .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } 58985be54bSTakashi Iwai /* stereo mute switch with index */ 591da177e4SLinus Torvalds #define HDA_CODEC_MUTE_IDX(xname, xcidx, nid, xindex, direction) \ 601da177e4SLinus Torvalds HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, 3, xindex, direction) 61985be54bSTakashi Iwai /* mono mute switch */ 621da177e4SLinus Torvalds #define HDA_CODEC_MUTE_MONO(xname, nid, channel, xindex, direction) \ 631da177e4SLinus Torvalds HDA_CODEC_MUTE_MONO_IDX(xname, 0, nid, channel, xindex, direction) 64985be54bSTakashi Iwai /* stereo mute switch */ 651da177e4SLinus Torvalds #define HDA_CODEC_MUTE(xname, nid, xindex, direction) \ 661da177e4SLinus Torvalds HDA_CODEC_MUTE_MONO(xname, nid, 3, xindex, direction) 671da177e4SLinus Torvalds 68*d01ce99fSTakashi Iwai int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, 69*d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo); 70*d01ce99fSTakashi Iwai int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, 71*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 72*d01ce99fSTakashi Iwai int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, 73*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 74*d01ce99fSTakashi Iwai int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, 75*d01ce99fSTakashi Iwai unsigned int size, unsigned int __user *tlv); 76*d01ce99fSTakashi Iwai int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, 77*d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo); 78*d01ce99fSTakashi Iwai int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, 79*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 80*d01ce99fSTakashi Iwai int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, 81*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 82834be88dSTakashi Iwai /* lowlevel accessor with caching; use carefully */ 83834be88dSTakashi Iwai int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, 84834be88dSTakashi Iwai int direction, int index); 85834be88dSTakashi Iwai int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch, 86834be88dSTakashi Iwai int direction, int idx, int mask, int val); 871da177e4SLinus Torvalds 88985be54bSTakashi Iwai /* mono switch binding multiple inputs */ 89985be54bSTakashi Iwai #define HDA_BIND_MUTE_MONO(xname, nid, channel, indices, direction) \ 90985be54bSTakashi Iwai { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ 91985be54bSTakashi Iwai .info = snd_hda_mixer_amp_switch_info, \ 92985be54bSTakashi Iwai .get = snd_hda_mixer_bind_switch_get, \ 93985be54bSTakashi Iwai .put = snd_hda_mixer_bind_switch_put, \ 94985be54bSTakashi Iwai .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, indices, direction) } 95985be54bSTakashi Iwai 96985be54bSTakashi Iwai /* stereo switch binding multiple inputs */ 97*d01ce99fSTakashi Iwai #define HDA_BIND_MUTE(xname,nid,indices,dir) \ 98*d01ce99fSTakashi Iwai HDA_BIND_MUTE_MONO(xname,nid,3,indices,dir) 99985be54bSTakashi Iwai 100*d01ce99fSTakashi Iwai int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, 101*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 102*d01ce99fSTakashi Iwai int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, 103*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 104985be54bSTakashi Iwai 1051da177e4SLinus Torvalds int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid); 1061da177e4SLinus Torvalds int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid); 1071da177e4SLinus Torvalds 1081da177e4SLinus Torvalds /* 1091da177e4SLinus Torvalds * input MUX helper 1101da177e4SLinus Torvalds */ 11154d17403STakashi Iwai #define HDA_MAX_NUM_INPUTS 16 1121da177e4SLinus Torvalds struct hda_input_mux_item { 1131da177e4SLinus Torvalds const char *label; 1141da177e4SLinus Torvalds unsigned int index; 1151da177e4SLinus Torvalds }; 1161da177e4SLinus Torvalds struct hda_input_mux { 1171da177e4SLinus Torvalds unsigned int num_items; 1181da177e4SLinus Torvalds struct hda_input_mux_item items[HDA_MAX_NUM_INPUTS]; 1191da177e4SLinus Torvalds }; 1201da177e4SLinus Torvalds 121*d01ce99fSTakashi Iwai int snd_hda_input_mux_info(const struct hda_input_mux *imux, 122*d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo); 123*d01ce99fSTakashi Iwai int snd_hda_input_mux_put(struct hda_codec *codec, 124*d01ce99fSTakashi Iwai const struct hda_input_mux *imux, 125c8b6bf9bSTakashi Iwai struct snd_ctl_elem_value *ucontrol, hda_nid_t nid, 1261da177e4SLinus Torvalds unsigned int *cur_val); 1271da177e4SLinus Torvalds 128d2a6d7dcSTakashi Iwai /* 129d2a6d7dcSTakashi Iwai * Channel mode helper 130d2a6d7dcSTakashi Iwai */ 131d2a6d7dcSTakashi Iwai struct hda_channel_mode { 132d2a6d7dcSTakashi Iwai int channels; 133d2a6d7dcSTakashi Iwai const struct hda_verb *sequence; 134d2a6d7dcSTakashi Iwai }; 135d2a6d7dcSTakashi Iwai 136*d01ce99fSTakashi Iwai int snd_hda_ch_mode_info(struct hda_codec *codec, 137*d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo, 138*d01ce99fSTakashi Iwai const struct hda_channel_mode *chmode, 139*d01ce99fSTakashi Iwai int num_chmodes); 140*d01ce99fSTakashi Iwai int snd_hda_ch_mode_get(struct hda_codec *codec, 141*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol, 142*d01ce99fSTakashi Iwai const struct hda_channel_mode *chmode, 143*d01ce99fSTakashi Iwai int num_chmodes, 144d2a6d7dcSTakashi Iwai int max_channels); 145*d01ce99fSTakashi Iwai int snd_hda_ch_mode_put(struct hda_codec *codec, 146*d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol, 147*d01ce99fSTakashi Iwai const struct hda_channel_mode *chmode, 148*d01ce99fSTakashi Iwai int num_chmodes, 149d2a6d7dcSTakashi Iwai int *max_channelsp); 150d2a6d7dcSTakashi Iwai 1511da177e4SLinus Torvalds /* 1521da177e4SLinus Torvalds * Multi-channel / digital-out PCM helper 1531da177e4SLinus Torvalds */ 1541da177e4SLinus Torvalds 1551da177e4SLinus Torvalds enum { HDA_FRONT, HDA_REAR, HDA_CLFE, HDA_SIDE }; /* index for dac_nidx */ 1561da177e4SLinus Torvalds enum { HDA_DIG_NONE, HDA_DIG_EXCLUSIVE, HDA_DIG_ANALOG_DUP }; /* dig_out_used */ 1571da177e4SLinus Torvalds 1581da177e4SLinus Torvalds struct hda_multi_out { 1591da177e4SLinus Torvalds int num_dacs; /* # of DACs, must be more than 1 */ 1601da177e4SLinus Torvalds hda_nid_t *dac_nids; /* DAC list */ 1611da177e4SLinus Torvalds hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ 16282bc955fSTakashi Iwai hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ 1631da177e4SLinus Torvalds hda_nid_t dig_out_nid; /* digital out audio widget */ 1641da177e4SLinus Torvalds int max_channels; /* currently supported analog channels */ 1651da177e4SLinus Torvalds int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ 1661da177e4SLinus Torvalds }; 1671da177e4SLinus Torvalds 168*d01ce99fSTakashi Iwai int snd_hda_multi_out_dig_open(struct hda_codec *codec, 169*d01ce99fSTakashi Iwai struct hda_multi_out *mout); 170*d01ce99fSTakashi Iwai int snd_hda_multi_out_dig_close(struct hda_codec *codec, 171*d01ce99fSTakashi Iwai struct hda_multi_out *mout); 1726b97eb45STakashi Iwai int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, 1736b97eb45STakashi Iwai struct hda_multi_out *mout, 1746b97eb45STakashi Iwai unsigned int stream_tag, 1756b97eb45STakashi Iwai unsigned int format, 1766b97eb45STakashi Iwai struct snd_pcm_substream *substream); 177*d01ce99fSTakashi Iwai int snd_hda_multi_out_analog_open(struct hda_codec *codec, 178*d01ce99fSTakashi Iwai struct hda_multi_out *mout, 179c8b6bf9bSTakashi Iwai struct snd_pcm_substream *substream); 180*d01ce99fSTakashi Iwai int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, 181*d01ce99fSTakashi Iwai struct hda_multi_out *mout, 1821da177e4SLinus Torvalds unsigned int stream_tag, 1831da177e4SLinus Torvalds unsigned int format, 184c8b6bf9bSTakashi Iwai struct snd_pcm_substream *substream); 185*d01ce99fSTakashi Iwai int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, 186*d01ce99fSTakashi Iwai struct hda_multi_out *mout); 1871da177e4SLinus Torvalds 1881da177e4SLinus Torvalds /* 1891da177e4SLinus Torvalds * generic codec parser 1901da177e4SLinus Torvalds */ 1911da177e4SLinus Torvalds int snd_hda_parse_generic_codec(struct hda_codec *codec); 1921da177e4SLinus Torvalds 1931da177e4SLinus Torvalds /* 1941da177e4SLinus Torvalds * generic proc interface 1951da177e4SLinus Torvalds */ 1961da177e4SLinus Torvalds #ifdef CONFIG_PROC_FS 1971da177e4SLinus Torvalds int snd_hda_codec_proc_new(struct hda_codec *codec); 1981da177e4SLinus Torvalds #else 1991da177e4SLinus Torvalds static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; } 2001da177e4SLinus Torvalds #endif 2011da177e4SLinus Torvalds 2021da177e4SLinus Torvalds /* 2031da177e4SLinus Torvalds * Misc 2041da177e4SLinus Torvalds */ 205f5fcc13cSTakashi Iwai int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, 206f5fcc13cSTakashi Iwai const char **modelnames, 207f5fcc13cSTakashi Iwai const struct snd_pci_quirk *pci_list); 208*d01ce99fSTakashi Iwai int snd_hda_add_new_ctls(struct hda_codec *codec, 209*d01ce99fSTakashi Iwai struct snd_kcontrol_new *knew); 2101da177e4SLinus Torvalds 2111da177e4SLinus Torvalds /* 2121da177e4SLinus Torvalds * power management 2131da177e4SLinus Torvalds */ 2141da177e4SLinus Torvalds #ifdef CONFIG_PM 215c8b6bf9bSTakashi Iwai int snd_hda_resume_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew); 2161da177e4SLinus Torvalds int snd_hda_resume_spdif_out(struct hda_codec *codec); 2171da177e4SLinus Torvalds int snd_hda_resume_spdif_in(struct hda_codec *codec); 2181da177e4SLinus Torvalds #endif 2191da177e4SLinus Torvalds 2201da177e4SLinus Torvalds /* 2211da177e4SLinus Torvalds * unsolicited event handler 2221da177e4SLinus Torvalds */ 2231da177e4SLinus Torvalds 2241da177e4SLinus Torvalds #define HDA_UNSOL_QUEUE_SIZE 64 2251da177e4SLinus Torvalds 2261da177e4SLinus Torvalds struct hda_bus_unsolicited { 2271da177e4SLinus Torvalds /* ring buffer */ 2281da177e4SLinus Torvalds u32 queue[HDA_UNSOL_QUEUE_SIZE * 2]; 2291da177e4SLinus Torvalds unsigned int rp, wp; 2301da177e4SLinus Torvalds 2311da177e4SLinus Torvalds /* workqueue */ 2321da177e4SLinus Torvalds struct work_struct work; 233c4028958SDavid Howells struct hda_bus *bus; 2341da177e4SLinus Torvalds }; 2351da177e4SLinus Torvalds 236e9edcee0STakashi Iwai /* 237e9edcee0STakashi Iwai * Helper for automatic ping configuration 238e9edcee0STakashi Iwai */ 239e9edcee0STakashi Iwai 240e9edcee0STakashi Iwai enum { 241e9edcee0STakashi Iwai AUTO_PIN_MIC, 242e9edcee0STakashi Iwai AUTO_PIN_FRONT_MIC, 243e9edcee0STakashi Iwai AUTO_PIN_LINE, 244e9edcee0STakashi Iwai AUTO_PIN_FRONT_LINE, 245e9edcee0STakashi Iwai AUTO_PIN_CD, 246e9edcee0STakashi Iwai AUTO_PIN_AUX, 247e9edcee0STakashi Iwai AUTO_PIN_LAST 248e9edcee0STakashi Iwai }; 249e9edcee0STakashi Iwai 250d258e24aSTakashi Iwai enum { 251d258e24aSTakashi Iwai AUTO_PIN_LINE_OUT, 252d258e24aSTakashi Iwai AUTO_PIN_SPEAKER_OUT, 253d258e24aSTakashi Iwai AUTO_PIN_HP_OUT 254d258e24aSTakashi Iwai }; 255d258e24aSTakashi Iwai 2564a471b7dSTakashi Iwai extern const char *auto_pin_cfg_labels[AUTO_PIN_LAST]; 2574a471b7dSTakashi Iwai 258e9edcee0STakashi Iwai struct auto_pin_cfg { 259e9edcee0STakashi Iwai int line_outs; 260*d01ce99fSTakashi Iwai hda_nid_t line_out_pins[5]; /* sorted in the order of 261*d01ce99fSTakashi Iwai * Front/Surr/CLFE/Side 262*d01ce99fSTakashi Iwai */ 26382bc955fSTakashi Iwai int speaker_outs; 26482bc955fSTakashi Iwai hda_nid_t speaker_pins[5]; 265eb06ed8fSTakashi Iwai int hp_outs; 266d258e24aSTakashi Iwai int line_out_type; /* AUTO_PIN_XXX_OUT */ 267eb06ed8fSTakashi Iwai hda_nid_t hp_pins[5]; 268e9edcee0STakashi Iwai hda_nid_t input_pins[AUTO_PIN_LAST]; 269e9edcee0STakashi Iwai hda_nid_t dig_out_pin; 270e9edcee0STakashi Iwai hda_nid_t dig_in_pin; 271e9edcee0STakashi Iwai }; 272e9edcee0STakashi Iwai 273*d01ce99fSTakashi Iwai #define get_defcfg_connect(cfg) \ 274*d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_PORT_CONN) >> AC_DEFCFG_PORT_CONN_SHIFT) 275*d01ce99fSTakashi Iwai #define get_defcfg_association(cfg) \ 276*d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_DEF_ASSOC) >> AC_DEFCFG_ASSOC_SHIFT) 277*d01ce99fSTakashi Iwai #define get_defcfg_location(cfg) \ 278*d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_LOCATION) >> AC_DEFCFG_LOCATION_SHIFT) 279*d01ce99fSTakashi Iwai #define get_defcfg_sequence(cfg) \ 280*d01ce99fSTakashi Iwai (cfg & AC_DEFCFG_SEQUENCE) 281*d01ce99fSTakashi Iwai #define get_defcfg_device(cfg) \ 282*d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT) 283e9edcee0STakashi Iwai 284*d01ce99fSTakashi Iwai int snd_hda_parse_pin_def_config(struct hda_codec *codec, 285*d01ce99fSTakashi Iwai struct auto_pin_cfg *cfg, 286df694daaSKailang Yang hda_nid_t *ignore_nids); 287e9edcee0STakashi Iwai 2888d88bc3dSTakashi Iwai /* amp values */ 2898d88bc3dSTakashi Iwai #define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8)) 2908d88bc3dSTakashi Iwai #define AMP_IN_UNMUTE(idx) (0x7000 | ((idx)<<8)) 2918d88bc3dSTakashi Iwai #define AMP_OUT_MUTE 0xb080 2928d88bc3dSTakashi Iwai #define AMP_OUT_UNMUTE 0xb000 2938d88bc3dSTakashi Iwai #define AMP_OUT_ZERO 0xb000 2948d88bc3dSTakashi Iwai /* pinctl values */ 2958d88bc3dSTakashi Iwai #define PIN_IN 0x20 2968d88bc3dSTakashi Iwai #define PIN_VREF80 0x24 2978d88bc3dSTakashi Iwai #define PIN_VREF50 0x21 2988d88bc3dSTakashi Iwai #define PIN_OUT 0x40 2998d88bc3dSTakashi Iwai #define PIN_HP 0xc0 3008d88bc3dSTakashi Iwai #define PIN_HP_AMP 0x80 3018d88bc3dSTakashi Iwai 30254d17403STakashi Iwai /* 30354d17403STakashi Iwai * get widget capabilities 30454d17403STakashi Iwai */ 30554d17403STakashi Iwai static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) 30654d17403STakashi Iwai { 30754d17403STakashi Iwai if (nid < codec->start_nid || 30854d17403STakashi Iwai nid >= codec->start_nid + codec->num_nodes) 30954d17403STakashi Iwai return snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); 31054d17403STakashi Iwai return codec->wcaps[nid - codec->start_nid]; 31154d17403STakashi Iwai } 31254d17403STakashi Iwai 313897cc188STakashi Iwai int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, 314897cc188STakashi Iwai unsigned int caps); 31554d17403STakashi Iwai 3161da177e4SLinus Torvalds #endif /* __SOUND_HDA_LOCAL_H */ 317