Skip to content

Commit

Permalink
ASoC: max98373: add 88200 and 96000 sampling rate support
Browse files Browse the repository at this point in the history
88200 and 96000 sampling rate was not enabled on driver, so can't be played.

The error information:
max98373 3-0031:rate 96000 not supported
max98373 3-0031:ASoC: can't set max98373-aif1 hw params: -22

Signed-off-by: fengchunguo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
fengchunguo authored and broonie committed Jul 31, 2019
1 parent 52f87f3 commit b9da500
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sound/soc/codecs/max98373.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ static int max98373_dai_hw_params(struct snd_pcm_substream *substream,
case 48000:
sampling_rate = MAX98373_PCM_SR_SET1_SR_48000;
break;
case 88200:
sampling_rate = MAX98373_PCM_SR_SET1_SR_88200;
break;
case 96000:
sampling_rate = MAX98373_PCM_SR_SET1_SR_96000;
break;
default:
dev_err(component->dev, "rate %d not supported\n",
params_rate(params));
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/max98373.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
#define MAX98373_PCM_SR_SET1_SR_32000 (0x6 << 0)
#define MAX98373_PCM_SR_SET1_SR_44100 (0x7 << 0)
#define MAX98373_PCM_SR_SET1_SR_48000 (0x8 << 0)
#define MAX98373_PCM_SR_SET1_SR_88200 (0x9 << 0)
#define MAX98373_PCM_SR_SET1_SR_96000 (0xA << 0)

/* MAX98373_R2028_PCM_SR_SETUP_2 */
#define MAX98373_PCM_SR_SET2_SR_MASK (0xF << 4)
Expand Down

0 comments on commit b9da500

Please sign in to comment.