Skip to content

Commit

Permalink
ASoC: ssm2602: add support for 11.025kHz and 22.5kHz sample rates
Browse files Browse the repository at this point in the history
This adds the necessary values to the constraint list and
register values to the coefficient table in order to
configure the device for 11.025kHz and 22.5kHz sample rates.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
  • Loading branch information
Stefan Kristiansson authored and Mark Brown committed Sep 30, 2014
1 parent 555b9ee commit 3b2a001
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sound/soc/codecs/ssm2602.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static const struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 = {
};

static const unsigned int ssm2602_rates_11289600[] = {
8000, 44100, 88200,
8000, 11025, 22050, 44100, 88200,
};

static const struct snd_pcm_hw_constraint_list ssm2602_constraints_11289600 = {
Expand Down Expand Up @@ -237,6 +237,16 @@ static const struct ssm2602_coeff ssm2602_coeff_table[] = {
{18432000, 96000, SSM2602_COEFF_SRATE(0x7, 0x1, 0x0)},
{12000000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x1)},

/* 11.025k */
{11289600, 11025, SSM2602_COEFF_SRATE(0xc, 0x0, 0x0)},
{16934400, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x0)},
{12000000, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x1)},

/* 22.05k */
{11289600, 22050, SSM2602_COEFF_SRATE(0xd, 0x0, 0x0)},
{16934400, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x0)},
{12000000, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x1)},

/* 44.1k */
{11289600, 44100, SSM2602_COEFF_SRATE(0x8, 0x0, 0x0)},
{16934400, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x0)},
Expand Down Expand Up @@ -467,7 +477,8 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
return 0;
}

#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
SNDRV_PCM_RATE_96000)
Expand Down

0 comments on commit 3b2a001

Please sign in to comment.