aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/pcm_misc.c')
-rw-r--r--sound/core/pcm_misc.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index 0019c59a779d..9142fce4dda2 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
423EXPORT_SYMBOL(snd_pcm_format_set_silence); 423EXPORT_SYMBOL(snd_pcm_format_set_silence);
424 424
425/* [width][unsigned][bigendian] */
426static 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 */
445snd_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
455EXPORT_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