aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-01 13:58:18 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-01 13:58:18 -0400
commit6e1bd1ab1d9ab8e83cdc940df82fbf8418e2593f (patch)
treef1324a39f155375221ed88db0626f61b75c51db6 /sound/soc/codecs
parentfec6dd833e733b5d9588a1f1e4d81118b79b5774 (diff)
parent76a6106f124e375df0ea6ba6bcf204b8caff786a (diff)
Merge branch 'for-2.6.37' into for-2.6.38
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/Kconfig3
-rw-r--r--sound/soc/codecs/ad73311.c2
-rw-r--r--sound/soc/codecs/max98088.c2
-rw-r--r--sound/soc/codecs/tlv320dac33.c28
-rw-r--r--sound/soc/codecs/tpa6130a2.c28
-rw-r--r--sound/soc/codecs/wm8900.c6
-rw-r--r--sound/soc/codecs/wm9090.c2
7 files changed, 51 insertions, 20 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 658cbe07fb72..8d11fbd1b1aa 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -26,8 +26,9 @@ config SND_SOC_ALL_CODECS
26 select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC 26 select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC
27 select SND_SOC_CS42L51 if I2C 27 select SND_SOC_CS42L51 if I2C
28 select SND_SOC_CS4270 if I2C 28 select SND_SOC_CS4270 if I2C
29 select SND_SOC_CX20442
29 select SND_SOC_DA7210 if I2C 30 select SND_SOC_DA7210 if I2C
30 select SND_SOC_JZ4740 if SOC_JZ4740 31 select SND_SOC_JZ4740_CODEC if SOC_JZ4740
31 select SND_SOC_MAX98088 if I2C 32 select SND_SOC_MAX98088 if I2C
32 select SND_SOC_MAX9877 if I2C 33 select SND_SOC_MAX9877 if I2C
33 select SND_SOC_PCM3008 34 select SND_SOC_PCM3008
diff --git a/sound/soc/codecs/ad73311.c b/sound/soc/codecs/ad73311.c
index c53955fe17b6..de799cd1ba72 100644
--- a/sound/soc/codecs/ad73311.c
+++ b/sound/soc/codecs/ad73311.c
@@ -47,7 +47,7 @@ static int ad73311_probe(struct platform_device *pdev)
47 &soc_codec_dev_ad73311, &ad73311_dai, 1); 47 &soc_codec_dev_ad73311, &ad73311_dai, 1);
48} 48}
49 49
50static int ad73311_remove(struct platform_device *pdev) 50static int __devexit ad73311_remove(struct platform_device *pdev)
51{ 51{
52 snd_soc_unregister_codec(&pdev->dev); 52 snd_soc_unregister_codec(&pdev->dev);
53 return 0; 53 return 0;
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index e7a40d16df90..bc22ee93a75d 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -2051,7 +2051,7 @@ static int max98088_i2c_probe(struct i2c_client *i2c,
2051 return ret; 2051 return ret;
2052} 2052}
2053 2053
2054static int max98088_i2c_remove(struct i2c_client *client) 2054static int __devexit max98088_i2c_remove(struct i2c_client *client)
2055{ 2055{
2056 snd_soc_unregister_codec(&client->dev); 2056 snd_soc_unregister_codec(&client->dev);
2057 kfree(i2c_get_clientdata(client)); 2057 kfree(i2c_get_clientdata(client));
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index bf6d01f4a45a..d251ff54a2d3 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -524,6 +524,22 @@ static const struct soc_enum dac33_fifo_mode_enum =
524 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(dac33_fifo_mode_texts), 524 SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(dac33_fifo_mode_texts),
525 dac33_fifo_mode_texts); 525 dac33_fifo_mode_texts);
526 526
527/* L/R Line Output Gain */
528static const char *lr_lineout_gain_texts[] = {
529 "Line -12dB DAC 0dB", "Line -6dB DAC 6dB",
530 "Line 0dB DAC 12dB", "Line 6dB DAC 18dB",
531};
532
533static const struct soc_enum l_lineout_gain_enum =
534 SOC_ENUM_SINGLE(DAC33_LDAC_PWR_CTRL, 0,
535 ARRAY_SIZE(lr_lineout_gain_texts),
536 lr_lineout_gain_texts);
537
538static const struct soc_enum r_lineout_gain_enum =
539 SOC_ENUM_SINGLE(DAC33_RDAC_PWR_CTRL, 0,
540 ARRAY_SIZE(lr_lineout_gain_texts),
541 lr_lineout_gain_texts);
542
527/* 543/*
528 * DACL/R digital volume control: 544 * DACL/R digital volume control:
529 * from 0 dB to -63.5 in 0.5 dB steps 545 * from 0 dB to -63.5 in 0.5 dB steps
@@ -541,6 +557,8 @@ static const struct snd_kcontrol_new dac33_snd_controls[] = {
541 DAC33_LDAC_DIG_VOL_CTRL, DAC33_RDAC_DIG_VOL_CTRL, 7, 1, 1), 557 DAC33_LDAC_DIG_VOL_CTRL, DAC33_RDAC_DIG_VOL_CTRL, 7, 1, 1),
542 SOC_DOUBLE_R("Line to Line Out Volume", 558 SOC_DOUBLE_R("Line to Line Out Volume",
543 DAC33_LINEL_TO_LLO_VOL, DAC33_LINER_TO_RLO_VOL, 0, 127, 1), 559 DAC33_LINEL_TO_LLO_VOL, DAC33_LINER_TO_RLO_VOL, 0, 127, 1),
560 SOC_ENUM("Left Line Output Gain", l_lineout_gain_enum),
561 SOC_ENUM("Right Line Output Gain", r_lineout_gain_enum),
544}; 562};
545 563
546static const struct snd_kcontrol_new dac33_mode_snd_controls[] = { 564static const struct snd_kcontrol_new dac33_mode_snd_controls[] = {
@@ -651,6 +669,7 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,
651static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) 669static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
652{ 670{
653 struct snd_soc_codec *codec = dac33->codec; 671 struct snd_soc_codec *codec = dac33->codec;
672 unsigned int delay;
654 673
655 switch (dac33->fifo_mode) { 674 switch (dac33->fifo_mode) {
656 case DAC33_FIFO_MODE1: 675 case DAC33_FIFO_MODE1:
@@ -666,8 +685,9 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
666 dac33_write16(codec, DAC33_PREFILL_MSB, 685 dac33_write16(codec, DAC33_PREFILL_MSB,
667 DAC33_THRREG(dac33->alarm_threshold)); 686 DAC33_THRREG(dac33->alarm_threshold));
668 /* Enable Alarm Threshold IRQ with a delay */ 687 /* Enable Alarm Threshold IRQ with a delay */
669 udelay(SAMPLES_TO_US(dac33->burst_rate, 688 delay = SAMPLES_TO_US(dac33->burst_rate,
670 dac33->alarm_threshold)); 689 dac33->alarm_threshold) + 1000;
690 usleep_range(delay, delay + 500);
671 dac33_write(codec, DAC33_FIFO_IRQ_MASK, DAC33_MAT); 691 dac33_write(codec, DAC33_FIFO_IRQ_MASK, DAC33_MAT);
672 break; 692 break;
673 case DAC33_FIFO_MODE7: 693 case DAC33_FIFO_MODE7:
@@ -767,11 +787,11 @@ static irqreturn_t dac33_interrupt_handler(int irq, void *dev)
767 787
768static void dac33_oscwait(struct snd_soc_codec *codec) 788static void dac33_oscwait(struct snd_soc_codec *codec)
769{ 789{
770 int timeout = 20; 790 int timeout = 60;
771 u8 reg; 791 u8 reg;
772 792
773 do { 793 do {
774 msleep(1); 794 usleep_range(1000, 2000);
775 dac33_read(codec, DAC33_INT_OSC_STATUS, &reg); 795 dac33_read(codec, DAC33_INT_OSC_STATUS, &reg);
776 } while (((reg & 0x03) != DAC33_OSCSTATUS_NORMAL) && timeout--); 796 } while (((reg & 0x03) != DAC33_OSCSTATUS_NORMAL) && timeout--);
777 if ((reg & 0x03) != DAC33_OSCSTATUS_NORMAL) 797 if ((reg & 0x03) != DAC33_OSCSTATUS_NORMAL)
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 99b70e5978a2..329acc1a2074 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -98,16 +98,21 @@ static u8 tpa6130a2_read(int reg)
98 return data->regs[reg]; 98 return data->regs[reg];
99} 99}
100 100
101static void tpa6130a2_initialize(void) 101static int tpa6130a2_initialize(void)
102{ 102{
103 struct tpa6130a2_data *data; 103 struct tpa6130a2_data *data;
104 int i; 104 int i, ret = 0;
105 105
106 BUG_ON(tpa6130a2_client == NULL); 106 BUG_ON(tpa6130a2_client == NULL);
107 data = i2c_get_clientdata(tpa6130a2_client); 107 data = i2c_get_clientdata(tpa6130a2_client);
108 108
109 for (i = 1; i < TPA6130A2_REG_VERSION; i++) 109 for (i = 1; i < TPA6130A2_REG_VERSION; i++) {
110 tpa6130a2_i2c_write(i, data->regs[i]); 110 ret = tpa6130a2_i2c_write(i, data->regs[i]);
111 if (ret < 0)
112 break;
113 }
114
115 return ret;
111} 116}
112 117
113static int tpa6130a2_power(int power) 118static int tpa6130a2_power(int power)
@@ -133,7 +138,16 @@ static int tpa6130a2_power(int power)
133 } 138 }
134 139
135 data->power_state = 1; 140 data->power_state = 1;
136 tpa6130a2_initialize(); 141 ret = tpa6130a2_initialize();
142 if (ret < 0) {
143 dev_err(&tpa6130a2_client->dev,
144 "Failed to initialize chip\n");
145 if (data->power_gpio >= 0)
146 gpio_set_value(data->power_gpio, 0);
147 regulator_disable(data->supply);
148 data->power_state = 0;
149 goto exit;
150 }
137 151
138 /* Clear SWS */ 152 /* Clear SWS */
139 val = tpa6130a2_read(TPA6130A2_REG_CONTROL); 153 val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
@@ -375,7 +389,9 @@ int tpa6130a2_add_controls(struct snd_soc_codec *codec)
375{ 389{
376 struct tpa6130a2_data *data; 390 struct tpa6130a2_data *data;
377 391
378 BUG_ON(tpa6130a2_client == NULL); 392 if (tpa6130a2_client == NULL)
393 return -ENODEV;
394
379 data = i2c_get_clientdata(tpa6130a2_client); 395 data = i2c_get_clientdata(tpa6130a2_client);
380 396
381 snd_soc_dapm_new_controls(codec, tpa6130a2_dapm_widgets, 397 snd_soc_dapm_new_controls(codec, tpa6130a2_dapm_widgets,
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c
index b4f11724a63f..aca4b1ea10bb 100644
--- a/sound/soc/codecs/wm8900.c
+++ b/sound/soc/codecs/wm8900.c
@@ -186,7 +186,6 @@ static int wm8900_volatile_register(unsigned int reg)
186{ 186{
187 switch (reg) { 187 switch (reg) {
188 case WM8900_REG_ID: 188 case WM8900_REG_ID:
189 case WM8900_REG_POWER1:
190 return 1; 189 return 1;
191 default: 190 default:
192 return 0; 191 return 0;
@@ -1200,11 +1199,6 @@ static int wm8900_probe(struct snd_soc_codec *codec)
1200 return -ENODEV; 1199 return -ENODEV;
1201 } 1200 }
1202 1201
1203 /* Read back from the chip */
1204 reg = snd_soc_read(codec, WM8900_REG_POWER1);
1205 reg = (reg >> 12) & 0xf;
1206 dev_info(codec->dev, "WM8900 revision %d\n", reg);
1207
1208 wm8900_reset(codec); 1202 wm8900_reset(codec);
1209 1203
1210 /* Turn the chip on */ 1204 /* Turn the chip on */
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c
index 7a1825418ee4..99c046ba46bb 100644
--- a/sound/soc/codecs/wm9090.c
+++ b/sound/soc/codecs/wm9090.c
@@ -665,7 +665,7 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
665 return ret; 665 return ret;
666} 666}
667 667
668static int wm9090_i2c_remove(struct i2c_client *i2c) 668static int __devexit wm9090_i2c_remove(struct i2c_client *i2c)
669{ 669{
670 struct wm9090_priv *wm9090 = i2c_get_clientdata(i2c); 670 struct wm9090_priv *wm9090 = i2c_get_clientdata(i2c);
671 671