aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm2000.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-14 01:16:58 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-24 10:42:35 -0500
commitd61100bbd18e8b3fc9406be55354dabd5e7525ec (patch)
tree0adbfd1c8e57abeaa02ff3b8fdff52511a2a620b /sound/soc/codecs/wm2000.c
parent514cfd6dd72508b79030c8504764a73a7261b713 (diff)
ASoC: wm2000: Use clock API integration to configure MCLK divisor
Since we are now using the clock API integration to manage MCLK we can now use clk_get_rate() to determine if we need to divide MCLK without relying on platform data. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm2000.c')
-rw-r--r--sound/soc/codecs/wm2000.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 0aba8ce424ca..85550dc319db 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -73,7 +73,6 @@ struct wm2000_priv {
73 unsigned int anc_eng_ena:1; 73 unsigned int anc_eng_ena:1;
74 unsigned int spk_ena:1; 74 unsigned int spk_ena:1;
75 75
76 unsigned int mclk_div:1;
77 unsigned int speech_clarity:1; 76 unsigned int speech_clarity:1;
78 77
79 int anc_download_size; 78 int anc_download_size;
@@ -133,6 +132,7 @@ static int wm2000_poll_bit(struct i2c_client *i2c,
133static int wm2000_power_up(struct i2c_client *i2c, int analogue) 132static int wm2000_power_up(struct i2c_client *i2c, int analogue)
134{ 133{
135 struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); 134 struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev);
135 unsigned long rate;
136 int ret; 136 int ret;
137 137
138 BUG_ON(wm2000->anc_mode != ANC_OFF); 138 BUG_ON(wm2000->anc_mode != ANC_OFF);
@@ -145,7 +145,8 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue)
145 return ret; 145 return ret;
146 } 146 }
147 147
148 if (!wm2000->mclk_div) { 148 rate = clk_get_rate(wm2000->mclk);
149 if (rate <= 13500000) {
149 dev_dbg(&i2c->dev, "Disabling MCLK divider\n"); 150 dev_dbg(&i2c->dev, "Disabling MCLK divider\n");
150 wm2000_write(i2c, WM2000_REG_SYS_CTL2, 151 wm2000_write(i2c, WM2000_REG_SYS_CTL2,
151 WM2000_MCLK_DIV2_ENA_CLR); 152 WM2000_MCLK_DIV2_ENA_CLR);
@@ -847,7 +848,6 @@ static int wm2000_i2c_probe(struct i2c_client *i2c,
847 filename = "wm2000_anc.bin"; 848 filename = "wm2000_anc.bin";
848 pdata = dev_get_platdata(&i2c->dev); 849 pdata = dev_get_platdata(&i2c->dev);
849 if (pdata) { 850 if (pdata) {
850 wm2000->mclk_div = pdata->mclkdiv2;
851 wm2000->speech_clarity = !pdata->speech_enh_disable; 851 wm2000->speech_clarity = !pdata->speech_enh_disable;
852 852
853 if (pdata->download_file) 853 if (pdata->download_file)