Skip to contentSkip to conversation

ASoC: Support 8 bit samples in soc-util

PATCH In review Mark Brown 2 participants 3 messages Jan 31, 2011 – Feb 1, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Support 8 bit samples in soc-util

---
 sound/soc/soc-utils.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
sound/soc/soc-utils.c +4 -0
index 1d07b93..e31d843 100644
@@ -29,6 +29,10 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params)
 	int sample_size;
 
 	switch (params_format(params)) {
+	case SNDRV_PCM_FORMAT_S8:
+	case SNDRV_PCM_FORMAT_U8:
+		sample_size = 8;
+		break;
 	case SNDRV_PCM_FORMAT_S16_LE:
 	case SNDRV_PCM_FORMAT_S16_BE:
 		sample_size = 16;
Signature · 1 line
1.7.2.3
maintainer
#1 lore raw
Quoted 1 line · Mark Brown

Is any reason to avoid using the snd_pcm_format_width() function here?

Jaroslav

Quoted 9 lines

---
sound/soc/soc-utils.c | 4 ++++

1 files changed, 4 insertions(+), 0 deletions(-)
sound/soc/soc-utils.c +0 -0
index 1d07b93..e31d843 100644

sound/soc/soc-utils.c int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params) · line 38

Quoted 10 lines
sound/soc/soc-utils.c +4 -0
@@ -29,6 +29,10 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params)
 	int sample_size;
 
 	switch (params_format(params)) {
+	case SNDRV_PCM_FORMAT_S8:
+	case SNDRV_PCM_FORMAT_U8:
+		sample_size = 8;
+		break;
 	case SNDRV_PCM_FORMAT_S16_LE:
 	case SNDRV_PCM_FORMAT_S16_BE:
 		sample_size = 16;

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.