aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/ad1836.h2
-rw-r--r--sound/soc/codecs/cs4270.c10
-rw-r--r--sound/soc/codecs/cs42l51.c2
-rw-r--r--sound/soc/codecs/max9877.c10
-rw-r--r--sound/soc/codecs/uda1380.c4
-rw-r--r--sound/soc/codecs/wm8994.c19
6 files changed, 23 insertions, 24 deletions
diff --git a/sound/soc/codecs/ad1836.h b/sound/soc/codecs/ad1836.h
index 444747f0db26..dd7be0dbbc58 100644
--- a/sound/soc/codecs/ad1836.h
+++ b/sound/soc/codecs/ad1836.h
@@ -34,7 +34,7 @@
34 34
35#define AD1836_ADC_CTRL2 13 35#define AD1836_ADC_CTRL2 13
36#define AD1836_ADC_WORD_LEN_MASK 0x30 36#define AD1836_ADC_WORD_LEN_MASK 0x30
37#define AD1836_ADC_WORD_OFFSET 5 37#define AD1836_ADC_WORD_OFFSET 4
38#define AD1836_ADC_SERFMT_MASK (7 << 6) 38#define AD1836_ADC_SERFMT_MASK (7 << 6)
39#define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) 39#define AD1836_ADC_SERFMT_PCK256 (0x4 << 6)
40#define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) 40#define AD1836_ADC_SERFMT_PCK128 (0x5 << 6)
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index f1f237ecec2a..73f46eb459f1 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -601,7 +601,6 @@ static int cs4270_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg)
601static int cs4270_soc_resume(struct snd_soc_codec *codec) 601static int cs4270_soc_resume(struct snd_soc_codec *codec)
602{ 602{
603 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); 603 struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
604 struct i2c_client *i2c_client = to_i2c_client(codec->dev);
605 int reg; 604 int reg;
606 605
607 regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies), 606 regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
@@ -612,14 +611,7 @@ static int cs4270_soc_resume(struct snd_soc_codec *codec)
612 ndelay(500); 611 ndelay(500);
613 612
614 /* first restore the entire register cache ... */ 613 /* first restore the entire register cache ... */
615 for (reg = CS4270_FIRSTREG; reg <= CS4270_LASTREG; reg++) { 614 snd_soc_cache_sync(codec);
616 u8 val = snd_soc_read(codec, reg);
617
618 if (i2c_smbus_write_byte_data(i2c_client, reg, val)) {
619 dev_err(codec->dev, "i2c write failed\n");
620 return -EIO;
621 }
622 }
623 615
624 /* ... then disable the power-down bits */ 616 /* ... then disable the power-down bits */
625 reg = snd_soc_read(codec, CS4270_PWRCTL); 617 reg = snd_soc_read(codec, CS4270_PWRCTL);
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
index 8c3c8205d19e..1ee66361f61b 100644
--- a/sound/soc/codecs/cs42l51.c
+++ b/sound/soc/codecs/cs42l51.c
@@ -555,7 +555,7 @@ static int cs42l51_probe(struct snd_soc_codec *codec)
555 555
556static struct snd_soc_codec_driver soc_codec_device_cs42l51 = { 556static struct snd_soc_codec_driver soc_codec_device_cs42l51 = {
557 .probe = cs42l51_probe, 557 .probe = cs42l51_probe,
558 .reg_cache_size = CS42L51_NUMREGS, 558 .reg_cache_size = CS42L51_NUMREGS + 1,
559 .reg_word_size = sizeof(u8), 559 .reg_word_size = sizeof(u8),
560}; 560};
561 561
diff --git a/sound/soc/codecs/max9877.c b/sound/soc/codecs/max9877.c
index 9e7e964a5fa3..dcf6f2a1600a 100644
--- a/sound/soc/codecs/max9877.c
+++ b/sound/soc/codecs/max9877.c
@@ -106,13 +106,13 @@ static int max9877_set_2reg(struct snd_kcontrol *kcontrol,
106 unsigned int mask = mc->max; 106 unsigned int mask = mc->max;
107 unsigned int val = (ucontrol->value.integer.value[0] & mask); 107 unsigned int val = (ucontrol->value.integer.value[0] & mask);
108 unsigned int val2 = (ucontrol->value.integer.value[1] & mask); 108 unsigned int val2 = (ucontrol->value.integer.value[1] & mask);
109 unsigned int change = 1; 109 unsigned int change = 0;
110 110
111 if (((max9877_regs[reg] >> shift) & mask) == val) 111 if (((max9877_regs[reg] >> shift) & mask) != val)
112 change = 0; 112 change = 1;
113 113
114 if (((max9877_regs[reg2] >> shift) & mask) == val2) 114 if (((max9877_regs[reg2] >> shift) & mask) != val2)
115 change = 0; 115 change = 1;
116 116
117 if (change) { 117 if (change) {
118 max9877_regs[reg] &= ~(mask << shift); 118 max9877_regs[reg] &= ~(mask << shift);
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index c5ca8cfea60f..0441893e270e 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -863,13 +863,13 @@ static struct i2c_driver uda1380_i2c_driver = {
863 863
864static int __init uda1380_modinit(void) 864static int __init uda1380_modinit(void)
865{ 865{
866 int ret; 866 int ret = 0;
867#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 867#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
868 ret = i2c_add_driver(&uda1380_i2c_driver); 868 ret = i2c_add_driver(&uda1380_i2c_driver);
869 if (ret != 0) 869 if (ret != 0)
870 pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); 870 pr_err("Failed to register UDA1380 I2C driver: %d\n", ret);
871#endif 871#endif
872 return 0; 872 return ret;
873} 873}
874module_init(uda1380_modinit); 874module_init(uda1380_modinit);
875 875
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 9c982e47eb99..d0c545b73d78 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -1325,15 +1325,15 @@ SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0),
1325}; 1325};
1326 1326
1327static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = { 1327static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = {
1328SND_SOC_DAPM_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux, 1328SND_SOC_DAPM_VIRT_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux,
1329 adc_mux_ev, SND_SOC_DAPM_PRE_PMU), 1329 adc_mux_ev, SND_SOC_DAPM_PRE_PMU),
1330SND_SOC_DAPM_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux, 1330SND_SOC_DAPM_VIRT_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux,
1331 adc_mux_ev, SND_SOC_DAPM_PRE_PMU), 1331 adc_mux_ev, SND_SOC_DAPM_PRE_PMU),
1332}; 1332};
1333 1333
1334static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = { 1334static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = {
1335SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), 1335SND_SOC_DAPM_VIRT_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux),
1336SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), 1336SND_SOC_DAPM_VIRT_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux),
1337}; 1337};
1338 1338
1339static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { 1339static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = {
@@ -2357,6 +2357,11 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream,
2357 bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT; 2357 bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT;
2358 2358
2359 lrclk = bclk_rate / params_rate(params); 2359 lrclk = bclk_rate / params_rate(params);
2360 if (!lrclk) {
2361 dev_err(dai->dev, "Unable to generate LRCLK from %dHz BCLK\n",
2362 bclk_rate);
2363 return -EINVAL;
2364 }
2360 dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n", 2365 dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n",
2361 lrclk, bclk_rate / lrclk); 2366 lrclk, bclk_rate / lrclk);
2362 2367
@@ -3178,6 +3183,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3178 switch (wm8994->revision) { 3183 switch (wm8994->revision) {
3179 case 0: 3184 case 0:
3180 case 1: 3185 case 1:
3186 case 2:
3187 case 3:
3181 wm8994->hubs.dcs_codes_l = -9; 3188 wm8994->hubs.dcs_codes_l = -9;
3182 wm8994->hubs.dcs_codes_r = -5; 3189 wm8994->hubs.dcs_codes_r = -5;
3183 break; 3190 break;