diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-08-08 10:49:08 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:58:31 -0400 |
commit | 64d27f96cb719cf8b5dae634c4c548049d4ae6bf (patch) | |
tree | f10c68d67e15711d48a92ed258c93ca9018e5584 /sound/core/pcm_misc.c | |
parent | 9390ec85c0ab98444140190f936a37fa4eb945a2 (diff) |
[ALSA] Support 3-bytes 24bit format in PCM OSS emulation
Add the support of 3-bytes 24bit formats in PCM OSS emulation.
Also removed snd_pcm_build_linear_format() function. It's exported
just for OSS emulation, and now the code was changed without calling
this function.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/pcm_misc.c')
-rw-r--r-- | sound/core/pcm_misc.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c index 0019c59a779..9142fce4dda 100644 --- a/sound/core/pcm_misc.c +++ b/sound/core/pcm_misc.c | |||
@@ -422,38 +422,6 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int | |||
422 | 422 | ||
423 | EXPORT_SYMBOL(snd_pcm_format_set_silence); | 423 | EXPORT_SYMBOL(snd_pcm_format_set_silence); |
424 | 424 | ||
425 | /* [width][unsigned][bigendian] */ | ||
426 | static int linear_formats[4][2][2] = { | ||
427 | {{ SNDRV_PCM_FORMAT_S8, SNDRV_PCM_FORMAT_S8}, | ||
428 | { SNDRV_PCM_FORMAT_U8, SNDRV_PCM_FORMAT_U8}}, | ||
429 | {{SNDRV_PCM_FORMAT_S16_LE, SNDRV_PCM_FORMAT_S16_BE}, | ||
430 | {SNDRV_PCM_FORMAT_U16_LE, SNDRV_PCM_FORMAT_U16_BE}}, | ||
431 | {{SNDRV_PCM_FORMAT_S24_LE, SNDRV_PCM_FORMAT_S24_BE}, | ||
432 | {SNDRV_PCM_FORMAT_U24_LE, SNDRV_PCM_FORMAT_U24_BE}}, | ||
433 | {{SNDRV_PCM_FORMAT_S32_LE, SNDRV_PCM_FORMAT_S32_BE}, | ||
434 | {SNDRV_PCM_FORMAT_U32_LE, SNDRV_PCM_FORMAT_U32_BE}} | ||
435 | }; | ||
436 | |||
437 | /** | ||
438 | * snd_pcm_build_linear_format - return the suitable linear format for the given condition | ||
439 | * @width: the bit-width | ||
440 | * @unsignd: 1 if unsigned, 0 if signed. | ||
441 | * @big_endian: 1 if big-endian, 0 if little-endian | ||
442 | * | ||
443 | * Returns the suitable linear format for the given condition. | ||
444 | */ | ||
445 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian) | ||
446 | { | ||
447 | if (width & 7) | ||
448 | return SND_PCM_FORMAT_UNKNOWN; | ||
449 | width = (width / 8) - 1; | ||
450 | if (width < 0 || width >= 4) | ||
451 | return SND_PCM_FORMAT_UNKNOWN; | ||
452 | return linear_formats[width][!!unsignd][!!big_endian]; | ||
453 | } | ||
454 | |||
455 | EXPORT_SYMBOL(snd_pcm_build_linear_format); | ||
456 | |||
457 | /** | 425 | /** |
458 | * snd_pcm_limit_hw_rates - determine rate_min/rate_max fields | 426 | * snd_pcm_limit_hw_rates - determine rate_min/rate_max fields |
459 | * @runtime: the runtime instance | 427 | * @runtime: the runtime instance |