aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-13 08:32:54 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-13 08:32:54 -0400
commitdc2af52c0d6d00fd530e4a5e300834cdb1bb1c1c (patch)
tree4573b99fb11e5b93bd011045039b370ddafe45e6 /sound
parentf1992dde7fef6713a469a5a142b86812b8a47f9e (diff)
parent36be50515fe2aef61533b516fa2576a2c7fe7664 (diff)
Merge tag 'v3.4-rc7' into for-3.5
Linux 3.4-rc7 Conflicts): drivers/base/regmap/regmap.c (overlap with bug fixes) sound/soc/blackfin/bf5xx-ssm2602.c (overlap with bug fixes)
Diffstat (limited to 'sound')
-rw-r--r--sound/core/vmaster.c1
-rw-r--r--sound/last.c2
-rw-r--r--sound/pci/echoaudio/echoaudio_dsp.c2
-rw-r--r--sound/pci/hda/hda_codec.c4
-rw-r--r--sound/pci/hda/hda_intel.c20
-rw-r--r--sound/pci/hda/patch_conexant.c35
-rw-r--r--sound/pci/hda/patch_realtek.c66
-rw-r--r--sound/pci/hda/patch_sigmatel.c5
-rw-r--r--sound/pci/rme9652/hdsp.c1
-rw-r--r--sound/soc/blackfin/bf5xx-ssm2602.c2
-rw-r--r--sound/soc/codecs/Kconfig3
-rw-r--r--sound/soc/codecs/cs42l73.c2
-rw-r--r--sound/soc/codecs/tlv320aic23.c4
-rw-r--r--sound/soc/codecs/twl6040.c3
-rw-r--r--sound/soc/codecs/wm8350.c11
-rw-r--r--sound/soc/codecs/wm8994.c276
-rw-r--r--sound/soc/codecs/wm_hubs.c15
-rw-r--r--sound/soc/omap/Kconfig2
-rw-r--r--sound/soc/omap/omap-pcm.c4
-rw-r--r--sound/soc/samsung/s3c2412-i2s.c2
-rw-r--r--sound/soc/sh/fsi.c7
-rw-r--r--sound/soc/sh/migor.c2
-rw-r--r--sound/soc/soc-core.c7
-rw-r--r--sound/soc/soc-dapm.c2
24 files changed, 370 insertions, 108 deletions
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c
index 14a286a7bf2b..857586135d18 100644
--- a/sound/core/vmaster.c
+++ b/sound/core/vmaster.c
@@ -419,6 +419,7 @@ EXPORT_SYMBOL(snd_ctl_make_virtual_master);
419 * snd_ctl_add_vmaster_hook - Add a hook to a vmaster control 419 * snd_ctl_add_vmaster_hook - Add a hook to a vmaster control
420 * @kcontrol: vmaster kctl element 420 * @kcontrol: vmaster kctl element
421 * @hook: the hook function 421 * @hook: the hook function
422 * @private_data: the private_data pointer to be saved
422 * 423 *
423 * Adds the given hook to the vmaster control element so that it's called 424 * Adds the given hook to the vmaster control element so that it's called
424 * at each time when the value is changed. 425 * at each time when the value is changed.
diff --git a/sound/last.c b/sound/last.c
index bdd0857b8871..7ffc182e0844 100644
--- a/sound/last.c
+++ b/sound/last.c
@@ -38,4 +38,4 @@ static int __init alsa_sound_last_init(void)
38 return 0; 38 return 0;
39} 39}
40 40
41__initcall(alsa_sound_last_init); 41late_initcall_sync(alsa_sound_last_init);
diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/echoaudio_dsp.c
index 64417a733220..d8c670c9d62c 100644
--- a/sound/pci/echoaudio/echoaudio_dsp.c
+++ b/sound/pci/echoaudio/echoaudio_dsp.c
@@ -475,7 +475,7 @@ static int load_firmware(struct echoaudio *chip)
475 const struct firmware *fw; 475 const struct firmware *fw;
476 int box_type, err; 476 int box_type, err;
477 477
478 if (snd_BUG_ON(!chip->dsp_code_to_load || !chip->comm_page)) 478 if (snd_BUG_ON(!chip->comm_page))
479 return -EPERM; 479 return -EPERM;
480 480
481 /* See if the ASIC is present and working - only if the DSP is already loaded */ 481 /* See if the ASIC is present and working - only if the DSP is already loaded */
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 7a8fcc4c15f8..841475cc13b6 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5444,10 +5444,6 @@ int snd_hda_suspend(struct hda_bus *bus)
5444 list_for_each_entry(codec, &bus->codec_list, list) { 5444 list_for_each_entry(codec, &bus->codec_list, list) {
5445 if (hda_codec_is_power_on(codec)) 5445 if (hda_codec_is_power_on(codec))
5446 hda_call_codec_suspend(codec); 5446 hda_call_codec_suspend(codec);
5447 else /* forcibly change the power to D3 even if not used */
5448 hda_set_power_state(codec,
5449 codec->afg ? codec->afg : codec->mfg,
5450 AC_PWRST_D3);
5451 if (codec->patch_ops.post_suspend) 5447 if (codec->patch_ops.post_suspend)
5452 codec->patch_ops.post_suspend(codec); 5448 codec->patch_ops.post_suspend(codec);
5453 } 5449 }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c19e71a94e1b..1f350522bed4 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -783,11 +783,13 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
783{ 783{
784 struct azx *chip = bus->private_data; 784 struct azx *chip = bus->private_data;
785 unsigned long timeout; 785 unsigned long timeout;
786 unsigned long loopcounter;
786 int do_poll = 0; 787 int do_poll = 0;
787 788
788 again: 789 again:
789 timeout = jiffies + msecs_to_jiffies(1000); 790 timeout = jiffies + msecs_to_jiffies(1000);
790 for (;;) { 791
792 for (loopcounter = 0;; loopcounter++) {
791 if (chip->polling_mode || do_poll) { 793 if (chip->polling_mode || do_poll) {
792 spin_lock_irq(&chip->reg_lock); 794 spin_lock_irq(&chip->reg_lock);
793 azx_update_rirb(chip); 795 azx_update_rirb(chip);
@@ -803,7 +805,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
803 } 805 }
804 if (time_after(jiffies, timeout)) 806 if (time_after(jiffies, timeout))
805 break; 807 break;
806 if (bus->needs_damn_long_delay) 808 if (bus->needs_damn_long_delay || loopcounter > 3000)
807 msleep(2); /* temporary workaround */ 809 msleep(2); /* temporary workaround */
808 else { 810 else {
809 udelay(10); 811 udelay(10);
@@ -2351,6 +2353,17 @@ static void azx_power_notify(struct hda_bus *bus)
2351 * power management 2353 * power management
2352 */ 2354 */
2353 2355
2356static int snd_hda_codecs_inuse(struct hda_bus *bus)
2357{
2358 struct hda_codec *codec;
2359
2360 list_for_each_entry(codec, &bus->codec_list, list) {
2361 if (snd_hda_codec_needs_resume(codec))
2362 return 1;
2363 }
2364 return 0;
2365}
2366
2354static int azx_suspend(struct pci_dev *pci, pm_message_t state) 2367static int azx_suspend(struct pci_dev *pci, pm_message_t state)
2355{ 2368{
2356 struct snd_card *card = pci_get_drvdata(pci); 2369 struct snd_card *card = pci_get_drvdata(pci);
@@ -2397,7 +2410,8 @@ static int azx_resume(struct pci_dev *pci)
2397 return -EIO; 2410 return -EIO;
2398 azx_init_pci(chip); 2411 azx_init_pci(chip);
2399 2412
2400 azx_init_chip(chip, 1); 2413 if (snd_hda_codecs_inuse(chip->bus))
2414 azx_init_chip(chip, 1);
2401 2415
2402 snd_hda_resume(chip->bus); 2416 snd_hda_resume(chip->bus);
2403 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2417 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index a36488d94aaa..d906c5b74cf0 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3971,9 +3971,14 @@ static void cx_auto_init_output(struct hda_codec *codec)
3971 int i; 3971 int i;
3972 3972
3973 mute_outputs(codec, spec->multiout.num_dacs, spec->multiout.dac_nids); 3973 mute_outputs(codec, spec->multiout.num_dacs, spec->multiout.dac_nids);
3974 for (i = 0; i < cfg->hp_outs; i++) 3974 for (i = 0; i < cfg->hp_outs; i++) {
3975 unsigned int val = PIN_OUT;
3976 if (snd_hda_query_pin_caps(codec, cfg->hp_pins[i]) &
3977 AC_PINCAP_HP_DRV)
3978 val |= AC_PINCTL_HP_EN;
3975 snd_hda_codec_write(codec, cfg->hp_pins[i], 0, 3979 snd_hda_codec_write(codec, cfg->hp_pins[i], 0,
3976 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); 3980 AC_VERB_SET_PIN_WIDGET_CONTROL, val);
3981 }
3977 mute_outputs(codec, cfg->hp_outs, cfg->hp_pins); 3982 mute_outputs(codec, cfg->hp_outs, cfg->hp_pins);
3978 mute_outputs(codec, cfg->line_outs, cfg->line_out_pins); 3983 mute_outputs(codec, cfg->line_outs, cfg->line_out_pins);
3979 mute_outputs(codec, cfg->speaker_outs, cfg->speaker_pins); 3984 mute_outputs(codec, cfg->speaker_outs, cfg->speaker_pins);
@@ -4391,8 +4396,10 @@ static void apply_pin_fixup(struct hda_codec *codec,
4391 4396
4392enum { 4397enum {
4393 CXT_PINCFG_LENOVO_X200, 4398 CXT_PINCFG_LENOVO_X200,
4399 CXT_PINCFG_LENOVO_TP410,
4394}; 4400};
4395 4401
4402/* ThinkPad X200 & co with cxt5051 */
4396static const struct cxt_pincfg cxt_pincfg_lenovo_x200[] = { 4403static const struct cxt_pincfg cxt_pincfg_lenovo_x200[] = {
4397 { 0x16, 0x042140ff }, /* HP (seq# overridden) */ 4404 { 0x16, 0x042140ff }, /* HP (seq# overridden) */
4398 { 0x17, 0x21a11000 }, /* dock-mic */ 4405 { 0x17, 0x21a11000 }, /* dock-mic */
@@ -4401,15 +4408,33 @@ static const struct cxt_pincfg cxt_pincfg_lenovo_x200[] = {
4401 {} 4408 {}
4402}; 4409};
4403 4410
4411/* ThinkPad 410/420/510/520, X201 & co with cxt5066 */
4412static const struct cxt_pincfg cxt_pincfg_lenovo_tp410[] = {
4413 { 0x19, 0x042110ff }, /* HP (seq# overridden) */
4414 { 0x1a, 0x21a190f0 }, /* dock-mic */
4415 { 0x1c, 0x212140ff }, /* dock-HP */
4416 {}
4417};
4418
4404static const struct cxt_pincfg *cxt_pincfg_tbl[] = { 4419static const struct cxt_pincfg *cxt_pincfg_tbl[] = {
4405 [CXT_PINCFG_LENOVO_X200] = cxt_pincfg_lenovo_x200, 4420 [CXT_PINCFG_LENOVO_X200] = cxt_pincfg_lenovo_x200,
4421 [CXT_PINCFG_LENOVO_TP410] = cxt_pincfg_lenovo_tp410,
4406}; 4422};
4407 4423
4408static const struct snd_pci_quirk cxt_fixups[] = { 4424static const struct snd_pci_quirk cxt5051_fixups[] = {
4409 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT_PINCFG_LENOVO_X200), 4425 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT_PINCFG_LENOVO_X200),
4410 {} 4426 {}
4411}; 4427};
4412 4428
4429static const struct snd_pci_quirk cxt5066_fixups[] = {
4430 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
4431 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T410", CXT_PINCFG_LENOVO_TP410),
4432 SND_PCI_QUIRK(0x17aa, 0x215f, "Lenovo T510", CXT_PINCFG_LENOVO_TP410),
4433 SND_PCI_QUIRK(0x17aa, 0x21ce, "Lenovo T420", CXT_PINCFG_LENOVO_TP410),
4434 SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520", CXT_PINCFG_LENOVO_TP410),
4435 {}
4436};
4437
4413/* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches 4438/* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches
4414 * can be created (bko#42825) 4439 * can be created (bko#42825)
4415 */ 4440 */
@@ -4446,13 +4471,13 @@ static int patch_conexant_auto(struct hda_codec *codec)
4446 case 0x14f15051: 4471 case 0x14f15051:
4447 add_cx5051_fake_mutes(codec); 4472 add_cx5051_fake_mutes(codec);
4448 codec->pin_amp_workaround = 1; 4473 codec->pin_amp_workaround = 1;
4474 apply_pin_fixup(codec, cxt5051_fixups, cxt_pincfg_tbl);
4449 break; 4475 break;
4450 default: 4476 default:
4451 codec->pin_amp_workaround = 1; 4477 codec->pin_amp_workaround = 1;
4478 apply_pin_fixup(codec, cxt5066_fixups, cxt_pincfg_tbl);
4452 } 4479 }
4453 4480
4454 apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl);
4455
4456 /* Show mute-led control only on HP laptops 4481 /* Show mute-led control only on HP laptops
4457 * This is a sort of white-list: on HP laptops, EAPD corresponds 4482 * This is a sort of white-list: on HP laptops, EAPD corresponds
4458 * only to the mute-LED without actualy amp function. Meanwhile, 4483 * only to the mute-LED without actualy amp function. Meanwhile,
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 2508f8109f11..7810913d07a0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1445,6 +1445,13 @@ enum {
1445 ALC_FIXUP_ACT_BUILD, 1445 ALC_FIXUP_ACT_BUILD,
1446}; 1446};
1447 1447
1448static void alc_apply_pincfgs(struct hda_codec *codec,
1449 const struct alc_pincfg *cfg)
1450{
1451 for (; cfg->nid; cfg++)
1452 snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
1453}
1454
1448static void alc_apply_fixup(struct hda_codec *codec, int action) 1455static void alc_apply_fixup(struct hda_codec *codec, int action)
1449{ 1456{
1450 struct alc_spec *spec = codec->spec; 1457 struct alc_spec *spec = codec->spec;
@@ -1478,9 +1485,7 @@ static void alc_apply_fixup(struct hda_codec *codec, int action)
1478 snd_printdd(KERN_INFO "hda_codec: %s: " 1485 snd_printdd(KERN_INFO "hda_codec: %s: "
1479 "Apply pincfg for %s\n", 1486 "Apply pincfg for %s\n",
1480 codec->chip_name, modelname); 1487 codec->chip_name, modelname);
1481 for (; cfg->nid; cfg++) 1488 alc_apply_pincfgs(codec, cfg);
1482 snd_hda_codec_set_pincfg(codec, cfg->nid,
1483 cfg->val);
1484 break; 1489 break;
1485 case ALC_FIXUP_VERBS: 1490 case ALC_FIXUP_VERBS:
1486 if (action != ALC_FIXUP_ACT_PROBE || !fix->v.verbs) 1491 if (action != ALC_FIXUP_ACT_PROBE || !fix->v.verbs)
@@ -4861,6 +4866,7 @@ enum {
4861 ALC260_FIXUP_GPIO1_TOGGLE, 4866 ALC260_FIXUP_GPIO1_TOGGLE,
4862 ALC260_FIXUP_REPLACER, 4867 ALC260_FIXUP_REPLACER,
4863 ALC260_FIXUP_HP_B1900, 4868 ALC260_FIXUP_HP_B1900,
4869 ALC260_FIXUP_KN1,
4864}; 4870};
4865 4871
4866static void alc260_gpio1_automute(struct hda_codec *codec) 4872static void alc260_gpio1_automute(struct hda_codec *codec)
@@ -4888,6 +4894,36 @@ static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
4888 } 4894 }
4889} 4895}
4890 4896
4897static void alc260_fixup_kn1(struct hda_codec *codec,
4898 const struct alc_fixup *fix, int action)
4899{
4900 struct alc_spec *spec = codec->spec;
4901 static const struct alc_pincfg pincfgs[] = {
4902 { 0x0f, 0x02214000 }, /* HP/speaker */
4903 { 0x12, 0x90a60160 }, /* int mic */
4904 { 0x13, 0x02a19000 }, /* ext mic */
4905 { 0x18, 0x01446000 }, /* SPDIF out */
4906 /* disable bogus I/O pins */
4907 { 0x10, 0x411111f0 },
4908 { 0x11, 0x411111f0 },
4909 { 0x14, 0x411111f0 },
4910 { 0x15, 0x411111f0 },
4911 { 0x16, 0x411111f0 },
4912 { 0x17, 0x411111f0 },
4913 { 0x19, 0x411111f0 },
4914 { }
4915 };
4916
4917 switch (action) {
4918 case ALC_FIXUP_ACT_PRE_PROBE:
4919 alc_apply_pincfgs(codec, pincfgs);
4920 break;
4921 case ALC_FIXUP_ACT_PROBE:
4922 spec->init_amp = ALC_INIT_NONE;
4923 break;
4924 }
4925}
4926
4891static const struct alc_fixup alc260_fixups[] = { 4927static const struct alc_fixup alc260_fixups[] = {
4892 [ALC260_FIXUP_HP_DC5750] = { 4928 [ALC260_FIXUP_HP_DC5750] = {
4893 .type = ALC_FIXUP_PINS, 4929 .type = ALC_FIXUP_PINS,
@@ -4938,7 +4974,11 @@ static const struct alc_fixup alc260_fixups[] = {
4938 .v.func = alc260_fixup_gpio1_toggle, 4974 .v.func = alc260_fixup_gpio1_toggle,
4939 .chained = true, 4975 .chained = true,
4940 .chain_id = ALC260_FIXUP_COEF, 4976 .chain_id = ALC260_FIXUP_COEF,
4941 } 4977 },
4978 [ALC260_FIXUP_KN1] = {
4979 .type = ALC_FIXUP_FUNC,
4980 .v.func = alc260_fixup_kn1,
4981 },
4942}; 4982};
4943 4983
4944static const struct snd_pci_quirk alc260_fixup_tbl[] = { 4984static const struct snd_pci_quirk alc260_fixup_tbl[] = {
@@ -4948,6 +4988,7 @@ static const struct snd_pci_quirk alc260_fixup_tbl[] = {
4948 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), 4988 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
4949 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), 4989 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
4950 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), 4990 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
4991 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
4951 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), 4992 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
4952 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), 4993 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
4953 {} 4994 {}
@@ -5364,6 +5405,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
5364 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", 5405 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
5365 ALC882_FIXUP_ACER_ASPIRE_4930G), 5406 ALC882_FIXUP_ACER_ASPIRE_4930G),
5366 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), 5407 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
5408 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
5409 ALC882_FIXUP_ACER_ASPIRE_4930G),
5367 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), 5410 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
5368 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), 5411 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
5369 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), 5412 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
@@ -5397,6 +5440,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
5397 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), 5440 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF),
5398 5441
5399 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 5442 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
5443 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
5400 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 5444 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5401 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD), 5445 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD),
5402 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), 5446 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
@@ -5597,13 +5641,13 @@ static int patch_alc262(struct hda_codec *codec)
5597 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); 5641 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80);
5598 } 5642 }
5599#endif 5643#endif
5600 alc_auto_parse_customize_define(codec);
5601
5602 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 5644 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
5603 5645
5604 alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); 5646 alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups);
5605 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 5647 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
5606 5648
5649 alc_auto_parse_customize_define(codec);
5650
5607 /* automatic parse from the BIOS config */ 5651 /* automatic parse from the BIOS config */
5608 err = alc262_parse_auto_config(codec); 5652 err = alc262_parse_auto_config(codec);
5609 if (err < 0) 5653 if (err < 0)
@@ -6068,6 +6112,7 @@ static const struct alc_fixup alc269_fixups[] = {
6068 6112
6069static const struct snd_pci_quirk alc269_fixup_tbl[] = { 6113static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6070 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED), 6114 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
6115 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
6071 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 6116 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
6072 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), 6117 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
6073 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), 6118 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
@@ -6207,8 +6252,6 @@ static int patch_alc269(struct hda_codec *codec)
6207 6252
6208 spec->mixer_nid = 0x0b; 6253 spec->mixer_nid = 0x0b;
6209 6254
6210 alc_auto_parse_customize_define(codec);
6211
6212 err = alc_codec_rename_from_preset(codec); 6255 err = alc_codec_rename_from_preset(codec);
6213 if (err < 0) 6256 if (err < 0)
6214 goto error; 6257 goto error;
@@ -6241,6 +6284,8 @@ static int patch_alc269(struct hda_codec *codec)
6241 alc269_fixup_tbl, alc269_fixups); 6284 alc269_fixup_tbl, alc269_fixups);
6242 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 6285 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6243 6286
6287 alc_auto_parse_customize_define(codec);
6288
6244 /* automatic parse from the BIOS config */ 6289 /* automatic parse from the BIOS config */
6245 err = alc269_parse_auto_config(codec); 6290 err = alc269_parse_auto_config(codec);
6246 if (err < 0) 6291 if (err < 0)
@@ -6817,8 +6862,6 @@ static int patch_alc662(struct hda_codec *codec)
6817 /* handle multiple HPs as is */ 6862 /* handle multiple HPs as is */
6818 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 6863 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6819 6864
6820 alc_auto_parse_customize_define(codec);
6821
6822 alc_fix_pll_init(codec, 0x20, 0x04, 15); 6865 alc_fix_pll_init(codec, 0x20, 0x04, 15);
6823 6866
6824 err = alc_codec_rename_from_preset(codec); 6867 err = alc_codec_rename_from_preset(codec);
@@ -6835,6 +6878,9 @@ static int patch_alc662(struct hda_codec *codec)
6835 alc_pick_fixup(codec, alc662_fixup_models, 6878 alc_pick_fixup(codec, alc662_fixup_models,
6836 alc662_fixup_tbl, alc662_fixups); 6879 alc662_fixup_tbl, alc662_fixups);
6837 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 6880 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6881
6882 alc_auto_parse_customize_define(codec);
6883
6838 /* automatic parse from the BIOS config */ 6884 /* automatic parse from the BIOS config */
6839 err = alc662_parse_auto_config(codec); 6885 err = alc662_parse_auto_config(codec);
6840 if (err < 0) 6886 if (err < 0)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 33a9946b492c..4742cac26aa9 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -5063,12 +5063,11 @@ static void stac92xx_update_led_status(struct hda_codec *codec, int enabled)
5063 if (spec->gpio_led_polarity) 5063 if (spec->gpio_led_polarity)
5064 muted = !muted; 5064 muted = !muted;
5065 5065
5066 /*polarity defines *not* muted state level*/
5067 if (!spec->vref_mute_led_nid) { 5066 if (!spec->vref_mute_led_nid) {
5068 if (muted) 5067 if (muted)
5069 spec->gpio_data &= ~spec->gpio_led; /* orange */ 5068 spec->gpio_data |= spec->gpio_led;
5070 else 5069 else
5071 spec->gpio_data |= spec->gpio_led; /* white */ 5070 spec->gpio_data &= ~spec->gpio_led;
5072 stac_gpio_set(codec, spec->gpio_mask, 5071 stac_gpio_set(codec, spec->gpio_mask,
5073 spec->gpio_dir, spec->gpio_data); 5072 spec->gpio_dir, spec->gpio_data);
5074 } else { 5073 } else {
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index b68cdec03b9e..0b2aea2ce172 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -5170,6 +5170,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
5170 strcpy(hw->name, "HDSP hwdep interface"); 5170 strcpy(hw->name, "HDSP hwdep interface");
5171 5171
5172 hw->ops.ioctl = snd_hdsp_hwdep_ioctl; 5172 hw->ops.ioctl = snd_hdsp_hwdep_ioctl;
5173 hw->ops.ioctl_compat = snd_hdsp_hwdep_ioctl;
5173 5174
5174 return 0; 5175 return 0;
5175} 5176}
diff --git a/sound/soc/blackfin/bf5xx-ssm2602.c b/sound/soc/blackfin/bf5xx-ssm2602.c
index 911edbab1345..7dbeef1099b4 100644
--- a/sound/soc/blackfin/bf5xx-ssm2602.c
+++ b/sound/soc/blackfin/bf5xx-ssm2602.c
@@ -70,6 +70,7 @@ static struct snd_soc_dai_link bf5xx_ssm2602_dai[] = {
70 .platform_name = "bfin-i2s-pcm-audio", 70 .platform_name = "bfin-i2s-pcm-audio",
71 .codec_name = "ssm2602.0-001b", 71 .codec_name = "ssm2602.0-001b",
72 .init = bf5xx_ssm2602_dai_init, 72 .init = bf5xx_ssm2602_dai_init,
73 .dai_fmt = BF5XX_SSM2602_DAIFMT,
73 }, 74 },
74 { 75 {
75 .name = "ssm2602", 76 .name = "ssm2602",
@@ -79,6 +80,7 @@ static struct snd_soc_dai_link bf5xx_ssm2602_dai[] = {
79 .platform_name = "bfin-i2s-pcm-audio", 80 .platform_name = "bfin-i2s-pcm-audio",
80 .codec_name = "ssm2602.0-001b", 81 .codec_name = "ssm2602.0-001b",
81 .init = bf5xx_ssm2602_dai_init, 82 .init = bf5xx_ssm2602_dai_init,
83 .dai_fmt = BF5XX_SSM2602_DAIFMT,
82 }, 84 },
83}; 85};
84 86
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 0235532a94ed..f8035bd09af6 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -60,7 +60,7 @@ config SND_SOC_ALL_CODECS
60 select SND_SOC_TPA6130A2 if I2C 60 select SND_SOC_TPA6130A2 if I2C
61 select SND_SOC_TLV320DAC33 if I2C 61 select SND_SOC_TLV320DAC33 if I2C
62 select SND_SOC_TWL4030 if TWL4030_CORE 62 select SND_SOC_TWL4030 if TWL4030_CORE
63 select SND_SOC_TWL6040 if TWL4030_CORE 63 select SND_SOC_TWL6040 if TWL6040_CORE
64 select SND_SOC_UDA134X 64 select SND_SOC_UDA134X
65 select SND_SOC_UDA1380 if I2C 65 select SND_SOC_UDA1380 if I2C
66 select SND_SOC_WL1273 if MFD_WL1273_CORE 66 select SND_SOC_WL1273 if MFD_WL1273_CORE
@@ -285,7 +285,6 @@ config SND_SOC_TWL4030
285 tristate 285 tristate
286 286
287config SND_SOC_TWL6040 287config SND_SOC_TWL6040
288 select TWL6040_CORE
289 tristate 288 tristate
290 289
291config SND_SOC_UDA134X 290config SND_SOC_UDA134X
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index 48a76fed2377..5a537b7713a3 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -941,6 +941,8 @@ static int cs42l73_set_mclk(struct snd_soc_dai *dai, unsigned int freq)
941 941
942 /* MCLKX -> MCLK */ 942 /* MCLKX -> MCLK */
943 mclkx_coeff = cs42l73_get_mclkx_coeff(freq); 943 mclkx_coeff = cs42l73_get_mclkx_coeff(freq);
944 if (mclkx_coeff < 0)
945 return mclkx_coeff;
944 946
945 mclk = cs42l73_mclkx_coeffs[mclkx_coeff].mclkx / 947 mclk = cs42l73_mclkx_coeffs[mclkx_coeff].mclkx /
946 cs42l73_mclkx_coeffs[mclkx_coeff].ratio; 948 cs42l73_mclkx_coeffs[mclkx_coeff].ratio;
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index 8c758b214a25..31762ebdd774 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -467,7 +467,7 @@ static int tlv320aic23_set_dai_sysclk(struct snd_soc_dai *codec_dai,
467static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec, 467static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
468 enum snd_soc_bias_level level) 468 enum snd_soc_bias_level level)
469{ 469{
470 u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0xff7f; 470 u16 reg = snd_soc_read(codec, TLV320AIC23_PWR) & 0x17f;
471 471
472 switch (level) { 472 switch (level) {
473 case SND_SOC_BIAS_ON: 473 case SND_SOC_BIAS_ON:
@@ -486,7 +486,7 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
486 case SND_SOC_BIAS_OFF: 486 case SND_SOC_BIAS_OFF:
487 /* everything off, dac mute, inactive */ 487 /* everything off, dac mute, inactive */
488 snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0); 488 snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x0);
489 snd_soc_write(codec, TLV320AIC23_PWR, 0xffff); 489 snd_soc_write(codec, TLV320AIC23_PWR, 0x1ff);
490 break; 490 break;
491 } 491 }
492 codec->dapm.bias_level = level; 492 codec->dapm.bias_level = level;
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index d3807a354941..a36e9fcdf184 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -26,7 +26,6 @@
26#include <linux/pm.h> 26#include <linux/pm.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/i2c/twl.h>
30#include <linux/mfd/twl6040.h> 29#include <linux/mfd/twl6040.h>
31 30
32#include <sound/core.h> 31#include <sound/core.h>
@@ -1113,7 +1112,7 @@ static int twl6040_resume(struct snd_soc_codec *codec)
1113static int twl6040_probe(struct snd_soc_codec *codec) 1112static int twl6040_probe(struct snd_soc_codec *codec)
1114{ 1113{
1115 struct twl6040_data *priv; 1114 struct twl6040_data *priv;
1116 struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev); 1115 struct twl6040_codec_data *pdata = dev_get_platdata(codec->dev);
1117 struct platform_device *pdev = container_of(codec->dev, 1116 struct platform_device *pdev = container_of(codec->dev,
1118 struct platform_device, dev); 1117 struct platform_device, dev);
1119 int ret = 0; 1118 int ret = 0;
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index 54971fcb7e4e..f610518a8887 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -60,7 +60,7 @@ struct wm8350_jack_data {
60}; 60};
61 61
62struct wm8350_data { 62struct wm8350_data {
63 struct snd_soc_codec codec; 63 struct wm8350 *wm8350;
64 struct wm8350_output out1; 64 struct wm8350_output out1;
65 struct wm8350_output out2; 65 struct wm8350_output out2;
66 struct wm8350_jack_data hpl; 66 struct wm8350_jack_data hpl;
@@ -1270,7 +1270,7 @@ static void wm8350_hp_work(struct wm8350_data *priv,
1270 struct wm8350_jack_data *jack, 1270 struct wm8350_jack_data *jack,
1271 u16 mask) 1271 u16 mask)
1272{ 1272{
1273 struct wm8350 *wm8350 = priv->codec.control_data; 1273 struct wm8350 *wm8350 = priv->wm8350;
1274 u16 reg; 1274 u16 reg;
1275 int report; 1275 int report;
1276 1276
@@ -1303,7 +1303,7 @@ static void wm8350_hpr_work(struct work_struct *work)
1303static irqreturn_t wm8350_hp_jack_handler(int irq, void *data) 1303static irqreturn_t wm8350_hp_jack_handler(int irq, void *data)
1304{ 1304{
1305 struct wm8350_data *priv = data; 1305 struct wm8350_data *priv = data;
1306 struct wm8350 *wm8350 = priv->codec.control_data; 1306 struct wm8350 *wm8350 = priv->wm8350;
1307 struct wm8350_jack_data *jack = NULL; 1307 struct wm8350_jack_data *jack = NULL;
1308 1308
1309 switch (irq - wm8350->irq_base) { 1309 switch (irq - wm8350->irq_base) {
@@ -1388,7 +1388,7 @@ EXPORT_SYMBOL_GPL(wm8350_hp_jack_detect);
1388static irqreturn_t wm8350_mic_handler(int irq, void *data) 1388static irqreturn_t wm8350_mic_handler(int irq, void *data)
1389{ 1389{
1390 struct wm8350_data *priv = data; 1390 struct wm8350_data *priv = data;
1391 struct wm8350 *wm8350 = priv->codec.control_data; 1391 struct wm8350 *wm8350 = priv->wm8350;
1392 u16 reg; 1392 u16 reg;
1393 int report = 0; 1393 int report = 0;
1394 1394
@@ -1496,6 +1496,8 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
1496 return -ENOMEM; 1496 return -ENOMEM;
1497 snd_soc_codec_set_drvdata(codec, priv); 1497 snd_soc_codec_set_drvdata(codec, priv);
1498 1498
1499 priv->wm8350 = wm8350;
1500
1499 for (i = 0; i < ARRAY_SIZE(supply_names); i++) 1501 for (i = 0; i < ARRAY_SIZE(supply_names); i++)
1500 priv->supplies[i].supply = supply_names[i]; 1502 priv->supplies[i].supply = supply_names[i];
1501 1503
@@ -1504,7 +1506,6 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
1504 if (ret != 0) 1506 if (ret != 0)
1505 return ret; 1507 return ret;
1506 1508
1507 wm8350->codec.codec = codec;
1508 codec->control_data = wm8350; 1509 codec->control_data = wm8350;
1509 1510
1510 /* Put the codec into reset if it wasn't already */ 1511 /* Put the codec into reset if it wasn't already */
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 50003b337722..2f9870aa0cf1 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -983,61 +983,170 @@ static bool wm8994_check_class_w_digital(struct snd_soc_codec *codec)
983 return true; 983 return true;
984} 984}
985 985
986static int late_enable_ev(struct snd_soc_dapm_widget *w, 986static int aif1clk_ev(struct snd_soc_dapm_widget *w,
987 struct snd_kcontrol *kcontrol, int event) 987 struct snd_kcontrol *kcontrol, int event)
988{ 988{
989 struct snd_soc_codec *codec = w->codec; 989 struct snd_soc_codec *codec = w->codec;
990 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 990 struct wm8994 *control = codec->control_data;
991 int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA;
992 int dac;
993 int adc;
994 int val;
995
996 switch (control->type) {
997 case WM8994:
998 case WM8958:
999 mask |= WM8994_AIF1DAC2L_ENA | WM8994_AIF1DAC2R_ENA;
1000 break;
1001 default:
1002 break;
1003 }
991 1004
992 switch (event) { 1005 switch (event) {
993 case SND_SOC_DAPM_PRE_PMU: 1006 case SND_SOC_DAPM_PRE_PMU:
994 if (wm8994->aif1clk_enable) { 1007 val = snd_soc_read(codec, WM8994_AIF1_CONTROL_1);
995 snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 1008 if ((val & WM8994_AIF1ADCL_SRC) &&
996 WM8994_AIF1CLK_ENA_MASK, 1009 (val & WM8994_AIF1ADCR_SRC))
997 WM8994_AIF1CLK_ENA); 1010 adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA;
998 wm8994->aif1clk_enable = 0; 1011 else if (!(val & WM8994_AIF1ADCL_SRC) &&
999 } 1012 !(val & WM8994_AIF1ADCR_SRC))
1000 if (wm8994->aif2clk_enable) { 1013 adc = WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA;
1001 snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 1014 else
1002 WM8994_AIF2CLK_ENA_MASK, 1015 adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA |
1003 WM8994_AIF2CLK_ENA); 1016 WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA;
1004 wm8994->aif2clk_enable = 0; 1017
1005 } 1018 val = snd_soc_read(codec, WM8994_AIF1_CONTROL_2);
1019 if ((val & WM8994_AIF1DACL_SRC) &&
1020 (val & WM8994_AIF1DACR_SRC))
1021 dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA;
1022 else if (!(val & WM8994_AIF1DACL_SRC) &&
1023 !(val & WM8994_AIF1DACR_SRC))
1024 dac = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA;
1025 else
1026 dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA |
1027 WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA;
1028
1029 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
1030 mask, adc);
1031 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
1032 mask, dac);
1033 snd_soc_update_bits(codec, WM8994_CLOCKING_1,
1034 WM8994_AIF1DSPCLK_ENA |
1035 WM8994_SYSDSPCLK_ENA,
1036 WM8994_AIF1DSPCLK_ENA |
1037 WM8994_SYSDSPCLK_ENA);
1038 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, mask,
1039 WM8994_AIF1ADC1R_ENA |
1040 WM8994_AIF1ADC1L_ENA |
1041 WM8994_AIF1ADC2R_ENA |
1042 WM8994_AIF1ADC2L_ENA);
1043 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, mask,
1044 WM8994_AIF1DAC1R_ENA |
1045 WM8994_AIF1DAC1L_ENA |
1046 WM8994_AIF1DAC2R_ENA |
1047 WM8994_AIF1DAC2L_ENA);
1006 break; 1048 break;
1007 }
1008 1049
1009 /* We may also have postponed startup of DSP, handle that. */ 1050 case SND_SOC_DAPM_PRE_PMD:
1010 wm8958_aif_ev(w, kcontrol, event); 1051 case SND_SOC_DAPM_POST_PMD:
1052 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
1053 mask, 0);
1054 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
1055 mask, 0);
1056
1057 val = snd_soc_read(codec, WM8994_CLOCKING_1);
1058 if (val & WM8994_AIF2DSPCLK_ENA)
1059 val = WM8994_SYSDSPCLK_ENA;
1060 else
1061 val = 0;
1062 snd_soc_update_bits(codec, WM8994_CLOCKING_1,
1063 WM8994_SYSDSPCLK_ENA |
1064 WM8994_AIF1DSPCLK_ENA, val);
1065 break;
1066 }
1011 1067
1012 return 0; 1068 return 0;
1013} 1069}
1014 1070
1015static int late_disable_ev(struct snd_soc_dapm_widget *w, 1071static int aif2clk_ev(struct snd_soc_dapm_widget *w,
1016 struct snd_kcontrol *kcontrol, int event) 1072 struct snd_kcontrol *kcontrol, int event)
1017{ 1073{
1018 struct snd_soc_codec *codec = w->codec; 1074 struct snd_soc_codec *codec = w->codec;
1019 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1075 int dac;
1076 int adc;
1077 int val;
1020 1078
1021 switch (event) { 1079 switch (event) {
1080 case SND_SOC_DAPM_PRE_PMU:
1081 val = snd_soc_read(codec, WM8994_AIF2_CONTROL_1);
1082 if ((val & WM8994_AIF2ADCL_SRC) &&
1083 (val & WM8994_AIF2ADCR_SRC))
1084 adc = WM8994_AIF2ADCR_ENA;
1085 else if (!(val & WM8994_AIF2ADCL_SRC) &&
1086 !(val & WM8994_AIF2ADCR_SRC))
1087 adc = WM8994_AIF2ADCL_ENA;
1088 else
1089 adc = WM8994_AIF2ADCL_ENA | WM8994_AIF2ADCR_ENA;
1090
1091
1092 val = snd_soc_read(codec, WM8994_AIF2_CONTROL_2);
1093 if ((val & WM8994_AIF2DACL_SRC) &&
1094 (val & WM8994_AIF2DACR_SRC))
1095 dac = WM8994_AIF2DACR_ENA;
1096 else if (!(val & WM8994_AIF2DACL_SRC) &&
1097 !(val & WM8994_AIF2DACR_SRC))
1098 dac = WM8994_AIF2DACL_ENA;
1099 else
1100 dac = WM8994_AIF2DACL_ENA | WM8994_AIF2DACR_ENA;
1101
1102 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
1103 WM8994_AIF2ADCL_ENA |
1104 WM8994_AIF2ADCR_ENA, adc);
1105 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
1106 WM8994_AIF2DACL_ENA |
1107 WM8994_AIF2DACR_ENA, dac);
1108 snd_soc_update_bits(codec, WM8994_CLOCKING_1,
1109 WM8994_AIF2DSPCLK_ENA |
1110 WM8994_SYSDSPCLK_ENA,
1111 WM8994_AIF2DSPCLK_ENA |
1112 WM8994_SYSDSPCLK_ENA);
1113 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4,
1114 WM8994_AIF2ADCL_ENA |
1115 WM8994_AIF2ADCR_ENA,
1116 WM8994_AIF2ADCL_ENA |
1117 WM8994_AIF2ADCR_ENA);
1118 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
1119 WM8994_AIF2DACL_ENA |
1120 WM8994_AIF2DACR_ENA,
1121 WM8994_AIF2DACL_ENA |
1122 WM8994_AIF2DACR_ENA);
1123 break;
1124
1125 case SND_SOC_DAPM_PRE_PMD:
1022 case SND_SOC_DAPM_POST_PMD: 1126 case SND_SOC_DAPM_POST_PMD:
1023 if (wm8994->aif1clk_disable) { 1127 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
1024 snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 1128 WM8994_AIF2DACL_ENA |
1025 WM8994_AIF1CLK_ENA_MASK, 0); 1129 WM8994_AIF2DACR_ENA, 0);
1026 wm8994->aif1clk_disable = 0; 1130 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5,
1027 } 1131 WM8994_AIF2ADCL_ENA |
1028 if (wm8994->aif2clk_disable) { 1132 WM8994_AIF2ADCR_ENA, 0);
1029 snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 1133
1030 WM8994_AIF2CLK_ENA_MASK, 0); 1134 val = snd_soc_read(codec, WM8994_CLOCKING_1);
1031 wm8994->aif2clk_disable = 0; 1135 if (val & WM8994_AIF1DSPCLK_ENA)
1032 } 1136 val = WM8994_SYSDSPCLK_ENA;
1137 else
1138 val = 0;
1139 snd_soc_update_bits(codec, WM8994_CLOCKING_1,
1140 WM8994_SYSDSPCLK_ENA |
1141 WM8994_AIF2DSPCLK_ENA, val);
1033 break; 1142 break;
1034 } 1143 }
1035 1144
1036 return 0; 1145 return 0;
1037} 1146}
1038 1147
1039static int aif1clk_ev(struct snd_soc_dapm_widget *w, 1148static int aif1clk_late_ev(struct snd_soc_dapm_widget *w,
1040 struct snd_kcontrol *kcontrol, int event) 1149 struct snd_kcontrol *kcontrol, int event)
1041{ 1150{
1042 struct snd_soc_codec *codec = w->codec; 1151 struct snd_soc_codec *codec = w->codec;
1043 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1152 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
@@ -1054,8 +1163,8 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w,
1054 return 0; 1163 return 0;
1055} 1164}
1056 1165
1057static int aif2clk_ev(struct snd_soc_dapm_widget *w, 1166static int aif2clk_late_ev(struct snd_soc_dapm_widget *w,
1058 struct snd_kcontrol *kcontrol, int event) 1167 struct snd_kcontrol *kcontrol, int event)
1059{ 1168{
1060 struct snd_soc_codec *codec = w->codec; 1169 struct snd_soc_codec *codec = w->codec;
1061 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1170 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
@@ -1072,6 +1181,63 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w,
1072 return 0; 1181 return 0;
1073} 1182}
1074 1183
1184static int late_enable_ev(struct snd_soc_dapm_widget *w,
1185 struct snd_kcontrol *kcontrol, int event)
1186{
1187 struct snd_soc_codec *codec = w->codec;
1188 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
1189
1190 switch (event) {
1191 case SND_SOC_DAPM_PRE_PMU:
1192 if (wm8994->aif1clk_enable) {
1193 aif1clk_ev(w, kcontrol, event);
1194 snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
1195 WM8994_AIF1CLK_ENA_MASK,
1196 WM8994_AIF1CLK_ENA);
1197 wm8994->aif1clk_enable = 0;
1198 }
1199 if (wm8994->aif2clk_enable) {
1200 aif2clk_ev(w, kcontrol, event);
1201 snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
1202 WM8994_AIF2CLK_ENA_MASK,
1203 WM8994_AIF2CLK_ENA);
1204 wm8994->aif2clk_enable = 0;
1205 }
1206 break;
1207 }
1208
1209 /* We may also have postponed startup of DSP, handle that. */
1210 wm8958_aif_ev(w, kcontrol, event);
1211
1212 return 0;
1213}
1214
1215static int late_disable_ev(struct snd_soc_dapm_widget *w,
1216 struct snd_kcontrol *kcontrol, int event)
1217{
1218 struct snd_soc_codec *codec = w->codec;
1219 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
1220
1221 switch (event) {
1222 case SND_SOC_DAPM_POST_PMD:
1223 if (wm8994->aif1clk_disable) {
1224 snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1,
1225 WM8994_AIF1CLK_ENA_MASK, 0);
1226 aif1clk_ev(w, kcontrol, event);
1227 wm8994->aif1clk_disable = 0;
1228 }
1229 if (wm8994->aif2clk_disable) {
1230 snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1,
1231 WM8994_AIF2CLK_ENA_MASK, 0);
1232 aif2clk_ev(w, kcontrol, event);
1233 wm8994->aif2clk_disable = 0;
1234 }
1235 break;
1236 }
1237
1238 return 0;
1239}
1240
1075static int adc_mux_ev(struct snd_soc_dapm_widget *w, 1241static int adc_mux_ev(struct snd_soc_dapm_widget *w,
1076 struct snd_kcontrol *kcontrol, int event) 1242 struct snd_kcontrol *kcontrol, int event)
1077{ 1243{
@@ -1329,9 +1495,9 @@ static const struct snd_kcontrol_new aif2dacr_src_mux =
1329 SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); 1495 SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum);
1330 1496
1331static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = { 1497static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = {
1332SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev, 1498SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_late_ev,
1333 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 1499 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
1334SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev, 1500SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_late_ev,
1335 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 1501 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
1336 1502
1337SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1503SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0,
@@ -1360,8 +1526,10 @@ SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev)
1360}; 1526};
1361 1527
1362static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { 1528static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = {
1363SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), 1529SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev,
1364SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), 1530 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
1531SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev,
1532 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
1365SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0), 1533SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0),
1366SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0, 1534SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0,
1367 left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)), 1535 left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)),
@@ -1414,30 +1582,30 @@ SND_SOC_DAPM_SUPPLY("VMID", SND_SOC_NOPM, 0, 0, vmid_event,
1414SND_SOC_DAPM_SUPPLY("CLK_SYS", SND_SOC_NOPM, 0, 0, clk_sys_event, 1582SND_SOC_DAPM_SUPPLY("CLK_SYS", SND_SOC_NOPM, 0, 0, clk_sys_event,
1415 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 1583 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1416 1584
1417SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0), 1585SND_SOC_DAPM_SUPPLY("DSP1CLK", SND_SOC_NOPM, 3, 0, NULL, 0),
1418SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0), 1586SND_SOC_DAPM_SUPPLY("DSP2CLK", SND_SOC_NOPM, 2, 0, NULL, 0),
1419SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0), 1587SND_SOC_DAPM_SUPPLY("DSPINTCLK", SND_SOC_NOPM, 1, 0, NULL, 0),
1420 1588
1421SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL, 1589SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL,
1422 0, WM8994_POWER_MANAGEMENT_4, 9, 0), 1590 0, SND_SOC_NOPM, 9, 0),
1423SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL, 1591SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL,
1424 0, WM8994_POWER_MANAGEMENT_4, 8, 0), 1592 0, SND_SOC_NOPM, 8, 0),
1425SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0, 1593SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0,
1426 WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev, 1594 SND_SOC_NOPM, 9, 0, wm8958_aif_ev,
1427 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 1595 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
1428SND_SOC_DAPM_AIF_IN_E("AIF1DAC1R", NULL, 0, 1596SND_SOC_DAPM_AIF_IN_E("AIF1DAC1R", NULL, 0,
1429 WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev, 1597 SND_SOC_NOPM, 8, 0, wm8958_aif_ev,
1430 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 1598 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
1431 1599
1432SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", NULL, 1600SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", NULL,
1433 0, WM8994_POWER_MANAGEMENT_4, 11, 0), 1601 0, SND_SOC_NOPM, 11, 0),
1434SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", NULL, 1602SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", NULL,
1435 0, WM8994_POWER_MANAGEMENT_4, 10, 0), 1603 0, SND_SOC_NOPM, 10, 0),
1436SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0, 1604SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0,
1437 WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev, 1605 SND_SOC_NOPM, 11, 0, wm8958_aif_ev,
1438 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 1606 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
1439SND_SOC_DAPM_AIF_IN_E("AIF1DAC2R", NULL, 0, 1607SND_SOC_DAPM_AIF_IN_E("AIF1DAC2R", NULL, 0,
1440 WM8994_POWER_MANAGEMENT_5, 10, 0, wm8958_aif_ev, 1608 SND_SOC_NOPM, 10, 0, wm8958_aif_ev,
1441 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 1609 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
1442 1610
1443SND_SOC_DAPM_MIXER("AIF1ADC1L Mixer", SND_SOC_NOPM, 0, 0, 1611SND_SOC_DAPM_MIXER("AIF1ADC1L Mixer", SND_SOC_NOPM, 0, 0,
@@ -1464,14 +1632,14 @@ SND_SOC_DAPM_MIXER("DAC1R Mixer", SND_SOC_NOPM, 0, 0,
1464 dac1r_mix, ARRAY_SIZE(dac1r_mix)), 1632 dac1r_mix, ARRAY_SIZE(dac1r_mix)),
1465 1633
1466SND_SOC_DAPM_AIF_OUT("AIF2ADCL", NULL, 0, 1634SND_SOC_DAPM_AIF_OUT("AIF2ADCL", NULL, 0,
1467 WM8994_POWER_MANAGEMENT_4, 13, 0), 1635 SND_SOC_NOPM, 13, 0),
1468SND_SOC_DAPM_AIF_OUT("AIF2ADCR", NULL, 0, 1636SND_SOC_DAPM_AIF_OUT("AIF2ADCR", NULL, 0,
1469 WM8994_POWER_MANAGEMENT_4, 12, 0), 1637 SND_SOC_NOPM, 12, 0),
1470SND_SOC_DAPM_AIF_IN_E("AIF2DACL", NULL, 0, 1638SND_SOC_DAPM_AIF_IN_E("AIF2DACL", NULL, 0,
1471 WM8994_POWER_MANAGEMENT_5, 13, 0, wm8958_aif_ev, 1639 SND_SOC_NOPM, 13, 0, wm8958_aif_ev,
1472 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 1640 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1473SND_SOC_DAPM_AIF_IN_E("AIF2DACR", NULL, 0, 1641SND_SOC_DAPM_AIF_IN_E("AIF2DACR", NULL, 0,
1474 WM8994_POWER_MANAGEMENT_5, 12, 0, wm8958_aif_ev, 1642 SND_SOC_NOPM, 12, 0, wm8958_aif_ev,
1475 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 1643 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1476 1644
1477SND_SOC_DAPM_AIF_IN("AIF1DACDAT", NULL, 0, SND_SOC_NOPM, 0, 0), 1645SND_SOC_DAPM_AIF_IN("AIF1DACDAT", NULL, 0, SND_SOC_NOPM, 0, 0),
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
index c424a1e50638..dfe957a47f29 100644
--- a/sound/soc/codecs/wm_hubs.c
+++ b/sound/soc/codecs/wm_hubs.c
@@ -1205,7 +1205,7 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
1205 enum snd_soc_bias_level level) 1205 enum snd_soc_bias_level level)
1206{ 1206{
1207 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); 1207 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
1208 int val; 1208 int mask, val;
1209 1209
1210 switch (level) { 1210 switch (level) {
1211 case SND_SOC_BIAS_STANDBY: 1211 case SND_SOC_BIAS_STANDBY:
@@ -1217,6 +1217,13 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
1217 case SND_SOC_BIAS_ON: 1217 case SND_SOC_BIAS_ON:
1218 /* Turn off any unneded single ended outputs */ 1218 /* Turn off any unneded single ended outputs */
1219 val = 0; 1219 val = 0;
1220 mask = 0;
1221
1222 if (hubs->lineout1_se)
1223 mask |= WM8993_LINEOUT1N_ENA | WM8993_LINEOUT1P_ENA;
1224
1225 if (hubs->lineout2_se)
1226 mask |= WM8993_LINEOUT2N_ENA | WM8993_LINEOUT2P_ENA;
1220 1227
1221 if (hubs->lineout1_se && hubs->lineout1n_ena) 1228 if (hubs->lineout1_se && hubs->lineout1n_ena)
1222 val |= WM8993_LINEOUT1N_ENA; 1229 val |= WM8993_LINEOUT1N_ENA;
@@ -1231,11 +1238,7 @@ void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
1231 val |= WM8993_LINEOUT2P_ENA; 1238 val |= WM8993_LINEOUT2P_ENA;
1232 1239
1233 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_3, 1240 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_3,
1234 WM8993_LINEOUT1N_ENA | 1241 mask, val);
1235 WM8993_LINEOUT1P_ENA |
1236 WM8993_LINEOUT2N_ENA |
1237 WM8993_LINEOUT2P_ENA,
1238 val);
1239 1242
1240 /* Remove the input clamps */ 1243 /* Remove the input clamps */
1241 snd_soc_update_bits(codec, WM8993_INPUTS_CLAMP_REG, 1244 snd_soc_update_bits(codec, WM8993_INPUTS_CLAMP_REG,
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index e00dd0b1139c..deafbfaacdbf 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -97,7 +97,7 @@ config SND_OMAP_SOC_SDP3430
97 97
98config SND_OMAP_SOC_OMAP_ABE_TWL6040 98config SND_OMAP_SOC_OMAP_ABE_TWL6040
99 tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" 99 tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
100 depends on TWL4030_CORE && SND_OMAP_SOC && ARCH_OMAP4 100 depends on TWL6040_CORE && SND_OMAP_SOC && ARCH_OMAP4
101 select SND_OMAP_SOC_DMIC 101 select SND_OMAP_SOC_DMIC
102 select SND_OMAP_SOC_MCPDM 102 select SND_OMAP_SOC_MCPDM
103 select SND_SOC_TWL6040 103 select SND_SOC_TWL6040
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index a59bd352d342..5a649da9122a 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -401,6 +401,10 @@ static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd)
401 } 401 }
402 402
403out: 403out:
404 /* free preallocated buffers in case of error */
405 if (ret)
406 omap_pcm_free_dma_buffers(pcm);
407
404 return ret; 408 return ret;
405} 409}
406 410
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c
index 72185078ddf8..79fbeea99d46 100644
--- a/sound/soc/samsung/s3c2412-i2s.c
+++ b/sound/soc/samsung/s3c2412-i2s.c
@@ -166,7 +166,7 @@ static struct snd_soc_dai_driver s3c2412_i2s_dai = {
166 166
167static __devinit int s3c2412_iis_dev_probe(struct platform_device *pdev) 167static __devinit int s3c2412_iis_dev_probe(struct platform_device *pdev)
168{ 168{
169 return snd_soc_register_dai(&pdev->dev, &s3c2412_i2s_dai); 169 return s3c_i2sv2_register_dai(&pdev->dev, -1, &s3c2412_i2s_dai);
170} 170}
171 171
172static __devexit int s3c2412_iis_dev_remove(struct platform_device *pdev) 172static __devexit int s3c2412_iis_dev_remove(struct platform_device *pdev)
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 378cc5b056d7..74ed2dffbffd 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1001,11 +1001,10 @@ static void fsi_dma_do_tasklet(unsigned long data)
1001 sg_dma_address(&sg) = buf; 1001 sg_dma_address(&sg) = buf;
1002 sg_dma_len(&sg) = len; 1002 sg_dma_len(&sg) = len;
1003 1003
1004 desc = chan->device->device_prep_slave_sg(chan, &sg, 1, dir, 1004 desc = dmaengine_prep_slave_sg(chan, &sg, 1, dir,
1005 DMA_PREP_INTERRUPT | 1005 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
1006 DMA_CTRL_ACK);
1007 if (!desc) { 1006 if (!desc) {
1008 dev_err(dai->dev, "device_prep_slave_sg() fail\n"); 1007 dev_err(dai->dev, "dmaengine_prep_slave_sg() fail\n");
1009 return; 1008 return;
1010 } 1009 }
1011 1010
diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c
index 9d9ad8d61c0a..8526e1edaf45 100644
--- a/sound/soc/sh/migor.c
+++ b/sound/soc/sh/migor.c
@@ -35,7 +35,7 @@ static unsigned long siumckb_recalc(struct clk *clk)
35 return codec_freq; 35 return codec_freq;
36} 36}
37 37
38static struct clk_ops siumckb_clk_ops = { 38static struct sh_clk_ops siumckb_clk_ops = {
39 .recalc = siumckb_recalc, 39 .recalc = siumckb_recalc,
40}; 40};
41 41
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a61671b89e9b..2783d2b00dba 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3380,6 +3380,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
3380 GFP_KERNEL); 3380 GFP_KERNEL);
3381 if (card->rtd == NULL) 3381 if (card->rtd == NULL)
3382 return -ENOMEM; 3382 return -ENOMEM;
3383 card->num_rtd = 0;
3383 card->rtd_aux = &card->rtd[card->num_links]; 3384 card->rtd_aux = &card->rtd[card->num_links];
3384 3385
3385 for (i = 0; i < card->num_links; i++) 3386 for (i = 0; i < card->num_links; i++)
@@ -3907,10 +3908,10 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
3907 int i, ret; 3908 int i, ret;
3908 3909
3909 num_routes = of_property_count_strings(np, propname); 3910 num_routes = of_property_count_strings(np, propname);
3910 if (num_routes & 1) { 3911 if (num_routes < 0 || num_routes & 1) {
3911 dev_err(card->dev, 3912 dev_err(card->dev,
3912 "Property '%s's length is not even\n", 3913 "Property '%s' does not exist or its length is not even\n",
3913 propname); 3914 propname);
3914 return -EINVAL; 3915 return -EINVAL;
3915 } 3916 }
3916 num_routes /= 2; 3917 num_routes /= 2;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3f12f481aa7e..90ee77d2409d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -68,6 +68,7 @@ static int dapm_up_seq[] = {
68 [snd_soc_dapm_out_drv] = 10, 68 [snd_soc_dapm_out_drv] = 10,
69 [snd_soc_dapm_hp] = 10, 69 [snd_soc_dapm_hp] = 10,
70 [snd_soc_dapm_spk] = 10, 70 [snd_soc_dapm_spk] = 10,
71 [snd_soc_dapm_line] = 10,
71 [snd_soc_dapm_post] = 11, 72 [snd_soc_dapm_post] = 11,
72}; 73};
73 74
@@ -76,6 +77,7 @@ static int dapm_down_seq[] = {
76 [snd_soc_dapm_adc] = 1, 77 [snd_soc_dapm_adc] = 1,
77 [snd_soc_dapm_hp] = 2, 78 [snd_soc_dapm_hp] = 2,
78 [snd_soc_dapm_spk] = 2, 79 [snd_soc_dapm_spk] = 2,
80 [snd_soc_dapm_line] = 2,
79 [snd_soc_dapm_out_drv] = 2, 81 [snd_soc_dapm_out_drv] = 2,
80 [snd_soc_dapm_pga] = 4, 82 [snd_soc_dapm_pga] = 4,
81 [snd_soc_dapm_mixer_named_ctl] = 5, 83 [snd_soc_dapm_mixer_named_ctl] = 5,