diff options
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 9db2770e9640..825db385f01f 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -37,7 +37,8 @@ static const struct snd_pcm_hardware omap_pcm_hardware = { | |||
37 | SNDRV_PCM_INFO_INTERLEAVED | | 37 | SNDRV_PCM_INFO_INTERLEAVED | |
38 | SNDRV_PCM_INFO_PAUSE | | 38 | SNDRV_PCM_INFO_PAUSE | |
39 | SNDRV_PCM_INFO_RESUME, | 39 | SNDRV_PCM_INFO_RESUME, |
40 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 40 | .formats = SNDRV_PCM_FMTBIT_S16_LE | |
41 | SNDRV_PCM_FMTBIT_S32_LE, | ||
41 | .period_bytes_min = 32, | 42 | .period_bytes_min = 32, |
42 | .period_bytes_max = 64 * 1024, | 43 | .period_bytes_max = 64 * 1024, |
43 | .periods_min = 2, | 44 | .periods_min = 2, |
@@ -149,6 +150,7 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) | |||
149 | struct omap_runtime_data *prtd = runtime->private_data; | 150 | struct omap_runtime_data *prtd = runtime->private_data; |
150 | struct omap_pcm_dma_data *dma_data = prtd->dma_data; | 151 | struct omap_pcm_dma_data *dma_data = prtd->dma_data; |
151 | struct omap_dma_channel_params dma_params; | 152 | struct omap_dma_channel_params dma_params; |
153 | int bytes; | ||
152 | 154 | ||
153 | /* return if this is a bufferless transfer e.g. | 155 | /* return if this is a bufferless transfer e.g. |
154 | * codec <--> BT codec or GSM modem -- lg FIXME */ | 156 | * codec <--> BT codec or GSM modem -- lg FIXME */ |
@@ -156,11 +158,7 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) | |||
156 | return 0; | 158 | return 0; |
157 | 159 | ||
158 | memset(&dma_params, 0, sizeof(dma_params)); | 160 | memset(&dma_params, 0, sizeof(dma_params)); |
159 | /* | 161 | dma_params.data_type = dma_data->data_type; |
160 | * Note: Regardless of interface data formats supported by OMAP McBSP | ||
161 | * or EAC blocks, internal representation is always fixed 16-bit/sample | ||
162 | */ | ||
163 | dma_params.data_type = OMAP_DMA_DATA_TYPE_S16; | ||
164 | dma_params.trigger = dma_data->dma_req; | 162 | dma_params.trigger = dma_data->dma_req; |
165 | dma_params.sync_mode = dma_data->sync_mode; | 163 | dma_params.sync_mode = dma_data->sync_mode; |
166 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 164 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
@@ -170,6 +168,7 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) | |||
170 | dma_params.src_start = runtime->dma_addr; | 168 | dma_params.src_start = runtime->dma_addr; |
171 | dma_params.dst_start = dma_data->port_addr; | 169 | dma_params.dst_start = dma_data->port_addr; |
172 | dma_params.dst_port = OMAP_DMA_PORT_MPUI; | 170 | dma_params.dst_port = OMAP_DMA_PORT_MPUI; |
171 | dma_params.dst_fi = dma_data->packet_size; | ||
173 | } else { | 172 | } else { |
174 | dma_params.src_amode = OMAP_DMA_AMODE_CONSTANT; | 173 | dma_params.src_amode = OMAP_DMA_AMODE_CONSTANT; |
175 | dma_params.dst_amode = OMAP_DMA_AMODE_POST_INC; | 174 | dma_params.dst_amode = OMAP_DMA_AMODE_POST_INC; |
@@ -177,6 +176,7 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) | |||
177 | dma_params.src_start = dma_data->port_addr; | 176 | dma_params.src_start = dma_data->port_addr; |
178 | dma_params.dst_start = runtime->dma_addr; | 177 | dma_params.dst_start = runtime->dma_addr; |
179 | dma_params.src_port = OMAP_DMA_PORT_MPUI; | 178 | dma_params.src_port = OMAP_DMA_PORT_MPUI; |
179 | dma_params.src_fi = dma_data->packet_size; | ||
180 | } | 180 | } |
181 | /* | 181 | /* |
182 | * Set DMA transfer frame size equal to ALSA period size and frame | 182 | * Set DMA transfer frame size equal to ALSA period size and frame |
@@ -184,7 +184,8 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) | |||
184 | * we can transfer the whole ALSA buffer with single DMA transfer but | 184 | * we can transfer the whole ALSA buffer with single DMA transfer but |
185 | * still can get an interrupt at each period bounary | 185 | * still can get an interrupt at each period bounary |
186 | */ | 186 | */ |
187 | dma_params.elem_count = snd_pcm_lib_period_bytes(substream) / 2; | 187 | bytes = snd_pcm_lib_period_bytes(substream); |
188 | dma_params.elem_count = bytes >> dma_data->data_type; | ||
188 | dma_params.frame_count = runtime->periods; | 189 | dma_params.frame_count = runtime->periods; |
189 | omap_set_dma_params(prtd->dma_ch, &dma_params); | 190 | omap_set_dma_params(prtd->dma_ch, &dma_params); |
190 | 191 | ||