Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: Replace the word "slave" in vmaster API

Follow the recent inclusive terminology guidelines and replace the
word "slave" in vmaster API. I chose the word "follower" at this time
since it seems fitting for the purpose.

Note that the word "master" is kept in API, since it refers rather to
audio master volume control.

Also, while we're at it, a typo in comments is corrected, too.

Link: https://lore.kernel.org/r/20200717154517.27599-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+268 -266
+23 -22
include/sound/control.h
··· 188 188 */ 189 189 struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, 190 190 const unsigned int *tlv); 191 - int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave, 192 - unsigned int flags); 193 - /* optional flags for slave */ 194 - #define SND_CTL_SLAVE_NEED_UPDATE (1 << 0) 191 + int _snd_ctl_add_follower(struct snd_kcontrol *master, 192 + struct snd_kcontrol *follower, 193 + unsigned int flags); 194 + /* optional flags for follower */ 195 + #define SND_CTL_FOLLOWER_NEED_UPDATE (1 << 0) 195 196 196 197 /** 197 - * snd_ctl_add_slave - Add a virtual slave control 198 + * snd_ctl_add_follower - Add a virtual follower control 198 199 * @master: vmaster element 199 - * @slave: slave element to add 200 + * @follower: follower element to add 200 201 * 201 - * Add a virtual slave control to the given master element created via 202 + * Add a virtual follower control to the given master element created via 202 203 * snd_ctl_create_virtual_master() beforehand. 203 204 * 204 - * All slaves must be the same type (returning the same information 205 + * All followers must be the same type (returning the same information 205 206 * via info callback). The function doesn't check it, so it's your 206 207 * responsibility. 207 208 * ··· 214 213 * Return: Zero if successful or a negative error code. 215 214 */ 216 215 static inline int 217 - snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave) 216 + snd_ctl_add_follower(struct snd_kcontrol *master, struct snd_kcontrol *follower) 218 217 { 219 - return _snd_ctl_add_slave(master, slave, 0); 218 + return _snd_ctl_add_follower(master, follower, 0); 220 219 } 221 220 222 221 /** 223 - * snd_ctl_add_slave_uncached - Add a virtual slave control 222 + * snd_ctl_add_follower_uncached - Add a virtual follower control 224 223 * @master: vmaster element 225 - * @slave: slave element to add 224 + * @follower: follower element to add 226 225 * 227 - * Add a virtual slave control to the given master. 228 - * Unlike snd_ctl_add_slave(), the element added via this function 226 + * Add a virtual follower control to the given master. 227 + * Unlike snd_ctl_add_follower(), the element added via this function 229 228 * is supposed to have volatile values, and get callback is called 230 229 * at each time queried from the master. 231 230 * ··· 236 235 * Return: Zero if successful or a negative error code. 237 236 */ 238 237 static inline int 239 - snd_ctl_add_slave_uncached(struct snd_kcontrol *master, 240 - struct snd_kcontrol *slave) 238 + snd_ctl_add_follower_uncached(struct snd_kcontrol *master, 239 + struct snd_kcontrol *follower) 241 240 { 242 - return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE); 241 + return _snd_ctl_add_follower(master, follower, SND_CTL_FOLLOWER_NEED_UPDATE); 243 242 } 244 243 245 244 int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kctl, ··· 247 246 void *private_data); 248 247 void snd_ctl_sync_vmaster(struct snd_kcontrol *kctl, bool hook_only); 249 248 #define snd_ctl_sync_vmaster_hook(kctl) snd_ctl_sync_vmaster(kctl, true) 250 - int snd_ctl_apply_vmaster_slaves(struct snd_kcontrol *kctl, 251 - int (*func)(struct snd_kcontrol *vslave, 252 - struct snd_kcontrol *slave, 253 - void *arg), 254 - void *arg); 249 + int snd_ctl_apply_vmaster_followers(struct snd_kcontrol *kctl, 250 + int (*func)(struct snd_kcontrol *vfollower, 251 + struct snd_kcontrol *follower, 252 + void *arg), 253 + void *arg); 255 254 256 255 /* 257 256 * Helper functions for jack-detection controls
+1 -1
include/sound/hda_codec.h
··· 208 208 struct mutex control_mutex; 209 209 struct snd_array spdif_out; 210 210 unsigned int spdif_in_enable; /* SPDIF input enable? */ 211 - const hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */ 211 + const hda_nid_t *follower_dig_outs; /* optional digital out follower widgets */ 212 212 struct snd_array init_pins; /* initial (BIOS) pin configurations */ 213 213 struct snd_array driver_pins; /* pin configs set by codec parser */ 214 214 struct snd_array cvt_setups; /* audio convert setups */
+131 -130
sound/core/vmaster.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * Virtual master and slave controls 3 + * Virtual master and follower controls 4 4 * 5 5 * Copyright (c) 2008 by Takashi Iwai <tiwai@suse.de> 6 6 */ ··· 21 21 }; 22 22 23 23 /* 24 - * link master - this contains a list of slave controls that are 24 + * link master - this contains a list of follower controls that are 25 25 * identical types, i.e. info returns the same value type and value 26 26 * ranges, but may have different number of counts. 27 27 * 28 28 * The master control is so far only mono volume/switch for simplicity. 29 - * The same value will be applied to all slaves. 29 + * The same value will be applied to all followers. 30 30 */ 31 31 struct link_master { 32 - struct list_head slaves; 32 + struct list_head followers; 33 33 struct link_ctl_info info; 34 34 int val; /* the master value */ 35 35 unsigned int tlv[4]; ··· 38 38 }; 39 39 40 40 /* 41 - * link slave - this contains a slave control element 41 + * link follower - this contains a follower control element 42 42 * 43 - * It fakes the control callbacsk with additional attenuation by the 44 - * master control. A slave may have either one or two channels. 43 + * It fakes the control callbacks with additional attenuation by the 44 + * master control. A follower may have either one or two channels. 45 45 */ 46 46 47 - struct link_slave { 47 + struct link_follower { 48 48 struct list_head list; 49 49 struct link_master *master; 50 50 struct link_ctl_info info; 51 51 int vals[2]; /* current values */ 52 52 unsigned int flags; 53 53 struct snd_kcontrol *kctl; /* original kcontrol pointer */ 54 - struct snd_kcontrol slave; /* the copy of original control entry */ 54 + struct snd_kcontrol follower; /* the copy of original control entry */ 55 55 }; 56 56 57 - static int slave_update(struct link_slave *slave) 57 + static int follower_update(struct link_follower *follower) 58 58 { 59 59 struct snd_ctl_elem_value *uctl; 60 60 int err, ch; ··· 62 62 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); 63 63 if (!uctl) 64 64 return -ENOMEM; 65 - uctl->id = slave->slave.id; 66 - err = slave->slave.get(&slave->slave, uctl); 65 + uctl->id = follower->follower.id; 66 + err = follower->follower.get(&follower->follower, uctl); 67 67 if (err < 0) 68 68 goto error; 69 - for (ch = 0; ch < slave->info.count; ch++) 70 - slave->vals[ch] = uctl->value.integer.value[ch]; 69 + for (ch = 0; ch < follower->info.count; ch++) 70 + follower->vals[ch] = uctl->value.integer.value[ch]; 71 71 error: 72 72 kfree(uctl); 73 73 return err < 0 ? err : 0; 74 74 } 75 75 76 - /* get the slave ctl info and save the initial values */ 77 - static int slave_init(struct link_slave *slave) 76 + /* get the follower ctl info and save the initial values */ 77 + static int follower_init(struct link_follower *follower) 78 78 { 79 79 struct snd_ctl_elem_info *uinfo; 80 80 int err; 81 81 82 - if (slave->info.count) { 82 + if (follower->info.count) { 83 83 /* already initialized */ 84 - if (slave->flags & SND_CTL_SLAVE_NEED_UPDATE) 85 - return slave_update(slave); 84 + if (follower->flags & SND_CTL_FOLLOWER_NEED_UPDATE) 85 + return follower_update(follower); 86 86 return 0; 87 87 } 88 88 89 89 uinfo = kmalloc(sizeof(*uinfo), GFP_KERNEL); 90 90 if (!uinfo) 91 91 return -ENOMEM; 92 - uinfo->id = slave->slave.id; 93 - err = slave->slave.info(&slave->slave, uinfo); 92 + uinfo->id = follower->follower.id; 93 + err = follower->follower.info(&follower->follower, uinfo); 94 94 if (err < 0) { 95 95 kfree(uinfo); 96 96 return err; 97 97 } 98 - slave->info.type = uinfo->type; 99 - slave->info.count = uinfo->count; 100 - if (slave->info.count > 2 || 101 - (slave->info.type != SNDRV_CTL_ELEM_TYPE_INTEGER && 102 - slave->info.type != SNDRV_CTL_ELEM_TYPE_BOOLEAN)) { 103 - pr_err("ALSA: vmaster: invalid slave element\n"); 98 + follower->info.type = uinfo->type; 99 + follower->info.count = uinfo->count; 100 + if (follower->info.count > 2 || 101 + (follower->info.type != SNDRV_CTL_ELEM_TYPE_INTEGER && 102 + follower->info.type != SNDRV_CTL_ELEM_TYPE_BOOLEAN)) { 103 + pr_err("ALSA: vmaster: invalid follower element\n"); 104 104 kfree(uinfo); 105 105 return -EINVAL; 106 106 } 107 - slave->info.min_val = uinfo->value.integer.min; 108 - slave->info.max_val = uinfo->value.integer.max; 107 + follower->info.min_val = uinfo->value.integer.min; 108 + follower->info.max_val = uinfo->value.integer.max; 109 109 kfree(uinfo); 110 110 111 - return slave_update(slave); 111 + return follower_update(follower); 112 112 } 113 113 114 114 /* initialize master volume */ 115 115 static int master_init(struct link_master *master) 116 116 { 117 - struct link_slave *slave; 117 + struct link_follower *follower; 118 118 119 119 if (master->info.count) 120 120 return 0; /* already initialized */ 121 121 122 - list_for_each_entry(slave, &master->slaves, list) { 123 - int err = slave_init(slave); 122 + list_for_each_entry(follower, &master->followers, list) { 123 + int err = follower_init(follower); 124 124 if (err < 0) 125 125 return err; 126 - master->info = slave->info; 126 + master->info = follower->info; 127 127 master->info.count = 1; /* always mono */ 128 128 /* set full volume as default (= no attenuation) */ 129 129 master->val = master->info.max_val; ··· 134 134 return -ENOENT; 135 135 } 136 136 137 - static int slave_get_val(struct link_slave *slave, 138 - struct snd_ctl_elem_value *ucontrol) 137 + static int follower_get_val(struct link_follower *follower, 138 + struct snd_ctl_elem_value *ucontrol) 139 139 { 140 140 int err, ch; 141 141 142 - err = slave_init(slave); 142 + err = follower_init(follower); 143 143 if (err < 0) 144 144 return err; 145 - for (ch = 0; ch < slave->info.count; ch++) 146 - ucontrol->value.integer.value[ch] = slave->vals[ch]; 145 + for (ch = 0; ch < follower->info.count; ch++) 146 + ucontrol->value.integer.value[ch] = follower->vals[ch]; 147 147 return 0; 148 148 } 149 149 150 - static int slave_put_val(struct link_slave *slave, 151 - struct snd_ctl_elem_value *ucontrol) 150 + static int follower_put_val(struct link_follower *follower, 151 + struct snd_ctl_elem_value *ucontrol) 152 152 { 153 153 int err, ch, vol; 154 154 155 - err = master_init(slave->master); 155 + err = master_init(follower->master); 156 156 if (err < 0) 157 157 return err; 158 158 159 - switch (slave->info.type) { 159 + switch (follower->info.type) { 160 160 case SNDRV_CTL_ELEM_TYPE_BOOLEAN: 161 - for (ch = 0; ch < slave->info.count; ch++) 161 + for (ch = 0; ch < follower->info.count; ch++) 162 162 ucontrol->value.integer.value[ch] &= 163 - !!slave->master->val; 163 + !!follower->master->val; 164 164 break; 165 165 case SNDRV_CTL_ELEM_TYPE_INTEGER: 166 - for (ch = 0; ch < slave->info.count; ch++) { 166 + for (ch = 0; ch < follower->info.count; ch++) { 167 167 /* max master volume is supposed to be 0 dB */ 168 168 vol = ucontrol->value.integer.value[ch]; 169 - vol += slave->master->val - slave->master->info.max_val; 170 - if (vol < slave->info.min_val) 171 - vol = slave->info.min_val; 172 - else if (vol > slave->info.max_val) 173 - vol = slave->info.max_val; 169 + vol += follower->master->val - follower->master->info.max_val; 170 + if (vol < follower->info.min_val) 171 + vol = follower->info.min_val; 172 + else if (vol > follower->info.max_val) 173 + vol = follower->info.max_val; 174 174 ucontrol->value.integer.value[ch] = vol; 175 175 } 176 176 break; 177 177 } 178 - return slave->slave.put(&slave->slave, ucontrol); 178 + return follower->follower.put(&follower->follower, ucontrol); 179 179 } 180 180 181 181 /* 182 - * ctl callbacks for slaves 182 + * ctl callbacks for followers 183 183 */ 184 - static int slave_info(struct snd_kcontrol *kcontrol, 185 - struct snd_ctl_elem_info *uinfo) 184 + static int follower_info(struct snd_kcontrol *kcontrol, 185 + struct snd_ctl_elem_info *uinfo) 186 186 { 187 - struct link_slave *slave = snd_kcontrol_chip(kcontrol); 188 - return slave->slave.info(&slave->slave, uinfo); 187 + struct link_follower *follower = snd_kcontrol_chip(kcontrol); 188 + return follower->follower.info(&follower->follower, uinfo); 189 189 } 190 190 191 - static int slave_get(struct snd_kcontrol *kcontrol, 192 - struct snd_ctl_elem_value *ucontrol) 191 + static int follower_get(struct snd_kcontrol *kcontrol, 192 + struct snd_ctl_elem_value *ucontrol) 193 193 { 194 - struct link_slave *slave = snd_kcontrol_chip(kcontrol); 195 - return slave_get_val(slave, ucontrol); 194 + struct link_follower *follower = snd_kcontrol_chip(kcontrol); 195 + return follower_get_val(follower, ucontrol); 196 196 } 197 197 198 - static int slave_put(struct snd_kcontrol *kcontrol, 199 - struct snd_ctl_elem_value *ucontrol) 198 + static int follower_put(struct snd_kcontrol *kcontrol, 199 + struct snd_ctl_elem_value *ucontrol) 200 200 { 201 - struct link_slave *slave = snd_kcontrol_chip(kcontrol); 201 + struct link_follower *follower = snd_kcontrol_chip(kcontrol); 202 202 int err, ch, changed = 0; 203 203 204 - err = slave_init(slave); 204 + err = follower_init(follower); 205 205 if (err < 0) 206 206 return err; 207 - for (ch = 0; ch < slave->info.count; ch++) { 208 - if (slave->vals[ch] != ucontrol->value.integer.value[ch]) { 207 + for (ch = 0; ch < follower->info.count; ch++) { 208 + if (follower->vals[ch] != ucontrol->value.integer.value[ch]) { 209 209 changed = 1; 210 - slave->vals[ch] = ucontrol->value.integer.value[ch]; 210 + follower->vals[ch] = ucontrol->value.integer.value[ch]; 211 211 } 212 212 } 213 213 if (!changed) 214 214 return 0; 215 - err = slave_put_val(slave, ucontrol); 215 + err = follower_put_val(follower, ucontrol); 216 216 if (err < 0) 217 217 return err; 218 218 return 1; 219 219 } 220 220 221 - static int slave_tlv_cmd(struct snd_kcontrol *kcontrol, 222 - int op_flag, unsigned int size, 223 - unsigned int __user *tlv) 221 + static int follower_tlv_cmd(struct snd_kcontrol *kcontrol, 222 + int op_flag, unsigned int size, 223 + unsigned int __user *tlv) 224 224 { 225 - struct link_slave *slave = snd_kcontrol_chip(kcontrol); 225 + struct link_follower *follower = snd_kcontrol_chip(kcontrol); 226 226 /* FIXME: this assumes that the max volume is 0 dB */ 227 - return slave->slave.tlv.c(&slave->slave, op_flag, size, tlv); 227 + return follower->follower.tlv.c(&follower->follower, op_flag, size, tlv); 228 228 } 229 229 230 - static void slave_free(struct snd_kcontrol *kcontrol) 230 + static void follower_free(struct snd_kcontrol *kcontrol) 231 231 { 232 - struct link_slave *slave = snd_kcontrol_chip(kcontrol); 233 - if (slave->slave.private_free) 234 - slave->slave.private_free(&slave->slave); 235 - if (slave->master) 236 - list_del(&slave->list); 237 - kfree(slave); 232 + struct link_follower *follower = snd_kcontrol_chip(kcontrol); 233 + if (follower->follower.private_free) 234 + follower->follower.private_free(&follower->follower); 235 + if (follower->master) 236 + list_del(&follower->list); 237 + kfree(follower); 238 238 } 239 239 240 240 /* 241 - * Add a slave control to the group with the given master control 241 + * Add a follower control to the group with the given master control 242 242 * 243 - * All slaves must be the same type (returning the same information 243 + * All followers must be the same type (returning the same information 244 244 * via info callback). The function doesn't check it, so it's your 245 245 * responsibility. 246 246 * ··· 249 249 * - logarithmic volume control (dB level), no linear volume 250 250 * - master can only attenuate the volume, no gain 251 251 */ 252 - int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave, 253 - unsigned int flags) 252 + int _snd_ctl_add_follower(struct snd_kcontrol *master, 253 + struct snd_kcontrol *follower, 254 + unsigned int flags) 254 255 { 255 256 struct link_master *master_link = snd_kcontrol_chip(master); 256 - struct link_slave *srec; 257 + struct link_follower *srec; 257 258 258 - srec = kzalloc(struct_size(srec, slave.vd, slave->count), 259 + srec = kzalloc(struct_size(srec, follower.vd, follower->count), 259 260 GFP_KERNEL); 260 261 if (!srec) 261 262 return -ENOMEM; 262 - srec->kctl = slave; 263 - srec->slave = *slave; 264 - memcpy(srec->slave.vd, slave->vd, slave->count * sizeof(*slave->vd)); 263 + srec->kctl = follower; 264 + srec->follower = *follower; 265 + memcpy(srec->follower.vd, follower->vd, follower->count * sizeof(*follower->vd)); 265 266 srec->master = master_link; 266 267 srec->flags = flags; 267 268 268 269 /* override callbacks */ 269 - slave->info = slave_info; 270 - slave->get = slave_get; 271 - slave->put = slave_put; 272 - if (slave->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) 273 - slave->tlv.c = slave_tlv_cmd; 274 - slave->private_data = srec; 275 - slave->private_free = slave_free; 270 + follower->info = follower_info; 271 + follower->get = follower_get; 272 + follower->put = follower_put; 273 + if (follower->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) 274 + follower->tlv.c = follower_tlv_cmd; 275 + follower->private_data = srec; 276 + follower->private_free = follower_free; 276 277 277 - list_add_tail(&srec->list, &master_link->slaves); 278 + list_add_tail(&srec->list, &master_link->followers); 278 279 return 0; 279 280 } 280 - EXPORT_SYMBOL(_snd_ctl_add_slave); 281 + EXPORT_SYMBOL(_snd_ctl_add_follower); 281 282 282 283 /* 283 284 * ctl callbacks for master controls ··· 310 309 return 0; 311 310 } 312 311 313 - static int sync_slaves(struct link_master *master, int old_val, int new_val) 312 + static int sync_followers(struct link_master *master, int old_val, int new_val) 314 313 { 315 - struct link_slave *slave; 314 + struct link_follower *follower; 316 315 struct snd_ctl_elem_value *uval; 317 316 318 317 uval = kmalloc(sizeof(*uval), GFP_KERNEL); 319 318 if (!uval) 320 319 return -ENOMEM; 321 - list_for_each_entry(slave, &master->slaves, list) { 320 + list_for_each_entry(follower, &master->followers, list) { 322 321 master->val = old_val; 323 - uval->id = slave->slave.id; 324 - slave_get_val(slave, uval); 322 + uval->id = follower->follower.id; 323 + follower_get_val(follower, uval); 325 324 master->val = new_val; 326 - slave_put_val(slave, uval); 325 + follower_put_val(follower, uval); 327 326 } 328 327 kfree(uval); 329 328 return 0; ··· 345 344 if (new_val == old_val) 346 345 return 0; 347 346 348 - err = sync_slaves(master, old_val, new_val); 347 + err = sync_followers(master, old_val, new_val); 349 348 if (err < 0) 350 349 return err; 351 350 if (master->hook && !first_init) ··· 356 355 static void master_free(struct snd_kcontrol *kcontrol) 357 356 { 358 357 struct link_master *master = snd_kcontrol_chip(kcontrol); 359 - struct link_slave *slave, *n; 358 + struct link_follower *follower, *n; 360 359 361 - /* free all slave links and retore the original slave kctls */ 362 - list_for_each_entry_safe(slave, n, &master->slaves, list) { 363 - struct snd_kcontrol *sctl = slave->kctl; 360 + /* free all follower links and retore the original follower kctls */ 361 + list_for_each_entry_safe(follower, n, &master->followers, list) { 362 + struct snd_kcontrol *sctl = follower->kctl; 364 363 struct list_head olist = sctl->list; 365 - memcpy(sctl, &slave->slave, sizeof(*sctl)); 366 - memcpy(sctl->vd, slave->slave.vd, 364 + memcpy(sctl, &follower->follower, sizeof(*sctl)); 365 + memcpy(sctl->vd, follower->follower.vd, 367 366 sctl->count * sizeof(*sctl->vd)); 368 367 sctl->list = olist; /* keep the current linked-list */ 369 - kfree(slave); 368 + kfree(follower); 370 369 } 371 370 kfree(master); 372 371 } ··· 379 378 * 380 379 * Creates a virtual master control with the given name string. 381 380 * 382 - * After creating a vmaster element, you can add the slave controls 383 - * via snd_ctl_add_slave() or snd_ctl_add_slave_uncached(). 381 + * After creating a vmaster element, you can add the follower controls 382 + * via snd_ctl_add_follower() or snd_ctl_add_follower_uncached(). 384 383 * 385 384 * The optional argument @tlv can be used to specify the TLV information 386 385 * for dB scale of the master control. It should be a single element ··· 404 403 master = kzalloc(sizeof(*master), GFP_KERNEL); 405 404 if (!master) 406 405 return NULL; 407 - INIT_LIST_HEAD(&master->slaves); 406 + INIT_LIST_HEAD(&master->followers); 408 407 409 408 kctl = snd_ctl_new1(&knew, master); 410 409 if (!kctl) { ··· 456 455 EXPORT_SYMBOL_GPL(snd_ctl_add_vmaster_hook); 457 456 458 457 /** 459 - * snd_ctl_sync_vmaster - Sync the vmaster slaves and hook 458 + * snd_ctl_sync_vmaster - Sync the vmaster followers and hook 460 459 * @kcontrol: vmaster kctl element 461 460 * @hook_only: sync only the hook 462 461 * 463 - * Forcibly call the put callback of each slave and call the hook function 462 + * Forcibly call the put callback of each follower and call the hook function 464 463 * to synchronize with the current value of the given vmaster element. 465 464 * NOP when NULL is passed to @kcontrol. 466 465 */ ··· 477 476 if (err < 0) 478 477 return; 479 478 first_init = err; 480 - err = sync_slaves(master, master->val, master->val); 479 + err = sync_followers(master, master->val, master->val); 481 480 if (err < 0) 482 481 return; 483 482 } ··· 488 487 EXPORT_SYMBOL_GPL(snd_ctl_sync_vmaster); 489 488 490 489 /** 491 - * snd_ctl_apply_vmaster_slaves - Apply function to each vmaster slave 490 + * snd_ctl_apply_vmaster_followers - Apply function to each vmaster follower 492 491 * @kctl: vmaster kctl element 493 492 * @func: function to apply 494 493 * @arg: optional function argument 495 494 * 496 - * Apply the function @func to each slave kctl of the given vmaster kctl. 495 + * Apply the function @func to each follower kctl of the given vmaster kctl. 497 496 * Returns 0 if successful, or a negative error code. 498 497 */ 499 - int snd_ctl_apply_vmaster_slaves(struct snd_kcontrol *kctl, 500 - int (*func)(struct snd_kcontrol *vslave, 501 - struct snd_kcontrol *slave, 502 - void *arg), 503 - void *arg) 498 + int snd_ctl_apply_vmaster_followers(struct snd_kcontrol *kctl, 499 + int (*func)(struct snd_kcontrol *vfollower, 500 + struct snd_kcontrol *follower, 501 + void *arg), 502 + void *arg) 504 503 { 505 504 struct link_master *master; 506 - struct link_slave *slave; 505 + struct link_follower *follower; 507 506 int err; 508 507 509 508 master = snd_kcontrol_chip(kctl); 510 509 err = master_init(master); 511 510 if (err < 0) 512 511 return err; 513 - list_for_each_entry(slave, &master->slaves, list) { 514 - err = func(slave->kctl, &slave->slave, arg); 512 + list_for_each_entry(follower, &master->followers, list) { 513 + err = func(follower->kctl, &follower->follower, arg); 515 514 if (err < 0) 516 515 return err; 517 516 } 518 517 519 518 return 0; 520 519 } 521 - EXPORT_SYMBOL_GPL(snd_ctl_apply_vmaster_slaves); 520 + EXPORT_SYMBOL_GPL(snd_ctl_apply_vmaster_followers);
+10 -10
sound/pci/ac97/ac97_patch.c
··· 19 19 const char *name); 20 20 static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, 21 21 const unsigned int *tlv, 22 - const char * const *slaves); 22 + const char * const *followers); 23 23 24 24 /* 25 25 * Chip specific initialization ··· 3373 3373 AC97_SINGLE("Downmix Surround to Front", 0x5a, 11, 1, 0), 3374 3374 }; 3375 3375 3376 - static const char * const slave_vols_vt1616[] = { 3376 + static const char * const follower_vols_vt1616[] = { 3377 3377 "Front Playback Volume", 3378 3378 "Surround Playback Volume", 3379 3379 "Center Playback Volume", ··· 3381 3381 NULL 3382 3382 }; 3383 3383 3384 - static const char * const slave_sws_vt1616[] = { 3384 + static const char * const follower_sws_vt1616[] = { 3385 3385 "Front Playback Switch", 3386 3386 "Surround Playback Switch", 3387 3387 "Center Playback Switch", ··· 3400 3400 return snd_ctl_find_id(ac97->bus->card, &id); 3401 3401 } 3402 3402 3403 - /* create a virtual master control and add slaves */ 3403 + /* create a virtual master control and add followers */ 3404 3404 static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, 3405 3405 const unsigned int *tlv, 3406 - const char * const *slaves) 3406 + const char * const *followers) 3407 3407 { 3408 3408 struct snd_kcontrol *kctl; 3409 3409 const char * const *s; ··· 3416 3416 if (err < 0) 3417 3417 return err; 3418 3418 3419 - for (s = slaves; *s; s++) { 3419 + for (s = followers; *s; s++) { 3420 3420 struct snd_kcontrol *sctl; 3421 3421 3422 3422 sctl = snd_ac97_find_mixer_ctl(ac97, *s); 3423 3423 if (!sctl) { 3424 3424 dev_dbg(ac97->bus->card->dev, 3425 - "Cannot find slave %s, skipped\n", *s); 3425 + "Cannot find follower %s, skipped\n", *s); 3426 3426 continue; 3427 3427 } 3428 - err = snd_ctl_add_slave(kctl, sctl); 3428 + err = snd_ctl_add_follower(kctl, sctl); 3429 3429 if (err < 0) 3430 3430 return err; 3431 3431 } ··· 3451 3451 snd_ac97_rename_vol_ctl(ac97, "Master Playback", "Front Playback"); 3452 3452 3453 3453 err = snd_ac97_add_vmaster(ac97, "Master Playback Volume", 3454 - kctl->tlv.p, slave_vols_vt1616); 3454 + kctl->tlv.p, follower_vols_vt1616); 3455 3455 if (err < 0) 3456 3456 return err; 3457 3457 3458 3458 err = snd_ac97_add_vmaster(ac97, "Master Playback Switch", 3459 - NULL, slave_sws_vt1616); 3459 + NULL, follower_sws_vt1616); 3460 3460 if (err < 0) 3461 3461 return err; 3462 3462
+9 -9
sound/pci/ca0106/ca0106_mixer.c
··· 739 739 static 740 740 DECLARE_TLV_DB_SCALE(snd_ca0106_master_db_scale, -6375, 25, 1); 741 741 742 - static const char * const slave_vols[] = { 742 + static const char * const follower_vols[] = { 743 743 "Analog Front Playback Volume", 744 744 "Analog Rear Playback Volume", 745 745 "Analog Center/LFE Playback Volume", ··· 752 752 NULL 753 753 }; 754 754 755 - static const char * const slave_sws[] = { 755 + static const char * const follower_sws[] = { 756 756 "Analog Front Playback Switch", 757 757 "Analog Rear Playback Switch", 758 758 "Analog Center/LFE Playback Switch", ··· 761 761 NULL 762 762 }; 763 763 764 - static void add_slaves(struct snd_card *card, 765 - struct snd_kcontrol *master, const char * const *list) 764 + static void add_followers(struct snd_card *card, 765 + struct snd_kcontrol *master, const char * const *list) 766 766 { 767 767 for (; *list; list++) { 768 - struct snd_kcontrol *slave = ctl_find(card, *list); 769 - if (slave) 770 - snd_ctl_add_slave(master, slave); 768 + struct snd_kcontrol *follower = ctl_find(card, *list); 769 + if (follower) 770 + snd_ctl_add_follower(master, follower); 771 771 } 772 772 } 773 773 ··· 852 852 err = snd_ctl_add(card, vmaster); 853 853 if (err < 0) 854 854 return err; 855 - add_slaves(card, vmaster, slave_vols); 855 + add_followers(card, vmaster, follower_vols); 856 856 857 857 if (emu->details->spi_dac) { 858 858 vmaster = snd_ctl_make_virtual_master("Master Playback Switch", ··· 862 862 err = snd_ctl_add(card, vmaster); 863 863 if (err < 0) 864 864 return err; 865 - add_slaves(card, vmaster, slave_sws); 865 + add_followers(card, vmaster, follower_sws); 866 866 } 867 867 868 868 strcpy(card->mixername, "CA0106");
+48 -48
sound/pci/hda/hda_codec.c
··· 785 785 snd_array_free(&codec->spdif_out); 786 786 snd_array_free(&codec->verbs); 787 787 codec->preset = NULL; 788 - codec->slave_dig_outs = NULL; 788 + codec->follower_dig_outs = NULL; 789 789 codec->spdif_status_reset = 0; 790 790 snd_array_free(&codec->mixers); 791 791 snd_array_free(&codec->nids); ··· 1806 1806 return 0; 1807 1807 } 1808 1808 1809 - typedef int (*map_slave_func_t)(struct hda_codec *, void *, struct snd_kcontrol *); 1809 + typedef int (*map_follower_func_t)(struct hda_codec *, void *, struct snd_kcontrol *); 1810 1810 1811 - /* apply the function to all matching slave ctls in the mixer list */ 1812 - static int map_slaves(struct hda_codec *codec, const char * const *slaves, 1813 - const char *suffix, map_slave_func_t func, void *data) 1811 + /* apply the function to all matching follower ctls in the mixer list */ 1812 + static int map_followers(struct hda_codec *codec, const char * const *followers, 1813 + const char *suffix, map_follower_func_t func, void *data) 1814 1814 { 1815 1815 struct hda_nid_item *items; 1816 1816 const char * const *s; ··· 1821 1821 struct snd_kcontrol *sctl = items[i].kctl; 1822 1822 if (!sctl || sctl->id.iface != SNDRV_CTL_ELEM_IFACE_MIXER) 1823 1823 continue; 1824 - for (s = slaves; *s; s++) { 1824 + for (s = followers; *s; s++) { 1825 1825 char tmpname[sizeof(sctl->id.name)]; 1826 1826 const char *name = *s; 1827 1827 if (suffix) { ··· 1840 1840 return 0; 1841 1841 } 1842 1842 1843 - static int check_slave_present(struct hda_codec *codec, 1844 - void *data, struct snd_kcontrol *sctl) 1843 + static int check_follower_present(struct hda_codec *codec, 1844 + void *data, struct snd_kcontrol *sctl) 1845 1845 { 1846 1846 return 1; 1847 1847 } ··· 1860 1860 return 0; 1861 1861 } 1862 1862 1863 - struct slave_init_arg { 1863 + struct follower_init_arg { 1864 1864 struct hda_codec *codec; 1865 1865 int step; 1866 1866 }; 1867 1867 1868 - /* initialize the slave volume with 0dB via snd_ctl_apply_vmaster_slaves() */ 1869 - static int init_slave_0dB(struct snd_kcontrol *slave, 1870 - struct snd_kcontrol *kctl, 1871 - void *_arg) 1868 + /* initialize the follower volume with 0dB via snd_ctl_apply_vmaster_followers() */ 1869 + static int init_follower_0dB(struct snd_kcontrol *follower, 1870 + struct snd_kcontrol *kctl, 1871 + void *_arg) 1872 1872 { 1873 - struct slave_init_arg *arg = _arg; 1873 + struct follower_init_arg *arg = _arg; 1874 1874 int _tlv[4]; 1875 1875 const int *tlv = NULL; 1876 1876 int step; ··· 1879 1879 if (kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) { 1880 1880 if (kctl->tlv.c != snd_hda_mixer_amp_tlv) { 1881 1881 codec_err(arg->codec, 1882 - "Unexpected TLV callback for slave %s:%d\n", 1882 + "Unexpected TLV callback for follower %s:%d\n", 1883 1883 kctl->id.name, kctl->id.index); 1884 1884 return 0; /* ignore */ 1885 1885 } ··· 1897 1897 return 0; 1898 1898 if (arg->step && arg->step != step) { 1899 1899 codec_err(arg->codec, 1900 - "Mismatching dB step for vmaster slave (%d!=%d)\n", 1900 + "Mismatching dB step for vmaster follower (%d!=%d)\n", 1901 1901 arg->step, step); 1902 1902 return 0; 1903 1903 } ··· 1905 1905 arg->step = step; 1906 1906 val = -tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] / step; 1907 1907 if (val > 0) { 1908 - put_kctl_with_value(slave, val); 1908 + put_kctl_with_value(follower, val); 1909 1909 return val; 1910 1910 } 1911 1911 1912 1912 return 0; 1913 1913 } 1914 1914 1915 - /* unmute the slave via snd_ctl_apply_vmaster_slaves() */ 1916 - static int init_slave_unmute(struct snd_kcontrol *slave, 1917 - struct snd_kcontrol *kctl, 1918 - void *_arg) 1915 + /* unmute the follower via snd_ctl_apply_vmaster_followers() */ 1916 + static int init_follower_unmute(struct snd_kcontrol *follower, 1917 + struct snd_kcontrol *kctl, 1918 + void *_arg) 1919 1919 { 1920 - return put_kctl_with_value(slave, 1); 1920 + return put_kctl_with_value(follower, 1); 1921 1921 } 1922 1922 1923 - static int add_slave(struct hda_codec *codec, 1924 - void *data, struct snd_kcontrol *slave) 1923 + static int add_follower(struct hda_codec *codec, 1924 + void *data, struct snd_kcontrol *follower) 1925 1925 { 1926 - return snd_ctl_add_slave(data, slave); 1926 + return snd_ctl_add_follower(data, follower); 1927 1927 } 1928 1928 1929 1929 /** 1930 - * __snd_hda_add_vmaster - create a virtual master control and add slaves 1930 + * __snd_hda_add_vmaster - create a virtual master control and add followers 1931 1931 * @codec: HD-audio codec 1932 1932 * @name: vmaster control name 1933 1933 * @tlv: TLV data (optional) 1934 - * @slaves: slave control names (optional) 1935 - * @suffix: suffix string to each slave name (optional) 1936 - * @init_slave_vol: initialize slaves to unmute/0dB 1934 + * @followers: follower control names (optional) 1935 + * @suffix: suffix string to each follower name (optional) 1936 + * @init_follower_vol: initialize followers to unmute/0dB 1937 1937 * @ctl_ret: store the vmaster kcontrol in return 1938 1938 * 1939 1939 * Create a virtual master control with the given name. The TLV data 1940 1940 * must be either NULL or a valid data. 1941 1941 * 1942 - * @slaves is a NULL-terminated array of strings, each of which is a 1943 - * slave control name. All controls with these names are assigned to 1942 + * @followers is a NULL-terminated array of strings, each of which is a 1943 + * follower control name. All controls with these names are assigned to 1944 1944 * the new virtual master control. 1945 1945 * 1946 1946 * This function returns zero if successful or a negative error code. 1947 1947 */ 1948 1948 int __snd_hda_add_vmaster(struct hda_codec *codec, char *name, 1949 - unsigned int *tlv, const char * const *slaves, 1950 - const char *suffix, bool init_slave_vol, 1949 + unsigned int *tlv, const char * const *followers, 1950 + const char *suffix, bool init_follower_vol, 1951 1951 struct snd_kcontrol **ctl_ret) 1952 1952 { 1953 1953 struct snd_kcontrol *kctl; ··· 1956 1956 if (ctl_ret) 1957 1957 *ctl_ret = NULL; 1958 1958 1959 - err = map_slaves(codec, slaves, suffix, check_slave_present, NULL); 1959 + err = map_followers(codec, followers, suffix, check_follower_present, NULL); 1960 1960 if (err != 1) { 1961 - codec_dbg(codec, "No slave found for %s\n", name); 1961 + codec_dbg(codec, "No follower found for %s\n", name); 1962 1962 return 0; 1963 1963 } 1964 1964 kctl = snd_ctl_make_virtual_master(name, tlv); ··· 1968 1968 if (err < 0) 1969 1969 return err; 1970 1970 1971 - err = map_slaves(codec, slaves, suffix, add_slave, kctl); 1971 + err = map_followers(codec, followers, suffix, add_follower, kctl); 1972 1972 if (err < 0) 1973 1973 return err; 1974 1974 1975 1975 /* init with master mute & zero volume */ 1976 1976 put_kctl_with_value(kctl, 0); 1977 - if (init_slave_vol) { 1978 - struct slave_init_arg arg = { 1977 + if (init_follower_vol) { 1978 + struct follower_init_arg arg = { 1979 1979 .codec = codec, 1980 1980 .step = 0, 1981 1981 }; 1982 - snd_ctl_apply_vmaster_slaves(kctl, 1983 - tlv ? init_slave_0dB : init_slave_unmute, 1984 - &arg); 1982 + snd_ctl_apply_vmaster_followers(kctl, 1983 + tlv ? init_follower_0dB : init_follower_unmute, 1984 + &arg); 1985 1985 } 1986 1986 1987 1987 if (ctl_ret) ··· 2284 2284 return sbits; 2285 2285 } 2286 2286 2287 - /* set digital convert verbs both for the given NID and its slaves */ 2287 + /* set digital convert verbs both for the given NID and its followers */ 2288 2288 static void set_dig_out(struct hda_codec *codec, hda_nid_t nid, 2289 2289 int mask, int val) 2290 2290 { ··· 2292 2292 2293 2293 snd_hdac_regmap_update(&codec->core, nid, AC_VERB_SET_DIGI_CONVERT_1, 2294 2294 mask, val); 2295 - d = codec->slave_dig_outs; 2295 + d = codec->follower_dig_outs; 2296 2296 if (!d) 2297 2297 return; 2298 2298 for (; *d; d++) ··· 3580 3580 spdif->ctls & ~AC_DIG1_ENABLE & 0xff, 3581 3581 -1); 3582 3582 snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); 3583 - if (codec->slave_dig_outs) { 3583 + if (codec->follower_dig_outs) { 3584 3584 const hda_nid_t *d; 3585 - for (d = codec->slave_dig_outs; *d; d++) 3585 + for (d = codec->follower_dig_outs; *d; d++) 3586 3586 snd_hda_codec_setup_stream(codec, *d, stream_tag, 0, 3587 3587 format); 3588 3588 } ··· 3595 3595 static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid) 3596 3596 { 3597 3597 snd_hda_codec_cleanup_stream(codec, nid); 3598 - if (codec->slave_dig_outs) { 3598 + if (codec->follower_dig_outs) { 3599 3599 const hda_nid_t *d; 3600 - for (d = codec->slave_dig_outs; *d; d++) 3600 + for (d = codec->follower_dig_outs; *d; d++) 3601 3601 snd_hda_codec_cleanup_stream(codec, *d); 3602 3602 } 3603 3603 } ··· 3679 3679 * @hinfo: PCM information to assign 3680 3680 * 3681 3681 * Open analog outputs and set up the hw-constraints. 3682 - * If the digital outputs can be opened as slave, open the digital 3682 + * If the digital outputs can be opened as follower, open the digital 3683 3683 * outputs, too. 3684 3684 */ 3685 3685 int snd_hda_multi_out_analog_open(struct hda_codec *codec,
+10 -10
sound/pci/hda/hda_generic.c
··· 4112 4112 int i, nums; 4113 4113 hda_nid_t dig_nid, pin; 4114 4114 4115 - /* support multiple SPDIFs; the secondary is set up as a slave */ 4115 + /* support multiple SPDIFs; the secondary is set up as a follower */ 4116 4116 nums = 0; 4117 4117 for (i = 0; i < spec->autocfg.dig_outs; i++) { 4118 4118 pin = spec->autocfg.dig_out_pins[i]; ··· 4131 4131 spec->multiout.dig_out_nid = dig_nid; 4132 4132 spec->dig_out_type = spec->autocfg.dig_out_type[0]; 4133 4133 } else { 4134 - spec->multiout.slave_dig_outs = spec->slave_dig_outs; 4135 - if (nums >= ARRAY_SIZE(spec->slave_dig_outs) - 1) 4134 + spec->multiout.follower_dig_outs = spec->follower_dig_outs; 4135 + if (nums >= ARRAY_SIZE(spec->follower_dig_outs) - 1) 4136 4136 break; 4137 - spec->slave_dig_outs[nums - 1] = dig_nid; 4137 + spec->follower_dig_outs[nums - 1] = dig_nid; 4138 4138 } 4139 4139 nums++; 4140 4140 } ··· 4589 4589 else 4590 4590 snd_hda_gen_update_outputs(codec); 4591 4591 4592 - /* sync the whole vmaster slaves to reflect the new auto-mute status */ 4592 + /* sync the whole vmaster followers to reflect the new auto-mute status */ 4593 4593 if (spec->auto_mute_via_amp && !codec->bus->shutdown) 4594 4594 snd_ctl_sync_vmaster(spec->vmaster_mute.sw_kctl, false); 4595 4595 } ··· 5233 5233 * Build control elements 5234 5234 */ 5235 5235 5236 - /* slave controls for virtual master */ 5237 - static const char * const slave_pfxs[] = { 5236 + /* follower controls for virtual master */ 5237 + static const char * const follower_pfxs[] = { 5238 5238 "Front", "Surround", "Center", "LFE", "Side", 5239 5239 "Headphone", "Speaker", "Mono", "Line Out", 5240 5240 "CLFE", "Bass Speaker", "PCM", ··· 5286 5286 if (!spec->no_analog && !spec->suppress_vmaster && 5287 5287 !snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) { 5288 5288 err = snd_hda_add_vmaster(codec, "Master Playback Volume", 5289 - spec->vmaster_tlv, slave_pfxs, 5289 + spec->vmaster_tlv, follower_pfxs, 5290 5290 "Playback Volume"); 5291 5291 if (err < 0) 5292 5292 return err; ··· 5294 5294 if (!spec->no_analog && !spec->suppress_vmaster && 5295 5295 !snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) { 5296 5296 err = __snd_hda_add_vmaster(codec, "Master Playback Switch", 5297 - NULL, slave_pfxs, 5297 + NULL, follower_pfxs, 5298 5298 "Playback Switch", 5299 5299 true, &spec->vmaster_mute.sw_kctl); 5300 5300 if (err < 0) ··· 5809 5809 spec->stream_name_digital); 5810 5810 if (!info) 5811 5811 return -ENOMEM; 5812 - codec->slave_dig_outs = spec->multiout.slave_dig_outs; 5812 + codec->follower_dig_outs = spec->multiout.follower_dig_outs; 5813 5813 spec->pcm_rec[1] = info; 5814 5814 if (spec->dig_out_type) 5815 5815 info->pcm_type = spec->dig_out_type;
+1 -1
sound/pci/hda/hda_generic.h
··· 116 116 * dig_out_nid and hp_nid are optional 117 117 */ 118 118 hda_nid_t alt_dac_nid; 119 - hda_nid_t slave_dig_outs[3]; /* optional - for auto-parsing */ 119 + hda_nid_t follower_dig_outs[3]; /* optional - for auto-parsing */ 120 120 int dig_out_type; 121 121 122 122 /* capture */
+5 -5
sound/pci/hda/hda_local.h
··· 129 129 struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, 130 130 const char *name); 131 131 int __snd_hda_add_vmaster(struct hda_codec *codec, char *name, 132 - unsigned int *tlv, const char * const *slaves, 133 - const char *suffix, bool init_slave_vol, 132 + unsigned int *tlv, const char * const *followers, 133 + const char *suffix, bool init_follower_vol, 134 134 struct snd_kcontrol **ctl_ret); 135 - #define snd_hda_add_vmaster(codec, name, tlv, slaves, suffix) \ 136 - __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) 137 137 int snd_hda_codec_reset(struct hda_codec *codec); 138 138 void snd_hda_codec_register(struct hda_codec *codec); 139 139 void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec); ··· 216 216 hda_nid_t hp_out_nid[HDA_MAX_OUTS]; /* DACs for multiple HPs */ 217 217 hda_nid_t extra_out_nid[HDA_MAX_OUTS]; /* other (e.g. speaker) DACs */ 218 218 hda_nid_t dig_out_nid; /* digital out audio widget */ 219 - const hda_nid_t *slave_dig_outs; 219 + const hda_nid_t *follower_dig_outs; 220 220 int max_channels; /* currently supported analog channels */ 221 221 int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ 222 222 int no_share_stream; /* don't share a stream with multiple pins */
+5 -5
sound/pci/hda/patch_ca0132.c
··· 6245 6245 } 6246 6246 6247 6247 /* 6248 - * Need to create slave controls for the alternate codecs that have surround 6248 + * Need to create follower controls for the alternate codecs that have surround 6249 6249 * capabilities. 6250 6250 */ 6251 - static const char * const ca0132_alt_slave_pfxs[] = { 6251 + static const char * const ca0132_alt_follower_pfxs[] = { 6252 6252 "Front", "Surround", "Center", "LFE", NULL, 6253 6253 }; 6254 6254 ··· 6376 6376 if (err < 0) 6377 6377 return err; 6378 6378 } 6379 - /* Setup vmaster with surround slaves for desktop ca0132 devices */ 6379 + /* Setup vmaster with surround followers for desktop ca0132 devices */ 6380 6380 if (ca0132_use_alt_functions(spec)) { 6381 6381 snd_hda_set_vmaster_tlv(codec, spec->dacs[0], HDA_OUTPUT, 6382 6382 spec->tlv); 6383 6383 snd_hda_add_vmaster(codec, "Master Playback Volume", 6384 - spec->tlv, ca0132_alt_slave_pfxs, 6384 + spec->tlv, ca0132_alt_follower_pfxs, 6385 6385 "Playback Volume"); 6386 6386 err = __snd_hda_add_vmaster(codec, "Master Playback Switch", 6387 - NULL, ca0132_alt_slave_pfxs, 6387 + NULL, ca0132_alt_follower_pfxs, 6388 6388 "Playback Switch", 6389 6389 true, &spec->vmaster_mute.sw_kctl); 6390 6390 if (err < 0)
+1 -1
sound/pci/hda/patch_sigmatel.c
··· 3135 3135 unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin); 3136 3136 3137 3137 /* It was changed in the BIOS to just satisfy MS DTM. 3138 - * Lets turn it back into slaved HP 3138 + * Lets turn it back into follower HP 3139 3139 */ 3140 3140 pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE)) | 3141 3141 (AC_JACK_HP_OUT << AC_DEFCFG_DEVICE_SHIFT);
+10 -10
sound/pci/ice1712/juli.c
··· 397 397 }, 398 398 }; 399 399 400 - static const char * const slave_vols[] = { 400 + static const char * const follower_vols[] = { 401 401 PCM_VOLUME, 402 402 MONITOR_AN_IN_VOLUME, 403 403 MONITOR_DIG_IN_VOLUME, ··· 418 418 return snd_ctl_find_id(card, &sid); 419 419 } 420 420 421 - static void add_slaves(struct snd_card *card, 422 - struct snd_kcontrol *master, 423 - const char * const *list) 421 + static void add_followers(struct snd_card *card, 422 + struct snd_kcontrol *master, 423 + const char * const *list) 424 424 { 425 425 for (; *list; list++) { 426 - struct snd_kcontrol *slave = ctl_find(card, *list); 427 - /* dev_dbg(card->dev, "add_slaves - %s\n", *list); */ 428 - if (slave) { 429 - /* dev_dbg(card->dev, "slave %s found\n", *list); */ 430 - snd_ctl_add_slave(master, slave); 426 + struct snd_kcontrol *follower = ctl_find(card, *list); 427 + /* dev_dbg(card->dev, "add_followers - %s\n", *list); */ 428 + if (follower) { 429 + /* dev_dbg(card->dev, "follower %s found\n", *list); */ 430 + snd_ctl_add_follower(master, follower); 431 431 } 432 432 } 433 433 } ··· 454 454 juli_master_db_scale); 455 455 if (!vmaster) 456 456 return -ENOMEM; 457 - add_slaves(ice->card, vmaster, slave_vols); 457 + add_followers(ice->card, vmaster, follower_vols); 458 458 err = snd_ctl_add(ice->card, vmaster); 459 459 if (err < 0) 460 460 return err;
+7 -7
sound/pci/ice1712/quartet.c
··· 757 757 QTET_CONTROL("Output 3/4 to Monitor 1/2", sw, OUT34_MON12), 758 758 }; 759 759 760 - static const char * const slave_vols[] = { 760 + static const char * const follower_vols[] = { 761 761 PCM_12_PLAYBACK_VOLUME, 762 762 PCM_34_PLAYBACK_VOLUME, 763 763 NULL ··· 776 776 return snd_ctl_find_id(card, &sid); 777 777 } 778 778 779 - static void add_slaves(struct snd_card *card, 780 - struct snd_kcontrol *master, const char * const *list) 779 + static void add_followers(struct snd_card *card, 780 + struct snd_kcontrol *master, const char * const *list) 781 781 { 782 782 for (; *list; list++) { 783 - struct snd_kcontrol *slave = ctl_find(card, *list); 784 - if (slave) 785 - snd_ctl_add_slave(master, slave); 783 + struct snd_kcontrol *follower = ctl_find(card, *list); 784 + if (follower) 785 + snd_ctl_add_follower(master, follower); 786 786 } 787 787 } 788 788 ··· 806 806 qtet_master_db_scale); 807 807 if (!vmaster) 808 808 return -ENOMEM; 809 - add_slaves(ice->card, vmaster, slave_vols); 809 + add_followers(ice->card, vmaster, follower_vols); 810 810 err = snd_ctl_add(ice->card, vmaster); 811 811 if (err < 0) 812 812 return err;
+6 -6
sound/ppc/awacs.c
··· 1063 1063 if (pm5500 || imac || lombard) { 1064 1064 vmaster_sw = snd_ctl_make_virtual_master( 1065 1065 "Master Playback Switch", (unsigned int *) NULL); 1066 - err = snd_ctl_add_slave_uncached(vmaster_sw, 1067 - chip->master_sw_ctl); 1066 + err = snd_ctl_add_follower_uncached(vmaster_sw, 1067 + chip->master_sw_ctl); 1068 1068 if (err < 0) 1069 1069 return err; 1070 - err = snd_ctl_add_slave_uncached(vmaster_sw, 1071 - chip->speaker_sw_ctl); 1070 + err = snd_ctl_add_follower_uncached(vmaster_sw, 1071 + chip->speaker_sw_ctl); 1072 1072 if (err < 0) 1073 1073 return err; 1074 1074 err = snd_ctl_add(chip->card, vmaster_sw); ··· 1076 1076 return err; 1077 1077 vmaster_vol = snd_ctl_make_virtual_master( 1078 1078 "Master Playback Volume", (unsigned int *) NULL); 1079 - err = snd_ctl_add_slave(vmaster_vol, master_vol); 1079 + err = snd_ctl_add_follower(vmaster_vol, master_vol); 1080 1080 if (err < 0) 1081 1081 return err; 1082 - err = snd_ctl_add_slave(vmaster_vol, speaker_vol); 1082 + err = snd_ctl_add_follower(vmaster_vol, speaker_vol); 1083 1083 if (err < 0) 1084 1084 return err; 1085 1085 err = snd_ctl_add(chip->card, vmaster_vol);
+1 -1
sound/usb/6fire/control.c
··· 539 539 ret = snd_ctl_add(card, control); 540 540 if (ret < 0) 541 541 return ret; 542 - ret = snd_ctl_add_slave(vmaster, control); 542 + ret = snd_ctl_add_follower(vmaster, control); 543 543 if (ret < 0) 544 544 return ret; 545 545 i++;