diff options
| author | Mark Brown <broonie@linaro.org> | 2014-01-16 07:42:53 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2014-01-16 07:42:53 -0500 |
| commit | a9b68d3b90988dd13c668d6b1d45cdca1557f070 (patch) | |
| tree | f464467614d873bbd2d590b8223d619da0771f3f | |
| parent | efe265d301c6157d6c8bcd2ef239fdf552191190 (diff) | |
| parent | 1104a9c822f0e9f5e57a236f20a142166dd8f91e (diff) | |
Merge remote-tracking branch 'asoc/topic/core' into for-tiwai
| -rw-r--r-- | sound/soc/soc-core.c | 4 | ||||
| -rw-r--r-- | sound/soc/soc-pcm.c | 35 |
2 files changed, 21 insertions, 18 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index be88df5eeaf7..18583660efbc 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
| @@ -3484,7 +3484,7 @@ int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
| 3484 | return dai->codec->driver->set_sysclk(dai->codec, clk_id, 0, | 3484 | return dai->codec->driver->set_sysclk(dai->codec, clk_id, 0, |
| 3485 | freq, dir); | 3485 | freq, dir); |
| 3486 | else | 3486 | else |
| 3487 | return -EINVAL; | 3487 | return -ENOTSUPP; |
| 3488 | } | 3488 | } |
| 3489 | EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk); | 3489 | EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk); |
| 3490 | 3490 | ||
| @@ -3505,7 +3505,7 @@ int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, | |||
| 3505 | return codec->driver->set_sysclk(codec, clk_id, source, | 3505 | return codec->driver->set_sysclk(codec, clk_id, source, |
| 3506 | freq, dir); | 3506 | freq, dir); |
| 3507 | else | 3507 | else |
| 3508 | return -EINVAL; | 3508 | return -ENOTSUPP; |
| 3509 | } | 3509 | } |
| 3510 | EXPORT_SYMBOL_GPL(snd_soc_codec_set_sysclk); | 3510 | EXPORT_SYMBOL_GPL(snd_soc_codec_set_sysclk); |
| 3511 | 3511 | ||
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 604e7e9a2ef8..e95ef9586723 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
| @@ -776,7 +776,7 @@ static int soc_pcm_bespoke_trigger(struct snd_pcm_substream *substream, | |||
| 776 | return ret; | 776 | return ret; |
| 777 | } | 777 | } |
| 778 | 778 | ||
| 779 | if (platform->driver->ops && platform->driver->bespoke_trigger) { | 779 | if (platform->driver->bespoke_trigger) { |
| 780 | ret = platform->driver->bespoke_trigger(substream, cmd); | 780 | ret = platform->driver->bespoke_trigger(substream, cmd); |
| 781 | if (ret < 0) | 781 | if (ret < 0) |
| 782 | return ret; | 782 | return ret; |
| @@ -1235,6 +1235,20 @@ unwind: | |||
| 1235 | return err; | 1235 | return err; |
| 1236 | } | 1236 | } |
| 1237 | 1237 | ||
| 1238 | static void dpcm_init_runtime_hw(struct snd_pcm_runtime *runtime, | ||
| 1239 | struct snd_soc_pcm_stream *stream) | ||
| 1240 | { | ||
| 1241 | runtime->hw.rate_min = stream->rate_min; | ||
| 1242 | runtime->hw.rate_max = stream->rate_max; | ||
| 1243 | runtime->hw.channels_min = stream->channels_min; | ||
| 1244 | runtime->hw.channels_max = stream->channels_max; | ||
| 1245 | if (runtime->hw.formats) | ||
| 1246 | runtime->hw.formats &= stream->formats; | ||
| 1247 | else | ||
| 1248 | runtime->hw.formats = stream->formats; | ||
| 1249 | runtime->hw.rates = stream->rates; | ||
| 1250 | } | ||
| 1251 | |||
| 1238 | static void dpcm_set_fe_runtime(struct snd_pcm_substream *substream) | 1252 | static void dpcm_set_fe_runtime(struct snd_pcm_substream *substream) |
| 1239 | { | 1253 | { |
| 1240 | struct snd_pcm_runtime *runtime = substream->runtime; | 1254 | struct snd_pcm_runtime *runtime = substream->runtime; |
| @@ -1242,21 +1256,10 @@ static void dpcm_set_fe_runtime(struct snd_pcm_substream *substream) | |||
| 1242 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 1256 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
| 1243 | struct snd_soc_dai_driver *cpu_dai_drv = cpu_dai->driver; | 1257 | struct snd_soc_dai_driver *cpu_dai_drv = cpu_dai->driver; |
| 1244 | 1258 | ||
| 1245 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 1259 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
| 1246 | runtime->hw.rate_min = cpu_dai_drv->playback.rate_min; | 1260 | dpcm_init_runtime_hw(runtime, &cpu_dai_drv->playback); |
| 1247 | runtime->hw.rate_max = cpu_dai_drv->playback.rate_max; | 1261 | else |
| 1248 | runtime->hw.channels_min = cpu_dai_drv->playback.channels_min; | 1262 | dpcm_init_runtime_hw(runtime, &cpu_dai_drv->capture); |
| 1249 | runtime->hw.channels_max = cpu_dai_drv->playback.channels_max; | ||
| 1250 | runtime->hw.formats &= cpu_dai_drv->playback.formats; | ||
| 1251 | runtime->hw.rates = cpu_dai_drv->playback.rates; | ||
| 1252 | } else { | ||
| 1253 | runtime->hw.rate_min = cpu_dai_drv->capture.rate_min; | ||
| 1254 | runtime->hw.rate_max = cpu_dai_drv->capture.rate_max; | ||
| 1255 | runtime->hw.channels_min = cpu_dai_drv->capture.channels_min; | ||
| 1256 | runtime->hw.channels_max = cpu_dai_drv->capture.channels_max; | ||
| 1257 | runtime->hw.formats &= cpu_dai_drv->capture.formats; | ||
| 1258 | runtime->hw.rates = cpu_dai_drv->capture.rates; | ||
| 1259 | } | ||
| 1260 | } | 1263 | } |
| 1261 | 1264 | ||
| 1262 | static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream) | 1265 | static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream) |
