Merge branch 'for-next' into for-linus
[sfrench/cifs-2.6.git] / sound / pci / hda / hda_codec.c
index 803978d69e3c4d283bfbe1b63512296bfcf43402..8ad73ccbdeb9468109d411d55b780f8a92b19c17 100644 (file)
@@ -785,7 +785,7 @@ 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);
@@ -1806,11 +1806,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 +1821,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 +1840,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 +1860,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 +1879,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 +1897,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 +1905,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 +1956,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 +1968,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 +2284,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 +2292,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++)
@@ -3588,9 +3588,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 +3603,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 +3687,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,