Lines Matching refs:loopback
129 struct loopback { struct
139 struct loopback *loopback; argument
193 return &dpcm->loopback->setup[dpcm->substream->number][device]; in get_setup()
350 card = cable->streams[SNDRV_PCM_STREAM_PLAYBACK]->loopback->card; in loopback_check_format()
372 snd_ctl_notify(dpcm->loopback->card, in loopback_active_notify()
488 mutex_lock(&dpcm->loopback->cable_lock); in loopback_prepare()
494 mutex_unlock(&dpcm->loopback->cable_lock); in loopback_prepare()
913 mutex_lock(&dpcm->loopback->cable_lock); in loopback_hw_free()
915 mutex_unlock(&dpcm->loopback->cable_lock); in loopback_hw_free()
935 mutex_lock(&dpcm->loopback->cable_lock); in rule_format()
938 mutex_unlock(&dpcm->loopback->cable_lock); in rule_format()
949 mutex_lock(&dpcm->loopback->cable_lock); in rule_rate()
952 mutex_unlock(&dpcm->loopback->cable_lock); in rule_rate()
965 mutex_lock(&dpcm->loopback->cable_lock); in rule_channels()
968 mutex_unlock(&dpcm->loopback->cable_lock); in rule_channels()
981 mutex_lock(&dpcm->loopback->cable_lock); in rule_period_bytes()
984 mutex_unlock(&dpcm->loopback->cable_lock); in rule_period_bytes()
993 struct loopback *loopback = substream->private_data; in free_cable() local
997 cable = loopback->cables[substream->number][dev]; in free_cable()
1011 loopback->cables[substream->number][dev] = NULL; in free_cable()
1110 err = loopback_parse_timer_id(dpcm->loopback->timer_source, &tid); in loopback_snd_timer_open()
1114 dpcm->loopback->timer_source, err); in loopback_snd_timer_open()
1121 timeri = snd_timer_instance_new(dpcm->loopback->card->id); in loopback_snd_timer_open()
1185 struct loopback *loopback = substream->private_data; in loopback_open() local
1191 mutex_lock(&loopback->cable_lock); in loopback_open()
1197 dpcm->loopback = loopback; in loopback_open()
1200 cable = loopback->cables[substream->number][dev]; in loopback_open()
1209 if (loopback->timer_source) in loopback_open()
1213 loopback->cables[substream->number][dev] = cable; in loopback_open()
1279 mutex_unlock(&loopback->cable_lock); in loopback_open()
1285 struct loopback *loopback = substream->private_data; in loopback_close() local
1291 mutex_lock(&loopback->cable_lock); in loopback_close()
1293 mutex_unlock(&loopback->cable_lock); in loopback_close()
1306 static int loopback_pcm_new(struct loopback *loopback, in loopback_pcm_new() argument
1312 err = snd_pcm_new(loopback->card, "Loopback PCM", device, in loopback_pcm_new()
1320 pcm->private_data = loopback; in loopback_pcm_new()
1324 loopback->pcm[device] = pcm; in loopback_pcm_new()
1342 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_rate_shift_get() local
1344 mutex_lock(&loopback->cable_lock); in loopback_rate_shift_get()
1346 loopback->setup[kcontrol->id.subdevice] in loopback_rate_shift_get()
1348 mutex_unlock(&loopback->cable_lock); in loopback_rate_shift_get()
1355 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_rate_shift_put() local
1364 mutex_lock(&loopback->cable_lock); in loopback_rate_shift_put()
1365 if (val != loopback->setup[kcontrol->id.subdevice] in loopback_rate_shift_put()
1367 loopback->setup[kcontrol->id.subdevice] in loopback_rate_shift_put()
1371 mutex_unlock(&loopback->cable_lock); in loopback_rate_shift_put()
1378 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_notify_get() local
1380 mutex_lock(&loopback->cable_lock); in loopback_notify_get()
1382 loopback->setup[kcontrol->id.subdevice] in loopback_notify_get()
1384 mutex_unlock(&loopback->cable_lock); in loopback_notify_get()
1391 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_notify_put() local
1396 mutex_lock(&loopback->cable_lock); in loopback_notify_put()
1397 if (val != loopback->setup[kcontrol->id.subdevice] in loopback_notify_put()
1399 loopback->setup[kcontrol->id.subdevice] in loopback_notify_put()
1403 mutex_unlock(&loopback->cable_lock); in loopback_notify_put()
1410 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_active_get() local
1415 mutex_lock(&loopback->cable_lock); in loopback_active_get()
1416 cable = loopback->cables[kcontrol->id.subdevice][kcontrol->id.device ^ 1]; in loopback_active_get()
1422 mutex_unlock(&loopback->cable_lock); in loopback_active_get()
1441 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_format_get() local
1444 (__force int)loopback->setup[kcontrol->id.subdevice] in loopback_format_get()
1463 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_rate_get() local
1465 mutex_lock(&loopback->cable_lock); in loopback_rate_get()
1467 loopback->setup[kcontrol->id.subdevice] in loopback_rate_get()
1469 mutex_unlock(&loopback->cable_lock); in loopback_rate_get()
1487 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_channels_get() local
1489 mutex_lock(&loopback->cable_lock); in loopback_channels_get()
1491 loopback->setup[kcontrol->id.subdevice] in loopback_channels_get()
1493 mutex_unlock(&loopback->cable_lock); in loopback_channels_get()
1546 static int loopback_mixer_new(struct loopback *loopback, int notify) in loopback_mixer_new() argument
1548 struct snd_card *card = loopback->card; in loopback_mixer_new()
1556 pcm = loopback->pcm[dev]; in loopback_mixer_new()
1560 setup = &loopback->setup[substr][dev]; in loopback_mixer_new()
1569 loopback); in loopback_mixer_new()
1625 struct loopback *loopback, in print_substream_info() argument
1629 struct loopback_cable *cable = loopback->cables[sub][num]; in print_substream_info()
1646 struct loopback *loopback = entry->private_data; in print_cable_info() local
1649 mutex_lock(&loopback->cable_lock); in print_cable_info()
1653 print_substream_info(buffer, loopback, sub, num); in print_cable_info()
1654 mutex_unlock(&loopback->cable_lock); in print_cable_info()
1657 static int loopback_cable_proc_new(struct loopback *loopback, int cidx) in loopback_cable_proc_new() argument
1662 return snd_card_ro_proc_new(loopback->card, name, loopback, in loopback_cable_proc_new()
1666 static void loopback_set_timer_source(struct loopback *loopback, in loopback_set_timer_source() argument
1669 if (loopback->timer_source) { in loopback_set_timer_source()
1670 devm_kfree(loopback->card->dev, loopback->timer_source); in loopback_set_timer_source()
1671 loopback->timer_source = NULL; in loopback_set_timer_source()
1674 loopback->timer_source = devm_kstrdup(loopback->card->dev, in loopback_set_timer_source()
1681 struct loopback *loopback = entry->private_data; in print_timer_source_info() local
1683 mutex_lock(&loopback->cable_lock); in print_timer_source_info()
1685 loopback->timer_source ? loopback->timer_source : ""); in print_timer_source_info()
1686 mutex_unlock(&loopback->cable_lock); in print_timer_source_info()
1692 struct loopback *loopback = entry->private_data; in change_timer_source_info() local
1695 mutex_lock(&loopback->cable_lock); in change_timer_source_info()
1697 loopback_set_timer_source(loopback, strim(line)); in change_timer_source_info()
1698 mutex_unlock(&loopback->cable_lock); in change_timer_source_info()
1701 static int loopback_timer_source_proc_new(struct loopback *loopback) in loopback_timer_source_proc_new() argument
1703 return snd_card_rw_proc_new(loopback->card, "timer_source", loopback, in loopback_timer_source_proc_new()
1711 struct loopback *loopback; in loopback_probe() local
1716 sizeof(struct loopback), &card); in loopback_probe()
1719 loopback = card->private_data; in loopback_probe()
1726 loopback->card = card; in loopback_probe()
1727 loopback_set_timer_source(loopback, timer_source[dev]); in loopback_probe()
1729 mutex_init(&loopback->cable_lock); in loopback_probe()
1731 err = loopback_pcm_new(loopback, 0, pcm_substreams[dev]); in loopback_probe()
1734 err = loopback_pcm_new(loopback, 1, pcm_substreams[dev]); in loopback_probe()
1737 err = loopback_mixer_new(loopback, pcm_notify[dev] ? 1 : 0); in loopback_probe()
1740 loopback_cable_proc_new(loopback, 0); in loopback_probe()
1741 loopback_cable_proc_new(loopback, 1); in loopback_probe()
1742 loopback_timer_source_proc_new(loopback); in loopback_probe()