aboutsummaryrefslogtreecommitdiffstats
path: root/dummy/dummy.c
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-01 17:43:39 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:35 +1100
commit3247d61d378afd8fc76f1e9182e5691bd538ab3f (patch)
tree02485f2a47d8df1c5dbaa11007d6439bac0951e0 /dummy/dummy.c
parent6c5c0d66a792ecbbf92538a7822b62a36710a341 (diff)
Add configfs interface, revamp stream grouping
Add additional callbacks for audio path configuring, after card has been sealed. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'dummy/dummy.c')
-rw-r--r--dummy/dummy.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/dummy/dummy.c b/dummy/dummy.c
index d619786..606b22d 100644
--- a/dummy/dummy.c
+++ b/dummy/dummy.c
@@ -130,7 +130,7 @@ static void dummy_systimer_callback(struct timer_list *t)
dpcm->elapsed = 0;
spin_unlock_irqrestore(&dpcm->lock, flags);
if (elapsed)
- coreinfo->pcm_buff_complete(dpcm->substream);
+ avirt_pcm_period_elapsed(dpcm->substream);
}
static snd_pcm_uframes_t
@@ -231,6 +231,25 @@ static struct snd_pcm_ops dummyap_pcm_ops = {
/*******************************************************************************
* Dummy Audio Path AVIRT registration
******************************************************************************/
+int dummy_configure(struct config_group *avirt_stream_group,
+ unsigned int stream_count)
+{
+ // Do something with streams
+
+ struct list_head *entry;
+ list_for_each(entry, &avirt_stream_group->cg_children)
+ {
+ struct config_item *item =
+ container_of(entry, struct config_item, ci_entry);
+ struct avirt_stream *stream =
+ avirt_stream_from_config_item(item);
+ pr_info("%s: stream name:%s device:%d channels:%d\n", __func__,
+ stream->name, stream->device, stream->channels);
+ }
+
+ return 0;
+}
+
static struct snd_pcm_hardware dummyap_hw = {
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.info = (SNDRV_PCM_INFO_INTERLEAVED // Channel interleaved audio
@@ -250,6 +269,7 @@ static struct avirt_audiopath dummyap_module = {
.hw = &dummyap_hw,
.pcm_ops = &dummyap_pcm_ops,
.blocksize = DUMMY_BLOCKSIZE,
+ .configure = dummy_configure,
};
static int __init dummy_init(void)