Lines Matching refs:master

49 	struct link_master *master;  member
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()
169 vol += follower->master->val - follower->master->info.max_val; in follower_put_val()
235 if (follower->master) in follower_free()
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()
292 int snd_ctl_add_followers(struct snd_card *card, struct snd_kcontrol *master, in snd_ctl_add_followers() argument
301 err = snd_ctl_add_follower(master, follower); in snd_ctl_add_followers()
317 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_info() local
320 ret = master_init(master); in master_info()
323 uinfo->type = master->info.type; in master_info()
324 uinfo->count = master->info.count; in master_info()
325 uinfo->value.integer.min = master->info.min_val; in master_info()
326 uinfo->value.integer.max = master->info.max_val; in master_info()
333 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_get() local
334 int err = master_init(master); in master_get()
337 ucontrol->value.integer.value[0] = master->val; in master_get()
341 static int sync_followers(struct link_master *master, int old_val, int new_val) in sync_followers() argument
349 list_for_each_entry(follower, &master->followers, list) { in sync_followers()
350 master->val = old_val; in sync_followers()
353 master->val = new_val; in sync_followers()
363 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_put() local
367 err = master_init(master); in master_put()
371 old_val = master->val; in master_put()
376 err = sync_followers(master, old_val, new_val); in master_put()
379 if (master->hook && !first_init) in master_put()
380 master->hook(master->hook_private_data, master->val); in master_put()
386 struct link_master *master = snd_kcontrol_chip(kcontrol); in master_free() local
390 list_for_each_entry_safe(follower, n, &master->followers, list) { in master_free()
399 kfree(master); in master_free()
423 struct link_master *master; in snd_ctl_make_virtual_master() local
432 master = kzalloc(sizeof(*master), GFP_KERNEL); in snd_ctl_make_virtual_master()
433 if (!master) in snd_ctl_make_virtual_master()
435 INIT_LIST_HEAD(&master->followers); in snd_ctl_make_virtual_master()
437 kctl = snd_ctl_new1(&knew, master); in snd_ctl_make_virtual_master()
439 kfree(master); in snd_ctl_make_virtual_master()
455 memcpy(master->tlv, tlv, sizeof(master->tlv)); in snd_ctl_make_virtual_master()
456 kctl->tlv.p = master->tlv; in snd_ctl_make_virtual_master()
479 struct link_master *master = snd_kcontrol_chip(kcontrol); in snd_ctl_add_vmaster_hook() local
480 master->hook = hook; in snd_ctl_add_vmaster_hook()
481 master->hook_private_data = private_data; in snd_ctl_add_vmaster_hook()
497 struct link_master *master; in snd_ctl_sync_vmaster() local
502 master = snd_kcontrol_chip(kcontrol); in snd_ctl_sync_vmaster()
504 int err = master_init(master); in snd_ctl_sync_vmaster()
508 err = sync_followers(master, master->val, master->val); in snd_ctl_sync_vmaster()
513 if (master->hook && !first_init) in snd_ctl_sync_vmaster()
514 master->hook(master->hook_private_data, master->val); in snd_ctl_sync_vmaster()
534 struct link_master *master; in snd_ctl_apply_vmaster_followers() local
538 master = snd_kcontrol_chip(kctl); in snd_ctl_apply_vmaster_followers()
539 err = master_init(master); in snd_ctl_apply_vmaster_followers()
542 list_for_each_entry(follower, &master->followers, list) { in snd_ctl_apply_vmaster_followers()