diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/ssm2602.c | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c index 480074d86476..c6dd48561884 100644 --- a/sound/soc/codecs/ssm2602.c +++ b/sound/soc/codecs/ssm2602.c | |||
@@ -53,8 +53,6 @@ enum ssm2602_type { | |||
53 | struct ssm2602_priv { | 53 | struct ssm2602_priv { |
54 | unsigned int sysclk; | 54 | unsigned int sysclk; |
55 | struct snd_pcm_hw_constraint_list *sysclk_constraints; | 55 | struct snd_pcm_hw_constraint_list *sysclk_constraints; |
56 | struct snd_pcm_substream *master_substream; | ||
57 | struct snd_pcm_substream *slave_substream; | ||
58 | 56 | ||
59 | struct regmap *regmap; | 57 | struct regmap *regmap; |
60 | 58 | ||
@@ -277,11 +275,6 @@ static int ssm2602_hw_params(struct snd_pcm_substream *substream, | |||
277 | int srate = ssm2602_get_coeff(ssm2602->sysclk, params_rate(params)); | 275 | int srate = ssm2602_get_coeff(ssm2602->sysclk, params_rate(params)); |
278 | unsigned int iface; | 276 | unsigned int iface; |
279 | 277 | ||
280 | if (substream == ssm2602->slave_substream) { | ||
281 | dev_dbg(codec->dev, "Ignoring hw_params for slave substream\n"); | ||
282 | return 0; | ||
283 | } | ||
284 | |||
285 | if (srate < 0) | 278 | if (srate < 0) |
286 | return srate; | 279 | return srate; |
287 | 280 | ||
@@ -314,33 +307,6 @@ static int ssm2602_startup(struct snd_pcm_substream *substream, | |||
314 | { | 307 | { |
315 | struct snd_soc_codec *codec = dai->codec; | 308 | struct snd_soc_codec *codec = dai->codec; |
316 | struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); | 309 | struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); |
317 | struct snd_pcm_runtime *master_runtime; | ||
318 | |||
319 | /* The DAI has shared clocks so if we already have a playback or | ||
320 | * capture going then constrain this substream to match it. | ||
321 | * TODO: the ssm2602 allows pairs of non-matching PB/REC rates | ||
322 | */ | ||
323 | if (ssm2602->master_substream) { | ||
324 | master_runtime = ssm2602->master_substream->runtime; | ||
325 | dev_dbg(codec->dev, "Constraining to %d bits at %dHz\n", | ||
326 | master_runtime->sample_bits, | ||
327 | master_runtime->rate); | ||
328 | |||
329 | if (master_runtime->rate != 0) | ||
330 | snd_pcm_hw_constraint_minmax(substream->runtime, | ||
331 | SNDRV_PCM_HW_PARAM_RATE, | ||
332 | master_runtime->rate, | ||
333 | master_runtime->rate); | ||
334 | |||
335 | if (master_runtime->sample_bits != 0) | ||
336 | snd_pcm_hw_constraint_minmax(substream->runtime, | ||
337 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, | ||
338 | master_runtime->sample_bits, | ||
339 | master_runtime->sample_bits); | ||
340 | |||
341 | ssm2602->slave_substream = substream; | ||
342 | } else | ||
343 | ssm2602->master_substream = substream; | ||
344 | 310 | ||
345 | if (ssm2602->sysclk_constraints) { | 311 | if (ssm2602->sysclk_constraints) { |
346 | snd_pcm_hw_constraint_list(substream->runtime, 0, | 312 | snd_pcm_hw_constraint_list(substream->runtime, 0, |
@@ -351,19 +317,6 @@ static int ssm2602_startup(struct snd_pcm_substream *substream, | |||
351 | return 0; | 317 | return 0; |
352 | } | 318 | } |
353 | 319 | ||
354 | static void ssm2602_shutdown(struct snd_pcm_substream *substream, | ||
355 | struct snd_soc_dai *dai) | ||
356 | { | ||
357 | struct snd_soc_codec *codec = dai->codec; | ||
358 | struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); | ||
359 | |||
360 | if (ssm2602->master_substream == substream) | ||
361 | ssm2602->master_substream = ssm2602->slave_substream; | ||
362 | |||
363 | ssm2602->slave_substream = NULL; | ||
364 | } | ||
365 | |||
366 | |||
367 | static int ssm2602_mute(struct snd_soc_dai *dai, int mute) | 320 | static int ssm2602_mute(struct snd_soc_dai *dai, int mute) |
368 | { | 321 | { |
369 | struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(dai->codec); | 322 | struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(dai->codec); |
@@ -530,7 +483,6 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec, | |||
530 | static const struct snd_soc_dai_ops ssm2602_dai_ops = { | 483 | static const struct snd_soc_dai_ops ssm2602_dai_ops = { |
531 | .startup = ssm2602_startup, | 484 | .startup = ssm2602_startup, |
532 | .hw_params = ssm2602_hw_params, | 485 | .hw_params = ssm2602_hw_params, |
533 | .shutdown = ssm2602_shutdown, | ||
534 | .digital_mute = ssm2602_mute, | 486 | .digital_mute = ssm2602_mute, |
535 | .set_sysclk = ssm2602_set_dai_sysclk, | 487 | .set_sysclk = ssm2602_set_dai_sysclk, |
536 | .set_fmt = ssm2602_set_dai_fmt, | 488 | .set_fmt = ssm2602_set_dai_fmt, |
@@ -551,6 +503,8 @@ static struct snd_soc_dai_driver ssm2602_dai = { | |||
551 | .rates = SSM2602_RATES, | 503 | .rates = SSM2602_RATES, |
552 | .formats = SSM2602_FORMATS,}, | 504 | .formats = SSM2602_FORMATS,}, |
553 | .ops = &ssm2602_dai_ops, | 505 | .ops = &ssm2602_dai_ops, |
506 | .symmetric_rates = 1, | ||
507 | .symmetric_samplebits = 1, | ||
554 | }; | 508 | }; |
555 | 509 | ||
556 | static int ssm2602_suspend(struct snd_soc_codec *codec) | 510 | static int ssm2602_suspend(struct snd_soc_codec *codec) |