aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ssm2602.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ssm2602.c')
-rw-r--r--sound/soc/codecs/ssm2602.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index 484b3bbe8624..314eaece1b7d 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -192,7 +192,7 @@ static const struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 = {
192}; 192};
193 193
194static const unsigned int ssm2602_rates_11289600[] = { 194static const unsigned int ssm2602_rates_11289600[] = {
195 8000, 44100, 88200, 195 8000, 11025, 22050, 44100, 88200,
196}; 196};
197 197
198static const struct snd_pcm_hw_constraint_list ssm2602_constraints_11289600 = { 198static const struct snd_pcm_hw_constraint_list ssm2602_constraints_11289600 = {
@@ -237,6 +237,16 @@ static const struct ssm2602_coeff ssm2602_coeff_table[] = {
237 {18432000, 96000, SSM2602_COEFF_SRATE(0x7, 0x1, 0x0)}, 237 {18432000, 96000, SSM2602_COEFF_SRATE(0x7, 0x1, 0x0)},
238 {12000000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x1)}, 238 {12000000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x1)},
239 239
240 /* 11.025k */
241 {11289600, 11025, SSM2602_COEFF_SRATE(0xc, 0x0, 0x0)},
242 {16934400, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x0)},
243 {12000000, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x1)},
244
245 /* 22.05k */
246 {11289600, 22050, SSM2602_COEFF_SRATE(0xd, 0x0, 0x0)},
247 {16934400, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x0)},
248 {12000000, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x1)},
249
240 /* 44.1k */ 250 /* 44.1k */
241 {11289600, 44100, SSM2602_COEFF_SRATE(0x8, 0x0, 0x0)}, 251 {11289600, 44100, SSM2602_COEFF_SRATE(0x8, 0x0, 0x0)},
242 {16934400, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x0)}, 252 {16934400, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x0)},
@@ -467,7 +477,8 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
467 return 0; 477 return 0;
468} 478}
469 479
470#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ 480#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
481 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
471 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\ 482 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
472 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\ 483 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
473 SNDRV_PCM_RATE_96000) 484 SNDRV_PCM_RATE_96000)
@@ -502,18 +513,11 @@ static struct snd_soc_dai_driver ssm2602_dai = {
502 .symmetric_samplebits = 1, 513 .symmetric_samplebits = 1,
503}; 514};
504 515
505static int ssm2602_suspend(struct snd_soc_codec *codec)
506{
507 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
508 return 0;
509}
510
511static int ssm2602_resume(struct snd_soc_codec *codec) 516static int ssm2602_resume(struct snd_soc_codec *codec)
512{ 517{
513 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); 518 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
514 519
515 regcache_sync(ssm2602->regmap); 520 regcache_sync(ssm2602->regmap);
516 ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
517 521
518 return 0; 522 return 0;
519} 523}
@@ -586,27 +590,14 @@ static int ssm260x_codec_probe(struct snd_soc_codec *codec)
586 break; 590 break;
587 } 591 }
588 592
589 if (ret) 593 return ret;
590 return ret;
591
592 ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
593
594 return 0;
595}
596
597/* remove everything here */
598static int ssm2602_remove(struct snd_soc_codec *codec)
599{
600 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
601 return 0;
602} 594}
603 595
604static struct snd_soc_codec_driver soc_codec_dev_ssm2602 = { 596static struct snd_soc_codec_driver soc_codec_dev_ssm2602 = {
605 .probe = ssm260x_codec_probe, 597 .probe = ssm260x_codec_probe,
606 .remove = ssm2602_remove,
607 .suspend = ssm2602_suspend,
608 .resume = ssm2602_resume, 598 .resume = ssm2602_resume,
609 .set_bias_level = ssm2602_set_bias_level, 599 .set_bias_level = ssm2602_set_bias_level,
600 .suspend_bias_off = true,
610 601
611 .controls = ssm260x_snd_controls, 602 .controls = ssm260x_snd_controls,
612 .num_controls = ARRAY_SIZE(ssm260x_snd_controls), 603 .num_controls = ARRAY_SIZE(ssm260x_snd_controls),
@@ -647,7 +638,7 @@ int ssm2602_probe(struct device *dev, enum ssm2602_type type,
647 return -ENOMEM; 638 return -ENOMEM;
648 639
649 dev_set_drvdata(dev, ssm2602); 640 dev_set_drvdata(dev, ssm2602);
650 ssm2602->type = SSM2602; 641 ssm2602->type = type;
651 ssm2602->regmap = regmap; 642 ssm2602->regmap = regmap;
652 643
653 return snd_soc_register_codec(dev, &soc_codec_dev_ssm2602, 644 return snd_soc_register_codec(dev, &soc_codec_dev_ssm2602,