Thomas Gleixner | 1a59d1b8 | 2019-05-27 08:55:05 +0200 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Advanced Linux Sound Architecture |
Jaroslav Kysela | c1017a4 | 2007-10-15 09:50:19 +0200 | [diff] [blame] | 4 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | */ |
| 6 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include <linux/init.h> |
| 8 | #include <sound/core.h> |
| 9 | |
| 10 | static int __init alsa_sound_last_init(void) |
| 11 | { |
Takashi Iwai | f4fa968 | 2019-04-16 18:18:47 +0200 | [diff] [blame] | 12 | struct snd_card *card; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | int idx, ok = 0; |
| 14 | |
| 15 | printk(KERN_INFO "ALSA device list:\n"); |
Takashi Iwai | f4fa968 | 2019-04-16 18:18:47 +0200 | [diff] [blame] | 16 | for (idx = 0; idx < SNDRV_CARDS; idx++) { |
| 17 | card = snd_card_ref(idx); |
| 18 | if (card) { |
| 19 | printk(KERN_INFO " #%i: %s\n", idx, card->longname); |
| 20 | snd_card_unref(card); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | ok++; |
| 22 | } |
Takashi Iwai | f4fa968 | 2019-04-16 18:18:47 +0200 | [diff] [blame] | 23 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | if (ok == 0) |
| 25 | printk(KERN_INFO " No soundcards found.\n"); |
| 26 | return 0; |
| 27 | } |
| 28 | |
Kuninori Morimoto | 590b477 | 2012-04-19 00:00:27 -0700 | [diff] [blame] | 29 | late_initcall_sync(alsa_sound_last_init); |