• Home
  • Raw
  • Download

Lines Matching full:master

3  * Virtual master and follower controls
24 * link master - this contains a list of follower controls that are
28 * The master control is so far only mono volume/switch for simplicity.
34 int val; /* the master value */
44 * master control. A follower may have either one or two channels.
49 struct link_master *master; member
114 /* initialize master volume */
115 static int master_init(struct link_master *master) in master_init() argument
119 if (master->info.count) in master_init()
122 list_for_each_entry(follower, &master->followers, list) { in master_init()
126 master->info = follower->info; in master_init()
127 master->info.count = 1; /* always mono */ in master_init()
129 master->val = master->info.max_val; in master_init()
130 if (master->hook) in master_init()
131 master->hook(master->hook_private_data, master->val); in master_init()
155 err = master_init(follower->master); in follower_put_val()
163 !!follower->master->val; in follower_put_val()
167 /* max master volume is supposed to be 0 dB */ in follower_put_val()
169 vol += follower->master->val - follower->master->info.max_val; in follower_put_val()
235 if (follower->master) in follower_free()
241 * Add a follower control to the group with the given master control
250 * - master can only attenuate the volume, no gain
252 int _snd_ctl_add_follower(struct snd_kcontrol *master, in _snd_ctl_add_follower() argument
256 struct link_master *master_link = snd_kcontrol_chip(master); in _snd_ctl_add_follower()
266 srec->master = master_link; in _snd_ctl_add_follower()
284 * ctl callbacks for master controls
289 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_info() local
292 ret = master_init(master); in master_info()
295 uinfo->type = master->info.type; in master_info()
296 uinfo->count = master->info.count; in master_info()
297 uinfo->value.integer.min = master->info.min_val; in master_info()
298 uinfo->value.integer.max = master->info.max_val; in master_info()
305 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_get() local
306 int err = master_init(master); in master_get()
309 ucontrol->value.integer.value[0] = master->val; in master_get()
313 static int sync_followers(struct link_master *master, int old_val, int new_val) in sync_followers() argument
321 list_for_each_entry(follower, &master->followers, list) { in sync_followers()
322 master->val = old_val; in sync_followers()
325 master->val = new_val; in sync_followers()
335 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_put() local
339 err = master_init(master); in master_put()
343 old_val = master->val; in master_put()
348 err = sync_followers(master, old_val, new_val); in master_put()
351 if (master->hook && !first_init) in master_put()
352 master->hook(master->hook_private_data, master->val); in master_put()
358 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_free() local
362 list_for_each_entry_safe(follower, n, &master->followers, list) { in master_free()
371 kfree(master); in master_free()
376 * snd_ctl_make_virtual_master - Create a virtual master control
380 * Creates a virtual master control with the given name string.
386 * for dB scale of the master control. It should be a single element
395 struct link_master *master; in snd_ctl_make_virtual_master() local
404 master = kzalloc(sizeof(*master), GFP_KERNEL); in snd_ctl_make_virtual_master()
405 if (!master) in snd_ctl_make_virtual_master()
407 INIT_LIST_HEAD(&master->followers); in snd_ctl_make_virtual_master()
409 kctl = snd_ctl_new1(&knew, master); in snd_ctl_make_virtual_master()
411 kfree(master); in snd_ctl_make_virtual_master()
427 memcpy(master->tlv, tlv, sizeof(master->tlv)); in snd_ctl_make_virtual_master()
428 kctl->tlv.p = master->tlv; in snd_ctl_make_virtual_master()
451 struct link_master *master = snd_kcontrol_chip(kcontrol); in snd_ctl_add_vmaster_hook() local
452 master->hook = hook; in snd_ctl_add_vmaster_hook()
453 master->hook_private_data = private_data; in snd_ctl_add_vmaster_hook()
469 struct link_master *master; in snd_ctl_sync_vmaster() local
474 master = snd_kcontrol_chip(kcontrol); in snd_ctl_sync_vmaster()
476 int err = master_init(master); in snd_ctl_sync_vmaster()
480 err = sync_followers(master, master->val, master->val); in snd_ctl_sync_vmaster()
485 if (master->hook && !first_init) in snd_ctl_sync_vmaster()
486 master->hook(master->hook_private_data, master->val); in snd_ctl_sync_vmaster()
505 struct link_master *master; in snd_ctl_apply_vmaster_followers() local
509 master = snd_kcontrol_chip(kctl); in snd_ctl_apply_vmaster_followers()
510 err = master_init(master); in snd_ctl_apply_vmaster_followers()
513 list_for_each_entry(follower, &master->followers, list) { in snd_ctl_apply_vmaster_followers()