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 269c96fa59STakashi Iwai /* We abuse kcontrol_new.subdev field to pass the NID corresponding to 279c96fa59STakashi Iwai * the given new control. If id.subdev has a bit flag HDA_SUBDEV_NID_FLAG, 289c96fa59STakashi Iwai * snd_hda_ctl_add() takes the lower-bit subdev value as a valid NID. 299c96fa59STakashi Iwai * 309c96fa59STakashi Iwai * Note that the subdevice field is cleared again before the real registration 319c96fa59STakashi Iwai * in snd_hda_ctl_add(), so that this value won't appear in the outside. 329c96fa59STakashi Iwai */ 339c96fa59STakashi Iwai #define HDA_SUBDEV_NID_FLAG (1U << 31) 349c96fa59STakashi Iwai 351da177e4SLinus Torvalds /* 361da177e4SLinus Torvalds * for mixer controls 371da177e4SLinus Torvalds */ 3829fdbec2STakashi Iwai #define HDA_COMPOSE_AMP_VAL_OFS(nid,chs,idx,dir,ofs) \ 3929fdbec2STakashi Iwai ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19) | ((ofs)<<23)) 40d01ce99fSTakashi Iwai #define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) \ 4129fdbec2STakashi Iwai HDA_COMPOSE_AMP_VAL_OFS(nid, chs, idx, dir, 0) 42985be54bSTakashi Iwai /* mono volume with index (index=0,1,...) (channel=1,2) */ 431da177e4SLinus Torvalds #define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 441da177e4SLinus Torvalds { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 459c96fa59STakashi Iwai .subdevice = HDA_SUBDEV_NID_FLAG | (nid), \ 46302e9c5aSJaroslav Kysela .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ 47302e9c5aSJaroslav Kysela SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 48302e9c5aSJaroslav Kysela SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \ 491da177e4SLinus Torvalds .info = snd_hda_mixer_amp_volume_info, \ 501da177e4SLinus Torvalds .get = snd_hda_mixer_amp_volume_get, \ 511da177e4SLinus Torvalds .put = snd_hda_mixer_amp_volume_put, \ 527cf0a953STakashi Iwai .tlv = { .c = snd_hda_mixer_amp_tlv }, \ 531da177e4SLinus Torvalds .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } 54985be54bSTakashi Iwai /* stereo volume with index */ 551da177e4SLinus Torvalds #define HDA_CODEC_VOLUME_IDX(xname, xcidx, nid, xindex, direction) \ 561da177e4SLinus Torvalds HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, 3, xindex, direction) 57985be54bSTakashi Iwai /* mono volume */ 581da177e4SLinus Torvalds #define HDA_CODEC_VOLUME_MONO(xname, nid, channel, xindex, direction) \ 591da177e4SLinus Torvalds HDA_CODEC_VOLUME_MONO_IDX(xname, 0, nid, channel, xindex, direction) 60985be54bSTakashi Iwai /* stereo volume */ 611da177e4SLinus Torvalds #define HDA_CODEC_VOLUME(xname, nid, xindex, direction) \ 621da177e4SLinus Torvalds HDA_CODEC_VOLUME_MONO(xname, nid, 3, xindex, direction) 63985be54bSTakashi Iwai /* mono mute switch with index (index=0,1,...) (channel=1,2) */ 641da177e4SLinus Torvalds #define HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 651da177e4SLinus Torvalds { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 669c96fa59STakashi Iwai .subdevice = HDA_SUBDEV_NID_FLAG | (nid), \ 671da177e4SLinus Torvalds .info = snd_hda_mixer_amp_switch_info, \ 681da177e4SLinus Torvalds .get = snd_hda_mixer_amp_switch_get, \ 691da177e4SLinus Torvalds .put = snd_hda_mixer_amp_switch_put, \ 701da177e4SLinus Torvalds .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } 71985be54bSTakashi Iwai /* stereo mute switch with index */ 721da177e4SLinus Torvalds #define HDA_CODEC_MUTE_IDX(xname, xcidx, nid, xindex, direction) \ 731da177e4SLinus Torvalds HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, 3, xindex, direction) 74985be54bSTakashi Iwai /* mono mute switch */ 751da177e4SLinus Torvalds #define HDA_CODEC_MUTE_MONO(xname, nid, channel, xindex, direction) \ 761da177e4SLinus Torvalds HDA_CODEC_MUTE_MONO_IDX(xname, 0, nid, channel, xindex, direction) 77985be54bSTakashi Iwai /* stereo mute switch */ 781da177e4SLinus Torvalds #define HDA_CODEC_MUTE(xname, nid, xindex, direction) \ 791da177e4SLinus Torvalds HDA_CODEC_MUTE_MONO(xname, nid, 3, xindex, direction) 8067d634c0STakashi Iwai #ifdef CONFIG_SND_HDA_INPUT_BEEP 81123c07aeSJaroslav Kysela /* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */ 82123c07aeSJaroslav Kysela #define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 83123c07aeSJaroslav Kysela { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 849c96fa59STakashi Iwai .subdevice = HDA_SUBDEV_NID_FLAG | (nid), \ 85123c07aeSJaroslav Kysela .info = snd_hda_mixer_amp_switch_info, \ 86123c07aeSJaroslav Kysela .get = snd_hda_mixer_amp_switch_get, \ 87123c07aeSJaroslav Kysela .put = snd_hda_mixer_amp_switch_put_beep, \ 88123c07aeSJaroslav Kysela .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } 8967d634c0STakashi Iwai #else 9067d634c0STakashi Iwai /* no digital beep - just the standard one */ 9167d634c0STakashi Iwai #define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, ch, xidx, dir) \ 9267d634c0STakashi Iwai HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, ch, xidx, dir) 9367d634c0STakashi Iwai #endif /* CONFIG_SND_HDA_INPUT_BEEP */ 94123c07aeSJaroslav Kysela /* special beep mono mute switch */ 95123c07aeSJaroslav Kysela #define HDA_CODEC_MUTE_BEEP_MONO(xname, nid, channel, xindex, direction) \ 96123c07aeSJaroslav Kysela HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, 0, nid, channel, xindex, direction) 97123c07aeSJaroslav Kysela /* special beep stereo mute switch */ 98123c07aeSJaroslav Kysela #define HDA_CODEC_MUTE_BEEP(xname, nid, xindex, direction) \ 99123c07aeSJaroslav Kysela HDA_CODEC_MUTE_BEEP_MONO(xname, nid, 3, xindex, direction) 1001da177e4SLinus Torvalds 10185dd662fSJaroslav Kysela extern const char *snd_hda_pcm_type_name[]; 10285dd662fSJaroslav Kysela 103d01ce99fSTakashi Iwai int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, 104d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo); 105d01ce99fSTakashi Iwai int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, 106d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 107d01ce99fSTakashi Iwai int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, 108d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 109d01ce99fSTakashi Iwai int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, 110d01ce99fSTakashi Iwai unsigned int size, unsigned int __user *tlv); 111d01ce99fSTakashi Iwai int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, 112d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo); 113d01ce99fSTakashi Iwai int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, 114d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 115d01ce99fSTakashi Iwai int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, 116d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 11767d634c0STakashi Iwai #ifdef CONFIG_SND_HDA_INPUT_BEEP 118123c07aeSJaroslav Kysela int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, 119123c07aeSJaroslav Kysela struct snd_ctl_elem_value *ucontrol); 12067d634c0STakashi Iwai #endif 121834be88dSTakashi Iwai /* lowlevel accessor with caching; use carefully */ 122834be88dSTakashi Iwai int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, 123834be88dSTakashi Iwai int direction, int index); 124834be88dSTakashi Iwai int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch, 125834be88dSTakashi Iwai int direction, int idx, int mask, int val); 12647fd830aSTakashi Iwai int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, 12747fd830aSTakashi Iwai int dir, int idx, int mask, int val); 128cb53c626STakashi Iwai #ifdef SND_HDA_NEEDS_RESUME 129b3ac5636STakashi Iwai void snd_hda_codec_resume_amp(struct hda_codec *codec); 13082beb8fdSTakashi Iwai #endif 1311da177e4SLinus Torvalds 1322134ea4fSTakashi Iwai void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, 1332134ea4fSTakashi Iwai unsigned int *tlv); 1342134ea4fSTakashi Iwai struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, 1352134ea4fSTakashi Iwai const char *name); 1362134ea4fSTakashi Iwai int snd_hda_add_vmaster(struct hda_codec *codec, char *name, 1372134ea4fSTakashi Iwai unsigned int *tlv, const char **slaves); 138a65d629cSTakashi Iwai int snd_hda_codec_reset(struct hda_codec *codec); 1392134ea4fSTakashi Iwai 14047fd830aSTakashi Iwai /* amp value bits */ 14147fd830aSTakashi Iwai #define HDA_AMP_MUTE 0x80 14247fd830aSTakashi Iwai #define HDA_AMP_UNMUTE 0x00 14347fd830aSTakashi Iwai #define HDA_AMP_VOLMASK 0x7f 14447fd830aSTakashi Iwai 145985be54bSTakashi Iwai /* mono switch binding multiple inputs */ 146985be54bSTakashi Iwai #define HDA_BIND_MUTE_MONO(xname, nid, channel, indices, direction) \ 147985be54bSTakashi Iwai { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ 148985be54bSTakashi Iwai .info = snd_hda_mixer_amp_switch_info, \ 149985be54bSTakashi Iwai .get = snd_hda_mixer_bind_switch_get, \ 150985be54bSTakashi Iwai .put = snd_hda_mixer_bind_switch_put, \ 151985be54bSTakashi Iwai .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, indices, direction) } 152985be54bSTakashi Iwai 153985be54bSTakashi Iwai /* stereo switch binding multiple inputs */ 154d01ce99fSTakashi Iwai #define HDA_BIND_MUTE(xname,nid,indices,dir) \ 155d01ce99fSTakashi Iwai HDA_BIND_MUTE_MONO(xname,nid,3,indices,dir) 156985be54bSTakashi Iwai 157d01ce99fSTakashi Iwai int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, 158d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 159d01ce99fSTakashi Iwai int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, 160d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol); 161985be54bSTakashi Iwai 162532d5381STakashi Iwai /* more generic bound controls */ 163532d5381STakashi Iwai struct hda_ctl_ops { 164532d5381STakashi Iwai snd_kcontrol_info_t *info; 165532d5381STakashi Iwai snd_kcontrol_get_t *get; 166532d5381STakashi Iwai snd_kcontrol_put_t *put; 167532d5381STakashi Iwai snd_kcontrol_tlv_rw_t *tlv; 168532d5381STakashi Iwai }; 169532d5381STakashi Iwai 170532d5381STakashi Iwai extern struct hda_ctl_ops snd_hda_bind_vol; /* for bind-volume with TLV */ 171532d5381STakashi Iwai extern struct hda_ctl_ops snd_hda_bind_sw; /* for bind-switch */ 172532d5381STakashi Iwai 173532d5381STakashi Iwai struct hda_bind_ctls { 174532d5381STakashi Iwai struct hda_ctl_ops *ops; 1755d9b6c07SHannes Eder unsigned long values[]; 176532d5381STakashi Iwai }; 177532d5381STakashi Iwai 178532d5381STakashi Iwai int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, 179532d5381STakashi Iwai struct snd_ctl_elem_info *uinfo); 180532d5381STakashi Iwai int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, 181532d5381STakashi Iwai struct snd_ctl_elem_value *ucontrol); 182532d5381STakashi Iwai int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, 183532d5381STakashi Iwai struct snd_ctl_elem_value *ucontrol); 184532d5381STakashi Iwai int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, 185532d5381STakashi Iwai unsigned int size, unsigned int __user *tlv); 186532d5381STakashi Iwai 187532d5381STakashi Iwai #define HDA_BIND_VOL(xname, bindrec) \ 188532d5381STakashi Iwai { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 189532d5381STakashi Iwai .name = xname, \ 190532d5381STakashi Iwai .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |\ 191532d5381STakashi Iwai SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 192532d5381STakashi Iwai SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,\ 193532d5381STakashi Iwai .info = snd_hda_mixer_bind_ctls_info,\ 194532d5381STakashi Iwai .get = snd_hda_mixer_bind_ctls_get,\ 195532d5381STakashi Iwai .put = snd_hda_mixer_bind_ctls_put,\ 196532d5381STakashi Iwai .tlv = { .c = snd_hda_mixer_bind_tlv },\ 197532d5381STakashi Iwai .private_value = (long) (bindrec) } 198532d5381STakashi Iwai #define HDA_BIND_SW(xname, bindrec) \ 199532d5381STakashi Iwai { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,\ 200532d5381STakashi Iwai .name = xname, \ 201532d5381STakashi Iwai .info = snd_hda_mixer_bind_ctls_info,\ 202532d5381STakashi Iwai .get = snd_hda_mixer_bind_ctls_get,\ 203532d5381STakashi Iwai .put = snd_hda_mixer_bind_ctls_put,\ 204532d5381STakashi Iwai .private_value = (long) (bindrec) } 205532d5381STakashi Iwai 206532d5381STakashi Iwai /* 207532d5381STakashi Iwai * SPDIF I/O 208532d5381STakashi Iwai */ 2091da177e4SLinus Torvalds int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid); 2101da177e4SLinus Torvalds int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid); 2111da177e4SLinus Torvalds 2121da177e4SLinus Torvalds /* 2131da177e4SLinus Torvalds * input MUX helper 2141da177e4SLinus Torvalds */ 21554d17403STakashi Iwai #define HDA_MAX_NUM_INPUTS 16 2161da177e4SLinus Torvalds struct hda_input_mux_item { 2171da177e4SLinus Torvalds const char *label; 2181da177e4SLinus Torvalds unsigned int index; 2191da177e4SLinus Torvalds }; 2201da177e4SLinus Torvalds struct hda_input_mux { 2211da177e4SLinus Torvalds unsigned int num_items; 2221da177e4SLinus Torvalds struct hda_input_mux_item items[HDA_MAX_NUM_INPUTS]; 2231da177e4SLinus Torvalds }; 2241da177e4SLinus Torvalds 225d01ce99fSTakashi Iwai int snd_hda_input_mux_info(const struct hda_input_mux *imux, 226d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo); 227d01ce99fSTakashi Iwai int snd_hda_input_mux_put(struct hda_codec *codec, 228d01ce99fSTakashi Iwai const struct hda_input_mux *imux, 229c8b6bf9bSTakashi Iwai struct snd_ctl_elem_value *ucontrol, hda_nid_t nid, 2301da177e4SLinus Torvalds unsigned int *cur_val); 2311da177e4SLinus Torvalds 232d2a6d7dcSTakashi Iwai /* 233d2a6d7dcSTakashi Iwai * Channel mode helper 234d2a6d7dcSTakashi Iwai */ 235d2a6d7dcSTakashi Iwai struct hda_channel_mode { 236d2a6d7dcSTakashi Iwai int channels; 237d2a6d7dcSTakashi Iwai const struct hda_verb *sequence; 238d2a6d7dcSTakashi Iwai }; 239d2a6d7dcSTakashi Iwai 240d01ce99fSTakashi Iwai int snd_hda_ch_mode_info(struct hda_codec *codec, 241d01ce99fSTakashi Iwai struct snd_ctl_elem_info *uinfo, 242d01ce99fSTakashi Iwai const struct hda_channel_mode *chmode, 243d01ce99fSTakashi Iwai int num_chmodes); 244d01ce99fSTakashi Iwai int snd_hda_ch_mode_get(struct hda_codec *codec, 245d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol, 246d01ce99fSTakashi Iwai const struct hda_channel_mode *chmode, 247d01ce99fSTakashi Iwai int num_chmodes, 248d2a6d7dcSTakashi Iwai int max_channels); 249d01ce99fSTakashi Iwai int snd_hda_ch_mode_put(struct hda_codec *codec, 250d01ce99fSTakashi Iwai struct snd_ctl_elem_value *ucontrol, 251d01ce99fSTakashi Iwai const struct hda_channel_mode *chmode, 252d01ce99fSTakashi Iwai int num_chmodes, 253d2a6d7dcSTakashi Iwai int *max_channelsp); 254d2a6d7dcSTakashi Iwai 2551da177e4SLinus Torvalds /* 2561da177e4SLinus Torvalds * Multi-channel / digital-out PCM helper 2571da177e4SLinus Torvalds */ 2581da177e4SLinus Torvalds 2591da177e4SLinus Torvalds enum { HDA_FRONT, HDA_REAR, HDA_CLFE, HDA_SIDE }; /* index for dac_nidx */ 2601da177e4SLinus Torvalds enum { HDA_DIG_NONE, HDA_DIG_EXCLUSIVE, HDA_DIG_ANALOG_DUP }; /* dig_out_used */ 2611da177e4SLinus Torvalds 2621da177e4SLinus Torvalds struct hda_multi_out { 2631da177e4SLinus Torvalds int num_dacs; /* # of DACs, must be more than 1 */ 2641da177e4SLinus Torvalds hda_nid_t *dac_nids; /* DAC list */ 2651da177e4SLinus Torvalds hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ 26682bc955fSTakashi Iwai hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ 2671da177e4SLinus Torvalds hda_nid_t dig_out_nid; /* digital out audio widget */ 268b25c9da1SWu Fengguang hda_nid_t *slave_dig_outs; 2691da177e4SLinus Torvalds int max_channels; /* currently supported analog channels */ 2701da177e4SLinus Torvalds int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ 271d29240ceSTakashi Iwai int no_share_stream; /* don't share a stream with multiple pins */ 2729a08160bSTakashi Iwai int share_spdif; /* share SPDIF pin */ 2739a08160bSTakashi Iwai /* PCM information for both analog and SPDIF DACs */ 2749a08160bSTakashi Iwai unsigned int analog_rates; 2759a08160bSTakashi Iwai unsigned int analog_maxbps; 2769a08160bSTakashi Iwai u64 analog_formats; 2779a08160bSTakashi Iwai unsigned int spdif_rates; 2789a08160bSTakashi Iwai unsigned int spdif_maxbps; 2799a08160bSTakashi Iwai u64 spdif_formats; 2801da177e4SLinus Torvalds }; 2811da177e4SLinus Torvalds 2829a08160bSTakashi Iwai int snd_hda_create_spdif_share_sw(struct hda_codec *codec, 2839a08160bSTakashi Iwai struct hda_multi_out *mout); 284d01ce99fSTakashi Iwai int snd_hda_multi_out_dig_open(struct hda_codec *codec, 285d01ce99fSTakashi Iwai struct hda_multi_out *mout); 286d01ce99fSTakashi Iwai int snd_hda_multi_out_dig_close(struct hda_codec *codec, 287d01ce99fSTakashi Iwai struct hda_multi_out *mout); 2886b97eb45STakashi Iwai int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, 2896b97eb45STakashi Iwai struct hda_multi_out *mout, 2906b97eb45STakashi Iwai unsigned int stream_tag, 2916b97eb45STakashi Iwai unsigned int format, 2926b97eb45STakashi Iwai struct snd_pcm_substream *substream); 2939411e21cSTakashi Iwai int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec, 2949411e21cSTakashi Iwai struct hda_multi_out *mout); 295d01ce99fSTakashi Iwai int snd_hda_multi_out_analog_open(struct hda_codec *codec, 296d01ce99fSTakashi Iwai struct hda_multi_out *mout, 2979a08160bSTakashi Iwai struct snd_pcm_substream *substream, 2989a08160bSTakashi Iwai struct hda_pcm_stream *hinfo); 299d01ce99fSTakashi Iwai int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, 300d01ce99fSTakashi Iwai struct hda_multi_out *mout, 3011da177e4SLinus Torvalds unsigned int stream_tag, 3021da177e4SLinus Torvalds unsigned int format, 303c8b6bf9bSTakashi Iwai struct snd_pcm_substream *substream); 304d01ce99fSTakashi Iwai int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, 305d01ce99fSTakashi Iwai struct hda_multi_out *mout); 3061da177e4SLinus Torvalds 3071da177e4SLinus Torvalds /* 3081da177e4SLinus Torvalds * generic codec parser 3091da177e4SLinus Torvalds */ 31035a1e0ccSTakashi Iwai #ifdef CONFIG_SND_HDA_GENERIC 3111da177e4SLinus Torvalds int snd_hda_parse_generic_codec(struct hda_codec *codec); 31235a1e0ccSTakashi Iwai #else 31335a1e0ccSTakashi Iwai static inline int snd_hda_parse_generic_codec(struct hda_codec *codec) 31435a1e0ccSTakashi Iwai { 31535a1e0ccSTakashi Iwai return -ENODEV; 31635a1e0ccSTakashi Iwai } 31735a1e0ccSTakashi Iwai #endif 3181da177e4SLinus Torvalds 3191da177e4SLinus Torvalds /* 3201da177e4SLinus Torvalds * generic proc interface 3211da177e4SLinus Torvalds */ 3221da177e4SLinus Torvalds #ifdef CONFIG_PROC_FS 3231da177e4SLinus Torvalds int snd_hda_codec_proc_new(struct hda_codec *codec); 3241da177e4SLinus Torvalds #else 3251da177e4SLinus Torvalds static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; } 3261da177e4SLinus Torvalds #endif 3271da177e4SLinus Torvalds 32833deeca3SWu Fengguang #define SND_PRINT_RATES_ADVISED_BUFSIZE 80 32933deeca3SWu Fengguang void snd_print_pcm_rates(int pcm, char *buf, int buflen); 33033deeca3SWu Fengguang 331d39b4352SWu Fengguang #define SND_PRINT_BITS_ADVISED_BUFSIZE 16 332d39b4352SWu Fengguang void snd_print_pcm_bits(int pcm, char *buf, int buflen); 333d39b4352SWu Fengguang 3341da177e4SLinus Torvalds /* 3351da177e4SLinus Torvalds * Misc 3361da177e4SLinus Torvalds */ 337f5fcc13cSTakashi Iwai int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, 338f5fcc13cSTakashi Iwai const char **modelnames, 339f5fcc13cSTakashi Iwai const struct snd_pci_quirk *pci_list); 3402eda3445SMauro Carvalho Chehab int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, 3412eda3445SMauro Carvalho Chehab int num_configs, const char **models, 3422eda3445SMauro Carvalho Chehab const struct snd_pci_quirk *tbl); 343d01ce99fSTakashi Iwai int snd_hda_add_new_ctls(struct hda_codec *codec, 344d01ce99fSTakashi Iwai struct snd_kcontrol_new *knew); 345*5b0cb1d8SJaroslav Kysela int snd_hda_add_nids(struct hda_codec *codec, struct snd_kcontrol *kctl, 346*5b0cb1d8SJaroslav Kysela unsigned int index, hda_nid_t *nids, unsigned int size); 3471da177e4SLinus Torvalds 3481da177e4SLinus Torvalds /* 3491da177e4SLinus Torvalds * unsolicited event handler 3501da177e4SLinus Torvalds */ 3511da177e4SLinus Torvalds 3521da177e4SLinus Torvalds #define HDA_UNSOL_QUEUE_SIZE 64 3531da177e4SLinus Torvalds 3541da177e4SLinus Torvalds struct hda_bus_unsolicited { 3551da177e4SLinus Torvalds /* ring buffer */ 3561da177e4SLinus Torvalds u32 queue[HDA_UNSOL_QUEUE_SIZE * 2]; 3571da177e4SLinus Torvalds unsigned int rp, wp; 3581da177e4SLinus Torvalds 3591da177e4SLinus Torvalds /* workqueue */ 3601da177e4SLinus Torvalds struct work_struct work; 361c4028958SDavid Howells struct hda_bus *bus; 3621da177e4SLinus Torvalds }; 3631da177e4SLinus Torvalds 364e9edcee0STakashi Iwai /* 365e9edcee0STakashi Iwai * Helper for automatic ping configuration 366e9edcee0STakashi Iwai */ 367e9edcee0STakashi Iwai 368e9edcee0STakashi Iwai enum { 369e9edcee0STakashi Iwai AUTO_PIN_MIC, 370e9edcee0STakashi Iwai AUTO_PIN_FRONT_MIC, 371e9edcee0STakashi Iwai AUTO_PIN_LINE, 372e9edcee0STakashi Iwai AUTO_PIN_FRONT_LINE, 373e9edcee0STakashi Iwai AUTO_PIN_CD, 374e9edcee0STakashi Iwai AUTO_PIN_AUX, 375e9edcee0STakashi Iwai AUTO_PIN_LAST 376e9edcee0STakashi Iwai }; 377e9edcee0STakashi Iwai 378d258e24aSTakashi Iwai enum { 379d258e24aSTakashi Iwai AUTO_PIN_LINE_OUT, 380d258e24aSTakashi Iwai AUTO_PIN_SPEAKER_OUT, 381d258e24aSTakashi Iwai AUTO_PIN_HP_OUT 382d258e24aSTakashi Iwai }; 383d258e24aSTakashi Iwai 3844a471b7dSTakashi Iwai extern const char *auto_pin_cfg_labels[AUTO_PIN_LAST]; 3854a471b7dSTakashi Iwai 38641923e44STakashi Iwai #define AUTO_CFG_MAX_OUTS 5 38741923e44STakashi Iwai 388e9edcee0STakashi Iwai struct auto_pin_cfg { 389e9edcee0STakashi Iwai int line_outs; 39041923e44STakashi Iwai /* sorted in the order of Front/Surr/CLFE/Side */ 39141923e44STakashi Iwai hda_nid_t line_out_pins[AUTO_CFG_MAX_OUTS]; 39282bc955fSTakashi Iwai int speaker_outs; 39341923e44STakashi Iwai hda_nid_t speaker_pins[AUTO_CFG_MAX_OUTS]; 394eb06ed8fSTakashi Iwai int hp_outs; 395d258e24aSTakashi Iwai int line_out_type; /* AUTO_PIN_XXX_OUT */ 39641923e44STakashi Iwai hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; 397e9edcee0STakashi Iwai hda_nid_t input_pins[AUTO_PIN_LAST]; 3980852d7a6STakashi Iwai int dig_outs; 3990852d7a6STakashi Iwai hda_nid_t dig_out_pins[2]; 400e9edcee0STakashi Iwai hda_nid_t dig_in_pin; 40190da78bfSMatthew Ranostay hda_nid_t mono_out_pin; 4020852d7a6STakashi Iwai int dig_out_type[2]; /* HDA_PCM_TYPE_XXX */ 4032297bd6eSTakashi Iwai int dig_in_type; /* HDA_PCM_TYPE_XXX */ 404e9edcee0STakashi Iwai }; 405e9edcee0STakashi Iwai 406d01ce99fSTakashi Iwai #define get_defcfg_connect(cfg) \ 407d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_PORT_CONN) >> AC_DEFCFG_PORT_CONN_SHIFT) 408d01ce99fSTakashi Iwai #define get_defcfg_association(cfg) \ 409d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_DEF_ASSOC) >> AC_DEFCFG_ASSOC_SHIFT) 410d01ce99fSTakashi Iwai #define get_defcfg_location(cfg) \ 411d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_LOCATION) >> AC_DEFCFG_LOCATION_SHIFT) 412d01ce99fSTakashi Iwai #define get_defcfg_sequence(cfg) \ 413d01ce99fSTakashi Iwai (cfg & AC_DEFCFG_SEQUENCE) 414d01ce99fSTakashi Iwai #define get_defcfg_device(cfg) \ 415d01ce99fSTakashi Iwai ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT) 416e9edcee0STakashi Iwai 417d01ce99fSTakashi Iwai int snd_hda_parse_pin_def_config(struct hda_codec *codec, 418d01ce99fSTakashi Iwai struct auto_pin_cfg *cfg, 419df694daaSKailang Yang hda_nid_t *ignore_nids); 420e9edcee0STakashi Iwai 4218d88bc3dSTakashi Iwai /* amp values */ 4228d88bc3dSTakashi Iwai #define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8)) 4238d88bc3dSTakashi Iwai #define AMP_IN_UNMUTE(idx) (0x7000 | ((idx)<<8)) 4248d88bc3dSTakashi Iwai #define AMP_OUT_MUTE 0xb080 4258d88bc3dSTakashi Iwai #define AMP_OUT_UNMUTE 0xb000 4268d88bc3dSTakashi Iwai #define AMP_OUT_ZERO 0xb000 4278d88bc3dSTakashi Iwai /* pinctl values */ 42835e8901eSRobin H. Johnson #define PIN_IN (AC_PINCTL_IN_EN) 42935e8901eSRobin H. Johnson #define PIN_VREFHIZ (AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ) 43035e8901eSRobin H. Johnson #define PIN_VREF50 (AC_PINCTL_IN_EN | AC_PINCTL_VREF_50) 43135e8901eSRobin H. Johnson #define PIN_VREFGRD (AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD) 43235e8901eSRobin H. Johnson #define PIN_VREF80 (AC_PINCTL_IN_EN | AC_PINCTL_VREF_80) 43335e8901eSRobin H. Johnson #define PIN_VREF100 (AC_PINCTL_IN_EN | AC_PINCTL_VREF_100) 43435e8901eSRobin H. Johnson #define PIN_OUT (AC_PINCTL_OUT_EN) 43535e8901eSRobin H. Johnson #define PIN_HP (AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN) 43635e8901eSRobin H. Johnson #define PIN_HP_AMP (AC_PINCTL_HP_EN) 4378d88bc3dSTakashi Iwai 43854d17403STakashi Iwai /* 43954d17403STakashi Iwai * get widget capabilities 44054d17403STakashi Iwai */ 44154d17403STakashi Iwai static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) 44254d17403STakashi Iwai { 44354d17403STakashi Iwai if (nid < codec->start_nid || 44454d17403STakashi Iwai nid >= codec->start_nid + codec->num_nodes) 445dca008f3STakashi Iwai return 0; 44654d17403STakashi Iwai return codec->wcaps[nid - codec->start_nid]; 44754d17403STakashi Iwai } 44854d17403STakashi Iwai 449a22d543aSTakashi Iwai /* get the widget type from widget capability bits */ 450a22d543aSTakashi Iwai #define get_wcaps_type(wcaps) (((wcaps) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT) 451a22d543aSTakashi Iwai 452fd72d008SWu Fengguang static inline unsigned int get_wcaps_channels(u32 wcaps) 453fd72d008SWu Fengguang { 454fd72d008SWu Fengguang unsigned int chans; 455fd72d008SWu Fengguang 456fd72d008SWu Fengguang chans = (wcaps & AC_WCAP_CHAN_CNT_EXT) >> 13; 457fd72d008SWu Fengguang chans = ((chans << 1) | 1) + 1; 458fd72d008SWu Fengguang 459fd72d008SWu Fengguang return chans; 460fd72d008SWu Fengguang } 461fd72d008SWu Fengguang 46209a99959SMatthew Ranostay u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction); 463897cc188STakashi Iwai int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, 464897cc188STakashi Iwai unsigned int caps); 4651327a32bSTakashi Iwai u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); 466864f92beSWu Fengguang u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid); 467864f92beSWu Fengguang int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid); 46854d17403STakashi Iwai 4693911a4c1SJaroslav Kysela struct hda_nid_item { 4703911a4c1SJaroslav Kysela struct snd_kcontrol *kctl; 471*5b0cb1d8SJaroslav Kysela unsigned int index; 4723911a4c1SJaroslav Kysela hda_nid_t nid; 4733911a4c1SJaroslav Kysela }; 4743911a4c1SJaroslav Kysela 4753911a4c1SJaroslav Kysela int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid, 4763911a4c1SJaroslav Kysela struct snd_kcontrol *kctl); 477*5b0cb1d8SJaroslav Kysela int snd_hda_add_nid(struct hda_codec *codec, struct snd_kcontrol *kctl, 478*5b0cb1d8SJaroslav Kysela unsigned int index, hda_nid_t nid); 479d13bd412STakashi Iwai void snd_hda_ctls_clear(struct hda_codec *codec); 480d13bd412STakashi Iwai 4812807314dSTakashi Iwai /* 4822807314dSTakashi Iwai * hwdep interface 4832807314dSTakashi Iwai */ 484d7ffba19STakashi Iwai #ifdef CONFIG_SND_HDA_HWDEP 4852807314dSTakashi Iwai int snd_hda_create_hwdep(struct hda_codec *codec); 486d7ffba19STakashi Iwai #else 487d7ffba19STakashi Iwai static inline int snd_hda_create_hwdep(struct hda_codec *codec) { return 0; } 488d7ffba19STakashi Iwai #endif 4892807314dSTakashi Iwai 4907288561aSTakashi Iwai #if defined(CONFIG_SND_HDA_POWER_SAVE) && defined(CONFIG_SND_HDA_HWDEP) 491a2f6309eSTakashi Iwai int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec); 492a2f6309eSTakashi Iwai #else 493a2f6309eSTakashi Iwai static inline int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec) 494a2f6309eSTakashi Iwai { 495a2f6309eSTakashi Iwai return 0; 496a2f6309eSTakashi Iwai } 497a2f6309eSTakashi Iwai #endif 498a2f6309eSTakashi Iwai 499e7ee058cSTakashi Iwai #ifdef CONFIG_SND_HDA_RECONFIG 500e7ee058cSTakashi Iwai int snd_hda_hwdep_add_sysfs(struct hda_codec *codec); 501e7ee058cSTakashi Iwai #else 502e7ee058cSTakashi Iwai static inline int snd_hda_hwdep_add_sysfs(struct hda_codec *codec) 503e7ee058cSTakashi Iwai { 504e7ee058cSTakashi Iwai return 0; 505e7ee058cSTakashi Iwai } 506e7ee058cSTakashi Iwai #endif 507e7ee058cSTakashi Iwai 50843b62713STakashi Iwai #ifdef CONFIG_SND_HDA_RECONFIG 50943b62713STakashi Iwai const char *snd_hda_get_hint(struct hda_codec *codec, const char *key); 51043b62713STakashi Iwai int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key); 51143b62713STakashi Iwai #else 51243b62713STakashi Iwai static inline 51343b62713STakashi Iwai const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) 51443b62713STakashi Iwai { 51543b62713STakashi Iwai return NULL; 51643b62713STakashi Iwai } 51743b62713STakashi Iwai 51843b62713STakashi Iwai static inline 51943b62713STakashi Iwai int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) 52043b62713STakashi Iwai { 52143b62713STakashi Iwai return -ENOENT; 52243b62713STakashi Iwai } 52343b62713STakashi Iwai #endif 52443b62713STakashi Iwai 525cb53c626STakashi Iwai /* 526cb53c626STakashi Iwai * power-management 527cb53c626STakashi Iwai */ 528cb53c626STakashi Iwai 529cb53c626STakashi Iwai #ifdef CONFIG_SND_HDA_POWER_SAVE 530cb53c626STakashi Iwai void snd_hda_schedule_power_save(struct hda_codec *codec); 531cb53c626STakashi Iwai 532cb53c626STakashi Iwai struct hda_amp_list { 533cb53c626STakashi Iwai hda_nid_t nid; 534cb53c626STakashi Iwai unsigned char dir; 535cb53c626STakashi Iwai unsigned char idx; 536cb53c626STakashi Iwai }; 537cb53c626STakashi Iwai 538cb53c626STakashi Iwai struct hda_loopback_check { 539cb53c626STakashi Iwai struct hda_amp_list *amplist; 540cb53c626STakashi Iwai int power_on; 541cb53c626STakashi Iwai }; 542cb53c626STakashi Iwai 543cb53c626STakashi Iwai int snd_hda_check_amp_list_power(struct hda_codec *codec, 544cb53c626STakashi Iwai struct hda_loopback_check *check, 545cb53c626STakashi Iwai hda_nid_t nid); 546cb53c626STakashi Iwai #endif /* CONFIG_SND_HDA_POWER_SAVE */ 547cb53c626STakashi Iwai 54889385035SMatthew Ranostay /* 54989385035SMatthew Ranostay * AMP control callbacks 55089385035SMatthew Ranostay */ 55189385035SMatthew Ranostay /* retrieve parameters from private_value */ 5523911a4c1SJaroslav Kysela #define get_amp_nid_(pv) ((pv) & 0xffff) 5533911a4c1SJaroslav Kysela #define get_amp_nid(kc) get_amp_nid_((kc)->private_value) 55489385035SMatthew Ranostay #define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3) 55589385035SMatthew Ranostay #define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1) 55689385035SMatthew Ranostay #define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf) 55729fdbec2STakashi Iwai #define get_amp_offset(kc) (((kc)->private_value >> 23) & 0x3f) 55889385035SMatthew Ranostay 5597f4a9f43SWu Fengguang /* 5607f4a9f43SWu Fengguang * CEA Short Audio Descriptor data 5617f4a9f43SWu Fengguang */ 5627f4a9f43SWu Fengguang struct cea_sad { 5637f4a9f43SWu Fengguang int channels; 5647f4a9f43SWu Fengguang int format; /* (format == 0) indicates invalid SAD */ 5657f4a9f43SWu Fengguang int rates; 5667f4a9f43SWu Fengguang int sample_bits; /* for LPCM */ 5677f4a9f43SWu Fengguang int max_bitrate; /* for AC3...ATRAC */ 5687f4a9f43SWu Fengguang int profile; /* for WMAPRO */ 5697f4a9f43SWu Fengguang }; 5707f4a9f43SWu Fengguang 5717f4a9f43SWu Fengguang #define ELD_FIXED_BYTES 20 5727f4a9f43SWu Fengguang #define ELD_MAX_MNL 16 5737f4a9f43SWu Fengguang #define ELD_MAX_SAD 16 5747f4a9f43SWu Fengguang 5757f4a9f43SWu Fengguang /* 5767f4a9f43SWu Fengguang * ELD: EDID Like Data 5777f4a9f43SWu Fengguang */ 5785b87ebb7SWu Fengguang struct hdmi_eld { 57923ccc2bdSWu Fengguang bool monitor_present; 58023ccc2bdSWu Fengguang bool eld_valid; 5817f4a9f43SWu Fengguang int eld_size; 5827f4a9f43SWu Fengguang int baseline_len; 58323ccc2bdSWu Fengguang int eld_ver; 5847f4a9f43SWu Fengguang int cea_edid_ver; 5857f4a9f43SWu Fengguang char monitor_name[ELD_MAX_MNL + 1]; 5867f4a9f43SWu Fengguang int manufacture_id; 5877f4a9f43SWu Fengguang int product_id; 5887f4a9f43SWu Fengguang u64 port_id; 5897f4a9f43SWu Fengguang int support_hdcp; 5907f4a9f43SWu Fengguang int support_ai; 5917f4a9f43SWu Fengguang int conn_type; 5927f4a9f43SWu Fengguang int aud_synch_delay; 5937f4a9f43SWu Fengguang int spk_alloc; 5947f4a9f43SWu Fengguang int sad_count; 5957f4a9f43SWu Fengguang struct cea_sad sad[ELD_MAX_SAD]; 596f208dba9STakashi Iwai #ifdef CONFIG_PROC_FS 597f208dba9STakashi Iwai struct snd_info_entry *proc_entry; 598f208dba9STakashi Iwai #endif 5997f4a9f43SWu Fengguang }; 6007f4a9f43SWu Fengguang 6017f4a9f43SWu Fengguang int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid); 6025b87ebb7SWu Fengguang int snd_hdmi_get_eld(struct hdmi_eld *, struct hda_codec *, hda_nid_t); 6035b87ebb7SWu Fengguang void snd_hdmi_show_eld(struct hdmi_eld *eld); 6047f4a9f43SWu Fengguang 6055f1e71b1SWu Fengguang #ifdef CONFIG_PROC_FS 60654a25f87SWu Fengguang int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld, 60754a25f87SWu Fengguang int index); 608f208dba9STakashi Iwai void snd_hda_eld_proc_free(struct hda_codec *codec, struct hdmi_eld *eld); 6095f1e71b1SWu Fengguang #else 6100623536cSTakashi Iwai static inline int snd_hda_eld_proc_new(struct hda_codec *codec, 61154a25f87SWu Fengguang struct hdmi_eld *eld, 61254a25f87SWu Fengguang int index) 6135f1e71b1SWu Fengguang { 6145f1e71b1SWu Fengguang return 0; 6155f1e71b1SWu Fengguang } 616f208dba9STakashi Iwai static inline void snd_hda_eld_proc_free(struct hda_codec *codec, 617f208dba9STakashi Iwai struct hdmi_eld *eld) 618f208dba9STakashi Iwai { 619f208dba9STakashi Iwai } 6205f1e71b1SWu Fengguang #endif 6215f1e71b1SWu Fengguang 622903b21d8SWu Fengguang #define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80 623903b21d8SWu Fengguang void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen); 624903b21d8SWu Fengguang 6251da177e4SLinus Torvalds #endif /* __SOUND_HDA_LOCAL_H */ 626