aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-11-01 05:11:07 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-01 05:11:07 -0500
commite87a3dd33eab30b4db539500064a9584867e4f2c (patch)
tree2f7ad16e46ae30518ff63bb5391b63f7f7cc74dd /sound/usb
parentb14f5de731ae657d498d18d713c6431bfbeefb4b (diff)
parent3d00941371a765779c4e3509214c7e5793cce1fe (diff)
Merge branch 'fix/misc' into topic/misc
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/caiaq/audio.c16
-rw-r--r--sound/usb/caiaq/device.c2
-rw-r--r--sound/usb/usbmixer.c23
-rw-r--r--sound/usb/usx2y/us122l.c2
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c2
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.c2
6 files changed, 31 insertions, 16 deletions
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 121af0644fd9..86b2c3b92df5 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -62,10 +62,14 @@ static void
62activate_substream(struct snd_usb_caiaqdev *dev, 62activate_substream(struct snd_usb_caiaqdev *dev,
63 struct snd_pcm_substream *sub) 63 struct snd_pcm_substream *sub)
64{ 64{
65 spin_lock(&dev->spinlock);
66
65 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) 67 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
66 dev->sub_playback[sub->number] = sub; 68 dev->sub_playback[sub->number] = sub;
67 else 69 else
68 dev->sub_capture[sub->number] = sub; 70 dev->sub_capture[sub->number] = sub;
71
72 spin_unlock(&dev->spinlock);
69} 73}
70 74
71static void 75static void
@@ -269,16 +273,22 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub)
269{ 273{
270 int index = sub->number; 274 int index = sub->number;
271 struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub); 275 struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub);
276 snd_pcm_uframes_t ptr;
277
278 spin_lock(&dev->spinlock);
272 279
273 if (dev->input_panic || dev->output_panic) 280 if (dev->input_panic || dev->output_panic)
274 return SNDRV_PCM_POS_XRUN; 281 ptr = SNDRV_PCM_POS_XRUN;
275 282
276 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) 283 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
277 return bytes_to_frames(sub->runtime, 284 ptr = bytes_to_frames(sub->runtime,
278 dev->audio_out_buf_pos[index]); 285 dev->audio_out_buf_pos[index]);
279 else 286 else
280 return bytes_to_frames(sub->runtime, 287 ptr = bytes_to_frames(sub->runtime,
281 dev->audio_in_buf_pos[index]); 288 dev->audio_in_buf_pos[index]);
289
290 spin_unlock(&dev->spinlock);
291 return ptr;
282} 292}
283 293
284/* operators for both playback and capture */ 294/* operators for both playback and capture */
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index 83e6c1312d47..a3f02dd97440 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -35,7 +35,7 @@
35#include "input.h" 35#include "input.h"
36 36
37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.19"); 38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.20");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," 40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
41 "{Native Instruments, RigKontrol3}," 41 "{Native Instruments, RigKontrol3},"
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index ab5a3ac2ac47..9efcfd08d747 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -898,6 +898,11 @@ static struct snd_kcontrol_new usb_feature_unit_ctl = {
898 * build a feature control 898 * build a feature control
899 */ 899 */
900 900
901static size_t append_ctl_name(struct snd_kcontrol *kctl, const char *str)
902{
903 return strlcat(kctl->id.name, str, sizeof(kctl->id.name));
904}
905
901static void build_feature_ctl(struct mixer_build *state, unsigned char *desc, 906static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
902 unsigned int ctl_mask, int control, 907 unsigned int ctl_mask, int control,
903 struct usb_audio_term *iterm, int unitid) 908 struct usb_audio_term *iterm, int unitid)
@@ -978,13 +983,13 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
978 */ 983 */
979 if (! mapped_name && ! (state->oterm.type >> 16)) { 984 if (! mapped_name && ! (state->oterm.type >> 16)) {
980 if ((state->oterm.type & 0xff00) == 0x0100) { 985 if ((state->oterm.type & 0xff00) == 0x0100) {
981 len = strlcat(kctl->id.name, " Capture", sizeof(kctl->id.name)); 986 len = append_ctl_name(kctl, " Capture");
982 } else { 987 } else {
983 len = strlcat(kctl->id.name + len, " Playback", sizeof(kctl->id.name)); 988 len = append_ctl_name(kctl, " Playback");
984 } 989 }
985 } 990 }
986 strlcat(kctl->id.name + len, control == USB_FEATURE_MUTE ? " Switch" : " Volume", 991 append_ctl_name(kctl, control == USB_FEATURE_MUTE ?
987 sizeof(kctl->id.name)); 992 " Switch" : " Volume");
988 if (control == USB_FEATURE_VOLUME) { 993 if (control == USB_FEATURE_VOLUME) {
989 kctl->tlv.c = mixer_vol_tlv; 994 kctl->tlv.c = mixer_vol_tlv;
990 kctl->vd[0].access |= 995 kctl->vd[0].access |=
@@ -1143,7 +1148,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state, unsigned char *desc,
1143 len = get_term_name(state, iterm, kctl->id.name, sizeof(kctl->id.name), 0); 1148 len = get_term_name(state, iterm, kctl->id.name, sizeof(kctl->id.name), 0);
1144 if (! len) 1149 if (! len)
1145 len = sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1); 1150 len = sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1);
1146 strlcat(kctl->id.name + len, " Volume", sizeof(kctl->id.name)); 1151 append_ctl_name(kctl, " Volume");
1147 1152
1148 snd_printdd(KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n", 1153 snd_printdd(KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n",
1149 cval->id, kctl->id.name, cval->channels, cval->min, cval->max); 1154 cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
@@ -1400,8 +1405,8 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, unsigned
1400 if (! len) 1405 if (! len)
1401 strlcpy(kctl->id.name, name, sizeof(kctl->id.name)); 1406 strlcpy(kctl->id.name, name, sizeof(kctl->id.name));
1402 } 1407 }
1403 strlcat(kctl->id.name, " ", sizeof(kctl->id.name)); 1408 append_ctl_name(kctl, " ");
1404 strlcat(kctl->id.name, valinfo->suffix, sizeof(kctl->id.name)); 1409 append_ctl_name(kctl, valinfo->suffix);
1405 1410
1406 snd_printdd(KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n", 1411 snd_printdd(KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n",
1407 cval->id, kctl->id.name, cval->channels, cval->min, cval->max); 1412 cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
@@ -1610,9 +1615,9 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsi
1610 strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name)); 1615 strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name));
1611 1616
1612 if ((state->oterm.type & 0xff00) == 0x0100) 1617 if ((state->oterm.type & 0xff00) == 0x0100)
1613 strlcat(kctl->id.name, " Capture Source", sizeof(kctl->id.name)); 1618 append_ctl_name(kctl, " Capture Source");
1614 else 1619 else
1615 strlcat(kctl->id.name, " Playback Source", sizeof(kctl->id.name)); 1620 append_ctl_name(kctl, " Playback Source");
1616 } 1621 }
1617 1622
1618 snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n", 1623 snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n",
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index b54e8ca360d1..00cd54c236b4 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -176,7 +176,7 @@ static void usb_stream_hwdep_vm_close(struct vm_area_struct *area)
176 snd_printdd(KERN_DEBUG "%i\n", atomic_read(&us122l->mmap_count)); 176 snd_printdd(KERN_DEBUG "%i\n", atomic_read(&us122l->mmap_count));
177} 177}
178 178
179static struct vm_operations_struct usb_stream_hwdep_vm_ops = { 179static const struct vm_operations_struct usb_stream_hwdep_vm_ops = {
180 .open = usb_stream_hwdep_vm_open, 180 .open = usb_stream_hwdep_vm_open,
181 .fault = usb_stream_hwdep_vm_fault, 181 .fault = usb_stream_hwdep_vm_fault,
182 .close = usb_stream_hwdep_vm_close, 182 .close = usb_stream_hwdep_vm_close,
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index f3d8f71265dd..52e04b2f35d3 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -53,7 +53,7 @@ static int snd_us428ctls_vm_fault(struct vm_area_struct *area,
53 return 0; 53 return 0;
54} 54}
55 55
56static struct vm_operations_struct us428ctls_vm_ops = { 56static const struct vm_operations_struct us428ctls_vm_ops = {
57 .fault = snd_us428ctls_vm_fault, 57 .fault = snd_us428ctls_vm_fault,
58}; 58};
59 59
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index 117946f2debb..4b2304c2e02d 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -697,7 +697,7 @@ static int snd_usX2Y_hwdep_pcm_vm_fault(struct vm_area_struct *area,
697} 697}
698 698
699 699
700static struct vm_operations_struct snd_usX2Y_hwdep_pcm_vm_ops = { 700static const struct vm_operations_struct snd_usX2Y_hwdep_pcm_vm_ops = {
701 .open = snd_usX2Y_hwdep_pcm_vm_open, 701 .open = snd_usX2Y_hwdep_pcm_vm_open,
702 .close = snd_usX2Y_hwdep_pcm_vm_close, 702 .close = snd_usX2Y_hwdep_pcm_vm_close,
703 .fault = snd_usX2Y_hwdep_pcm_vm_fault, 703 .fault = snd_usX2Y_hwdep_pcm_vm_fault,