diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-14 03:37:36 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-14 07:32:04 -0400 |
commit | 5cd15e29a45a18b9a744af61a7d90f26f730eb97 (patch) | |
tree | da6b02f5006d3e509f48d9e8b892ad30f9e99633 | |
parent | d815c703cedbc783ae09ac65eef5c4aa18e06128 (diff) |
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>
-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 b568692a256b..3ba4c0f11418 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c | |||
@@ -136,6 +136,7 @@ | |||
136 | 136 | ||
137 | struct ak4642_drvdata { | 137 | struct ak4642_drvdata { |
138 | const struct regmap_config *regmap_config; | 138 | const struct regmap_config *regmap_config; |
139 | int extended_frequencies; | ||
139 | }; | 140 | }; |
140 | 141 | ||
141 | struct ak4642_priv { | 142 | struct ak4642_priv { |
@@ -297,7 +298,9 @@ static int ak4642_dai_set_sysclk(struct snd_soc_dai *codec_dai, | |||
297 | int clk_id, unsigned int freq, int dir) | 298 | int clk_id, unsigned int freq, int dir) |
298 | { | 299 | { |
299 | struct snd_soc_codec *codec = codec_dai->codec; | 300 | struct snd_soc_codec *codec = codec_dai->codec; |
301 | struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec); | ||
300 | u8 pll; | 302 | u8 pll; |
303 | int extended_freq = 0; | ||
301 | 304 | ||
302 | switch (freq) { | 305 | switch (freq) { |
303 | case 11289600: | 306 | case 11289600: |
@@ -318,9 +321,25 @@ static int ak4642_dai_set_sysclk(struct snd_soc_dai *codec_dai, | |||
318 | case 27000000: | 321 | case 27000000: |
319 | pll = PLL3 | PLL2 | PLL0; | 322 | pll = PLL3 | PLL2 | PLL0; |
320 | break; | 323 | break; |
324 | case 19200000: | ||
325 | pll = PLL3; | ||
326 | extended_freq = 1; | ||
327 | break; | ||
328 | case 13000000: | ||
329 | pll = PLL3 | PLL2 | PLL1; | ||
330 | extended_freq = 1; | ||
331 | break; | ||
332 | case 26000000: | ||
333 | pll = PLL3 | PLL2 | PLL1 | PLL0; | ||
334 | extended_freq = 1; | ||
335 | break; | ||
321 | default: | 336 | default: |
322 | return -EINVAL; | 337 | return -EINVAL; |
323 | } | 338 | } |
339 | |||
340 | if (extended_freq && !priv->drvdata->extended_frequencies) | ||
341 | return -EINVAL; | ||
342 | |||
324 | snd_soc_update_bits(codec, MD_CTL1, PLL_MASK, pll); | 343 | snd_soc_update_bits(codec, MD_CTL1, PLL_MASK, pll); |
325 | 344 | ||
326 | return 0; | 345 | return 0; |
@@ -525,6 +544,7 @@ static const struct ak4642_drvdata ak4643_drvdata = { | |||
525 | 544 | ||
526 | static const struct ak4642_drvdata ak4648_drvdata = { | 545 | static const struct ak4642_drvdata ak4648_drvdata = { |
527 | .regmap_config = &ak4648_regmap, | 546 | .regmap_config = &ak4648_regmap, |
547 | .extended_frequencies = 1, | ||
528 | }; | 548 | }; |
529 | 549 | ||
530 | static struct of_device_id ak4642_of_match[]; | 550 | static struct of_device_id ak4642_of_match[]; |