aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/core/control.c5
-rw-r--r--sound/i2c/other/tea575x-tuner.c1
-rw-r--r--sound/pci/bt87x.c4
-rw-r--r--sound/pci/hda/hda_codec.c9
-rw-r--r--sound/pci/hda/hda_local.h18
-rw-r--r--sound/pci/hda/patch_analog.c5
-rw-r--r--sound/pci/hda/patch_cmedia.c3
-rw-r--r--sound/pci/hda/patch_conexant.c35
-rw-r--r--sound/pci/hda/patch_realtek.c2
-rw-r--r--sound/pci/hda/patch_sigmatel.c6
-rw-r--r--sound/pci/hda/patch_via.c2
-rw-r--r--sound/sh/aica.c31
-rw-r--r--sound/sparc/cs4231.c59
-rw-r--r--sound/usb/usbquirks.h9
14 files changed, 108 insertions, 81 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 4c3aa8e10378..df0774c76f6f 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -93,15 +93,16 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
93 93
94static void snd_ctl_empty_read_queue(struct snd_ctl_file * ctl) 94static void snd_ctl_empty_read_queue(struct snd_ctl_file * ctl)
95{ 95{
96 unsigned long flags;
96 struct snd_kctl_event *cread; 97 struct snd_kctl_event *cread;
97 98
98 spin_lock(&ctl->read_lock); 99 spin_lock_irqsave(&ctl->read_lock, flags);
99 while (!list_empty(&ctl->events)) { 100 while (!list_empty(&ctl->events)) {
100 cread = snd_kctl_event(ctl->events.next); 101 cread = snd_kctl_event(ctl->events.next);
101 list_del(&cread->list); 102 list_del(&cread->list);
102 kfree(cread); 103 kfree(cread);
103 } 104 }
104 spin_unlock(&ctl->read_lock); 105 spin_unlock_irqrestore(&ctl->read_lock, flags);
105} 106}
106 107
107static int snd_ctl_release(struct inode *inode, struct file *file) 108static int snd_ctl_release(struct inode *inode, struct file *file)
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index fe31bb5cffb8..37c47fb95aca 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -189,7 +189,6 @@ void snd_tea575x_init(struct snd_tea575x *tea)
189 tea->vd.owner = tea->card->module; 189 tea->vd.owner = tea->card->module;
190 strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio"); 190 strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio");
191 tea->vd.type = VID_TYPE_TUNER; 191 tea->vd.type = VID_TYPE_TUNER;
192 tea->vd.hardware = VID_HARDWARE_RTRACK; /* FIXME: assign new number */
193 tea->vd.release = snd_tea575x_release; 192 tea->vd.release = snd_tea575x_release;
194 video_set_drvdata(&tea->vd, tea); 193 video_set_drvdata(&tea->vd, tea);
195 tea->vd.fops = &tea->fops; 194 tea->vd.fops = &tea->fops;
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 91f9e6a112ff..2dba752faf4e 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -165,7 +165,7 @@ struct snd_bt87x_board {
165 unsigned no_digital:1; /* No digital input */ 165 unsigned no_digital:1; /* No digital input */
166}; 166};
167 167
168static const __devinitdata struct snd_bt87x_board snd_bt87x_boards[] = { 168static __devinitdata struct snd_bt87x_board snd_bt87x_boards[] = {
169 [SND_BT87X_BOARD_UNKNOWN] = { 169 [SND_BT87X_BOARD_UNKNOWN] = {
170 .dig_rate = 32000, /* just a guess */ 170 .dig_rate = 32000, /* just a guess */
171 }, 171 },
@@ -848,7 +848,7 @@ static int __devinit snd_bt87x_detect_card(struct pci_dev *pci)
848 int i; 848 int i;
849 const struct pci_device_id *supported; 849 const struct pci_device_id *supported;
850 850
851 supported = pci_match_device(&driver, pci); 851 supported = pci_match_id(snd_bt87x_ids, pci);
852 if (supported && supported->driver_data > 0) 852 if (supported && supported->driver_data > 0)
853 return supported->driver_data; 853 return supported->driver_data;
854 854
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 187533e477c6..ad4cb38109fc 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -626,24 +626,19 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
626 snd_hda_get_codec_name(codec, bus->card->mixername, 626 snd_hda_get_codec_name(codec, bus->card->mixername,
627 sizeof(bus->card->mixername)); 627 sizeof(bus->card->mixername));
628 628
629#ifdef CONFIG_SND_HDA_GENERIC
630 if (is_generic_config(codec)) { 629 if (is_generic_config(codec)) {
631 err = snd_hda_parse_generic_codec(codec); 630 err = snd_hda_parse_generic_codec(codec);
632 goto patched; 631 goto patched;
633 } 632 }
634#endif
635 if (codec->preset && codec->preset->patch) { 633 if (codec->preset && codec->preset->patch) {
636 err = codec->preset->patch(codec); 634 err = codec->preset->patch(codec);
637 goto patched; 635 goto patched;
638 } 636 }
639 637
640 /* call the default parser */ 638 /* call the default parser */
641#ifdef CONFIG_SND_HDA_GENERIC
642 err = snd_hda_parse_generic_codec(codec); 639 err = snd_hda_parse_generic_codec(codec);
643#else 640 if (err < 0)
644 printk(KERN_ERR "hda-codec: No codec parser is available\n"); 641 printk(KERN_ERR "hda-codec: No codec parser is available\n");
645 err = -ENODEV;
646#endif
647 642
648 patched: 643 patched:
649 if (err < 0) { 644 if (err < 0) {
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index a79d0ed5469c..20c5e6250374 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -245,7 +245,14 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
245/* 245/*
246 * generic codec parser 246 * generic codec parser
247 */ 247 */
248#ifdef CONFIG_SND_HDA_GENERIC
248int snd_hda_parse_generic_codec(struct hda_codec *codec); 249int snd_hda_parse_generic_codec(struct hda_codec *codec);
250#else
251static inline int snd_hda_parse_generic_codec(struct hda_codec *codec)
252{
253 return -ENODEV;
254}
255#endif
249 256
250/* 257/*
251 * generic proc interface 258 * generic proc interface
@@ -303,16 +310,17 @@ enum {
303 310
304extern const char *auto_pin_cfg_labels[AUTO_PIN_LAST]; 311extern const char *auto_pin_cfg_labels[AUTO_PIN_LAST];
305 312
313#define AUTO_CFG_MAX_OUTS 5
314
306struct auto_pin_cfg { 315struct auto_pin_cfg {
307 int line_outs; 316 int line_outs;
308 hda_nid_t line_out_pins[5]; /* sorted in the order of 317 /* sorted in the order of Front/Surr/CLFE/Side */
309 * Front/Surr/CLFE/Side 318 hda_nid_t line_out_pins[AUTO_CFG_MAX_OUTS];
310 */
311 int speaker_outs; 319 int speaker_outs;
312 hda_nid_t speaker_pins[5]; 320 hda_nid_t speaker_pins[AUTO_CFG_MAX_OUTS];
313 int hp_outs; 321 int hp_outs;
314 int line_out_type; /* AUTO_PIN_XXX_OUT */ 322 int line_out_type; /* AUTO_PIN_XXX_OUT */
315 hda_nid_t hp_pins[5]; 323 hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS];
316 hda_nid_t input_pins[AUTO_PIN_LAST]; 324 hda_nid_t input_pins[AUTO_PIN_LAST];
317 hda_nid_t dig_out_pin; 325 hda_nid_t dig_out_pin;
318 hda_nid_t dig_in_pin; 326 hda_nid_t dig_in_pin;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 54cfd4526d20..0ee8ae4d4410 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -72,7 +72,7 @@ struct ad198x_spec {
72 unsigned int num_kctl_alloc, num_kctl_used; 72 unsigned int num_kctl_alloc, num_kctl_used;
73 struct snd_kcontrol_new *kctl_alloc; 73 struct snd_kcontrol_new *kctl_alloc;
74 struct hda_input_mux private_imux; 74 struct hda_input_mux private_imux;
75 hda_nid_t private_dac_nids[4]; 75 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
76 76
77 unsigned int jack_present :1; 77 unsigned int jack_present :1;
78 78
@@ -612,7 +612,8 @@ static void ad1986a_hp_automute(struct hda_codec *codec)
612 unsigned int present; 612 unsigned int present;
613 613
614 present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0); 614 present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0);
615 spec->jack_present = (present & 0x80000000) != 0; 615 /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */
616 spec->jack_present = !(present & 0x80000000);
616 ad1986a_update_hp(codec); 617 ad1986a_update_hp(codec);
617} 618}
618 619
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index 2468f3171222..6c54793bf424 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -50,7 +50,7 @@ struct cmi_spec {
50 50
51 /* playback */ 51 /* playback */
52 struct hda_multi_out multiout; 52 struct hda_multi_out multiout;
53 hda_nid_t dac_nids[4]; /* NID for each DAC */ 53 hda_nid_t dac_nids[AUTO_CFG_MAX_OUTS]; /* NID for each DAC */
54 int num_dacs; 54 int num_dacs;
55 55
56 /* capture */ 56 /* capture */
@@ -73,7 +73,6 @@ struct cmi_spec {
73 unsigned int pin_def_confs; 73 unsigned int pin_def_confs;
74 74
75 /* multichannel pins */ 75 /* multichannel pins */
76 hda_nid_t multich_pin[4]; /* max 8-channel */
77 struct hda_verb multi_init[9]; /* 2 verbs for each pin + terminator */ 76 struct hda_verb multi_init[9]; /* 2 verbs for each pin + terminator */
78}; 77};
79 78
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 080e3001d9c5..6aa073986747 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -85,7 +85,7 @@ struct conexant_spec {
85 unsigned int num_kctl_alloc, num_kctl_used; 85 unsigned int num_kctl_alloc, num_kctl_used;
86 struct snd_kcontrol_new *kctl_alloc; 86 struct snd_kcontrol_new *kctl_alloc;
87 struct hda_input_mux private_imux; 87 struct hda_input_mux private_imux;
88 hda_nid_t private_dac_nids[4]; 88 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
89 89
90}; 90};
91 91
@@ -554,10 +554,16 @@ static struct snd_kcontrol_new cxt5045_mixers[] = {
554 .get = conexant_mux_enum_get, 554 .get = conexant_mux_enum_get,
555 .put = conexant_mux_enum_put 555 .put = conexant_mux_enum_put
556 }, 556 },
557 HDA_CODEC_VOLUME("Int Mic Volume", 0x1a, 0x01, HDA_INPUT), 557 HDA_CODEC_VOLUME("Int Mic Capture Volume", 0x1a, 0x01, HDA_INPUT),
558 HDA_CODEC_MUTE("Int Mic Switch", 0x1a, 0x01, HDA_INPUT), 558 HDA_CODEC_MUTE("Int Mic Capture Switch", 0x1a, 0x01, HDA_INPUT),
559 HDA_CODEC_VOLUME("Ext Mic Volume", 0x1a, 0x02, HDA_INPUT), 559 HDA_CODEC_VOLUME("Ext Mic Capture Volume", 0x1a, 0x02, HDA_INPUT),
560 HDA_CODEC_MUTE("Ext Mic Switch", 0x1a, 0x02, HDA_INPUT), 560 HDA_CODEC_MUTE("Ext Mic Capture Switch", 0x1a, 0x02, HDA_INPUT),
561 HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT),
562 HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT),
563 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x17, 0x1, HDA_INPUT),
564 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x17, 0x1, HDA_INPUT),
565 HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x17, 0x2, HDA_INPUT),
566 HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x17, 0x2, HDA_INPUT),
561 HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol), 567 HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol),
562 { 568 {
563 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 569 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -576,16 +582,15 @@ static struct hda_verb cxt5045_init_verbs[] = {
576 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 582 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
577 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, 583 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 },
578 /* HP, Amp */ 584 /* HP, Amp */
579 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP }, 585 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
580 {0x17, AC_VERB_SET_CONNECT_SEL,0x01}, 586 {0x10, AC_VERB_SET_CONNECT_SEL, 0x1},
581 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 587 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
582 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x01}, 588 {0x11, AC_VERB_SET_CONNECT_SEL, 0x1},
583 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 589 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
584 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x02}, 590 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
585 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 591 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
586 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03}, 592 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
587 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 593 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
588 AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x04},
589 /* Record selector: Int mic */ 594 /* Record selector: Int mic */
590 {0x1a, AC_VERB_SET_CONNECT_SEL,0x1}, 595 {0x1a, AC_VERB_SET_CONNECT_SEL,0x1},
591 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, 596 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE,
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 53b0428abfc2..d9f78c809ee9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -238,7 +238,7 @@ struct alc_spec {
238 unsigned int num_kctl_alloc, num_kctl_used; 238 unsigned int num_kctl_alloc, num_kctl_used;
239 struct snd_kcontrol_new *kctl_alloc; 239 struct snd_kcontrol_new *kctl_alloc;
240 struct hda_input_mux private_imux; 240 struct hda_input_mux private_imux;
241 hda_nid_t private_dac_nids[5]; 241 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
242 242
243 /* hooks */ 243 /* hooks */
244 void (*init_hook)(struct hda_codec *codec); 244 void (*init_hook)(struct hda_codec *codec);
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index bf950195107c..f9b2c435a130 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -111,6 +111,7 @@ struct sigmatel_spec {
111 unsigned int alt_switch: 1; 111 unsigned int alt_switch: 1;
112 unsigned int hp_detect: 1; 112 unsigned int hp_detect: 1;
113 unsigned int gpio_mute: 1; 113 unsigned int gpio_mute: 1;
114 unsigned int no_vol_knob :1;
114 115
115 unsigned int gpio_mask, gpio_data; 116 unsigned int gpio_mask, gpio_data;
116 117
@@ -1930,7 +1931,8 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
1930 } 1931 }
1931 if (spec->multiout.hp_nid) { 1932 if (spec->multiout.hp_nid) {
1932 const char *pfx; 1933 const char *pfx;
1933 if (old_num_dacs == spec->multiout.num_dacs) 1934 if (old_num_dacs == spec->multiout.num_dacs &&
1935 spec->no_vol_knob)
1934 pfx = "Master"; 1936 pfx = "Master";
1935 else 1937 else
1936 pfx = "Headphone"; 1938 pfx = "Headphone";
@@ -2487,6 +2489,7 @@ static int patch_stac9200(struct hda_codec *codec)
2487 codec->spec = spec; 2489 codec->spec = spec;
2488 spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); 2490 spec->num_pins = ARRAY_SIZE(stac9200_pin_nids);
2489 spec->pin_nids = stac9200_pin_nids; 2491 spec->pin_nids = stac9200_pin_nids;
2492 spec->no_vol_knob = 1;
2490 spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS, 2493 spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS,
2491 stac9200_models, 2494 stac9200_models,
2492 stac9200_cfg_tbl); 2495 stac9200_cfg_tbl);
@@ -2541,6 +2544,7 @@ static int patch_stac925x(struct hda_codec *codec)
2541 codec->spec = spec; 2544 codec->spec = spec;
2542 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); 2545 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
2543 spec->pin_nids = stac925x_pin_nids; 2546 spec->pin_nids = stac925x_pin_nids;
2547 spec->no_vol_knob = 1;
2544 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, 2548 spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS,
2545 stac925x_models, 2549 stac925x_models,
2546 stac925x_cfg_tbl); 2550 stac925x_cfg_tbl);
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 33b5e1ffa817..4cdf3e6df4ba 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -114,7 +114,7 @@ struct via_spec {
114 unsigned int num_kctl_alloc, num_kctl_used; 114 unsigned int num_kctl_alloc, num_kctl_used;
115 struct snd_kcontrol_new *kctl_alloc; 115 struct snd_kcontrol_new *kctl_alloc;
116 struct hda_input_mux private_imux; 116 struct hda_input_mux private_imux;
117 hda_nid_t private_dac_nids[4]; 117 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
118 118
119#ifdef CONFIG_SND_HDA_POWER_SAVE 119#ifdef CONFIG_SND_HDA_POWER_SAVE
120 struct hda_loopback_check loopback; 120 struct hda_loopback_check loopback;
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 131ec4812288..88dc840152ce 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -106,11 +106,14 @@ static void spu_write_wait(void)
106static void spu_memset(u32 toi, u32 what, int length) 106static void spu_memset(u32 toi, u32 what, int length)
107{ 107{
108 int i; 108 int i;
109 unsigned long flags;
109 snd_assert(length % 4 == 0, return); 110 snd_assert(length % 4 == 0, return);
110 for (i = 0; i < length; i++) { 111 for (i = 0; i < length; i++) {
111 if (!(i % 8)) 112 if (!(i % 8))
112 spu_write_wait(); 113 spu_write_wait();
114 local_irq_save(flags);
113 writel(what, toi + SPU_MEMORY_BASE); 115 writel(what, toi + SPU_MEMORY_BASE);
116 local_irq_restore(flags);
114 toi++; 117 toi++;
115 } 118 }
116} 119}
@@ -118,6 +121,7 @@ static void spu_memset(u32 toi, u32 what, int length)
118/* spu_memload - write to SPU address space */ 121/* spu_memload - write to SPU address space */
119static void spu_memload(u32 toi, void *from, int length) 122static void spu_memload(u32 toi, void *from, int length)
120{ 123{
124 unsigned long flags;
121 u32 *froml = from; 125 u32 *froml = from;
122 u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi); 126 u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi);
123 int i; 127 int i;
@@ -128,7 +132,9 @@ static void spu_memload(u32 toi, void *from, int length)
128 if (!(i % 8)) 132 if (!(i % 8))
129 spu_write_wait(); 133 spu_write_wait();
130 val = *froml; 134 val = *froml;
135 local_irq_save(flags);
131 writel(val, to); 136 writel(val, to);
137 local_irq_restore(flags);
132 froml++; 138 froml++;
133 to++; 139 to++;
134 } 140 }
@@ -138,28 +144,36 @@ static void spu_memload(u32 toi, void *from, int length)
138static void spu_disable(void) 144static void spu_disable(void)
139{ 145{
140 int i; 146 int i;
147 unsigned long flags;
141 u32 regval; 148 u32 regval;
142 spu_write_wait(); 149 spu_write_wait();
143 regval = readl(ARM_RESET_REGISTER); 150 regval = readl(ARM_RESET_REGISTER);
144 regval |= 1; 151 regval |= 1;
145 spu_write_wait(); 152 spu_write_wait();
153 local_irq_save(flags);
146 writel(regval, ARM_RESET_REGISTER); 154 writel(regval, ARM_RESET_REGISTER);
155 local_irq_restore(flags);
147 for (i = 0; i < 64; i++) { 156 for (i = 0; i < 64; i++) {
148 spu_write_wait(); 157 spu_write_wait();
149 regval = readl(SPU_REGISTER_BASE + (i * 0x80)); 158 regval = readl(SPU_REGISTER_BASE + (i * 0x80));
150 regval = (regval & ~0x4000) | 0x8000; 159 regval = (regval & ~0x4000) | 0x8000;
151 spu_write_wait(); 160 spu_write_wait();
161 local_irq_save(flags);
152 writel(regval, SPU_REGISTER_BASE + (i * 0x80)); 162 writel(regval, SPU_REGISTER_BASE + (i * 0x80));
163 local_irq_restore(flags);
153 } 164 }
154} 165}
155 166
156/* spu_enable - set spu registers to enable sound output */ 167/* spu_enable - set spu registers to enable sound output */
157static void spu_enable(void) 168static void spu_enable(void)
158{ 169{
170 unsigned long flags;
159 u32 regval = readl(ARM_RESET_REGISTER); 171 u32 regval = readl(ARM_RESET_REGISTER);
160 regval &= ~1; 172 regval &= ~1;
161 spu_write_wait(); 173 spu_write_wait();
174 local_irq_save(flags);
162 writel(regval, ARM_RESET_REGISTER); 175 writel(regval, ARM_RESET_REGISTER);
176 local_irq_restore(flags);
163} 177}
164 178
165/* 179/*
@@ -168,25 +182,34 @@ static void spu_enable(void)
168*/ 182*/
169static void spu_reset(void) 183static void spu_reset(void)
170{ 184{
185 unsigned long flags;
171 spu_disable(); 186 spu_disable();
172 spu_memset(0, 0, 0x200000 / 4); 187 spu_memset(0, 0, 0x200000 / 4);
173 /* Put ARM7 in endless loop */ 188 /* Put ARM7 in endless loop */
189 local_irq_save(flags);
174 ctrl_outl(0xea000002, SPU_MEMORY_BASE); 190 ctrl_outl(0xea000002, SPU_MEMORY_BASE);
191 local_irq_restore(flags);
175 spu_enable(); 192 spu_enable();
176} 193}
177 194
178/* aica_chn_start - write to spu to start playback */ 195/* aica_chn_start - write to spu to start playback */
179static void aica_chn_start(void) 196static void aica_chn_start(void)
180{ 197{
198 unsigned long flags;
181 spu_write_wait(); 199 spu_write_wait();
200 local_irq_save(flags);
182 writel(AICA_CMD_KICK | AICA_CMD_START, (u32 *) AICA_CONTROL_POINT); 201 writel(AICA_CMD_KICK | AICA_CMD_START, (u32 *) AICA_CONTROL_POINT);
202 local_irq_restore(flags);
183} 203}
184 204
185/* aica_chn_halt - write to spu to halt playback */ 205/* aica_chn_halt - write to spu to halt playback */
186static void aica_chn_halt(void) 206static void aica_chn_halt(void)
187{ 207{
208 unsigned long flags;
188 spu_write_wait(); 209 spu_write_wait();
210 local_irq_save(flags);
189 writel(AICA_CMD_KICK | AICA_CMD_STOP, (u32 *) AICA_CONTROL_POINT); 211 writel(AICA_CMD_KICK | AICA_CMD_STOP, (u32 *) AICA_CONTROL_POINT);
212 local_irq_restore(flags);
190} 213}
191 214
192/* ALSA code below */ 215/* ALSA code below */
@@ -213,12 +236,13 @@ static int aica_dma_transfer(int channels, int buffer_size,
213 int q, err, period_offset; 236 int q, err, period_offset;
214 struct snd_card_aica *dreamcastcard; 237 struct snd_card_aica *dreamcastcard;
215 struct snd_pcm_runtime *runtime; 238 struct snd_pcm_runtime *runtime;
216 err = 0; 239 unsigned long flags;
217 dreamcastcard = substream->pcm->private_data; 240 dreamcastcard = substream->pcm->private_data;
218 period_offset = dreamcastcard->clicks; 241 period_offset = dreamcastcard->clicks;
219 period_offset %= (AICA_PERIOD_NUMBER / channels); 242 period_offset %= (AICA_PERIOD_NUMBER / channels);
220 runtime = substream->runtime; 243 runtime = substream->runtime;
221 for (q = 0; q < channels; q++) { 244 for (q = 0; q < channels; q++) {
245 local_irq_save(flags);
222 err = dma_xfer(AICA_DMA_CHANNEL, 246 err = dma_xfer(AICA_DMA_CHANNEL,
223 (unsigned long) (runtime->dma_area + 247 (unsigned long) (runtime->dma_area +
224 (AICA_BUFFER_SIZE * q) / 248 (AICA_BUFFER_SIZE * q) /
@@ -228,9 +252,12 @@ static int aica_dma_transfer(int channels, int buffer_size,
228 AICA_CHANNEL0_OFFSET + q * CHANNEL_OFFSET + 252 AICA_CHANNEL0_OFFSET + q * CHANNEL_OFFSET +
229 AICA_PERIOD_SIZE * period_offset, 253 AICA_PERIOD_SIZE * period_offset,
230 buffer_size / channels, AICA_DMA_MODE); 254 buffer_size / channels, AICA_DMA_MODE);
231 if (unlikely(err < 0)) 255 if (unlikely(err < 0)) {
256 local_irq_restore(flags);
232 break; 257 break;
258 }
233 dma_wait_for_completion(AICA_DMA_CHANNEL); 259 dma_wait_for_completion(AICA_DMA_CHANNEL);
260 local_irq_restore(flags);
234 } 261 }
235 return err; 262 return err;
236} 263}
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index 9785382a5f39..f8c7a120ccbb 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -400,65 +400,44 @@ static void snd_cs4231_mce_up(struct snd_cs4231 *chip)
400 400
401static void snd_cs4231_mce_down(struct snd_cs4231 *chip) 401static void snd_cs4231_mce_down(struct snd_cs4231 *chip)
402{ 402{
403 unsigned long flags; 403 unsigned long flags, timeout;
404 unsigned long end_time; 404 int reg;
405 int timeout;
406 405
407 spin_lock_irqsave(&chip->lock, flags);
408 snd_cs4231_busy_wait(chip); 406 snd_cs4231_busy_wait(chip);
407 spin_lock_irqsave(&chip->lock, flags);
409#ifdef CONFIG_SND_DEBUG 408#ifdef CONFIG_SND_DEBUG
410 if (__cs4231_readb(chip, CS4231U(chip, REGSEL)) & CS4231_INIT) 409 if (__cs4231_readb(chip, CS4231U(chip, REGSEL)) & CS4231_INIT)
411 snd_printdd("mce_down [%p] - auto calibration time out (0)\n", 410 snd_printdd("mce_down [%p] - auto calibration time out (0)\n",
412 CS4231U(chip, REGSEL)); 411 CS4231U(chip, REGSEL));
413#endif 412#endif
414 chip->mce_bit &= ~CS4231_MCE; 413 chip->mce_bit &= ~CS4231_MCE;
415 timeout = __cs4231_readb(chip, CS4231U(chip, REGSEL)); 414 reg = __cs4231_readb(chip, CS4231U(chip, REGSEL));
416 __cs4231_writeb(chip, chip->mce_bit | (timeout & 0x1f), 415 __cs4231_writeb(chip, chip->mce_bit | (reg & 0x1f),
417 CS4231U(chip, REGSEL)); 416 CS4231U(chip, REGSEL));
418 if (timeout == 0x80) 417 if (reg == 0x80)
419 snd_printdd("mce_down [%p]: serious init problem - " 418 snd_printdd("mce_down [%p]: serious init problem "
420 "codec still busy\n", 419 "- codec still busy\n", chip->port);
421 chip->port); 420 if ((reg & CS4231_MCE) == 0) {
422 if ((timeout & CS4231_MCE) == 0) {
423 spin_unlock_irqrestore(&chip->lock, flags); 421 spin_unlock_irqrestore(&chip->lock, flags);
424 return; 422 return;
425 } 423 }
426 424
427 /* 425 /*
428 * Wait for (possible -- during init auto-calibration may not be set) 426 * Wait for auto-calibration (AC) process to finish, i.e. ACI to go low.
429 * calibration process to start. Needs upto 5 sample periods on AD1848
430 * which at the slowest possible rate of 5.5125 kHz means 907 us.
431 */ 427 */
432 msleep(1); 428 timeout = jiffies + msecs_to_jiffies(250);
433 429 do {
434 /* check condition up to 250ms */
435 end_time = jiffies + msecs_to_jiffies(250);
436 while (snd_cs4231_in(chip, CS4231_TEST_INIT) &
437 CS4231_CALIB_IN_PROGRESS) {
438
439 spin_unlock_irqrestore(&chip->lock, flags); 430 spin_unlock_irqrestore(&chip->lock, flags);
440 if (time_after(jiffies, end_time)) {
441 snd_printk("mce_down - "
442 "auto calibration time out (2)\n");
443 return;
444 }
445 msleep(1);
446 spin_lock_irqsave(&chip->lock, flags);
447 }
448
449 /* check condition up to 100ms */
450 end_time = jiffies + msecs_to_jiffies(100);
451 while (__cs4231_readb(chip, CS4231U(chip, REGSEL)) & CS4231_INIT) {
452 spin_unlock_irqrestore(&chip->lock, flags);
453 if (time_after(jiffies, end_time)) {
454 snd_printk("mce_down - "
455 "auto calibration time out (3)\n");
456 return;
457 }
458 msleep(1); 431 msleep(1);
459 spin_lock_irqsave(&chip->lock, flags); 432 spin_lock_irqsave(&chip->lock, flags);
460 } 433 reg = snd_cs4231_in(chip, CS4231_TEST_INIT);
434 reg &= CS4231_CALIB_IN_PROGRESS;
435 } while (reg && time_before(jiffies, timeout));
461 spin_unlock_irqrestore(&chip->lock, flags); 436 spin_unlock_irqrestore(&chip->lock, flags);
437
438 if (reg)
439 snd_printk(KERN_ERR
440 "mce_down - auto calibration time out (2)\n");
462} 441}
463 442
464static void snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont, 443static void snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont,
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 743568f89907..59410f437705 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -84,6 +84,15 @@
84 USB_DEVICE_ID_MATCH_INT_CLASS | 84 USB_DEVICE_ID_MATCH_INT_CLASS |
85 USB_DEVICE_ID_MATCH_INT_SUBCLASS, 85 USB_DEVICE_ID_MATCH_INT_SUBCLASS,
86 .idVendor = 0x046d, 86 .idVendor = 0x046d,
87 .idProduct = 0x08f5,
88 .bInterfaceClass = USB_CLASS_AUDIO,
89 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
90},
91{
92 .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
93 USB_DEVICE_ID_MATCH_INT_CLASS |
94 USB_DEVICE_ID_MATCH_INT_SUBCLASS,
95 .idVendor = 0x046d,
87 .idProduct = 0x08f6, 96 .idProduct = 0x08f6,
88 .bInterfaceClass = USB_CLASS_AUDIO, 97 .bInterfaceClass = USB_CLASS_AUDIO,
89 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL 98 .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL