diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-11-21 15:24:03 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-21 15:24:03 -0500 |
commit | b20222667d371bb9ddeadd47d18072efcab3f6d2 (patch) | |
tree | 65d8a638f1fa9d1d40b976afce11c81eb3dca64f /sound/pci/hda/hda_codec.c | |
parent | c70bfa8733e1ec4babe5a1b4a9a90053f79eb301 (diff) |
ALSA: hda - Fix build without CONFIG_PROC_FS
snd_print_pcm_rates() and snd_print_pcm_bits() are used by both
hda_proc.c and hda_eld.c, thus they have to be defined in the common
place.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index a98ce5b11188..d56d11ab20a3 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3425,3 +3425,33 @@ void snd_array_free(struct snd_array *array) | |||
3425 | array->alloced = 0; | 3425 | array->alloced = 0; |
3426 | array->list = NULL; | 3426 | array->list = NULL; |
3427 | } | 3427 | } |
3428 | |||
3429 | /* | ||
3430 | * used by hda_proc.c and hda_eld.c | ||
3431 | */ | ||
3432 | void snd_print_pcm_rates(int pcm, char *buf, int buflen) | ||
3433 | { | ||
3434 | static unsigned int rates[] = { | ||
3435 | 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, | ||
3436 | 96000, 176400, 192000, 384000 | ||
3437 | }; | ||
3438 | int i, j; | ||
3439 | |||
3440 | for (i = 0, j = 0; i < ARRAY_SIZE(rates); i++) | ||
3441 | if (pcm & (1 << i)) | ||
3442 | j += snprintf(buf + j, buflen - j, " %d", rates[i]); | ||
3443 | |||
3444 | buf[j] = '\0'; /* necessary when j == 0 */ | ||
3445 | } | ||
3446 | |||
3447 | void snd_print_pcm_bits(int pcm, char *buf, int buflen) | ||
3448 | { | ||
3449 | static unsigned int bits[] = { 8, 16, 20, 24, 32 }; | ||
3450 | int i, j; | ||
3451 | |||
3452 | for (i = 0, j = 0; i < ARRAY_SIZE(bits); i++) | ||
3453 | if (pcm & (AC_SUPPCM_BITS_8 << i)) | ||
3454 | j += snprintf(buf + j, buflen - j, " %d", bits[i]); | ||
3455 | |||
3456 | buf[j] = '\0'; /* necessary when j == 0 */ | ||
3457 | } | ||