diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-14 09:37:36 +0200 |
---|---|---|
committer | Stephane Desneux <stephane.desneux@open.eurogiciel.org> | 2015-02-04 11:14:13 +0100 |
commit | 0950ecbe84096c79a8710cc4bbf7cb2dabf39df1 (patch) | |
tree | 0775f79a63c90b2bff6d381efb7dfdd55859616e /sound | |
parent | d5ae3444029cd1d55dc4f88a83d5150f7a428f97 (diff) | |
download | kernel-common-0950ecbe84096c79a8710cc4bbf7cb2dabf39df1.tar.gz kernel-common-0950ecbe84096c79a8710cc4bbf7cb2dabf39df1.tar.bz2 kernel-common-0950ecbe84096c79a8710cc4bbf7cb2dabf39df1.zip |
ASoC: ak4642: Add support for extended sysclk frequencies of the ak4648
Additionally to the ak4642 pll frequencies the ak4648 also supports 13MHz,
19.2MHz and 26MHz. This adds support for these frequencies.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 5cd15e29a45a18b9a744af61a7d90f26f730eb97)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/ak4642.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 0a7f03f3d934..86242f770c10 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -136,6 +136,7 @@ struct ak4642_drvdata { const struct regmap_config *regmap_config; + int extended_frequencies; }; struct ak4642_priv { @@ -297,7 +298,9 @@ static int ak4642_dai_set_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_codec *codec = codec_dai->codec; + struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec); u8 pll; + int extended_freq = 0; switch (freq) { case 11289600: @@ -318,9 +321,25 @@ static int ak4642_dai_set_sysclk(struct snd_soc_dai *codec_dai, case 27000000: pll = PLL3 | PLL2 | PLL0; break; + case 19200000: + pll = PLL3; + extended_freq = 1; + break; + case 13000000: + pll = PLL3 | PLL2 | PLL1; + extended_freq = 1; + break; + case 26000000: + pll = PLL3 | PLL2 | PLL1 | PLL0; + extended_freq = 1; + break; default: return -EINVAL; } + + if (extended_freq && !priv->drvdata->extended_frequencies) + return -EINVAL; + snd_soc_update_bits(codec, MD_CTL1, PLL_MASK, pll); return 0; @@ -533,6 +552,7 @@ static const struct ak4642_drvdata ak4643_drvdata = { static const struct ak4642_drvdata ak4648_drvdata = { .regmap_config = &ak4648_regmap, + .extended_frequencies = 1, }; static struct of_device_id ak4642_of_match[]; |