Lines Matching refs:jack_kctl
67 struct snd_jack_kctl *jack_kctl, *tmp_jack_kctl; in snd_jack_dev_free() local
69 list_for_each_entry_safe(jack_kctl, tmp_jack_kctl, &jack->kctl_list, list) { in snd_jack_dev_free()
70 list_del_init(&jack_kctl->list); in snd_jack_dev_free()
71 snd_ctl_remove(card, jack_kctl->kctl); in snd_jack_dev_free()
130 static void snd_jack_inject_report(struct snd_jack_kctl *jack_kctl, int status) in snd_jack_inject_report() argument
136 if (!jack_kctl) in snd_jack_inject_report()
139 jack = jack_kctl->jack; in snd_jack_inject_report()
141 if (jack_kctl->sw_inject_enable) in snd_jack_inject_report()
142 snd_kctl_jack_report(jack->card, jack_kctl->kctl, in snd_jack_inject_report()
143 status & jack_kctl->mask_bits); in snd_jack_inject_report()
150 int testbit = ((SND_JACK_BTN_0 >> i) & jack_kctl->mask_bits); in snd_jack_inject_report()
158 int testbit = ((1 << i) & jack_kctl->mask_bits); in snd_jack_inject_report()
173 struct snd_jack_kctl *jack_kctl = file->private_data; in sw_inject_enable_read() local
177 len = scnprintf(buf, sizeof(buf), "%s: %s\t\t%s: %i\n", "Jack", jack_kctl->kctl->id.name, in sw_inject_enable_read()
178 "Inject Enabled", jack_kctl->sw_inject_enable); in sw_inject_enable_read()
187 struct snd_jack_kctl *jack_kctl = file->private_data; in sw_inject_enable_write() local
197 if (jack_kctl->sw_inject_enable == (!!enable)) in sw_inject_enable_write()
200 jack_kctl->sw_inject_enable = !!enable; in sw_inject_enable_write()
202 if (!jack_kctl->sw_inject_enable) in sw_inject_enable_write()
203 snd_jack_report(jack_kctl->jack, jack_kctl->jack->hw_status_cache); in sw_inject_enable_write()
211 struct snd_jack_kctl *jack_kctl = file->private_data; in jackin_inject_write() local
216 if (!jack_kctl->sw_inject_enable) in jackin_inject_write()
224 snd_jack_inject_report(jack_kctl, !!enable ? jack_kctl->mask_bits : 0); in jackin_inject_write()
232 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_kctl_id_read() local
236 len = scnprintf(buf, sizeof(buf), "%s\n", jack_kctl->kctl->id.name); in jack_kctl_id_read()
270 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_kctl_mask_bits_read() local
274 len = parse_mask_bits(jack_kctl->mask_bits, buf, sizeof(buf)); in jack_kctl_mask_bits_read()
283 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_kctl_status_read() local
287 len = scnprintf(buf, sizeof(buf), "%s\n", jack_kctl->kctl->private_value ? in jack_kctl_status_read()
298 struct snd_jack_kctl *jack_kctl = file->private_data; in jack_type_read() local
302 len = parse_mask_bits(jack_kctl->jack->type, buf, sizeof(buf)); in jack_type_read()
347 struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_add_inject_node() argument
353 if (strstr(jack_kctl->kctl->id.name, "Phantom")) in snd_jack_debugfs_add_inject_node()
356 tname = kstrdup(jack_kctl->kctl->id.name, GFP_KERNEL); in snd_jack_debugfs_add_inject_node()
365 jack_kctl->jack_debugfs_root = debugfs_create_dir(tname, jack->card->debugfs_root); in snd_jack_debugfs_add_inject_node()
368 debugfs_create_file("sw_inject_enable", 0644, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
371 debugfs_create_file("jackin_inject", 0200, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
374 debugfs_create_file("kctl_id", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
377 debugfs_create_file("mask_bits", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
380 debugfs_create_file("status", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
384 debugfs_create_file("type", 0444, jack_kctl->jack_debugfs_root, jack_kctl, in snd_jack_debugfs_add_inject_node()
390 static void snd_jack_debugfs_clear_inject_node(struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_clear_inject_node() argument
392 debugfs_remove(jack_kctl->jack_debugfs_root); in snd_jack_debugfs_clear_inject_node()
393 jack_kctl->jack_debugfs_root = NULL; in snd_jack_debugfs_clear_inject_node()
397 struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_add_inject_node() argument
402 static void snd_jack_debugfs_clear_inject_node(struct snd_jack_kctl *jack_kctl) in snd_jack_debugfs_clear_inject_node() argument
409 struct snd_jack_kctl *jack_kctl; in snd_jack_kctl_private_free() local
411 jack_kctl = kctl->private_data; in snd_jack_kctl_private_free()
412 if (jack_kctl) { in snd_jack_kctl_private_free()
413 snd_jack_debugfs_clear_inject_node(jack_kctl); in snd_jack_kctl_private_free()
414 list_del(&jack_kctl->list); in snd_jack_kctl_private_free()
415 kfree(jack_kctl); in snd_jack_kctl_private_free()
419 static void snd_jack_kctl_add(struct snd_jack *jack, struct snd_jack_kctl *jack_kctl) in snd_jack_kctl_add() argument
421 jack_kctl->jack = jack; in snd_jack_kctl_add()
422 list_add_tail(&jack_kctl->list, &jack->kctl_list); in snd_jack_kctl_add()
423 snd_jack_debugfs_add_inject_node(jack, jack_kctl); in snd_jack_kctl_add()
429 struct snd_jack_kctl *jack_kctl; in snd_jack_kctl_new() local
440 jack_kctl = kzalloc(sizeof(*jack_kctl), GFP_KERNEL); in snd_jack_kctl_new()
442 if (!jack_kctl) in snd_jack_kctl_new()
445 jack_kctl->kctl = kctl; in snd_jack_kctl_new()
446 jack_kctl->mask_bits = mask; in snd_jack_kctl_new()
448 kctl->private_data = jack_kctl; in snd_jack_kctl_new()
451 return jack_kctl; in snd_jack_kctl_new()
470 struct snd_jack_kctl *jack_kctl; in snd_jack_add_new_kctl() local
472 jack_kctl = snd_jack_kctl_new(jack->card, name, mask); in snd_jack_add_new_kctl()
473 if (!jack_kctl) in snd_jack_add_new_kctl()
476 snd_jack_kctl_add(jack, jack_kctl); in snd_jack_add_new_kctl()
500 struct snd_jack_kctl *jack_kctl = NULL; in snd_jack_new() local
511 jack_kctl = snd_jack_kctl_new(card, id, type); in snd_jack_new()
512 if (!jack_kctl) in snd_jack_new()
559 snd_jack_kctl_add(jack, jack_kctl); in snd_jack_new()
652 struct snd_jack_kctl *jack_kctl; in snd_jack_report() local
664 list_for_each_entry(jack_kctl, &jack->kctl_list, list) in snd_jack_report()
665 if (jack_kctl->sw_inject_enable) in snd_jack_report()
666 mask_bits |= jack_kctl->mask_bits; in snd_jack_report()
668 snd_kctl_jack_report(jack->card, jack_kctl->kctl, in snd_jack_report()
669 status & jack_kctl->mask_bits); in snd_jack_report()