diff options
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/max98088.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/stac9766.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/tpa6130a2.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/uda134x.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/wm8350.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/wm8523.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/wm8776.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/wm8904.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm8961.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/wm8962.c | 5 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.c | 6 |
12 files changed, 43 insertions, 11 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index bc22ee93a75d..d63e28773eb1 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -28,6 +28,11 @@ | |||
28 | #include <sound/max98088.h> | 28 | #include <sound/max98088.h> |
29 | #include "max98088.h" | 29 | #include "max98088.h" |
30 | 30 | ||
31 | enum max98088_type { | ||
32 | MAX98088, | ||
33 | MAX98089, | ||
34 | }; | ||
35 | |||
31 | struct max98088_cdata { | 36 | struct max98088_cdata { |
32 | unsigned int rate; | 37 | unsigned int rate; |
33 | unsigned int fmt; | 38 | unsigned int fmt; |
@@ -36,6 +41,7 @@ struct max98088_cdata { | |||
36 | 41 | ||
37 | struct max98088_priv { | 42 | struct max98088_priv { |
38 | u8 reg_cache[M98088_REG_CNT]; | 43 | u8 reg_cache[M98088_REG_CNT]; |
44 | enum max98088_type devtype; | ||
39 | void *control_data; | 45 | void *control_data; |
40 | struct max98088_pdata *pdata; | 46 | struct max98088_pdata *pdata; |
41 | unsigned int sysclk; | 47 | unsigned int sysclk; |
@@ -2013,7 +2019,10 @@ err_access: | |||
2013 | 2019 | ||
2014 | static int max98088_remove(struct snd_soc_codec *codec) | 2020 | static int max98088_remove(struct snd_soc_codec *codec) |
2015 | { | 2021 | { |
2022 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); | ||
2023 | |||
2016 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2024 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2025 | kfree(max98088->eq_texts); | ||
2017 | 2026 | ||
2018 | return 0; | 2027 | return 0; |
2019 | } | 2028 | } |
@@ -2040,6 +2049,8 @@ static int max98088_i2c_probe(struct i2c_client *i2c, | |||
2040 | if (max98088 == NULL) | 2049 | if (max98088 == NULL) |
2041 | return -ENOMEM; | 2050 | return -ENOMEM; |
2042 | 2051 | ||
2052 | max98088->devtype = id->driver_data; | ||
2053 | |||
2043 | i2c_set_clientdata(i2c, max98088); | 2054 | i2c_set_clientdata(i2c, max98088); |
2044 | max98088->control_data = i2c; | 2055 | max98088->control_data = i2c; |
2045 | max98088->pdata = i2c->dev.platform_data; | 2056 | max98088->pdata = i2c->dev.platform_data; |
@@ -2059,7 +2070,8 @@ static int __devexit max98088_i2c_remove(struct i2c_client *client) | |||
2059 | } | 2070 | } |
2060 | 2071 | ||
2061 | static const struct i2c_device_id max98088_i2c_id[] = { | 2072 | static const struct i2c_device_id max98088_i2c_id[] = { |
2062 | { "max98088", 0 }, | 2073 | { "max98088", MAX98088 }, |
2074 | { "max98089", MAX98089 }, | ||
2063 | { } | 2075 | { } |
2064 | }; | 2076 | }; |
2065 | MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); | 2077 | MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); |
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c index 00d67cc8e206..061f9e5a497b 100644 --- a/sound/soc/codecs/stac9766.c +++ b/sound/soc/codecs/stac9766.c | |||
@@ -383,6 +383,7 @@ static struct snd_soc_codec_driver soc_codec_dev_stac9766 = { | |||
383 | .reg_cache_size = sizeof(stac9766_reg), | 383 | .reg_cache_size = sizeof(stac9766_reg), |
384 | .reg_word_size = sizeof(u16), | 384 | .reg_word_size = sizeof(u16), |
385 | .reg_cache_step = 2, | 385 | .reg_cache_step = 2, |
386 | .reg_cache_default = stac9766_reg, | ||
386 | }; | 387 | }; |
387 | 388 | ||
388 | static __devinit int stac9766_probe(struct platform_device *pdev) | 389 | static __devinit int stac9766_probe(struct platform_device *pdev) |
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index fc687790188b..77b8f9ae29be 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -1176,7 +1176,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_gpio); | |||
1176 | int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio) | 1176 | int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio) |
1177 | { | 1177 | { |
1178 | u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; | 1178 | u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; |
1179 | u8 val, bit = gpio ? 2: 1; | 1179 | u8 val = 0, bit = gpio ? 2 : 1; |
1180 | 1180 | ||
1181 | aic3x_read(codec, reg, &val); | 1181 | aic3x_read(codec, reg, &val); |
1182 | return (val >> bit) & 1; | 1182 | return (val >> bit) & 1; |
@@ -1204,7 +1204,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_headset_detection); | |||
1204 | 1204 | ||
1205 | int aic3x_headset_detected(struct snd_soc_codec *codec) | 1205 | int aic3x_headset_detected(struct snd_soc_codec *codec) |
1206 | { | 1206 | { |
1207 | u8 val; | 1207 | u8 val = 0; |
1208 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); | 1208 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); |
1209 | return (val >> 4) & 1; | 1209 | return (val >> 4) & 1; |
1210 | } | 1210 | } |
@@ -1212,7 +1212,7 @@ EXPORT_SYMBOL_GPL(aic3x_headset_detected); | |||
1212 | 1212 | ||
1213 | int aic3x_button_pressed(struct snd_soc_codec *codec) | 1213 | int aic3x_button_pressed(struct snd_soc_codec *codec) |
1214 | { | 1214 | { |
1215 | u8 val; | 1215 | u8 val = 0; |
1216 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); | 1216 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); |
1217 | return (val >> 5) & 1; | 1217 | return (val >> 5) & 1; |
1218 | } | 1218 | } |
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index ee4fb201de60..d2c243095673 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c | |||
@@ -78,8 +78,10 @@ static int tpa6130a2_i2c_write(int reg, u8 value) | |||
78 | 78 | ||
79 | if (data->power_state) { | 79 | if (data->power_state) { |
80 | val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value); | 80 | val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value); |
81 | if (val < 0) | 81 | if (val < 0) { |
82 | dev_err(&tpa6130a2_client->dev, "Write failed\n"); | 82 | dev_err(&tpa6130a2_client->dev, "Write failed\n"); |
83 | return val; | ||
84 | } | ||
83 | } | 85 | } |
84 | 86 | ||
85 | /* Either powered on or off, we save the context */ | 87 | /* Either powered on or off, we save the context */ |
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 7540a509a6f5..464f0cfa4c7a 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c | |||
@@ -597,6 +597,7 @@ static struct snd_soc_codec_driver soc_codec_dev_uda134x = { | |||
597 | .resume = uda134x_soc_resume, | 597 | .resume = uda134x_soc_resume, |
598 | .reg_cache_size = sizeof(uda134x_reg), | 598 | .reg_cache_size = sizeof(uda134x_reg), |
599 | .reg_word_size = sizeof(u8), | 599 | .reg_word_size = sizeof(u8), |
600 | .reg_cache_default = uda134x_reg, | ||
600 | .reg_cache_step = 1, | 601 | .reg_cache_step = 1, |
601 | .read = uda134x_read_reg_cache, | 602 | .read = uda134x_read_reg_cache, |
602 | .write = uda134x_write, | 603 | .write = uda134x_write, |
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index f4f1fba38eb9..7611add7f8c3 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -831,7 +831,7 @@ static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
831 | } | 831 | } |
832 | 832 | ||
833 | /* MCLK direction */ | 833 | /* MCLK direction */ |
834 | if (dir == WM8350_MCLK_DIR_OUT) | 834 | if (dir == SND_SOC_CLOCK_OUT) |
835 | wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_2, | 835 | wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_2, |
836 | WM8350_MCLK_DIR); | 836 | WM8350_MCLK_DIR); |
837 | else | 837 | else |
@@ -1586,6 +1586,13 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec) | |||
1586 | wm8350_set_bits(wm8350, WM8350_ROUT2_VOLUME, | 1586 | wm8350_set_bits(wm8350, WM8350_ROUT2_VOLUME, |
1587 | WM8350_OUT2_VU | WM8350_OUT2R_MUTE); | 1587 | WM8350_OUT2_VU | WM8350_OUT2R_MUTE); |
1588 | 1588 | ||
1589 | /* Make sure AIF tristating is disabled by default */ | ||
1590 | wm8350_clear_bits(wm8350, WM8350_AI_FORMATING, WM8350_AIF_TRI); | ||
1591 | |||
1592 | /* Make sure we've got a sane companding setup too */ | ||
1593 | wm8350_clear_bits(wm8350, WM8350_ADC_DAC_COMP, | ||
1594 | WM8350_DAC_COMP | WM8350_LOOPBACK); | ||
1595 | |||
1589 | /* Make sure jack detect is disabled to start off with */ | 1596 | /* Make sure jack detect is disabled to start off with */ |
1590 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, | 1597 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, |
1591 | WM8350_JDL_ENA | WM8350_JDR_ENA); | 1598 | WM8350_JDL_ENA | WM8350_JDR_ENA); |
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 712ef7c76f90..9a433a5396cb 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c | |||
@@ -146,7 +146,6 @@ static int wm8523_startup(struct snd_pcm_substream *substream, | |||
146 | return -EINVAL; | 146 | return -EINVAL; |
147 | } | 147 | } |
148 | 148 | ||
149 | return 0; | ||
150 | snd_pcm_hw_constraint_list(substream->runtime, 0, | 149 | snd_pcm_hw_constraint_list(substream->runtime, 0, |
151 | SNDRV_PCM_HW_PARAM_RATE, | 150 | SNDRV_PCM_HW_PARAM_RATE, |
152 | &wm8523->rate_constraint); | 151 | &wm8523->rate_constraint); |
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c index 04182c464e35..0132a27140ae 100644 --- a/sound/soc/codecs/wm8776.c +++ b/sound/soc/codecs/wm8776.c | |||
@@ -34,7 +34,6 @@ | |||
34 | /* codec private data */ | 34 | /* codec private data */ |
35 | struct wm8776_priv { | 35 | struct wm8776_priv { |
36 | enum snd_soc_control_type control_type; | 36 | enum snd_soc_control_type control_type; |
37 | u16 reg_cache[WM8776_CACHEREGNUM]; | ||
38 | int sysclk[2]; | 37 | int sysclk[2]; |
39 | }; | 38 | }; |
40 | 39 | ||
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 33be84e506ea..fca60a0b57b8 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
@@ -2498,6 +2498,8 @@ static int wm8904_remove(struct snd_soc_codec *codec) | |||
2498 | 2498 | ||
2499 | wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2499 | wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2500 | regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); | 2500 | regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); |
2501 | kfree(wm8904->retune_mobile_texts); | ||
2502 | kfree(wm8904->drc_texts); | ||
2501 | 2503 | ||
2502 | return 0; | 2504 | return 0; |
2503 | } | 2505 | } |
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 4f326f604104..8340485c9851 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c | |||
@@ -711,7 +711,7 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream, | |||
711 | if (fs <= 24000) | 711 | if (fs <= 24000) |
712 | reg |= WM8961_DACSLOPE; | 712 | reg |= WM8961_DACSLOPE; |
713 | else | 713 | else |
714 | reg &= WM8961_DACSLOPE; | 714 | reg &= ~WM8961_DACSLOPE; |
715 | snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); | 715 | snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); |
716 | 716 | ||
717 | return 0; | 717 | return 0; |
@@ -736,7 +736,7 @@ static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
736 | freq /= 2; | 736 | freq /= 2; |
737 | } else { | 737 | } else { |
738 | dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); | 738 | dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); |
739 | reg &= WM8961_MCLKDIV; | 739 | reg &= ~WM8961_MCLKDIV; |
740 | } | 740 | } |
741 | 741 | ||
742 | snd_soc_write(codec, WM8961_CLOCKING1, reg); | 742 | snd_soc_write(codec, WM8961_CLOCKING1, reg); |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 894d0cd3aa9b..e8092745a207 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -3500,8 +3500,11 @@ static ssize_t wm8962_beep_set(struct device *dev, | |||
3500 | { | 3500 | { |
3501 | struct wm8962_priv *wm8962 = dev_get_drvdata(dev); | 3501 | struct wm8962_priv *wm8962 = dev_get_drvdata(dev); |
3502 | long int time; | 3502 | long int time; |
3503 | int ret; | ||
3503 | 3504 | ||
3504 | strict_strtol(buf, 10, &time); | 3505 | ret = strict_strtol(buf, 10, &time); |
3506 | if (ret != 0) | ||
3507 | return ret; | ||
3505 | 3508 | ||
3506 | input_event(wm8962->beep, EV_SND, SND_TONE, time); | 3509 | input_event(wm8962->beep, EV_SND, SND_TONE, time); |
3507 | 3510 | ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 0db59c3aa5d4..4d3e6f1ac584 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -3903,6 +3903,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3903 | return -ENOMEM; | 3903 | return -ENOMEM; |
3904 | snd_soc_codec_set_drvdata(codec, wm8994); | 3904 | snd_soc_codec_set_drvdata(codec, wm8994); |
3905 | 3905 | ||
3906 | codec->reg_cache = &wm8994->reg_cache; | ||
3907 | |||
3906 | wm8994->pdata = dev_get_platdata(codec->dev->parent); | 3908 | wm8994->pdata = dev_get_platdata(codec->dev->parent); |
3907 | wm8994->codec = codec; | 3909 | wm8994->codec = codec; |
3908 | 3910 | ||
@@ -4059,6 +4061,8 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) | |||
4059 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); | 4061 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); |
4060 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); | 4062 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); |
4061 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994); | 4063 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994); |
4064 | kfree(wm8994->retune_mobile_texts); | ||
4065 | kfree(wm8994->drc_texts); | ||
4062 | kfree(wm8994); | 4066 | kfree(wm8994); |
4063 | 4067 | ||
4064 | return 0; | 4068 | return 0; |
@@ -4071,6 +4075,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { | |||
4071 | .resume = wm8994_resume, | 4075 | .resume = wm8994_resume, |
4072 | .read = wm8994_read, | 4076 | .read = wm8994_read, |
4073 | .write = wm8994_write, | 4077 | .write = wm8994_write, |
4078 | .readable_register = wm8994_readable, | ||
4079 | .volatile_register = wm8994_volatile, | ||
4074 | .set_bias_level = wm8994_set_bias_level, | 4080 | .set_bias_level = wm8994_set_bias_level, |
4075 | }; | 4081 | }; |
4076 | 4082 | ||