Date:2010-05-23 15:43:15 (10 years 1 month ago)
Author:Maarten ter Huurne
Commit:876550983461ea2e9434123e861bcedeccc8e432
Message:jz4740-i2s: Fixed indentation.

Files: sound/soc/jz4740/jz4740-i2s.c (9 diffs)

Change Details

sound/soc/jz4740/jz4740-i2s.c
153153    return 0;
154154}
155155
156static void jz4740_i2s_shutdown(struct snd_pcm_substream *substream, struct
157                              snd_soc_dai *dai)
156static void jz4740_i2s_shutdown(struct snd_pcm_substream *substream,
157                struct snd_soc_dai *dai)
158158{
159159    struct jz4740_i2s *i2s = jz4740_dai_to_i2s(dai);
160160    uint32_t conf;
...... 
171171
172172
173173static int jz4740_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
174                   struct snd_soc_dai *dai)
174                  struct snd_soc_dai *dai)
175175{
176176    struct jz4740_i2s *i2s = jz4740_dai_to_i2s(dai);
177177    bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
...... 
180180    uint32_t mask;
181181
182182    if (playback) {
183        mask = JZ_AIC_CTRL_ENABLE_PLAYBACK | JZ_AIC_CTRL_ENABLE_TX_DMA;
183        mask = JZ_AIC_CTRL_ENABLE_PLAYBACK | JZ_AIC_CTRL_ENABLE_TX_DMA;
184184    } else {
185        mask = JZ_AIC_CTRL_ENABLE_CAPTURE | JZ_AIC_CTRL_ENABLE_RX_DMA;
185        mask = JZ_AIC_CTRL_ENABLE_CAPTURE | JZ_AIC_CTRL_ENABLE_RX_DMA;
186186    }
187187
188188    ctrl = jz4740_i2s_read(i2s, JZ_REG_AIC_CTRL);
...... 
191191    case SNDRV_PCM_TRIGGER_START:
192192    case SNDRV_PCM_TRIGGER_RESUME:
193193    case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
194        ctrl |= mask;
195        break;
194        ctrl |= mask;
195        break;
196196    case SNDRV_PCM_TRIGGER_STOP:
197197    case SNDRV_PCM_TRIGGER_SUSPEND:
198198    case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
199        ctrl &= ~mask;
200        break;
199        ctrl &= ~mask;
200        break;
201201    default:
202        return -EINVAL;
202        return -EINVAL;
203203    }
204204
205205    jz4740_i2s_write(i2s, JZ_REG_AIC_CTRL, ctrl);
...... 
208208}
209209
210210
211static int jz4740_i2s_set_fmt(struct snd_soc_dai *dai,
212                   unsigned int fmt)
211static int jz4740_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
213212{
214213    struct jz4740_i2s *i2s = jz4740_dai_to_i2s(dai);
215214
...... 
222221
223222    switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
224223    case SND_SOC_DAIFMT_CBS_CFS:
225        conf |= JZ_AIC_CONF_BIT_CLK_MASTER | JZ_AIC_CONF_SYNC_CLK_MASTER;
226        format |= JZ_AIC_I2S_FMT_ENABLE_SYS_CLK;
227        break;
224        conf |= JZ_AIC_CONF_BIT_CLK_MASTER | JZ_AIC_CONF_SYNC_CLK_MASTER;
225        format |= JZ_AIC_I2S_FMT_ENABLE_SYS_CLK;
226        break;
228227    case SND_SOC_DAIFMT_CBM_CFS:
229        conf |= JZ_AIC_CONF_SYNC_CLK_MASTER;
230        break;
228        conf |= JZ_AIC_CONF_SYNC_CLK_MASTER;
229        break;
231230    case SND_SOC_DAIFMT_CBS_CFM:
232        conf |= JZ_AIC_CONF_BIT_CLK_MASTER;
233        break;
231        conf |= JZ_AIC_CONF_BIT_CLK_MASTER;
232        break;
234233    case SND_SOC_DAIFMT_CBM_CFM:
235        break;
234        break;
236235    default:
237        return -EINVAL;
236        return -EINVAL;
238237    }
239238
240239    switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
241240    case SND_SOC_DAIFMT_MSB:
242        format |= JZ_AIC_I2S_FMT_MSB;
243        break;
241        format |= JZ_AIC_I2S_FMT_MSB;
242        break;
244243    case SND_SOC_DAIFMT_I2S:
245        break;
244        break;
246245    default:
247        return -EINVAL;
246        return -EINVAL;
248247    }
249248
250249    switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
251250    case SND_SOC_DAIFMT_NB_NF:
252        break;
251        break;
253252    default:
254        return -EINVAL;
253        return -EINVAL;
255254    }
256255
257256    jz4740_i2s_write(i2s, JZ_REG_AIC_CONF, conf);
...... 
261260}
262261
263262static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream,
264                 struct snd_pcm_hw_params *params,
265                 struct snd_soc_dai *dai)
263                struct snd_pcm_hw_params *params,
264                struct snd_soc_dai *dai)
266265{
267266    struct jz4740_i2s *i2s = jz4740_dai_to_i2s(dai);
268267    bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
...... 
275274
276275    switch (params_format(params)) {
277276    case SNDRV_PCM_FORMAT_S8:
278        sample_size = 0;
277        sample_size = 0;
279278        dma_width = JZ4740_DMA_WIDTH_8BIT;
280        break;
279        break;
281280    case SNDRV_PCM_FORMAT_S16:
282        sample_size = 1;
281        sample_size = 1;
283282        dma_width = JZ4740_DMA_WIDTH_16BIT;
284283        break;
285284    default:
...... 
296295
297296    switch (params_channels(params)) {
298297    case 2:
299        break;
298        break;
300299    case 1:
301300        if (playback) {
302301            ctrl |= JZ_AIC_CTRL_MONO_TO_STEREO;

Archive Download the corresponding diff file



interactive