Lines Matching refs:jack_kctl

67 	struct snd_jack_kctl *jack_kctl, *tmp_jack_kctl;  in snd_jack_dev_free()  local
70 list_for_each_entry_safe(jack_kctl, tmp_jack_kctl, &jack->kctl_list, list) { in snd_jack_dev_free()
71 list_del_init(&jack_kctl->list); in snd_jack_dev_free()
72 snd_ctl_remove(card, jack_kctl->kctl); in snd_jack_dev_free()
132 static void snd_jack_inject_report(struct snd_jack_kctl *jack_kctl, int status) in snd_jack_inject_report() argument
138 if (!jack_kctl) in snd_jack_inject_report()
141 jack = jack_kctl->jack; in snd_jack_inject_report()
143 if (jack_kctl->sw_inject_enable) in snd_jack_inject_report()
144 snd_kctl_jack_report(jack->card, jack_kctl->kctl, in snd_jack_inject_report()
145 status & jack_kctl->mask_bits); in snd_jack_inject_report()
152 int testbit = ((SND_JACK_BTN_0 >> i) & jack_kctl->mask_bits); in snd_jack_inject_report()
160 int testbit = ((1 << i) & jack_kctl->mask_bits); in snd_jack_inject_report()
175 struct snd_jack_kctl *jack_kctl = file->private_data; in sw_inject_enable_read() local
179 len = scnprintf(buf, sizeof(buf), "%s: %s\t\t%s: %i\n", "Jack", jack_kctl->kctl->id.name, in sw_inject_enable_read()
180 "Inject Enabled", jack_kctl->sw_inject_enable); in sw_inject_enable_read()
189 struct snd_jack_kctl *jack_kctl = file->private_data; in sw_inject_enable_write() local
199 if (jack_kctl->sw_inject_enable == (!!enable)) in sw_inject_enable_write()
202 jack_kctl->sw_inject_enable = !!enable; in sw_inject_enable_write()
204 if (!jack_kctl->sw_inject_enable) in sw_inject_enable_write()
205 snd_jack_report(jack_kctl->jack, jack_kctl->jack->hw_status_cache); in sw_inject_enable_write()
213 struct snd_jack_kctl *jack_kctl = file->private_data; in jackin_inject_write() local
218 if (!jack_kctl->sw_inject_enable) in jackin_inject_write()
226 snd_jack_inject_report(jack_kctl, !!enable ? jack_kctl->mask_bits : 0); in jackin_inject_write()
234 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_kctl_id_read() local
238 len = scnprintf(buf, sizeof(buf), "%s\n", jack_kctl->kctl->id.name); in jack_kctl_id_read()
272 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_kctl_mask_bits_read() local
276 len = parse_mask_bits(jack_kctl->mask_bits, buf, sizeof(buf)); in jack_kctl_mask_bits_read()
285 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_kctl_status_read() local
289 len = scnprintf(buf, sizeof(buf), "%s\n", jack_kctl->kctl->private_value ? in jack_kctl_status_read()
300 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_type_read() local
304 len = parse_mask_bits(jack_kctl->jack->type, buf, sizeof(buf)); in jack_type_read()
349 struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_add_inject_node() argument
355 if (strstr(jack_kctl->kctl->id.name, "Phantom")) in snd_jack_debugfs_add_inject_node()
358 tname = kstrdup(jack_kctl->kctl->id.name, GFP_KERNEL); in snd_jack_debugfs_add_inject_node()
367 jack_kctl->jack_debugfs_root = debugfs_create_dir(tname, jack->card->debugfs_root); in snd_jack_debugfs_add_inject_node()
370 debugfs_create_file("sw_inject_enable", 0644, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
373 debugfs_create_file("jackin_inject", 0200, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
376 debugfs_create_file("kctl_id", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
379 debugfs_create_file("mask_bits", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
382 debugfs_create_file("status", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
386 debugfs_create_file("type", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
392 static void snd_jack_debugfs_clear_inject_node(struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_clear_inject_node() argument
394 debugfs_remove(jack_kctl->jack_debugfs_root); in snd_jack_debugfs_clear_inject_node()
395 jack_kctl->jack_debugfs_root = NULL; in snd_jack_debugfs_clear_inject_node()
399 struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_add_inject_node() argument
404 static void snd_jack_debugfs_clear_inject_node(struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_clear_inject_node() argument
411 struct snd_jack_kctl *jack_kctl; in snd_jack_kctl_private_free() local
413 jack_kctl = kctl->private_data; in snd_jack_kctl_private_free()
414 if (jack_kctl) { in snd_jack_kctl_private_free()
415 snd_jack_debugfs_clear_inject_node(jack_kctl); in snd_jack_kctl_private_free()
416 list_del(&jack_kctl->list); in snd_jack_kctl_private_free()
417 kfree(jack_kctl); in snd_jack_kctl_private_free()
421 static void snd_jack_kctl_add(struct snd_jack *jack, struct snd_jack_kctl *jack_kctl) in snd_jack_kctl_add() argument
423 jack_kctl->jack = jack; in snd_jack_kctl_add()
424 list_add_tail(&jack_kctl->list, &jack->kctl_list); in snd_jack_kctl_add()
425 snd_jack_debugfs_add_inject_node(jack, jack_kctl); in snd_jack_kctl_add()
431 struct snd_jack_kctl *jack_kctl; in snd_jack_kctl_new() local
442 jack_kctl = kzalloc(sizeof(*jack_kctl), GFP_KERNEL); in snd_jack_kctl_new()
444 if (!jack_kctl) in snd_jack_kctl_new()
447 jack_kctl->kctl = kctl; in snd_jack_kctl_new()
448 jack_kctl->mask_bits = mask; in snd_jack_kctl_new()
450 kctl->private_data = jack_kctl; in snd_jack_kctl_new()
453 return jack_kctl; in snd_jack_kctl_new()
472 struct snd_jack_kctl *jack_kctl; in snd_jack_add_new_kctl() local
474 jack_kctl = snd_jack_kctl_new(jack->card, name, mask); in snd_jack_add_new_kctl()
475 if (!jack_kctl) in snd_jack_add_new_kctl()
478 snd_jack_kctl_add(jack, jack_kctl); in snd_jack_add_new_kctl()
502 struct snd_jack_kctl *jack_kctl = NULL; in snd_jack_new() local
513 jack_kctl = snd_jack_kctl_new(card, id, type); in snd_jack_new()
514 if (!jack_kctl) in snd_jack_new()
561 snd_jack_kctl_add(jack, jack_kctl); in snd_jack_new()
654 struct snd_jack_kctl *jack_kctl; in snd_jack_report() local
665 list_for_each_entry(jack_kctl, &jack->kctl_list, list) in snd_jack_report()
666 if (jack_kctl->sw_inject_enable) in snd_jack_report()
667 mask_bits |= jack_kctl->mask_bits; in snd_jack_report()
669 snd_kctl_jack_report(jack->card, jack_kctl->kctl, in snd_jack_report()
670 status & jack_kctl->mask_bits); in snd_jack_report()