From d3893a39eb0165809325071ab07984797d78e57a Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 6 Mar 2018 08:40:47 +0100 Subject: audio: add driver registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add registry for audio drivers, using the existing audio_driver struct. Make all drivers register themself. The old list of audio_driver struct pointers is now a list of audio driver names, specifying the priority (aka probe order) in case no driver is explicitly asked for. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20180306074053.22856-2-kraxel@redhat.com --- audio/dsoundaudio.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'audio/dsoundaudio.c') diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index bc39cb9b4d..3ed73a30d1 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -890,7 +890,7 @@ static struct audio_pcm_ops dsound_pcm_ops = { .ctl_in = dsound_ctl_in }; -struct audio_driver dsound_audio_driver = { +static struct audio_driver dsound_audio_driver = { .name = "dsound", .descr = "DirectSound http://wikipedia.org/wiki/DirectSound", .options = dsound_options, @@ -903,3 +903,9 @@ struct audio_driver dsound_audio_driver = { .voice_size_out = sizeof (DSoundVoiceOut), .voice_size_in = sizeof (DSoundVoiceIn) }; + +static void register_audio_dsound(void) +{ + audio_driver_register(&dsound_audio_driver); +} +type_init(register_audio_dsound); -- cgit v1.2.1