aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-01-15 15:05:59 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-15 15:05:59 -0500
commit4b87f922598acf91eee18f71688a33f54f57bcde (patch)
tree9cdfe30c6b96c47093da5392ed82d147290cd64c /sound
parent55eb555d9674e2ebe9d4de0146602f96ff18e7d6 (diff)
parentdaf3ec688e057f6060fb9bb0819feac7a8bbf45c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: Documentation/networking/ip-sysctl.txt drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Both conflicts were simply overlapping context. A build fix for qlcnic is in here too, simply removing the added devinit annotations which no longer exist. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/pxa2xx-ac97-lib.c26
-rw-r--r--sound/oss/pas2_card.c5
-rw-r--r--sound/pci/au88x0/au88x0_synth.c2
-rw-r--r--sound/pci/hda/hda_codec.c2
-rw-r--r--sound/pci/hda/hda_intel.c13
-rw-r--r--sound/pci/hda/patch_conexant.c16
-rw-r--r--sound/pci/hda/patch_realtek.c54
-rw-r--r--sound/pci/rme9652/hdspm.c17
-rw-r--r--sound/soc/codecs/arizona.c9
-rw-r--r--sound/soc/codecs/arizona.h18
-rw-r--r--sound/soc/codecs/cs4271.c6
-rw-r--r--sound/soc/codecs/cs42l52.c4
-rw-r--r--sound/soc/codecs/lm49453.c106
-rw-r--r--sound/soc/codecs/sgtl5000.c4
-rw-r--r--sound/soc/codecs/sta529.c9
-rw-r--r--sound/soc/codecs/wm2000.c4
-rw-r--r--sound/soc/codecs/wm2200.c8
-rw-r--r--sound/soc/codecs/wm5100.c6
-rw-r--r--sound/soc/codecs/wm5102.c48
-rw-r--r--sound/soc/codecs/wm_adsp.c23
-rw-r--r--sound/soc/soc-core.c35
-rw-r--r--sound/soc/soc-pcm.c1
-rw-r--r--sound/usb/midi.c4
-rw-r--r--sound/usb/mixer_quirks.c2
-rw-r--r--sound/usb/pcm.c10
-rw-r--r--sound/usb/quirks-table.h24
-rw-r--r--sound/usb/quirks.c16
-rw-r--r--sound/usb/usbaudio.h1
28 files changed, 310 insertions, 163 deletions
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index 6fc0ae90e5b1..fff7753e35c1 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -18,6 +18,7 @@
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/gpio.h>
21 22
22#include <sound/ac97_codec.h> 23#include <sound/ac97_codec.h>
23#include <sound/pxa2xx-lib.h> 24#include <sound/pxa2xx-lib.h>
@@ -148,6 +149,8 @@ static inline void pxa_ac97_warm_pxa27x(void)
148 149
149static inline void pxa_ac97_cold_pxa27x(void) 150static inline void pxa_ac97_cold_pxa27x(void)
150{ 151{
152 unsigned int timeout;
153
151 GCR &= GCR_COLD_RST; /* clear everything but nCRST */ 154 GCR &= GCR_COLD_RST; /* clear everything but nCRST */
152 GCR &= ~GCR_COLD_RST; /* then assert nCRST */ 155 GCR &= ~GCR_COLD_RST; /* then assert nCRST */
153 156
@@ -157,8 +160,10 @@ static inline void pxa_ac97_cold_pxa27x(void)
157 clk_enable(ac97conf_clk); 160 clk_enable(ac97conf_clk);
158 udelay(5); 161 udelay(5);
159 clk_disable(ac97conf_clk); 162 clk_disable(ac97conf_clk);
160 GCR = GCR_COLD_RST; 163 GCR = GCR_COLD_RST | GCR_WARM_RST;
161 udelay(50); 164 timeout = 100; /* wait for the codec-ready bit to be set */
165 while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
166 mdelay(1);
162} 167}
163#endif 168#endif
164 169
@@ -340,8 +345,21 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
340 } 345 }
341 346
342 if (cpu_is_pxa27x()) { 347 if (cpu_is_pxa27x()) {
343 /* Use GPIO 113 as AC97 Reset on Bulverde */ 348 /*
349 * This gpio is needed for a work-around to a bug in the ac97
350 * controller during warm reset. The direction and level is set
351 * here so that it is an output driven high when switching from
352 * AC97_nRESET alt function to generic gpio.
353 */
354 ret = gpio_request_one(reset_gpio, GPIOF_OUT_INIT_HIGH,
355 "pxa27x ac97 reset");
356 if (ret < 0) {
357 pr_err("%s: gpio_request_one() failed: %d\n",
358 __func__, ret);
359 goto err_conf;
360 }
344 pxa27x_assert_ac97reset(reset_gpio, 0); 361 pxa27x_assert_ac97reset(reset_gpio, 0);
362
345 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK"); 363 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
346 if (IS_ERR(ac97conf_clk)) { 364 if (IS_ERR(ac97conf_clk)) {
347 ret = PTR_ERR(ac97conf_clk); 365 ret = PTR_ERR(ac97conf_clk);
@@ -384,6 +402,8 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
384 402
385void pxa2xx_ac97_hw_remove(struct platform_device *dev) 403void pxa2xx_ac97_hw_remove(struct platform_device *dev)
386{ 404{
405 if (cpu_is_pxa27x())
406 gpio_free(reset_gpio);
387 GCR |= GCR_ACLINK_OFF; 407 GCR |= GCR_ACLINK_OFF;
388 free_irq(IRQ_AC97, NULL); 408 free_irq(IRQ_AC97, NULL);
389 if (ac97conf_clk) { 409 if (ac97conf_clk) {
diff --git a/sound/oss/pas2_card.c b/sound/oss/pas2_card.c
index dabf8a871dcc..7004e24d209f 100644
--- a/sound/oss/pas2_card.c
+++ b/sound/oss/pas2_card.c
@@ -333,6 +333,11 @@ static void __init attach_pas_card(struct address_info *hw_config)
333 { 333 {
334 char temp[100]; 334 char temp[100];
335 335
336 if (pas_model < 0 ||
337 pas_model >= ARRAY_SIZE(pas_model_names)) {
338 printk(KERN_ERR "pas2 unrecognized model.\n");
339 return;
340 }
336 sprintf(temp, 341 sprintf(temp,
337 "%s rev %d", pas_model_names[(int) pas_model], 342 "%s rev %d", pas_model_names[(int) pas_model],
338 pas_read(0x2789)); 343 pas_read(0x2789));
diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c
index 2805e34bd41d..8bef47311e45 100644
--- a/sound/pci/au88x0/au88x0_synth.c
+++ b/sound/pci/au88x0/au88x0_synth.c
@@ -58,7 +58,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en)
58 if (en) 58 if (en)
59 temp |= (1 << (wt & 0x1f)); 59 temp |= (1 << (wt & 0x1f));
60 else 60 else
61 temp &= (1 << ~(wt & 0x1f)); 61 temp &= ~(1 << (wt & 0x1f));
62 hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp); 62 hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp);
63} 63}
64 64
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 8353c77536ac..b8fb0a5adb9b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2531,7 +2531,7 @@ static int vmaster_mute_mode_info(struct snd_kcontrol *kcontrol,
2531 struct snd_ctl_elem_info *uinfo) 2531 struct snd_ctl_elem_info *uinfo)
2532{ 2532{
2533 static const char * const texts[] = { 2533 static const char * const texts[] = {
2534 "Off", "On", "Follow Master" 2534 "On", "Off", "Follow Master"
2535 }; 2535 };
2536 unsigned int index; 2536 unsigned int index;
2537 2537
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index cca87277baf0..0b6aebacc56b 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -573,9 +573,12 @@ enum {
573#define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */ 573#define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */
574 574
575/* quirks for Intel PCH */ 575/* quirks for Intel PCH */
576#define AZX_DCAPS_INTEL_PCH \ 576#define AZX_DCAPS_INTEL_PCH_NOPM \
577 (AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \ 577 (AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \
578 AZX_DCAPS_COUNT_LPIB_DELAY | AZX_DCAPS_PM_RUNTIME) 578 AZX_DCAPS_COUNT_LPIB_DELAY)
579
580#define AZX_DCAPS_INTEL_PCH \
581 (AZX_DCAPS_INTEL_PCH_NOPM | AZX_DCAPS_PM_RUNTIME)
579 582
580/* quirks for ATI SB / AMD Hudson */ 583/* quirks for ATI SB / AMD Hudson */
581#define AZX_DCAPS_PRESET_ATI_SB \ 584#define AZX_DCAPS_PRESET_ATI_SB \
@@ -3586,13 +3589,13 @@ static void azx_remove(struct pci_dev *pci)
3586static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { 3589static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
3587 /* CPT */ 3590 /* CPT */
3588 { PCI_DEVICE(0x8086, 0x1c20), 3591 { PCI_DEVICE(0x8086, 0x1c20),
3589 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3592 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
3590 /* PBG */ 3593 /* PBG */
3591 { PCI_DEVICE(0x8086, 0x1d20), 3594 { PCI_DEVICE(0x8086, 0x1d20),
3592 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3595 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
3593 /* Panther Point */ 3596 /* Panther Point */
3594 { PCI_DEVICE(0x8086, 0x1e20), 3597 { PCI_DEVICE(0x8086, 0x1e20),
3595 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3598 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
3596 /* Lynx Point */ 3599 /* Lynx Point */
3597 { PCI_DEVICE(0x8086, 0x8c20), 3600 { PCI_DEVICE(0x8086, 0x8c20),
3598 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 3601 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 60890bfecc19..dd798c3196ff 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -558,24 +558,12 @@ static int conexant_build_controls(struct hda_codec *codec)
558 return 0; 558 return 0;
559} 559}
560 560
561#ifdef CONFIG_PM
562static int conexant_suspend(struct hda_codec *codec)
563{
564 snd_hda_shutup_pins(codec);
565 return 0;
566}
567#endif
568
569static const struct hda_codec_ops conexant_patch_ops = { 561static const struct hda_codec_ops conexant_patch_ops = {
570 .build_controls = conexant_build_controls, 562 .build_controls = conexant_build_controls,
571 .build_pcms = conexant_build_pcms, 563 .build_pcms = conexant_build_pcms,
572 .init = conexant_init, 564 .init = conexant_init,
573 .free = conexant_free, 565 .free = conexant_free,
574 .set_power_state = conexant_set_power, 566 .set_power_state = conexant_set_power,
575#ifdef CONFIG_PM
576 .suspend = conexant_suspend,
577#endif
578 .reboot_notify = snd_hda_shutup_pins,
579}; 567};
580 568
581#ifdef CONFIG_SND_HDA_INPUT_BEEP 569#ifdef CONFIG_SND_HDA_INPUT_BEEP
@@ -4405,10 +4393,6 @@ static const struct hda_codec_ops cx_auto_patch_ops = {
4405 .init = cx_auto_init, 4393 .init = cx_auto_init,
4406 .free = conexant_free, 4394 .free = conexant_free,
4407 .unsol_event = snd_hda_jack_unsol_event, 4395 .unsol_event = snd_hda_jack_unsol_event,
4408#ifdef CONFIG_PM
4409 .suspend = conexant_suspend,
4410#endif
4411 .reboot_notify = snd_hda_shutup_pins,
4412}; 4396};
4413 4397
4414/* 4398/*
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6ee34593774a..f5196277b6e9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5817,6 +5817,9 @@ enum {
5817 ALC269_TYPE_ALC269VB, 5817 ALC269_TYPE_ALC269VB,
5818 ALC269_TYPE_ALC269VC, 5818 ALC269_TYPE_ALC269VC,
5819 ALC269_TYPE_ALC269VD, 5819 ALC269_TYPE_ALC269VD,
5820 ALC269_TYPE_ALC280,
5821 ALC269_TYPE_ALC282,
5822 ALC269_TYPE_ALC284,
5820}; 5823};
5821 5824
5822/* 5825/*
@@ -5833,10 +5836,13 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
5833 switch (spec->codec_variant) { 5836 switch (spec->codec_variant) {
5834 case ALC269_TYPE_ALC269VA: 5837 case ALC269_TYPE_ALC269VA:
5835 case ALC269_TYPE_ALC269VC: 5838 case ALC269_TYPE_ALC269VC:
5839 case ALC269_TYPE_ALC280:
5840 case ALC269_TYPE_ALC284:
5836 ssids = alc269va_ssids; 5841 ssids = alc269va_ssids;
5837 break; 5842 break;
5838 case ALC269_TYPE_ALC269VB: 5843 case ALC269_TYPE_ALC269VB:
5839 case ALC269_TYPE_ALC269VD: 5844 case ALC269_TYPE_ALC269VD:
5845 case ALC269_TYPE_ALC282:
5840 ssids = alc269_ssids; 5846 ssids = alc269_ssids;
5841 break; 5847 break;
5842 default: 5848 default:
@@ -5992,6 +5998,30 @@ static void alc269_fixup_quanta_mute(struct hda_codec *codec,
5992 spec->automute_hook = alc269_quanta_automute; 5998 spec->automute_hook = alc269_quanta_automute;
5993} 5999}
5994 6000
6001/* update mute-LED according to the speaker mute state via mic1 VREF pin */
6002static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled)
6003{
6004 struct hda_codec *codec = private_data;
6005 unsigned int pinval = AC_PINCTL_IN_EN + (enabled ?
6006 AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80);
6007 snd_hda_set_pin_ctl_cache(codec, 0x18, pinval);
6008}
6009
6010static void alc269_fixup_mic1_mute(struct hda_codec *codec,
6011 const struct alc_fixup *fix, int action)
6012{
6013 struct alc_spec *spec = codec->spec;
6014 switch (action) {
6015 case ALC_FIXUP_ACT_BUILD:
6016 spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook;
6017 snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
6018 /* fallthru */
6019 case ALC_FIXUP_ACT_INIT:
6020 snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
6021 break;
6022 }
6023}
6024
5995/* update mute-LED according to the speaker mute state via mic2 VREF pin */ 6025/* update mute-LED according to the speaker mute state via mic2 VREF pin */
5996static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled) 6026static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled)
5997{ 6027{
@@ -6043,6 +6073,7 @@ enum {
6043 ALC269_FIXUP_DMIC, 6073 ALC269_FIXUP_DMIC,
6044 ALC269VB_FIXUP_AMIC, 6074 ALC269VB_FIXUP_AMIC,
6045 ALC269VB_FIXUP_DMIC, 6075 ALC269VB_FIXUP_DMIC,
6076 ALC269_FIXUP_MIC1_MUTE_LED,
6046 ALC269_FIXUP_MIC2_MUTE_LED, 6077 ALC269_FIXUP_MIC2_MUTE_LED,
6047 ALC269_FIXUP_INV_DMIC, 6078 ALC269_FIXUP_INV_DMIC,
6048 ALC269_FIXUP_LENOVO_DOCK, 6079 ALC269_FIXUP_LENOVO_DOCK,
@@ -6171,6 +6202,10 @@ static const struct alc_fixup alc269_fixups[] = {
6171 { } 6202 { }
6172 }, 6203 },
6173 }, 6204 },
6205 [ALC269_FIXUP_MIC1_MUTE_LED] = {
6206 .type = ALC_FIXUP_FUNC,
6207 .v.func = alc269_fixup_mic1_mute,
6208 },
6174 [ALC269_FIXUP_MIC2_MUTE_LED] = { 6209 [ALC269_FIXUP_MIC2_MUTE_LED] = {
6175 .type = ALC_FIXUP_FUNC, 6210 .type = ALC_FIXUP_FUNC,
6176 .v.func = alc269_fixup_mic2_mute, 6211 .v.func = alc269_fixup_mic2_mute,
@@ -6215,6 +6250,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6215 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 6250 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
6216 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 6251 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
6217 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED), 6252 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
6253 SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED),
6218 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), 6254 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
6219 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), 6255 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC),
6220 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 6256 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
@@ -6370,7 +6406,8 @@ static int patch_alc269(struct hda_codec *codec)
6370 6406
6371 alc_auto_parse_customize_define(codec); 6407 alc_auto_parse_customize_define(codec);
6372 6408
6373 if (codec->vendor_id == 0x10ec0269) { 6409 switch (codec->vendor_id) {
6410 case 0x10ec0269:
6374 spec->codec_variant = ALC269_TYPE_ALC269VA; 6411 spec->codec_variant = ALC269_TYPE_ALC269VA;
6375 switch (alc_get_coef0(codec) & 0x00f0) { 6412 switch (alc_get_coef0(codec) & 0x00f0) {
6376 case 0x0010: 6413 case 0x0010:
@@ -6395,6 +6432,20 @@ static int patch_alc269(struct hda_codec *codec)
6395 goto error; 6432 goto error;
6396 spec->init_hook = alc269_fill_coef; 6433 spec->init_hook = alc269_fill_coef;
6397 alc269_fill_coef(codec); 6434 alc269_fill_coef(codec);
6435 break;
6436
6437 case 0x10ec0280:
6438 case 0x10ec0290:
6439 spec->codec_variant = ALC269_TYPE_ALC280;
6440 break;
6441 case 0x10ec0282:
6442 case 0x10ec0283:
6443 spec->codec_variant = ALC269_TYPE_ALC282;
6444 break;
6445 case 0x10ec0284:
6446 case 0x10ec0292:
6447 spec->codec_variant = ALC269_TYPE_ALC284;
6448 break;
6398 } 6449 }
6399 6450
6400 /* automatic parse from the BIOS config */ 6451 /* automatic parse from the BIOS config */
@@ -7099,6 +7150,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
7099 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 }, 7150 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
7100 { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 }, 7151 { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
7101 { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 }, 7152 { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 },
7153 { .id = 0x10ec0284, .name = "ALC284", .patch = patch_alc269 },
7102 { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 }, 7154 { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 },
7103 { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 }, 7155 { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 },
7104 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 7156 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 6e02e064d7b4..223c3d9cc69e 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -441,6 +441,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
441*/ 441*/
442/* status */ 442/* status */
443#define HDSPM_AES32_wcLock 0x0200000 443#define HDSPM_AES32_wcLock 0x0200000
444#define HDSPM_AES32_wcSync 0x0100000
444#define HDSPM_AES32_wcFreq_bit 22 445#define HDSPM_AES32_wcFreq_bit 22
445/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function 446/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function
446 HDSPM_bit2freq */ 447 HDSPM_bit2freq */
@@ -3467,10 +3468,12 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm)
3467 switch (hdspm->io_type) { 3468 switch (hdspm->io_type) {
3468 case AES32: 3469 case AES32:
3469 status = hdspm_read(hdspm, HDSPM_statusRegister); 3470 status = hdspm_read(hdspm, HDSPM_statusRegister);
3470 if (status & HDSPM_wcSync) 3471 if (status & HDSPM_AES32_wcLock) {
3471 return 2; 3472 if (status & HDSPM_AES32_wcSync)
3472 else if (status & HDSPM_wcLock) 3473 return 2;
3473 return 1; 3474 else
3475 return 1;
3476 }
3474 return 0; 3477 return 0;
3475 break; 3478 break;
3476 3479
@@ -4658,6 +4661,7 @@ snd_hdspm_proc_read_aes32(struct snd_info_entry * entry,
4658 unsigned int status; 4661 unsigned int status;
4659 unsigned int status2; 4662 unsigned int status2;
4660 unsigned int timecode; 4663 unsigned int timecode;
4664 unsigned int wcLock, wcSync;
4661 int pref_syncref; 4665 int pref_syncref;
4662 char *autosync_ref; 4666 char *autosync_ref;
4663 int x; 4667 int x;
@@ -4751,8 +4755,11 @@ snd_hdspm_proc_read_aes32(struct snd_info_entry * entry,
4751 4755
4752 snd_iprintf(buffer, "--- Status:\n"); 4756 snd_iprintf(buffer, "--- Status:\n");
4753 4757
4758 wcLock = status & HDSPM_AES32_wcLock;
4759 wcSync = wcLock && (status & HDSPM_AES32_wcSync);
4760
4754 snd_iprintf(buffer, "Word: %s Frequency: %d\n", 4761 snd_iprintf(buffer, "Word: %s Frequency: %d\n",
4755 (status & HDSPM_AES32_wcLock) ? "Sync " : "No Lock", 4762 (wcLock) ? (wcSync ? "Sync " : "Lock ") : "No Lock",
4756 HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF)); 4763 HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF));
4757 4764
4758 for (x = 0; x < 8; x++) { 4765 for (x = 0; x < 8; x++) {
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index adf397b9d0e6..1d8bb5917594 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -446,15 +446,9 @@ static int arizona_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
446 case SND_SOC_DAIFMT_DSP_A: 446 case SND_SOC_DAIFMT_DSP_A:
447 mode = 0; 447 mode = 0;
448 break; 448 break;
449 case SND_SOC_DAIFMT_DSP_B:
450 mode = 1;
451 break;
452 case SND_SOC_DAIFMT_I2S: 449 case SND_SOC_DAIFMT_I2S:
453 mode = 2; 450 mode = 2;
454 break; 451 break;
455 case SND_SOC_DAIFMT_LEFT_J:
456 mode = 3;
457 break;
458 default: 452 default:
459 arizona_aif_err(dai, "Unsupported DAI format %d\n", 453 arizona_aif_err(dai, "Unsupported DAI format %d\n",
460 fmt & SND_SOC_DAIFMT_FORMAT_MASK); 454 fmt & SND_SOC_DAIFMT_FORMAT_MASK);
@@ -714,7 +708,8 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
714 snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1, 708 snd_soc_update_bits(codec, ARIZONA_ASYNC_SAMPLE_RATE_1,
715 ARIZONA_ASYNC_SAMPLE_RATE_MASK, sr_val); 709 ARIZONA_ASYNC_SAMPLE_RATE_MASK, sr_val);
716 snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL, 710 snd_soc_update_bits(codec, base + ARIZONA_AIF_RATE_CTRL,
717 ARIZONA_AIF1_RATE_MASK, 8); 711 ARIZONA_AIF1_RATE_MASK,
712 8 << ARIZONA_AIF1_RATE_SHIFT);
718 break; 713 break;
719 default: 714 default:
720 arizona_aif_err(dai, "Invalid clock %d\n", dai_priv->clk); 715 arizona_aif_err(dai, "Invalid clock %d\n", dai_priv->clk);
diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h
index 41dae1ed3b71..4deebeb07177 100644
--- a/sound/soc/codecs/arizona.h
+++ b/sound/soc/codecs/arizona.h
@@ -34,15 +34,15 @@
34 34
35#define ARIZONA_FLL_SRC_MCLK1 0 35#define ARIZONA_FLL_SRC_MCLK1 0
36#define ARIZONA_FLL_SRC_MCLK2 1 36#define ARIZONA_FLL_SRC_MCLK2 1
37#define ARIZONA_FLL_SRC_SLIMCLK 2 37#define ARIZONA_FLL_SRC_SLIMCLK 3
38#define ARIZONA_FLL_SRC_FLL1 3 38#define ARIZONA_FLL_SRC_FLL1 4
39#define ARIZONA_FLL_SRC_FLL2 4 39#define ARIZONA_FLL_SRC_FLL2 5
40#define ARIZONA_FLL_SRC_AIF1BCLK 5 40#define ARIZONA_FLL_SRC_AIF1BCLK 8
41#define ARIZONA_FLL_SRC_AIF2BCLK 6 41#define ARIZONA_FLL_SRC_AIF2BCLK 9
42#define ARIZONA_FLL_SRC_AIF3BCLK 7 42#define ARIZONA_FLL_SRC_AIF3BCLK 10
43#define ARIZONA_FLL_SRC_AIF1LRCLK 8 43#define ARIZONA_FLL_SRC_AIF1LRCLK 12
44#define ARIZONA_FLL_SRC_AIF2LRCLK 9 44#define ARIZONA_FLL_SRC_AIF2LRCLK 13
45#define ARIZONA_FLL_SRC_AIF3LRCLK 10 45#define ARIZONA_FLL_SRC_AIF3LRCLK 14
46 46
47#define ARIZONA_MIXER_VOL_MASK 0x00FE 47#define ARIZONA_MIXER_VOL_MASK 0x00FE
48#define ARIZONA_MIXER_VOL_SHIFT 1 48#define ARIZONA_MIXER_VOL_SHIFT 1
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 4f1127935fdf..ac8742a1f25a 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -474,16 +474,16 @@ static int cs4271_probe(struct snd_soc_codec *codec)
474 struct cs4271_platform_data *cs4271plat = codec->dev->platform_data; 474 struct cs4271_platform_data *cs4271plat = codec->dev->platform_data;
475 int ret; 475 int ret;
476 int gpio_nreset = -EINVAL; 476 int gpio_nreset = -EINVAL;
477 int amutec_eq_bmutec = 0; 477 bool amutec_eq_bmutec = false;
478 478
479#ifdef CONFIG_OF 479#ifdef CONFIG_OF
480 if (of_match_device(cs4271_dt_ids, codec->dev)) { 480 if (of_match_device(cs4271_dt_ids, codec->dev)) {
481 gpio_nreset = of_get_named_gpio(codec->dev->of_node, 481 gpio_nreset = of_get_named_gpio(codec->dev->of_node,
482 "reset-gpio", 0); 482 "reset-gpio", 0);
483 483
484 if (!of_get_property(codec->dev->of_node, 484 if (of_get_property(codec->dev->of_node,
485 "cirrus,amutec-eq-bmutec", NULL)) 485 "cirrus,amutec-eq-bmutec", NULL))
486 amutec_eq_bmutec = 1; 486 amutec_eq_bmutec = true;
487 } 487 }
488#endif 488#endif
489 489
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 99bb1c69499e..9811a5478c87 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -737,7 +737,7 @@ static const struct cs42l52_clk_para clk_map_table[] = {
737 737
738static int cs42l52_get_clk(int mclk, int rate) 738static int cs42l52_get_clk(int mclk, int rate)
739{ 739{
740 int i, ret = 0; 740 int i, ret = -EINVAL;
741 u_int mclk1, mclk2 = 0; 741 u_int mclk1, mclk2 = 0;
742 742
743 for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) { 743 for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) {
@@ -749,8 +749,6 @@ static int cs42l52_get_clk(int mclk, int rate)
749 } 749 }
750 } 750 }
751 } 751 }
752 if (ret > ARRAY_SIZE(clk_map_table))
753 return -EINVAL;
754 return ret; 752 return ret;
755} 753}
756 754
diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c
index d75257d40a49..e19490cfb3a8 100644
--- a/sound/soc/codecs/lm49453.c
+++ b/sound/soc/codecs/lm49453.c
@@ -111,9 +111,9 @@ static struct reg_default lm49453_reg_defs[] = {
111 { 101, 0x00 }, 111 { 101, 0x00 },
112 { 102, 0x00 }, 112 { 102, 0x00 },
113 { 103, 0x01 }, 113 { 103, 0x01 },
114 { 105, 0x01 }, 114 { 104, 0x01 },
115 { 106, 0x00 }, 115 { 105, 0x00 },
116 { 107, 0x01 }, 116 { 106, 0x01 },
117 { 107, 0x00 }, 117 { 107, 0x00 },
118 { 108, 0x00 }, 118 { 108, 0x00 },
119 { 109, 0x00 }, 119 { 109, 0x00 },
@@ -163,56 +163,25 @@ static struct reg_default lm49453_reg_defs[] = {
163 { 184, 0x00 }, 163 { 184, 0x00 },
164 { 185, 0x00 }, 164 { 185, 0x00 },
165 { 186, 0x00 }, 165 { 186, 0x00 },
166 { 189, 0x00 }, 166 { 187, 0x00 },
167 { 188, 0x00 }, 167 { 188, 0x00 },
168 { 194, 0x00 }, 168 { 189, 0x00 },
169 { 195, 0x00 }, 169 { 208, 0x06 },
170 { 196, 0x00 },
171 { 197, 0x00 },
172 { 200, 0x00 },
173 { 201, 0x00 },
174 { 202, 0x00 },
175 { 203, 0x00 },
176 { 204, 0x00 },
177 { 205, 0x00 },
178 { 208, 0x00 },
179 { 209, 0x00 }, 170 { 209, 0x00 },
180 { 210, 0x00 }, 171 { 210, 0x08 },
181 { 211, 0x00 }, 172 { 211, 0x54 },
182 { 213, 0x00 }, 173 { 212, 0x14 },
183 { 214, 0x00 }, 174 { 213, 0x0d },
184 { 215, 0x00 }, 175 { 214, 0x0d },
185 { 216, 0x00 }, 176 { 215, 0x14 },
186 { 217, 0x00 }, 177 { 216, 0x60 },
187 { 218, 0x00 },
188 { 219, 0x00 },
189 { 221, 0x00 }, 178 { 221, 0x00 },
190 { 222, 0x00 }, 179 { 222, 0x00 },
180 { 223, 0x00 },
191 { 224, 0x00 }, 181 { 224, 0x00 },
192 { 225, 0x00 },
193 { 226, 0x00 },
194 { 227, 0x00 },
195 { 228, 0x00 },
196 { 229, 0x00 },
197 { 230, 0x13 },
198 { 231, 0x00 },
199 { 232, 0x80 },
200 { 233, 0x0C },
201 { 234, 0xDD },
202 { 235, 0x00 },
203 { 236, 0x04 },
204 { 237, 0x00 },
205 { 238, 0x00 },
206 { 239, 0x00 },
207 { 240, 0x00 },
208 { 241, 0x00 },
209 { 242, 0x00 },
210 { 243, 0x00 },
211 { 244, 0x00 },
212 { 245, 0x00 },
213 { 248, 0x00 }, 182 { 248, 0x00 },
214 { 249, 0x00 }, 183 { 249, 0x00 },
215 { 254, 0x00 }, 184 { 250, 0x00 },
216 { 255, 0x00 }, 185 { 255, 0x00 },
217}; 186};
218 187
@@ -525,36 +494,41 @@ SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0),
525}; 494};
526 495
527/* TLV Declarations */ 496/* TLV Declarations */
528static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1); 497static const DECLARE_TLV_DB_SCALE(adc_dac_tlv, -7650, 150, 1);
529static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0); 498static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 200, 1);
499static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);
500static const DECLARE_TLV_DB_SCALE(stn_tlv, -7200, 150, 0);
530 501
531static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = { 502static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = {
532/* Sidetone supports mono only */ 503/* Sidetone supports mono only */
533SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG, 504SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG,
534 0, 0x3F, 0, digital_tlv), 505 0, 0x3F, 0, stn_tlv),
535SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG, 506SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG,
536 0, 0x3F, 0, digital_tlv), 507 0, 0x3F, 0, stn_tlv),
537SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG, 508SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG,
538 0, 0x3F, 0, digital_tlv), 509 0, 0x3F, 0, stn_tlv),
539SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG, 510SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG,
540 0, 0x3F, 0, digital_tlv), 511 0, 0x3F, 0, stn_tlv),
541SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG, 512SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG,
542 0, 0x3F, 0, digital_tlv), 513 0, 0x3F, 0, stn_tlv),
543SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, 514SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG,
544 0, 0x3F, 0, digital_tlv), 515 0, 0x3F, 0, stn_tlv),
545}; 516};
546 517
547static const struct snd_kcontrol_new lm49453_snd_controls[] = { 518static const struct snd_kcontrol_new lm49453_snd_controls[] = {
548 /* mic1 and mic2 supports mono only */ 519 /* mic1 and mic2 supports mono only */
549 SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6, 520 SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_MICL_REG, 0, 15, 0, mic_tlv),
550 0, digital_tlv), 521 SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_MICR_REG, 0, 15, 0, mic_tlv),
551 SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6, 522
552 0, digital_tlv), 523 SOC_SINGLE_TLV("ADCL Volume", LM49453_P0_ADC_LEVELL_REG, 0, 63,
524 0, adc_dac_tlv),
525 SOC_SINGLE_TLV("ADCR Volume", LM49453_P0_ADC_LEVELR_REG, 0, 63,
526 0, adc_dac_tlv),
553 527
554 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG, 528 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
555 LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv), 529 LM49453_P0_DMIC1_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
556 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG, 530 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG,
557 LM49453_P0_DMIC2_LEVELR_REG, 0, 6, 0, digital_tlv), 531 LM49453_P0_DMIC2_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
558 532
559 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum), 533 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum),
560 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum), 534 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum),
@@ -569,16 +543,16 @@ static const struct snd_kcontrol_new lm49453_snd_controls[] = {
569 2, 1, 0), 543 2, 1, 0),
570 544
571 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG, 545 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG,
572 LM49453_P0_DAC_HP_LEVELR_REG, 0, 6, 0, digital_tlv), 546 LM49453_P0_DAC_HP_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
573 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG, 547 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG,
574 LM49453_P0_DAC_LO_LEVELR_REG, 0, 6, 0, digital_tlv), 548 LM49453_P0_DAC_LO_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
575 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG, 549 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG,
576 LM49453_P0_DAC_LS_LEVELR_REG, 0, 6, 0, digital_tlv), 550 LM49453_P0_DAC_LS_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
577 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG, 551 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG,
578 LM49453_P0_DAC_HA_LEVELR_REG, 0, 6, 0, digital_tlv), 552 LM49453_P0_DAC_HA_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
579 553
580 SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG, 554 SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG,
581 0, 6, 0, digital_tlv), 555 0, 63, 0, adc_dac_tlv),
582 556
583 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, 557 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG,
584 0, 3, 0, port_tlv), 558 0, 3, 0, port_tlv),
@@ -1218,7 +1192,7 @@ static int lm49453_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
1218 } 1192 }
1219 1193
1220 snd_soc_update_bits(codec, LM49453_P0_AUDIO_PORT1_BASIC_REG, 1194 snd_soc_update_bits(codec, LM49453_P0_AUDIO_PORT1_BASIC_REG,
1221 LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(1)|BIT(5), 1195 LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(0)|BIT(5),
1222 (aif_val | mode | clk_phase)); 1196 (aif_val | mode | clk_phase));
1223 1197
1224 snd_soc_write(codec, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift); 1198 snd_soc_write(codec, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift);
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index cb1675cd8e1c..92bbfec9b107 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -401,7 +401,7 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = {
401 5, 1, 0), 401 5, 1, 0),
402 402
403 SOC_SINGLE_TLV("Mic Volume", SGTL5000_CHIP_MIC_CTRL, 403 SOC_SINGLE_TLV("Mic Volume", SGTL5000_CHIP_MIC_CTRL,
404 0, 4, 0, mic_gain_tlv), 404 0, 3, 0, mic_gain_tlv),
405}; 405};
406 406
407/* mute the codec used by alsa core */ 407/* mute the codec used by alsa core */
@@ -1344,7 +1344,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
1344 SGTL5000_HP_ZCD_EN | 1344 SGTL5000_HP_ZCD_EN |
1345 SGTL5000_ADC_ZCD_EN); 1345 SGTL5000_ADC_ZCD_EN);
1346 1346
1347 snd_soc_write(codec, SGTL5000_CHIP_MIC_CTRL, 0); 1347 snd_soc_write(codec, SGTL5000_CHIP_MIC_CTRL, 2);
1348 1348
1349 /* 1349 /*
1350 * disable DAP 1350 * disable DAP
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c
index ab355c4f0b2d..40c07be9b581 100644
--- a/sound/soc/codecs/sta529.c
+++ b/sound/soc/codecs/sta529.c
@@ -74,9 +74,10 @@
74 SNDRV_PCM_FMTBIT_S32_LE) 74 SNDRV_PCM_FMTBIT_S32_LE)
75#define S2PC_VALUE 0x98 75#define S2PC_VALUE 0x98
76#define CLOCK_OUT 0x60 76#define CLOCK_OUT 0x60
77#define LEFT_J_DATA_FORMAT 0x10 77#define DATA_FORMAT_MSK 0x0E
78#define I2S_DATA_FORMAT 0x12 78#define LEFT_J_DATA_FORMAT 0x00
79#define RIGHT_J_DATA_FORMAT 0x14 79#define I2S_DATA_FORMAT 0x02
80#define RIGHT_J_DATA_FORMAT 0x04
80#define CODEC_MUTE_VAL 0x80 81#define CODEC_MUTE_VAL 0x80
81 82
82#define POWER_CNTLMSAK 0x40 83#define POWER_CNTLMSAK 0x40
@@ -289,7 +290,7 @@ static int sta529_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt)
289 return -EINVAL; 290 return -EINVAL;
290 } 291 }
291 292
292 snd_soc_update_bits(codec, STA529_S2PCFG0, 0x0D, mode); 293 snd_soc_update_bits(codec, STA529_S2PCFG0, DATA_FORMAT_MSK, mode);
293 294
294 return 0; 295 return 0;
295} 296}
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 1cbe88f01d63..12bcae63a7f0 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -209,9 +209,9 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue)
209 209
210 ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY); 210 ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY);
211 if (wm2000->speech_clarity) 211 if (wm2000->speech_clarity)
212 ret &= ~WM2000_SPEECH_CLARITY;
213 else
214 ret |= WM2000_SPEECH_CLARITY; 212 ret |= WM2000_SPEECH_CLARITY;
213 else
214 ret &= ~WM2000_SPEECH_CLARITY;
215 wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret); 215 wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret);
216 216
217 wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33); 217 wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33);
diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c
index afcf31df77e0..e6cefe1ac677 100644
--- a/sound/soc/codecs/wm2200.c
+++ b/sound/soc/codecs/wm2200.c
@@ -1566,15 +1566,9 @@ static int wm2200_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1566 case SND_SOC_DAIFMT_DSP_A: 1566 case SND_SOC_DAIFMT_DSP_A:
1567 fmt_val = 0; 1567 fmt_val = 0;
1568 break; 1568 break;
1569 case SND_SOC_DAIFMT_DSP_B:
1570 fmt_val = 1;
1571 break;
1572 case SND_SOC_DAIFMT_I2S: 1569 case SND_SOC_DAIFMT_I2S:
1573 fmt_val = 2; 1570 fmt_val = 2;
1574 break; 1571 break;
1575 case SND_SOC_DAIFMT_LEFT_J:
1576 fmt_val = 3;
1577 break;
1578 default: 1572 default:
1579 dev_err(codec->dev, "Unsupported DAI format %d\n", 1573 dev_err(codec->dev, "Unsupported DAI format %d\n",
1580 fmt & SND_SOC_DAIFMT_FORMAT_MASK); 1574 fmt & SND_SOC_DAIFMT_FORMAT_MASK);
@@ -1626,7 +1620,7 @@ static int wm2200_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1626 WM2200_AIF1TX_LRCLK_MSTR | WM2200_AIF1TX_LRCLK_INV, 1620 WM2200_AIF1TX_LRCLK_MSTR | WM2200_AIF1TX_LRCLK_INV,
1627 lrclk); 1621 lrclk);
1628 snd_soc_update_bits(codec, WM2200_AUDIO_IF_1_5, 1622 snd_soc_update_bits(codec, WM2200_AUDIO_IF_1_5,
1629 WM2200_AIF1_FMT_MASK << 1, fmt_val << 1); 1623 WM2200_AIF1_FMT_MASK, fmt_val);
1630 1624
1631 return 0; 1625 return 0;
1632} 1626}
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index 5a5f36936235..54397a508073 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -1279,15 +1279,9 @@ static int wm5100_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1279 case SND_SOC_DAIFMT_DSP_A: 1279 case SND_SOC_DAIFMT_DSP_A:
1280 mask = 0; 1280 mask = 0;
1281 break; 1281 break;
1282 case SND_SOC_DAIFMT_DSP_B:
1283 mask = 1;
1284 break;
1285 case SND_SOC_DAIFMT_I2S: 1282 case SND_SOC_DAIFMT_I2S:
1286 mask = 2; 1283 mask = 2;
1287 break; 1284 break;
1288 case SND_SOC_DAIFMT_LEFT_J:
1289 mask = 3;
1290 break;
1291 default: 1285 default:
1292 dev_err(codec->dev, "Unsupported DAI format %d\n", 1286 dev_err(codec->dev, "Unsupported DAI format %d\n",
1293 fmt & SND_SOC_DAIFMT_FORMAT_MASK); 1287 fmt & SND_SOC_DAIFMT_FORMAT_MASK);
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 688ade080589..7a9048dad1cd 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -36,6 +36,9 @@
36struct wm5102_priv { 36struct wm5102_priv {
37 struct arizona_priv core; 37 struct arizona_priv core;
38 struct arizona_fll fll[2]; 38 struct arizona_fll fll[2];
39
40 unsigned int spk_ena:2;
41 unsigned int spk_ena_pending:1;
39}; 42};
40 43
41static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); 44static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
@@ -787,6 +790,47 @@ ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE),
787ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE), 790ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE),
788}; 791};
789 792
793static int wm5102_spk_ev(struct snd_soc_dapm_widget *w,
794 struct snd_kcontrol *kcontrol,
795 int event)
796{
797 struct snd_soc_codec *codec = w->codec;
798 struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
799 struct wm5102_priv *wm5102 = snd_soc_codec_get_drvdata(codec);
800
801 if (arizona->rev < 1)
802 return 0;
803
804 switch (event) {
805 case SND_SOC_DAPM_PRE_PMU:
806 if (!wm5102->spk_ena) {
807 snd_soc_write(codec, 0x4f5, 0x25a);
808 wm5102->spk_ena_pending = true;
809 }
810 break;
811 case SND_SOC_DAPM_POST_PMU:
812 if (wm5102->spk_ena_pending) {
813 msleep(75);
814 snd_soc_write(codec, 0x4f5, 0xda);
815 wm5102->spk_ena_pending = false;
816 wm5102->spk_ena++;
817 }
818 break;
819 case SND_SOC_DAPM_PRE_PMD:
820 wm5102->spk_ena--;
821 if (!wm5102->spk_ena)
822 snd_soc_write(codec, 0x4f5, 0x25a);
823 break;
824 case SND_SOC_DAPM_POST_PMD:
825 if (!wm5102->spk_ena)
826 snd_soc_write(codec, 0x4f5, 0x0da);
827 break;
828 }
829
830 return 0;
831}
832
833
790ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE); 834ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE);
791ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE); 835ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE);
792ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE); 836ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE);
@@ -1034,10 +1078,10 @@ SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
1034 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1078 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1035 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1079 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1036SND_SOC_DAPM_PGA_E("OUT4L", ARIZONA_OUTPUT_ENABLES_1, 1080SND_SOC_DAPM_PGA_E("OUT4L", ARIZONA_OUTPUT_ENABLES_1,
1037 ARIZONA_OUT4L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1081 ARIZONA_OUT4L_ENA_SHIFT, 0, NULL, 0, wm5102_spk_ev,
1038 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1082 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1039SND_SOC_DAPM_PGA_E("OUT4R", ARIZONA_OUTPUT_ENABLES_1, 1083SND_SOC_DAPM_PGA_E("OUT4R", ARIZONA_OUTPUT_ENABLES_1,
1040 ARIZONA_OUT4R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1084 ARIZONA_OUT4R_ENA_SHIFT, 0, NULL, 0, wm5102_spk_ev,
1041 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), 1085 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1042SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1, 1086SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1,
1043 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, 1087 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index ffc89fab96fb..7b198c38f3ef 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -169,6 +169,7 @@ static int wm_adsp_load(struct wm_adsp *dsp)
169 const struct wm_adsp_region *mem; 169 const struct wm_adsp_region *mem;
170 const char *region_name; 170 const char *region_name;
171 char *file, *text; 171 char *file, *text;
172 void *buf;
172 unsigned int reg; 173 unsigned int reg;
173 int regions = 0; 174 int regions = 0;
174 int ret, offset, type, sizes; 175 int ret, offset, type, sizes;
@@ -322,8 +323,18 @@ static int wm_adsp_load(struct wm_adsp *dsp)
322 } 323 }
323 324
324 if (reg) { 325 if (reg) {
325 ret = regmap_raw_write(regmap, reg, region->data, 326 buf = kmemdup(region->data, le32_to_cpu(region->len),
327 GFP_KERNEL);
328 if (!buf) {
329 adsp_err(dsp, "Out of memory\n");
330 return -ENOMEM;
331 }
332
333 ret = regmap_raw_write(regmap, reg, buf,
326 le32_to_cpu(region->len)); 334 le32_to_cpu(region->len));
335
336 kfree(buf);
337
327 if (ret != 0) { 338 if (ret != 0) {
328 adsp_err(dsp, 339 adsp_err(dsp,
329 "%s.%d: Failed to write %d bytes at %d in %s: %d\n", 340 "%s.%d: Failed to write %d bytes at %d in %s: %d\n",
@@ -359,6 +370,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
359 const char *region_name; 370 const char *region_name;
360 int ret, pos, blocks, type, offset, reg; 371 int ret, pos, blocks, type, offset, reg;
361 char *file; 372 char *file;
373 void *buf;
362 374
363 file = kzalloc(PAGE_SIZE, GFP_KERNEL); 375 file = kzalloc(PAGE_SIZE, GFP_KERNEL);
364 if (file == NULL) 376 if (file == NULL)
@@ -426,6 +438,13 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
426 } 438 }
427 439
428 if (reg) { 440 if (reg) {
441 buf = kmemdup(blk->data, le32_to_cpu(blk->len),
442 GFP_KERNEL);
443 if (!buf) {
444 adsp_err(dsp, "Out of memory\n");
445 return -ENOMEM;
446 }
447
429 ret = regmap_raw_write(regmap, reg, blk->data, 448 ret = regmap_raw_write(regmap, reg, blk->data,
430 le32_to_cpu(blk->len)); 449 le32_to_cpu(blk->len));
431 if (ret != 0) { 450 if (ret != 0) {
@@ -433,6 +452,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
433 "%s.%d: Failed to write to %x in %s\n", 452 "%s.%d: Failed to write to %x in %s\n",
434 file, blocks, reg, region_name); 453 file, blocks, reg, region_name);
435 } 454 }
455
456 kfree(buf);
436 } 457 }
437 458
438 pos += le32_to_cpu(blk->len) + sizeof(*blk); 459 pos += le32_to_cpu(blk->len) + sizeof(*blk);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 91d592ff67b7..2370063b5824 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1255,6 +1255,8 @@ static int soc_post_component_init(struct snd_soc_card *card,
1255 INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].fe_clients); 1255 INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].fe_clients);
1256 ret = device_add(rtd->dev); 1256 ret = device_add(rtd->dev);
1257 if (ret < 0) { 1257 if (ret < 0) {
1258 /* calling put_device() here to free the rtd->dev */
1259 put_device(rtd->dev);
1258 dev_err(card->dev, 1260 dev_err(card->dev,
1259 "ASoC: failed to register runtime device: %d\n", ret); 1261 "ASoC: failed to register runtime device: %d\n", ret);
1260 return ret; 1262 return ret;
@@ -1554,7 +1556,7 @@ static void soc_remove_aux_dev(struct snd_soc_card *card, int num)
1554 /* unregister the rtd device */ 1556 /* unregister the rtd device */
1555 if (rtd->dev_registered) { 1557 if (rtd->dev_registered) {
1556 device_remove_file(rtd->dev, &dev_attr_codec_reg); 1558 device_remove_file(rtd->dev, &dev_attr_codec_reg);
1557 device_del(rtd->dev); 1559 device_unregister(rtd->dev);
1558 rtd->dev_registered = 0; 1560 rtd->dev_registered = 0;
1559 } 1561 }
1560 1562
@@ -2917,7 +2919,7 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
2917 platform_max = mc->platform_max; 2919 platform_max = mc->platform_max;
2918 2920
2919 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2921 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2920 uinfo->count = 1; 2922 uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
2921 uinfo->value.integer.min = 0; 2923 uinfo->value.integer.min = 0;
2922 uinfo->value.integer.max = platform_max - min; 2924 uinfo->value.integer.max = platform_max - min;
2923 2925
@@ -2941,12 +2943,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
2941 (struct soc_mixer_control *)kcontrol->private_value; 2943 (struct soc_mixer_control *)kcontrol->private_value;
2942 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 2944 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
2943 unsigned int reg = mc->reg; 2945 unsigned int reg = mc->reg;
2946 unsigned int rreg = mc->rreg;
2944 unsigned int shift = mc->shift; 2947 unsigned int shift = mc->shift;
2945 int min = mc->min; 2948 int min = mc->min;
2946 int max = mc->max; 2949 int max = mc->max;
2947 unsigned int mask = (1 << fls(max)) - 1; 2950 unsigned int mask = (1 << fls(max)) - 1;
2948 unsigned int invert = mc->invert; 2951 unsigned int invert = mc->invert;
2949 unsigned int val, val_mask; 2952 unsigned int val, val_mask;
2953 int ret;
2950 2954
2951 val = ((ucontrol->value.integer.value[0] + min) & mask); 2955 val = ((ucontrol->value.integer.value[0] + min) & mask);
2952 if (invert) 2956 if (invert)
@@ -2954,7 +2958,21 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
2954 val_mask = mask << shift; 2958 val_mask = mask << shift;
2955 val = val << shift; 2959 val = val << shift;
2956 2960
2957 return snd_soc_update_bits_locked(codec, reg, val_mask, val); 2961 ret = snd_soc_update_bits_locked(codec, reg, val_mask, val);
2962 if (ret != 0)
2963 return ret;
2964
2965 if (snd_soc_volsw_is_stereo(mc)) {
2966 val = ((ucontrol->value.integer.value[1] + min) & mask);
2967 if (invert)
2968 val = max - val;
2969 val_mask = mask << shift;
2970 val = val << shift;
2971
2972 ret = snd_soc_update_bits_locked(codec, rreg, val_mask, val);
2973 }
2974
2975 return ret;
2958} 2976}
2959EXPORT_SYMBOL_GPL(snd_soc_put_volsw_range); 2977EXPORT_SYMBOL_GPL(snd_soc_put_volsw_range);
2960 2978
@@ -2974,6 +2992,7 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
2974 (struct soc_mixer_control *)kcontrol->private_value; 2992 (struct soc_mixer_control *)kcontrol->private_value;
2975 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 2993 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
2976 unsigned int reg = mc->reg; 2994 unsigned int reg = mc->reg;
2995 unsigned int rreg = mc->rreg;
2977 unsigned int shift = mc->shift; 2996 unsigned int shift = mc->shift;
2978 int min = mc->min; 2997 int min = mc->min;
2979 int max = mc->max; 2998 int max = mc->max;
@@ -2988,6 +3007,16 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
2988 ucontrol->value.integer.value[0] = 3007 ucontrol->value.integer.value[0] =
2989 ucontrol->value.integer.value[0] - min; 3008 ucontrol->value.integer.value[0] - min;
2990 3009
3010 if (snd_soc_volsw_is_stereo(mc)) {
3011 ucontrol->value.integer.value[1] =
3012 (snd_soc_read(codec, rreg) >> shift) & mask;
3013 if (invert)
3014 ucontrol->value.integer.value[1] =
3015 max - ucontrol->value.integer.value[1];
3016 ucontrol->value.integer.value[1] =
3017 ucontrol->value.integer.value[1] - min;
3018 }
3019
2991 return 0; 3020 return 0;
2992} 3021}
2993EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range); 3022EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range);
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index d7711fce119b..cf191e6aebbe 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1243,6 +1243,7 @@ static int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream)
1243 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && 1243 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
1244 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && 1244 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
1245 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && 1245 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
1246 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) &&
1246 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) 1247 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
1247 continue; 1248 continue;
1248 1249
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index c183d34842ac..34b9bb7fe87c 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -2181,10 +2181,6 @@ int snd_usbmidi_create(struct snd_card *card,
2181 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; 2181 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
2182 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 2182 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
2183 break; 2183 break;
2184 case QUIRK_MIDI_MBOX2:
2185 umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops;
2186 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
2187 break;
2188 case QUIRK_MIDI_RAW_BYTES: 2184 case QUIRK_MIDI_RAW_BYTES:
2189 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; 2185 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
2190 /* 2186 /*
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 0422b1360af3..15520de1df56 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -1206,7 +1206,7 @@ static int snd_c400_create_mixer(struct usb_mixer_interface *mixer)
1206 * are valid they presents mono controls as L and R channels of 1206 * are valid they presents mono controls as L and R channels of
1207 * stereo. So we provide a good mixer here. 1207 * stereo. So we provide a good mixer here.
1208 */ 1208 */
1209struct std_mono_table ebox44_table[] = { 1209static struct std_mono_table ebox44_table[] = {
1210 { 1210 {
1211 .unitid = 4, 1211 .unitid = 4,
1212 .control = 1, 1212 .control = 1,
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index c6593101c049..d82e378d37cb 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -511,6 +511,16 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs)
511 struct snd_usb_substream *sync_subs = 511 struct snd_usb_substream *sync_subs =
512 &subs->stream->substream[subs->direction ^ 1]; 512 &subs->stream->substream[subs->direction ^ 1];
513 513
514 if (subs->sync_endpoint->type != SND_USB_ENDPOINT_TYPE_DATA ||
515 !subs->stream)
516 return snd_usb_endpoint_set_params(subs->sync_endpoint,
517 subs->pcm_format,
518 subs->channels,
519 subs->period_bytes,
520 subs->cur_rate,
521 subs->cur_audiofmt,
522 NULL);
523
514 /* Try to find the best matching audioformat. */ 524 /* Try to find the best matching audioformat. */
515 list_for_each_entry(fp, &sync_subs->fmt_list, list) { 525 list_for_each_entry(fp, &sync_subs->fmt_list, list) {
516 int score = match_endpoint_audioformats(fp, subs->cur_audiofmt, 526 int score = match_endpoint_audioformats(fp, subs->cur_audiofmt,
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index cdcf6b45e8a8..78e845ec65da 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -50,6 +50,28 @@
50 } 50 }
51}, 51},
52 52
53{
54 /* Creative BT-D1 */
55 USB_DEVICE(0x041e, 0x0005),
56 .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
57 .ifnum = 1,
58 .type = QUIRK_AUDIO_FIXED_ENDPOINT,
59 .data = &(const struct audioformat) {
60 .formats = SNDRV_PCM_FMTBIT_S16_LE,
61 .channels = 2,
62 .iface = 1,
63 .altsetting = 1,
64 .altset_idx = 1,
65 .endpoint = 0x03,
66 .ep_attr = USB_ENDPOINT_XFER_ISOC,
67 .attributes = 0,
68 .rates = SNDRV_PCM_RATE_CONTINUOUS,
69 .rate_min = 48000,
70 .rate_max = 48000,
71 }
72 }
73},
74
53/* Creative/Toshiba Multimedia Center SB-0500 */ 75/* Creative/Toshiba Multimedia Center SB-0500 */
54{ 76{
55 USB_DEVICE(0x041e, 0x3048), 77 USB_DEVICE(0x041e, 0x3048),
@@ -2993,7 +3015,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
2993 }, 3015 },
2994 { 3016 {
2995 .ifnum = 6, 3017 .ifnum = 6,
2996 .type = QUIRK_MIDI_MBOX2, 3018 .type = QUIRK_MIDI_MIDIMAN,
2997 .data = &(const struct snd_usb_midi_endpoint_info) { 3019 .data = &(const struct snd_usb_midi_endpoint_info) {
2998 .out_ep = 0x02, 3020 .out_ep = 0x02,
2999 .out_cables = 0x0001, 3021 .out_cables = 0x0001,
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index f104c68fe1e0..acc12f004c23 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
306 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk, 306 [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
307 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk, 307 [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
308 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk, 308 [QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
309 [QUIRK_MIDI_MBOX2] = create_any_midi_quirk,
310 [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk, 309 [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
311 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk, 310 [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
312 [QUIRK_MIDI_CME] = create_any_midi_quirk, 311 [QUIRK_MIDI_CME] = create_any_midi_quirk,
@@ -528,11 +527,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev)
528#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */ 527#define MBOX2_BOOT_LOADING 0x01 /* Hard coded into the device */
529#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */ 528#define MBOX2_BOOT_READY 0x02 /* Hard coded into the device */
530 529
531int snd_usb_mbox2_boot_quirk(struct usb_device *dev) 530static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
532{ 531{
533 struct usb_host_config *config = dev->actconfig; 532 struct usb_host_config *config = dev->actconfig;
534 int err; 533 int err;
535 u8 bootresponse; 534 u8 bootresponse[12];
536 int fwsize; 535 int fwsize;
537 int count; 536 int count;
538 537
@@ -546,20 +545,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
546 snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n"); 545 snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n");
547 546
548 count = 0; 547 count = 0;
549 bootresponse = MBOX2_BOOT_LOADING; 548 bootresponse[0] = MBOX2_BOOT_LOADING;
550 while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) { 549 while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) {
551 msleep(500); /* 0.5 second delay */ 550 msleep(500); /* 0.5 second delay */
552 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 551 snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
553 /* Control magic - load onboard firmware */ 552 /* Control magic - load onboard firmware */
554 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); 553 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012);
555 if (bootresponse == MBOX2_BOOT_READY) 554 if (bootresponse[0] == MBOX2_BOOT_READY)
556 break; 555 break;
557 snd_printd("usb-audio: device not ready, resending boot sequence...\n"); 556 snd_printd("usb-audio: device not ready, resending boot sequence...\n");
558 count++; 557 count++;
559 } 558 }
560 559
561 if (bootresponse != MBOX2_BOOT_READY) { 560 if (bootresponse[0] != MBOX2_BOOT_READY) {
562 snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse); 561 snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]);
563 return -ENODEV; 562 return -ENODEV;
564 } 563 }
565 564
@@ -660,7 +659,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip,
660 return 0; /* keep this altsetting */ 659 return 0; /* keep this altsetting */
661} 660}
662 661
663
664static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, 662static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
665 int iface, int altno) 663 int iface, int altno)
666{ 664{
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index a8172c119796..1ac3fd9cc5a6 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -76,7 +76,6 @@ enum quirk_type {
76 QUIRK_MIDI_YAMAHA, 76 QUIRK_MIDI_YAMAHA,
77 QUIRK_MIDI_MIDIMAN, 77 QUIRK_MIDI_MIDIMAN,
78 QUIRK_MIDI_NOVATION, 78 QUIRK_MIDI_NOVATION,
79 QUIRK_MIDI_MBOX2,
80 QUIRK_MIDI_RAW_BYTES, 79 QUIRK_MIDI_RAW_BYTES,
81 QUIRK_MIDI_EMAGIC, 80 QUIRK_MIDI_EMAGIC,
82 QUIRK_MIDI_CME, 81 QUIRK_MIDI_CME,