diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-01 08:44:25 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-01 09:22:01 -0500 |
commit | cd1707a99a2cb43cd8ab0c1952b455b218f15884 (patch) | |
tree | bff5dbc48acb806834ce224f5e09c52ee4ca70e6 /sound/soc/codecs/wm8994.c | |
parent | 52ac7ab2475da2b577e4a4616c98b5d1fa3a3cfd (diff) |
ASoC: Add platform data for WM8958/WM1811 microphone detection rates
Allow systems to override the default microphone detection rates using
platform data in case the settings are not suitable (eg, due to an
unusually noisy jack).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8994.c')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 91f3638ab33f..6bdf8137c7e8 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -60,13 +60,6 @@ static int wm8994_retune_mobile_base[] = { | |||
60 | 60 | ||
61 | static void wm8958_default_micdet(u16 status, void *data); | 61 | static void wm8958_default_micdet(u16 status, void *data); |
62 | 62 | ||
63 | struct wm8958_micd_rate { | ||
64 | int sysclk; | ||
65 | bool idle; | ||
66 | int start; | ||
67 | int rate; | ||
68 | }; | ||
69 | |||
70 | static const struct wm8958_micd_rate micdet_rates[] = { | 63 | static const struct wm8958_micd_rate micdet_rates[] = { |
71 | { 32768, true, 1, 4 }, | 64 | { 32768, true, 1, 4 }, |
72 | { 32768, false, 1, 1 }, | 65 | { 32768, false, 1, 1 }, |
@@ -100,7 +93,10 @@ static void wm8958_micd_set_rate(struct snd_soc_codec *codec) | |||
100 | else | 93 | else |
101 | sysclk = wm8994->aifclk[0]; | 94 | sysclk = wm8994->aifclk[0]; |
102 | 95 | ||
103 | if (wm8994->jackdet) { | 96 | if (wm8994->pdata && wm8994->pdata->micd_rates) { |
97 | rates = wm8994->pdata->micd_rates; | ||
98 | num_rates = wm8994->pdata->num_micd_rates; | ||
99 | } else if (wm8994->jackdet) { | ||
104 | rates = jackdet_rates; | 100 | rates = jackdet_rates; |
105 | num_rates = ARRAY_SIZE(jackdet_rates); | 101 | num_rates = ARRAY_SIZE(jackdet_rates); |
106 | } else { | 102 | } else { |