diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
| -rw-r--r-- | sound/pci/hda/hda_codec.c | 101 | 
1 files changed, 51 insertions, 50 deletions
| diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 803978d69e3c..e96a87f1b611 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -785,13 +785,14 @@ void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec)  	snd_array_free(&codec->spdif_out);  	snd_array_free(&codec->verbs);  	codec->preset = NULL; -	codec->slave_dig_outs = NULL; +	codec->follower_dig_outs = NULL;  	codec->spdif_status_reset = 0;  	snd_array_free(&codec->mixers);  	snd_array_free(&codec->nids);  	remove_conn_list(codec);  	snd_hdac_regmap_exit(&codec->core);  } +EXPORT_SYMBOL_GPL(snd_hda_codec_cleanup_for_unbind);  static unsigned int hda_set_power_state(struct hda_codec *codec,  				unsigned int power_state); @@ -1806,11 +1807,11 @@ int snd_hda_codec_reset(struct hda_codec *codec)  	return 0;  } -typedef int (*map_slave_func_t)(struct hda_codec *, void *, struct snd_kcontrol *); +typedef int (*map_follower_func_t)(struct hda_codec *, void *, struct snd_kcontrol *); -/* apply the function to all matching slave ctls in the mixer list */ -static int map_slaves(struct hda_codec *codec, const char * const *slaves, -		      const char *suffix, map_slave_func_t func, void *data)  +/* apply the function to all matching follower ctls in the mixer list */ +static int map_followers(struct hda_codec *codec, const char * const *followers, +			 const char *suffix, map_follower_func_t func, void *data)  {  	struct hda_nid_item *items;  	const char * const *s; @@ -1821,7 +1822,7 @@ static int map_slaves(struct hda_codec *codec, const char * const *slaves,  		struct snd_kcontrol *sctl = items[i].kctl;  		if (!sctl || sctl->id.iface != SNDRV_CTL_ELEM_IFACE_MIXER)  			continue; -		for (s = slaves; *s; s++) { +		for (s = followers; *s; s++) {  			char tmpname[sizeof(sctl->id.name)];  			const char *name = *s;  			if (suffix) { @@ -1840,8 +1841,8 @@ static int map_slaves(struct hda_codec *codec, const char * const *slaves,  	return 0;  } -static int check_slave_present(struct hda_codec *codec, -			       void *data, struct snd_kcontrol *sctl) +static int check_follower_present(struct hda_codec *codec, +				  void *data, struct snd_kcontrol *sctl)  {  	return 1;  } @@ -1860,17 +1861,17 @@ static int put_kctl_with_value(struct snd_kcontrol *kctl, int val)  	return 0;  } -struct slave_init_arg { +struct follower_init_arg {  	struct hda_codec *codec;  	int step;  }; -/* initialize the slave volume with 0dB via snd_ctl_apply_vmaster_slaves() */ -static int init_slave_0dB(struct snd_kcontrol *slave, -			  struct snd_kcontrol *kctl, -			  void *_arg) +/* initialize the follower volume with 0dB via snd_ctl_apply_vmaster_followers() */ +static int init_follower_0dB(struct snd_kcontrol *follower, +			     struct snd_kcontrol *kctl, +			     void *_arg)  { -	struct slave_init_arg *arg = _arg; +	struct follower_init_arg *arg = _arg;  	int _tlv[4];  	const int *tlv = NULL;  	int step; @@ -1879,7 +1880,7 @@ static int init_slave_0dB(struct snd_kcontrol *slave,  	if (kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {  		if (kctl->tlv.c != snd_hda_mixer_amp_tlv) {  			codec_err(arg->codec, -				  "Unexpected TLV callback for slave %s:%d\n", +				  "Unexpected TLV callback for follower %s:%d\n",  				  kctl->id.name, kctl->id.index);  			return 0; /* ignore */  		} @@ -1897,7 +1898,7 @@ static int init_slave_0dB(struct snd_kcontrol *slave,  		return 0;  	if (arg->step && arg->step != step) {  		codec_err(arg->codec, -			  "Mismatching dB step for vmaster slave (%d!=%d)\n", +			  "Mismatching dB step for vmaster follower (%d!=%d)\n",  			  arg->step, step);  		return 0;  	} @@ -1905,49 +1906,49 @@ static int init_slave_0dB(struct snd_kcontrol *slave,  	arg->step = step;  	val = -tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] / step;  	if (val > 0) { -		put_kctl_with_value(slave, val); +		put_kctl_with_value(follower, val);  		return val;  	}  	return 0;  } -/* unmute the slave via snd_ctl_apply_vmaster_slaves() */ -static int init_slave_unmute(struct snd_kcontrol *slave, -			     struct snd_kcontrol *kctl, -			     void *_arg) +/* unmute the follower via snd_ctl_apply_vmaster_followers() */ +static int init_follower_unmute(struct snd_kcontrol *follower, +				struct snd_kcontrol *kctl, +				void *_arg)  { -	return put_kctl_with_value(slave, 1); +	return put_kctl_with_value(follower, 1);  } -static int add_slave(struct hda_codec *codec, -		     void *data, struct snd_kcontrol *slave) +static int add_follower(struct hda_codec *codec, +			void *data, struct snd_kcontrol *follower)  { -	return snd_ctl_add_slave(data, slave); +	return snd_ctl_add_follower(data, follower);  }  /** - * __snd_hda_add_vmaster - create a virtual master control and add slaves + * __snd_hda_add_vmaster - create a virtual master control and add followers   * @codec: HD-audio codec   * @name: vmaster control name   * @tlv: TLV data (optional) - * @slaves: slave control names (optional) - * @suffix: suffix string to each slave name (optional) - * @init_slave_vol: initialize slaves to unmute/0dB + * @followers: follower control names (optional) + * @suffix: suffix string to each follower name (optional) + * @init_follower_vol: initialize followers to unmute/0dB   * @ctl_ret: store the vmaster kcontrol in return   *   * Create a virtual master control with the given name.  The TLV data   * must be either NULL or a valid data.   * - * @slaves is a NULL-terminated array of strings, each of which is a - * slave control name.  All controls with these names are assigned to + * @followers is a NULL-terminated array of strings, each of which is a + * follower control name.  All controls with these names are assigned to   * the new virtual master control.   *   * This function returns zero if successful or a negative error code.   */  int __snd_hda_add_vmaster(struct hda_codec *codec, char *name, -			unsigned int *tlv, const char * const *slaves, -			  const char *suffix, bool init_slave_vol, +			  unsigned int *tlv, const char * const *followers, +			  const char *suffix, bool init_follower_vol,  			  struct snd_kcontrol **ctl_ret)  {  	struct snd_kcontrol *kctl; @@ -1956,9 +1957,9 @@ int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,  	if (ctl_ret)  		*ctl_ret = NULL; -	err = map_slaves(codec, slaves, suffix, check_slave_present, NULL); +	err = map_followers(codec, followers, suffix, check_follower_present, NULL);  	if (err != 1) { -		codec_dbg(codec, "No slave found for %s\n", name); +		codec_dbg(codec, "No follower found for %s\n", name);  		return 0;  	}  	kctl = snd_ctl_make_virtual_master(name, tlv); @@ -1968,20 +1969,20 @@ int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,  	if (err < 0)  		return err; -	err = map_slaves(codec, slaves, suffix, add_slave, kctl); +	err = map_followers(codec, followers, suffix, add_follower, kctl);  	if (err < 0)  		return err;  	/* init with master mute & zero volume */  	put_kctl_with_value(kctl, 0); -	if (init_slave_vol) { -		struct slave_init_arg arg = { +	if (init_follower_vol) { +		struct follower_init_arg arg = {  			.codec = codec,  			.step = 0,  		}; -		snd_ctl_apply_vmaster_slaves(kctl, -					     tlv ? init_slave_0dB : init_slave_unmute, -					     &arg); +		snd_ctl_apply_vmaster_followers(kctl, +						tlv ? init_follower_0dB : init_follower_unmute, +						&arg);  	}  	if (ctl_ret) @@ -2284,7 +2285,7 @@ static unsigned int convert_to_spdif_status(unsigned short val)  	return sbits;  } -/* set digital convert verbs both for the given NID and its slaves */ +/* set digital convert verbs both for the given NID and its followers */  static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,  			int mask, int val)  { @@ -2292,7 +2293,7 @@ static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,  	snd_hdac_regmap_update(&codec->core, nid, AC_VERB_SET_DIGI_CONVERT_1,  			       mask, val); -	d = codec->slave_dig_outs; +	d = codec->follower_dig_outs;  	if (!d)  		return;  	for (; *d; d++) @@ -3186,7 +3187,7 @@ int snd_hda_codec_prepare(struct hda_codec *codec,  EXPORT_SYMBOL_GPL(snd_hda_codec_prepare);  /** - * snd_hda_codec_cleanup - Prepare a stream + * snd_hda_codec_cleanup - Clean up stream resources   * @codec: the HDA codec   * @hinfo: PCM information   * @substream: PCM substream @@ -3427,7 +3428,7 @@ EXPORT_SYMBOL_GPL(snd_hda_set_power_save);   * @nid: NID to check / update   *   * Check whether the given NID is in the amp list.  If it's in the list, - * check the current AMP status, and update the the power-status according + * check the current AMP status, and update the power-status according   * to the mute status.   *   * This function is supposed to be set or called from the check_power_status @@ -3588,9 +3589,9 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,  				    spdif->ctls & ~AC_DIG1_ENABLE & 0xff,  				    -1);  	snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); -	if (codec->slave_dig_outs) { +	if (codec->follower_dig_outs) {  		const hda_nid_t *d; -		for (d = codec->slave_dig_outs; *d; d++) +		for (d = codec->follower_dig_outs; *d; d++)  			snd_hda_codec_setup_stream(codec, *d, stream_tag, 0,  						   format);  	} @@ -3603,9 +3604,9 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,  static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid)  {  	snd_hda_codec_cleanup_stream(codec, nid); -	if (codec->slave_dig_outs) { +	if (codec->follower_dig_outs) {  		const hda_nid_t *d; -		for (d = codec->slave_dig_outs; *d; d++) +		for (d = codec->follower_dig_outs; *d; d++)  			snd_hda_codec_cleanup_stream(codec, *d);  	}  } @@ -3687,7 +3688,7 @@ EXPORT_SYMBOL_GPL(snd_hda_multi_out_dig_close);   * @hinfo: PCM information to assign   *   * Open analog outputs and set up the hw-constraints. - * If the digital outputs can be opened as slave, open the digital + * If the digital outputs can be opened as follower, open the digital   * outputs, too.   */  int snd_hda_multi_out_analog_open(struct hda_codec *codec, | 
