Lines Matching refs:loopback

129 struct loopback {  struct
139 struct loopback *loopback; member
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()
914 mutex_lock(&dpcm->loopback->cable_lock); in loopback_hw_free()
916 mutex_unlock(&dpcm->loopback->cable_lock); in loopback_hw_free()
936 mutex_lock(&dpcm->loopback->cable_lock); in rule_format()
939 mutex_unlock(&dpcm->loopback->cable_lock); in rule_format()
950 mutex_lock(&dpcm->loopback->cable_lock); in rule_rate()
953 mutex_unlock(&dpcm->loopback->cable_lock); in rule_rate()
966 mutex_lock(&dpcm->loopback->cable_lock); in rule_channels()
969 mutex_unlock(&dpcm->loopback->cable_lock); in rule_channels()
982 mutex_lock(&dpcm->loopback->cable_lock); in rule_period_bytes()
985 mutex_unlock(&dpcm->loopback->cable_lock); in rule_period_bytes()
994 struct loopback *loopback = substream->private_data; in free_cable() local
998 cable = loopback->cables[substream->number][dev]; in free_cable()
1012 loopback->cables[substream->number][dev] = NULL; in free_cable()
1111 err = loopback_parse_timer_id(dpcm->loopback->timer_source, &tid); in loopback_snd_timer_open()
1115 dpcm->loopback->timer_source, err); in loopback_snd_timer_open()
1122 timeri = snd_timer_instance_new(dpcm->loopback->card->id); in loopback_snd_timer_open()
1186 struct loopback *loopback = substream->private_data; in loopback_open() local
1192 mutex_lock(&loopback->cable_lock); in loopback_open()
1198 dpcm->loopback = loopback; in loopback_open()
1201 cable = loopback->cables[substream->number][dev]; in loopback_open()
1210 if (loopback->timer_source) in loopback_open()
1214 loopback->cables[substream->number][dev] = cable; in loopback_open()
1280 mutex_unlock(&loopback->cable_lock); in loopback_open()
1286 struct loopback *loopback = substream->private_data; in loopback_close() local
1292 mutex_lock(&loopback->cable_lock); in loopback_close()
1294 mutex_unlock(&loopback->cable_lock); in loopback_close()
1307 static int loopback_pcm_new(struct loopback *loopback, in loopback_pcm_new() argument
1313 err = snd_pcm_new(loopback->card, "Loopback PCM", device, in loopback_pcm_new()
1321 pcm->private_data = loopback; in loopback_pcm_new()
1325 loopback->pcm[device] = pcm; in loopback_pcm_new()
1343 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_rate_shift_get() local
1345 mutex_lock(&loopback->cable_lock); in loopback_rate_shift_get()
1347 loopback->setup[kcontrol->id.subdevice] in loopback_rate_shift_get()
1349 mutex_unlock(&loopback->cable_lock); in loopback_rate_shift_get()
1356 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_rate_shift_put() local
1365 mutex_lock(&loopback->cable_lock); in loopback_rate_shift_put()
1366 if (val != loopback->setup[kcontrol->id.subdevice] in loopback_rate_shift_put()
1368 loopback->setup[kcontrol->id.subdevice] in loopback_rate_shift_put()
1372 mutex_unlock(&loopback->cable_lock); in loopback_rate_shift_put()
1379 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_notify_get() local
1381 mutex_lock(&loopback->cable_lock); in loopback_notify_get()
1383 loopback->setup[kcontrol->id.subdevice] in loopback_notify_get()
1385 mutex_unlock(&loopback->cable_lock); in loopback_notify_get()
1392 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_notify_put() local
1397 mutex_lock(&loopback->cable_lock); in loopback_notify_put()
1398 if (val != loopback->setup[kcontrol->id.subdevice] in loopback_notify_put()
1400 loopback->setup[kcontrol->id.subdevice] in loopback_notify_put()
1404 mutex_unlock(&loopback->cable_lock); in loopback_notify_put()
1411 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_active_get() local
1416 mutex_lock(&loopback->cable_lock); in loopback_active_get()
1417 cable = loopback->cables[kcontrol->id.subdevice][kcontrol->id.device ^ 1]; in loopback_active_get()
1423 mutex_unlock(&loopback->cable_lock); in loopback_active_get()
1442 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_format_get() local
1445 (__force int)loopback->setup[kcontrol->id.subdevice] in loopback_format_get()
1464 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_rate_get() local
1466 mutex_lock(&loopback->cable_lock); in loopback_rate_get()
1468 loopback->setup[kcontrol->id.subdevice] in loopback_rate_get()
1470 mutex_unlock(&loopback->cable_lock); in loopback_rate_get()
1488 struct loopback *loopback = snd_kcontrol_chip(kcontrol); in loopback_channels_get() local
1490 mutex_lock(&loopback->cable_lock); in loopback_channels_get()
1492 loopback->setup[kcontrol->id.subdevice] in loopback_channels_get()
1494 mutex_unlock(&loopback->cable_lock); in loopback_channels_get()
1547 static int loopback_mixer_new(struct loopback *loopback, int notify) in loopback_mixer_new() argument
1549 struct snd_card *card = loopback->card; in loopback_mixer_new()
1557 pcm = loopback->pcm[dev]; in loopback_mixer_new()
1561 setup = &loopback->setup[substr][dev]; in loopback_mixer_new()
1570 loopback); in loopback_mixer_new()
1626 struct loopback *loopback, in print_substream_info() argument
1630 struct loopback_cable *cable = loopback->cables[sub][num]; in print_substream_info()
1647 struct loopback *loopback = entry->private_data; in print_cable_info() local
1650 mutex_lock(&loopback->cable_lock); in print_cable_info()
1654 print_substream_info(buffer, loopback, sub, num); in print_cable_info()
1655 mutex_unlock(&loopback->cable_lock); in print_cable_info()
1658 static int loopback_cable_proc_new(struct loopback *loopback, int cidx) in loopback_cable_proc_new() argument
1663 return snd_card_ro_proc_new(loopback->card, name, loopback, in loopback_cable_proc_new()
1667 static void loopback_set_timer_source(struct loopback *loopback, in loopback_set_timer_source() argument
1670 if (loopback->timer_source) { in loopback_set_timer_source()
1671 devm_kfree(loopback->card->dev, loopback->timer_source); in loopback_set_timer_source()
1672 loopback->timer_source = NULL; in loopback_set_timer_source()
1675 loopback->timer_source = devm_kstrdup(loopback->card->dev, in loopback_set_timer_source()
1682 struct loopback *loopback = entry->private_data; in print_timer_source_info() local
1684 mutex_lock(&loopback->cable_lock); in print_timer_source_info()
1686 loopback->timer_source ? loopback->timer_source : ""); in print_timer_source_info()
1687 mutex_unlock(&loopback->cable_lock); in print_timer_source_info()
1693 struct loopback *loopback = entry->private_data; in change_timer_source_info() local
1696 mutex_lock(&loopback->cable_lock); in change_timer_source_info()
1698 loopback_set_timer_source(loopback, strim(line)); in change_timer_source_info()
1699 mutex_unlock(&loopback->cable_lock); in change_timer_source_info()
1702 static int loopback_timer_source_proc_new(struct loopback *loopback) in loopback_timer_source_proc_new() argument
1704 return snd_card_rw_proc_new(loopback->card, "timer_source", loopback, in loopback_timer_source_proc_new()
1712 struct loopback *loopback; in loopback_probe() local
1717 sizeof(struct loopback), &card); in loopback_probe()
1720 loopback = card->private_data; in loopback_probe()
1727 loopback->card = card; in loopback_probe()
1728 loopback_set_timer_source(loopback, timer_source[dev]); in loopback_probe()
1730 mutex_init(&loopback->cable_lock); in loopback_probe()
1732 err = loopback_pcm_new(loopback, 0, pcm_substreams[dev]); in loopback_probe()
1735 err = loopback_pcm_new(loopback, 1, pcm_substreams[dev]); in loopback_probe()
1738 err = loopback_mixer_new(loopback, pcm_notify[dev] ? 1 : 0); in loopback_probe()
1741 loopback_cable_proc_new(loopback, 0); in loopback_probe()
1742 loopback_cable_proc_new(loopback, 1); in loopback_probe()
1743 loopback_timer_source_proc_new(loopback); in loopback_probe()