diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-12 13:46:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-09 07:15:35 -0400 |
commit | da445afe357ae656f6baddd8fd58b01e923f1fc6 (patch) | |
tree | cbb362d4df750c4cce06782b9374c3b6a08d537f /sound/soc/codecs/wm8994.c | |
parent | d3725761ee3d4813c6071ea1d952de1094d8b68f (diff) |
ASoC: wm8994: Remove duplicate revision cache
There's already a device revision stored in the core data structure,
don't duplicate it in the CODEC driver.
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 | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 1c02a47910e4..14094f558e03 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -2209,7 +2209,7 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, | |||
2209 | vmid_reference(codec); | 2209 | vmid_reference(codec); |
2210 | break; | 2210 | break; |
2211 | case WM8958: | 2211 | case WM8958: |
2212 | if (wm8994->revision < 1) | 2212 | if (control->revision < 1) |
2213 | vmid_reference(codec); | 2213 | vmid_reference(codec); |
2214 | break; | 2214 | break; |
2215 | default: | 2215 | default: |
@@ -2244,7 +2244,7 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, | |||
2244 | vmid_dereference(codec); | 2244 | vmid_dereference(codec); |
2245 | break; | 2245 | break; |
2246 | case WM8958: | 2246 | case WM8958: |
2247 | if (wm8994->revision < 1) | 2247 | if (control->revision < 1) |
2248 | vmid_dereference(codec); | 2248 | vmid_dereference(codec); |
2249 | break; | 2249 | break; |
2250 | default: | 2250 | default: |
@@ -2443,7 +2443,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, | |||
2443 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | 2443 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
2444 | switch (control->type) { | 2444 | switch (control->type) { |
2445 | case WM8958: | 2445 | case WM8958: |
2446 | if (wm8994->revision == 0) { | 2446 | if (control->revision == 0) { |
2447 | /* Optimise performance for rev A */ | 2447 | /* Optimise performance for rev A */ |
2448 | snd_soc_update_bits(codec, | 2448 | snd_soc_update_bits(codec, |
2449 | WM8958_CHARGE_PUMP_2, | 2449 | WM8958_CHARGE_PUMP_2, |
@@ -3094,7 +3094,7 @@ static int wm8994_codec_resume(struct snd_soc_codec *codec) | |||
3094 | int i, ret; | 3094 | int i, ret; |
3095 | unsigned int val, mask; | 3095 | unsigned int val, mask; |
3096 | 3096 | ||
3097 | if (wm8994->revision < 4) { | 3097 | if (control->revision < 4) { |
3098 | /* force a HW read */ | 3098 | /* force a HW read */ |
3099 | ret = regmap_read(control->regmap, | 3099 | ret = regmap_read(control->regmap, |
3100 | WM8994_POWER_MANAGEMENT_5, &val); | 3100 | WM8994_POWER_MANAGEMENT_5, &val); |
@@ -3911,7 +3911,6 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3911 | codec->dapm.idle_bias_off = 1; | 3911 | codec->dapm.idle_bias_off = 1; |
3912 | 3912 | ||
3913 | /* Set revision-specific configuration */ | 3913 | /* Set revision-specific configuration */ |
3914 | wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); | ||
3915 | switch (control->type) { | 3914 | switch (control->type) { |
3916 | case WM8994: | 3915 | case WM8994: |
3917 | /* Single ended line outputs should have VMID on. */ | 3916 | /* Single ended line outputs should have VMID on. */ |
@@ -3919,7 +3918,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3919 | !control->pdata.lineout2_diff) | 3918 | !control->pdata.lineout2_diff) |
3920 | codec->dapm.idle_bias_off = 0; | 3919 | codec->dapm.idle_bias_off = 0; |
3921 | 3920 | ||
3922 | switch (wm8994->revision) { | 3921 | switch (control->revision) { |
3923 | case 2: | 3922 | case 2: |
3924 | case 3: | 3923 | case 3: |
3925 | wm8994->hubs.dcs_codes_l = -5; | 3924 | wm8994->hubs.dcs_codes_l = -5; |
@@ -3938,7 +3937,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3938 | wm8994->hubs.dcs_readback_mode = 1; | 3937 | wm8994->hubs.dcs_readback_mode = 1; |
3939 | wm8994->hubs.hp_startup_mode = 1; | 3938 | wm8994->hubs.hp_startup_mode = 1; |
3940 | 3939 | ||
3941 | switch (wm8994->revision) { | 3940 | switch (control->revision) { |
3942 | case 0: | 3941 | case 0: |
3943 | break; | 3942 | break; |
3944 | default: | 3943 | default: |
@@ -4041,7 +4040,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
4041 | 4040 | ||
4042 | switch (control->type) { | 4041 | switch (control->type) { |
4043 | case WM1811: | 4042 | case WM1811: |
4044 | if (control->cust_id > 1 || wm8994->revision > 1) { | 4043 | if (control->cust_id > 1 || control->revision > 1) { |
4045 | ret = wm8994_request_irq(wm8994->wm8994, | 4044 | ret = wm8994_request_irq(wm8994->wm8994, |
4046 | WM8994_IRQ_GPIO(6), | 4045 | WM8994_IRQ_GPIO(6), |
4047 | wm1811_jackdet_irq, "JACKDET", | 4046 | wm1811_jackdet_irq, "JACKDET", |
@@ -4155,7 +4154,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
4155 | case WM8994: | 4154 | case WM8994: |
4156 | snd_soc_dapm_new_controls(dapm, wm8994_specific_dapm_widgets, | 4155 | snd_soc_dapm_new_controls(dapm, wm8994_specific_dapm_widgets, |
4157 | ARRAY_SIZE(wm8994_specific_dapm_widgets)); | 4156 | ARRAY_SIZE(wm8994_specific_dapm_widgets)); |
4158 | if (wm8994->revision < 4) { | 4157 | if (control->revision < 4) { |
4159 | snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets, | 4158 | snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets, |
4160 | ARRAY_SIZE(wm8994_lateclk_revd_widgets)); | 4159 | ARRAY_SIZE(wm8994_lateclk_revd_widgets)); |
4161 | snd_soc_dapm_new_controls(dapm, wm8994_adc_revd_widgets, | 4160 | snd_soc_dapm_new_controls(dapm, wm8994_adc_revd_widgets, |
@@ -4176,7 +4175,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
4176 | ARRAY_SIZE(wm8958_snd_controls)); | 4175 | ARRAY_SIZE(wm8958_snd_controls)); |
4177 | snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets, | 4176 | snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets, |
4178 | ARRAY_SIZE(wm8958_dapm_widgets)); | 4177 | ARRAY_SIZE(wm8958_dapm_widgets)); |
4179 | if (wm8994->revision < 1) { | 4178 | if (control->revision < 1) { |
4180 | snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets, | 4179 | snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets, |
4181 | ARRAY_SIZE(wm8994_lateclk_revd_widgets)); | 4180 | ARRAY_SIZE(wm8994_lateclk_revd_widgets)); |
4182 | snd_soc_dapm_new_controls(dapm, wm8994_adc_revd_widgets, | 4181 | snd_soc_dapm_new_controls(dapm, wm8994_adc_revd_widgets, |
@@ -4215,7 +4214,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
4215 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, | 4214 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, |
4216 | ARRAY_SIZE(wm8994_intercon)); | 4215 | ARRAY_SIZE(wm8994_intercon)); |
4217 | 4216 | ||
4218 | if (wm8994->revision < 4) { | 4217 | if (control->revision < 4) { |
4219 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, | 4218 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, |
4220 | ARRAY_SIZE(wm8994_revd_intercon)); | 4219 | ARRAY_SIZE(wm8994_revd_intercon)); |
4221 | snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, | 4220 | snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, |
@@ -4226,7 +4225,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
4226 | } | 4225 | } |
4227 | break; | 4226 | break; |
4228 | case WM8958: | 4227 | case WM8958: |
4229 | if (wm8994->revision < 1) { | 4228 | if (control->revision < 1) { |
4230 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, | 4229 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, |
4231 | ARRAY_SIZE(wm8994_intercon)); | 4230 | ARRAY_SIZE(wm8994_intercon)); |
4232 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, | 4231 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, |