| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Universal Interface for Intel High Definition Audio Codec |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Local helper functions |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of the GNU General Public License as published by the Free |
|---|
| 10 | | - * Software Foundation; either version 2 of the License, or (at your option) |
|---|
| 11 | | - * any later version. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 14 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 15 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 16 | | - * more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 19 | | - * this program; if not, write to the Free Software Foundation, Inc., 59 |
|---|
| 20 | | - * Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 21 | 8 | */ |
|---|
| 22 | 9 | |
|---|
| 23 | 10 | #ifndef __SOUND_HDA_LOCAL_H |
|---|
| .. | .. |
|---|
| 113 | 100 | int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, |
|---|
| 114 | 101 | struct snd_ctl_elem_value *ucontrol); |
|---|
| 115 | 102 | int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, |
|---|
| 116 | | - unsigned int size, unsigned int __user *tlv); |
|---|
| 103 | + unsigned int size, unsigned int __user *_tlv); |
|---|
| 117 | 104 | int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, |
|---|
| 118 | 105 | struct snd_ctl_elem_info *uinfo); |
|---|
| 119 | 106 | int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, |
|---|
| .. | .. |
|---|
| 132 | 119 | int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, |
|---|
| 133 | 120 | int ch, int dir, int idx, int mask, int val); |
|---|
| 134 | 121 | int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, |
|---|
| 135 | | - int dir, int idx, int mask, int val); |
|---|
| 122 | + int direction, int idx, int mask, int val); |
|---|
| 136 | 123 | int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch, |
|---|
| 137 | 124 | int direction, int idx, int mask, int val); |
|---|
| 138 | 125 | int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid, |
|---|
| .. | .. |
|---|
| 142 | 129 | struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, |
|---|
| 143 | 130 | const char *name); |
|---|
| 144 | 131 | int __snd_hda_add_vmaster(struct hda_codec *codec, char *name, |
|---|
| 145 | | - unsigned int *tlv, const char * const *slaves, |
|---|
| 146 | | - const char *suffix, bool init_slave_vol, |
|---|
| 132 | + unsigned int *tlv, const char * const *followers, |
|---|
| 133 | + const char *suffix, bool init_follower_vol, |
|---|
| 147 | 134 | struct snd_kcontrol **ctl_ret); |
|---|
| 148 | | -#define snd_hda_add_vmaster(codec, name, tlv, slaves, suffix) \ |
|---|
| 149 | | - __snd_hda_add_vmaster(codec, name, tlv, slaves, suffix, true, NULL) |
|---|
| 135 | +#define snd_hda_add_vmaster(codec, name, tlv, followers, suffix) \ |
|---|
| 136 | + __snd_hda_add_vmaster(codec, name, tlv, followers, suffix, true, NULL) |
|---|
| 150 | 137 | int snd_hda_codec_reset(struct hda_codec *codec); |
|---|
| 151 | 138 | void snd_hda_codec_register(struct hda_codec *codec); |
|---|
| 152 | 139 | void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec); |
|---|
| 140 | + |
|---|
| 141 | +#define snd_hda_regmap_sync(codec) snd_hdac_regmap_sync(&(codec)->core) |
|---|
| 153 | 142 | |
|---|
| 154 | 143 | enum { |
|---|
| 155 | 144 | HDA_VMUTE_OFF, |
|---|
| .. | .. |
|---|
| 209 | 198 | unsigned int *cur_val); |
|---|
| 210 | 199 | int snd_hda_add_imux_item(struct hda_codec *codec, |
|---|
| 211 | 200 | struct hda_input_mux *imux, const char *label, |
|---|
| 212 | | - int index, int *type_index_ret); |
|---|
| 201 | + int index, int *type_idx); |
|---|
| 213 | 202 | |
|---|
| 214 | 203 | /* |
|---|
| 215 | 204 | * Multi-channel / digital-out PCM helper |
|---|
| .. | .. |
|---|
| 227 | 216 | hda_nid_t hp_out_nid[HDA_MAX_OUTS]; /* DACs for multiple HPs */ |
|---|
| 228 | 217 | hda_nid_t extra_out_nid[HDA_MAX_OUTS]; /* other (e.g. speaker) DACs */ |
|---|
| 229 | 218 | hda_nid_t dig_out_nid; /* digital out audio widget */ |
|---|
| 230 | | - const hda_nid_t *slave_dig_outs; |
|---|
| 219 | + const hda_nid_t *follower_dig_outs; |
|---|
| 231 | 220 | int max_channels; /* currently supported analog channels */ |
|---|
| 232 | 221 | int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ |
|---|
| 233 | 222 | int no_share_stream; /* don't share a stream with multiple pins */ |
|---|
| .. | .. |
|---|
| 368 | 357 | void snd_hda_apply_pincfgs(struct hda_codec *codec, |
|---|
| 369 | 358 | const struct hda_pintbl *cfg); |
|---|
| 370 | 359 | void snd_hda_apply_fixup(struct hda_codec *codec, int action); |
|---|
| 360 | +void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth); |
|---|
| 371 | 361 | void snd_hda_pick_fixup(struct hda_codec *codec, |
|---|
| 372 | 362 | const struct hda_model_fixup *models, |
|---|
| 373 | 363 | const struct snd_pci_quirk *quirk, |
|---|
| 374 | 364 | const struct hda_fixup *fixlist); |
|---|
| 375 | 365 | void snd_hda_pick_pin_fixup(struct hda_codec *codec, |
|---|
| 376 | 366 | const struct snd_hda_pin_quirk *pin_quirk, |
|---|
| 377 | | - const struct hda_fixup *fixlist); |
|---|
| 367 | + const struct hda_fixup *fixlist, |
|---|
| 368 | + bool match_all_pins); |
|---|
| 378 | 369 | |
|---|
| 379 | 370 | /* helper macros to retrieve pin default-config values */ |
|---|
| 380 | 371 | #define get_defcfg_connect(cfg) \ |
|---|
| .. | .. |
|---|
| 652 | 643 | */ |
|---|
| 653 | 644 | int snd_hda_enum_helper_info(struct snd_kcontrol *kcontrol, |
|---|
| 654 | 645 | struct snd_ctl_elem_info *uinfo, |
|---|
| 655 | | - int num_entries, const char * const *texts); |
|---|
| 646 | + int num_items, const char * const *texts); |
|---|
| 656 | 647 | #define snd_hda_enum_bool_helper_info(kcontrol, uinfo) \ |
|---|
| 657 | 648 | snd_hda_enum_helper_info(kcontrol, uinfo, 0, NULL) |
|---|
| 658 | 649 | |
|---|