aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/ua101.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-03-02 02:47:20 -0500
committerJaroslav Kysela <perex@perex.cz>2010-03-02 05:25:43 -0500
commit0a566ec25627bdd360f7294aa2e52f9d121233b4 (patch)
treee9c0266eeec1e1d2b269212123d796f6f5d1b0de /sound/usb/ua101.c
parente584bc3cf6865e005bbb4dbabae0bf4b3df59500 (diff)
ALSA: ua101: removing debugging code
Remove some code that is no longer needed now that the relevant parts of the driver have been tested. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/usb/ua101.c')
-rw-r--r--sound/usb/ua101.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/sound/usb/ua101.c b/sound/usb/ua101.c
index 047dc1ca84d0..3d458d3b9962 100644
--- a/sound/usb/ua101.c
+++ b/sound/usb/ua101.c
@@ -30,9 +30,6 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
30MODULE_LICENSE("GPL v2"); 30MODULE_LICENSE("GPL v2");
31MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}"); 31MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}");
32 32
33/* I use my UA-1A for testing because I don't have a UA-101 ... */
34#define UA1A_HACK
35
36/* 33/*
37 * Should not be lower than the minimum scheduling delay of the host 34 * Should not be lower than the minimum scheduling delay of the host
38 * controller. Some Intel controllers need more than one frame; as long as 35 * controller. Some Intel controllers need more than one frame; as long as
@@ -132,9 +129,6 @@ struct ua101 {
132 dma_addr_t dma; 129 dma_addr_t dma;
133 } buffers[MAX_MEMORY_BUFFERS]; 130 } buffers[MAX_MEMORY_BUFFERS];
134 } capture, playback; 131 } capture, playback;
135
136 unsigned int fps[10];
137 unsigned int frame_counter;
138}; 132};
139 133
140static DEFINE_MUTEX(devices_mutex); 134static DEFINE_MUTEX(devices_mutex);
@@ -424,16 +418,6 @@ static void capture_urb_complete(struct urb *urb)
424 if (do_period_elapsed) 418 if (do_period_elapsed)
425 snd_pcm_period_elapsed(stream->substream); 419 snd_pcm_period_elapsed(stream->substream);
426 420
427 /* for debugging: measure the sample rate relative to the USB clock */
428 ua->fps[ua->frame_counter++ / ua->packets_per_second] += frames;
429 if (ua->frame_counter >= ARRAY_SIZE(ua->fps) * ua->packets_per_second) {
430 printk(KERN_DEBUG "capture rate:");
431 for (frames = 0; frames < ARRAY_SIZE(ua->fps); ++frames)
432 printk(KERN_CONT " %u", ua->fps[frames]);
433 printk(KERN_CONT "\n");
434 memset(ua->fps, 0, sizeof(ua->fps));
435 ua->frame_counter = 0;
436 }
437 return; 421 return;
438 422
439stream_stopped: 423stream_stopped:
@@ -1256,15 +1240,6 @@ static int ua101_probe(struct usb_interface *interface,
1256 init_waitqueue_head(&ua->rate_feedback_wait); 1240 init_waitqueue_head(&ua->rate_feedback_wait);
1257 init_waitqueue_head(&ua->alsa_playback_wait); 1241 init_waitqueue_head(&ua->alsa_playback_wait);
1258 1242
1259#ifdef UA1A_HACK
1260 if (ua->dev->descriptor.idProduct == cpu_to_le16(0x0018)) {
1261 ua->intf[2] = interface;
1262 ua->intf[0] = usb_ifnum_to_if(ua->dev, 1);
1263 ua->intf[1] = usb_ifnum_to_if(ua->dev, 2);
1264 usb_driver_claim_interface(&ua101_driver, ua->intf[0], ua);
1265 usb_driver_claim_interface(&ua101_driver, ua->intf[1], ua);
1266 } else {
1267#endif
1268 ua->intf[0] = interface; 1243 ua->intf[0] = interface;
1269 for (i = 1; i < ARRAY_SIZE(ua->intf); ++i) { 1244 for (i = 1; i < ARRAY_SIZE(ua->intf); ++i) {
1270 ua->intf[i] = usb_ifnum_to_if(ua->dev, 1245 ua->intf[i] = usb_ifnum_to_if(ua->dev,
@@ -1283,33 +1258,12 @@ static int ua101_probe(struct usb_interface *interface,
1283 goto probe_error; 1258 goto probe_error;
1284 } 1259 }
1285 } 1260 }
1286#ifdef UA1A_HACK
1287 }
1288#endif
1289 1261
1290 snd_card_set_dev(card, &interface->dev); 1262 snd_card_set_dev(card, &interface->dev);
1291 1263
1292#ifdef UA1A_HACK
1293 if (ua->dev->descriptor.idProduct == cpu_to_le16(0x0018)) {
1294 ua->format_bit = SNDRV_PCM_FMTBIT_S16_LE;
1295 ua->rate = 44100;
1296 ua->packets_per_second = 1000;
1297 ua->capture.channels = 2;
1298 ua->playback.channels = 2;
1299 ua->capture.frame_bytes = 4;
1300 ua->playback.frame_bytes = 4;
1301 ua->capture.usb_pipe = usb_rcvisocpipe(ua->dev, 2);
1302 ua->playback.usb_pipe = usb_sndisocpipe(ua->dev, 1);
1303 ua->capture.max_packet_bytes = 192;
1304 ua->playback.max_packet_bytes = 192;
1305 } else {
1306#endif
1307 err = detect_usb_format(ua); 1264 err = detect_usb_format(ua);
1308 if (err < 0) 1265 if (err < 0)
1309 goto probe_error; 1266 goto probe_error;
1310#ifdef UA1A_HACK
1311 }
1312#endif
1313 1267
1314 name = usb_id->idProduct == 0x0044 ? "UA-1000" : "UA-101"; 1268 name = usb_id->idProduct == 0x0044 ? "UA-1000" : "UA-101";
1315 strcpy(card->driver, "UA-101"); 1269 strcpy(card->driver, "UA-101");
@@ -1342,16 +1296,10 @@ static int ua101_probe(struct usb_interface *interface,
1342 snd_pcm_set_ops(ua->pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_pcm_ops); 1296 snd_pcm_set_ops(ua->pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_pcm_ops);
1343 snd_pcm_set_ops(ua->pcm, SNDRV_PCM_STREAM_CAPTURE, &capture_pcm_ops); 1297 snd_pcm_set_ops(ua->pcm, SNDRV_PCM_STREAM_CAPTURE, &capture_pcm_ops);
1344 1298
1345#ifdef UA1A_HACK
1346 if (ua->dev->descriptor.idProduct != cpu_to_le16(0x0018)) {
1347#endif
1348 err = snd_usbmidi_create(card, ua->intf[INTF_MIDI], 1299 err = snd_usbmidi_create(card, ua->intf[INTF_MIDI],
1349 &ua->midi_list, &midi_quirk); 1300 &ua->midi_list, &midi_quirk);
1350 if (err < 0) 1301 if (err < 0)
1351 goto probe_error; 1302 goto probe_error;
1352#ifdef UA1A_HACK
1353 }
1354#endif
1355 1303
1356 err = snd_card_register(card); 1304 err = snd_card_register(card);
1357 if (err < 0) 1305 if (err < 0)
@@ -1406,9 +1354,6 @@ static void ua101_disconnect(struct usb_interface *interface)
1406} 1354}
1407 1355
1408static struct usb_device_id ua101_ids[] = { 1356static struct usb_device_id ua101_ids[] = {
1409#ifdef UA1A_HACK
1410 { USB_DEVICE(0x0582, 0x0018) },
1411#endif
1412 { USB_DEVICE(0x0582, 0x0044) }, /* UA-1000 high speed */ 1357 { USB_DEVICE(0x0582, 0x0044) }, /* UA-1000 high speed */
1413 { USB_DEVICE(0x0582, 0x007d) }, /* UA-101 high speed */ 1358 { USB_DEVICE(0x0582, 0x007d) }, /* UA-101 high speed */
1414 { USB_DEVICE(0x0582, 0x008d) }, /* UA-101 full speed */ 1359 { USB_DEVICE(0x0582, 0x008d) }, /* UA-101 full speed */