summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-12-17 12:06:24 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-12-17 12:07:22 +1100
commit4737bc9ffcdd0ec17c8fa7629c15de6d4b30594d (patch)
treec66827cf033353575b24cb6e027bfd199d952293
parent42000f29ef6775f092dab2c80f8b3a6a319b5658 (diff)
Make card discoverable at module loadguppy_6.99.3guppy/6.99.36.99.3
We can achieve this using the snd_device_register function Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r--core.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/core.c b/core.c
index 8d73ed1..2fd416e 100644
--- a/core.c
+++ b/core.c
@@ -287,6 +287,8 @@ static struct snd_pcm *pcm_create(struct snd_avirt_stream *stream)
// Set the private free function for the private user data
pcm->private_free = pcm_private_data_free;
+ snd_device_register(core.card, pcm);
+
return pcm;
}
@@ -458,12 +460,6 @@ int snd_avirt_streams_seal(void)
ap_obj->path->configure(core.card, &stream_array);
}
- err = snd_card_register(core.card);
- if (err < 0) {
- D_ERRORK("Sound card registration failed!");
- snd_card_free(core.card);
- }
-
core.streams_sealed = true;
return err;
@@ -573,6 +569,12 @@ static int __init snd_avirt_core_init(void)
goto exit_class_container;
}
+ err = snd_card_register(core.card);
+ if (err < 0) {
+ D_ERRORK("Sound card registration failed!");
+ snd_card_free(core.card);
+ }
+
err = snd_avirt_configfs_init(&core);
if (err < 0)
goto exit_kset;