diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-28 05:54:43 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-28 05:54:43 -0500 |
commit | 2b9e4a73fbd90cb8459cf84c12ae05d2eb81da41 (patch) | |
tree | 52800decb82a6f478611a41b1592a9a0c7ae75a6 /sound/usb | |
parent | e8b99a1dcb49b0d362b19a4831a00d85c76bd4b3 (diff) | |
parent | e3b3757b92a4df4addff74e179438afbfd8bb643 (diff) |
Merge branch 'topic/cvt-dev-prints' into for-next
This merges the bunch of changes over pci and usb sound drivers to
convert to dev_err() and co.
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/6fire/chip.c | 8 | ||||
-rw-r--r-- | sound/usb/6fire/comm.c | 4 | ||||
-rw-r--r-- | sound/usb/6fire/control.c | 18 | ||||
-rw-r--r-- | sound/usb/6fire/firmware.c | 70 | ||||
-rw-r--r-- | sound/usb/6fire/midi.c | 12 | ||||
-rw-r--r-- | sound/usb/6fire/pcm.c | 46 | ||||
-rw-r--r-- | sound/usb/card.c | 41 | ||||
-rw-r--r-- | sound/usb/clock.c | 65 | ||||
-rw-r--r-- | sound/usb/endpoint.c | 32 | ||||
-rw-r--r-- | sound/usb/format.c | 68 | ||||
-rw-r--r-- | sound/usb/midi.c | 45 | ||||
-rw-r--r-- | sound/usb/mixer.c | 124 | ||||
-rw-r--r-- | sound/usb/mixer_quirks.c | 10 | ||||
-rw-r--r-- | sound/usb/pcm.c | 83 | ||||
-rw-r--r-- | sound/usb/quirks.c | 52 | ||||
-rw-r--r-- | sound/usb/stream.c | 50 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 9 |
17 files changed, 411 insertions, 326 deletions
diff --git a/sound/usb/6fire/chip.c b/sound/usb/6fire/chip.c index e0fe0d92db8c..dcddfc354ba6 100644 --- a/sound/usb/6fire/chip.c +++ b/sound/usb/6fire/chip.c | |||
@@ -106,7 +106,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf, | |||
106 | } | 106 | } |
107 | if (regidx < 0) { | 107 | if (regidx < 0) { |
108 | mutex_unlock(®ister_mutex); | 108 | mutex_unlock(®ister_mutex); |
109 | snd_printk(KERN_ERR PREFIX "too many cards registered.\n"); | 109 | dev_err(&intf->dev, "too many cards registered.\n"); |
110 | return -ENODEV; | 110 | return -ENODEV; |
111 | } | 111 | } |
112 | devices[regidx] = device; | 112 | devices[regidx] = device; |
@@ -121,13 +121,13 @@ static int usb6fire_chip_probe(struct usb_interface *intf, | |||
121 | 121 | ||
122 | /* if we are here, card can be registered in alsa. */ | 122 | /* if we are here, card can be registered in alsa. */ |
123 | if (usb_set_interface(device, 0, 0) != 0) { | 123 | if (usb_set_interface(device, 0, 0) != 0) { |
124 | snd_printk(KERN_ERR PREFIX "can't set first interface.\n"); | 124 | dev_err(&intf->dev, "can't set first interface.\n"); |
125 | return -EIO; | 125 | return -EIO; |
126 | } | 126 | } |
127 | ret = snd_card_new(&intf->dev, index[regidx], id[regidx], | 127 | ret = snd_card_new(&intf->dev, index[regidx], id[regidx], |
128 | THIS_MODULE, sizeof(struct sfire_chip), &card); | 128 | THIS_MODULE, sizeof(struct sfire_chip), &card); |
129 | if (ret < 0) { | 129 | if (ret < 0) { |
130 | snd_printk(KERN_ERR PREFIX "cannot create alsa card.\n"); | 130 | dev_err(&intf->dev, "cannot create alsa card.\n"); |
131 | return ret; | 131 | return ret; |
132 | } | 132 | } |
133 | strcpy(card->driver, "6FireUSB"); | 133 | strcpy(card->driver, "6FireUSB"); |
@@ -168,7 +168,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf, | |||
168 | 168 | ||
169 | ret = snd_card_register(card); | 169 | ret = snd_card_register(card); |
170 | if (ret < 0) { | 170 | if (ret < 0) { |
171 | snd_printk(KERN_ERR PREFIX "cannot register card."); | 171 | dev_err(&intf->dev, "cannot register card."); |
172 | usb6fire_chip_destroy(chip); | 172 | usb6fire_chip_destroy(chip); |
173 | return ret; | 173 | return ret; |
174 | } | 174 | } |
diff --git a/sound/usb/6fire/comm.c b/sound/usb/6fire/comm.c index 23452ee617e1..161215d78d95 100644 --- a/sound/usb/6fire/comm.c +++ b/sound/usb/6fire/comm.c | |||
@@ -51,7 +51,7 @@ static void usb6fire_comm_receiver_handler(struct urb *urb) | |||
51 | urb->status = 0; | 51 | urb->status = 0; |
52 | urb->actual_length = 0; | 52 | urb->actual_length = 0; |
53 | if (usb_submit_urb(urb, GFP_ATOMIC) < 0) | 53 | if (usb_submit_urb(urb, GFP_ATOMIC) < 0) |
54 | snd_printk(KERN_WARNING PREFIX | 54 | dev_warn(&urb->dev->dev, |
55 | "comm data receiver aborted.\n"); | 55 | "comm data receiver aborted.\n"); |
56 | } | 56 | } |
57 | } | 57 | } |
@@ -179,7 +179,7 @@ int usb6fire_comm_init(struct sfire_chip *chip) | |||
179 | if (ret < 0) { | 179 | if (ret < 0) { |
180 | kfree(rt->receiver_buffer); | 180 | kfree(rt->receiver_buffer); |
181 | kfree(rt); | 181 | kfree(rt); |
182 | snd_printk(KERN_ERR PREFIX "cannot create comm data receiver."); | 182 | dev_err(&chip->dev->dev, "cannot create comm data receiver."); |
183 | return ret; | 183 | return ret; |
184 | } | 184 | } |
185 | chip->comm = rt; | 185 | chip->comm = rt; |
diff --git a/sound/usb/6fire/control.c b/sound/usb/6fire/control.c index f6434c245720..184e3987ac24 100644 --- a/sound/usb/6fire/control.c +++ b/sound/usb/6fire/control.c | |||
@@ -194,7 +194,8 @@ static int usb6fire_control_output_vol_put(struct snd_kcontrol *kcontrol, | |||
194 | int changed = 0; | 194 | int changed = 0; |
195 | 195 | ||
196 | if (ch > 4) { | 196 | if (ch > 4) { |
197 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 197 | dev_err(&rt->chip->dev->dev, |
198 | "Invalid channel in volume control."); | ||
198 | return -EINVAL; | 199 | return -EINVAL; |
199 | } | 200 | } |
200 | 201 | ||
@@ -222,7 +223,8 @@ static int usb6fire_control_output_vol_get(struct snd_kcontrol *kcontrol, | |||
222 | unsigned int ch = kcontrol->private_value; | 223 | unsigned int ch = kcontrol->private_value; |
223 | 224 | ||
224 | if (ch > 4) { | 225 | if (ch > 4) { |
225 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 226 | dev_err(&rt->chip->dev->dev, |
227 | "Invalid channel in volume control."); | ||
226 | return -EINVAL; | 228 | return -EINVAL; |
227 | } | 229 | } |
228 | 230 | ||
@@ -240,7 +242,8 @@ static int usb6fire_control_output_mute_put(struct snd_kcontrol *kcontrol, | |||
240 | u8 value = 0; | 242 | u8 value = 0; |
241 | 243 | ||
242 | if (ch > 4) { | 244 | if (ch > 4) { |
243 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 245 | dev_err(&rt->chip->dev->dev, |
246 | "Invalid channel in volume control."); | ||
244 | return -EINVAL; | 247 | return -EINVAL; |
245 | } | 248 | } |
246 | 249 | ||
@@ -265,7 +268,8 @@ static int usb6fire_control_output_mute_get(struct snd_kcontrol *kcontrol, | |||
265 | u8 value = rt->output_mute >> ch; | 268 | u8 value = rt->output_mute >> ch; |
266 | 269 | ||
267 | if (ch > 4) { | 270 | if (ch > 4) { |
268 | snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); | 271 | dev_err(&rt->chip->dev->dev, |
272 | "Invalid channel in volume control."); | ||
269 | return -EINVAL; | 273 | return -EINVAL; |
270 | } | 274 | } |
271 | 275 | ||
@@ -594,14 +598,14 @@ int usb6fire_control_init(struct sfire_chip *chip) | |||
594 | ret = usb6fire_control_add_virtual(rt, chip->card, | 598 | ret = usb6fire_control_add_virtual(rt, chip->card, |
595 | "Master Playback Volume", vol_elements); | 599 | "Master Playback Volume", vol_elements); |
596 | if (ret) { | 600 | if (ret) { |
597 | snd_printk(KERN_ERR PREFIX "cannot add control.\n"); | 601 | dev_err(&chip->dev->dev, "cannot add control.\n"); |
598 | kfree(rt); | 602 | kfree(rt); |
599 | return ret; | 603 | return ret; |
600 | } | 604 | } |
601 | ret = usb6fire_control_add_virtual(rt, chip->card, | 605 | ret = usb6fire_control_add_virtual(rt, chip->card, |
602 | "Master Playback Switch", mute_elements); | 606 | "Master Playback Switch", mute_elements); |
603 | if (ret) { | 607 | if (ret) { |
604 | snd_printk(KERN_ERR PREFIX "cannot add control.\n"); | 608 | dev_err(&chip->dev->dev, "cannot add control.\n"); |
605 | kfree(rt); | 609 | kfree(rt); |
606 | return ret; | 610 | return ret; |
607 | } | 611 | } |
@@ -611,7 +615,7 @@ int usb6fire_control_init(struct sfire_chip *chip) | |||
611 | ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt)); | 615 | ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt)); |
612 | if (ret < 0) { | 616 | if (ret < 0) { |
613 | kfree(rt); | 617 | kfree(rt); |
614 | snd_printk(KERN_ERR PREFIX "cannot add control.\n"); | 618 | dev_err(&chip->dev->dev, "cannot add control.\n"); |
615 | return ret; | 619 | return ret; |
616 | } | 620 | } |
617 | i++; | 621 | i++; |
diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c index 780bf3f62d28..3b02e54b8f6d 100644 --- a/sound/usb/6fire/firmware.c +++ b/sound/usb/6fire/firmware.c | |||
@@ -219,16 +219,16 @@ static int usb6fire_fw_ezusb_upload( | |||
219 | ret = request_firmware(&fw, fwname, &device->dev); | 219 | ret = request_firmware(&fw, fwname, &device->dev); |
220 | if (ret < 0) { | 220 | if (ret < 0) { |
221 | kfree(rec); | 221 | kfree(rec); |
222 | snd_printk(KERN_ERR PREFIX "error requesting ezusb " | 222 | dev_err(&intf->dev, |
223 | "firmware %s.\n", fwname); | 223 | "error requesting ezusb firmware %s.\n", fwname); |
224 | return ret; | 224 | return ret; |
225 | } | 225 | } |
226 | ret = usb6fire_fw_ihex_init(fw, rec); | 226 | ret = usb6fire_fw_ihex_init(fw, rec); |
227 | if (ret < 0) { | 227 | if (ret < 0) { |
228 | kfree(rec); | 228 | kfree(rec); |
229 | release_firmware(fw); | 229 | release_firmware(fw); |
230 | snd_printk(KERN_ERR PREFIX "error validating ezusb " | 230 | dev_err(&intf->dev, |
231 | "firmware %s.\n", fwname); | 231 | "error validating ezusb firmware %s.\n", fwname); |
232 | return ret; | 232 | return ret; |
233 | } | 233 | } |
234 | /* upload firmware image */ | 234 | /* upload firmware image */ |
@@ -237,8 +237,9 @@ static int usb6fire_fw_ezusb_upload( | |||
237 | if (ret < 0) { | 237 | if (ret < 0) { |
238 | kfree(rec); | 238 | kfree(rec); |
239 | release_firmware(fw); | 239 | release_firmware(fw); |
240 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 240 | dev_err(&intf->dev, |
241 | "firmware %s: begin message.\n", fwname); | 241 | "unable to upload ezusb firmware %s: begin message.\n", |
242 | fwname); | ||
242 | return ret; | 243 | return ret; |
243 | } | 244 | } |
244 | 245 | ||
@@ -248,8 +249,9 @@ static int usb6fire_fw_ezusb_upload( | |||
248 | if (ret < 0) { | 249 | if (ret < 0) { |
249 | kfree(rec); | 250 | kfree(rec); |
250 | release_firmware(fw); | 251 | release_firmware(fw); |
251 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 252 | dev_err(&intf->dev, |
252 | "firmware %s: data urb.\n", fwname); | 253 | "unable to upload ezusb firmware %s: data urb.\n", |
254 | fwname); | ||
253 | return ret; | 255 | return ret; |
254 | } | 256 | } |
255 | } | 257 | } |
@@ -260,8 +262,9 @@ static int usb6fire_fw_ezusb_upload( | |||
260 | ret = usb6fire_fw_ezusb_write(device, 0xa0, postaddr, | 262 | ret = usb6fire_fw_ezusb_write(device, 0xa0, postaddr, |
261 | postdata, postlen); | 263 | postdata, postlen); |
262 | if (ret < 0) { | 264 | if (ret < 0) { |
263 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 265 | dev_err(&intf->dev, |
264 | "firmware %s: post urb.\n", fwname); | 266 | "unable to upload ezusb firmware %s: post urb.\n", |
267 | fwname); | ||
265 | return ret; | 268 | return ret; |
266 | } | 269 | } |
267 | } | 270 | } |
@@ -269,8 +272,9 @@ static int usb6fire_fw_ezusb_upload( | |||
269 | data = 0x00; /* resume ezusb cpu */ | 272 | data = 0x00; /* resume ezusb cpu */ |
270 | ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1); | 273 | ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1); |
271 | if (ret < 0) { | 274 | if (ret < 0) { |
272 | snd_printk(KERN_ERR PREFIX "unable to upload ezusb " | 275 | dev_err(&intf->dev, |
273 | "firmware %s: end message.\n", fwname); | 276 | "unable to upload ezusb firmware %s: end message.\n", |
277 | fwname); | ||
274 | return ret; | 278 | return ret; |
275 | } | 279 | } |
276 | return 0; | 280 | return 0; |
@@ -292,7 +296,7 @@ static int usb6fire_fw_fpga_upload( | |||
292 | 296 | ||
293 | ret = request_firmware(&fw, fwname, &device->dev); | 297 | ret = request_firmware(&fw, fwname, &device->dev); |
294 | if (ret < 0) { | 298 | if (ret < 0) { |
295 | snd_printk(KERN_ERR PREFIX "unable to get fpga firmware %s.\n", | 299 | dev_err(&intf->dev, "unable to get fpga firmware %s.\n", |
296 | fwname); | 300 | fwname); |
297 | kfree(buffer); | 301 | kfree(buffer); |
298 | return -EIO; | 302 | return -EIO; |
@@ -305,8 +309,8 @@ static int usb6fire_fw_fpga_upload( | |||
305 | if (ret < 0) { | 309 | if (ret < 0) { |
306 | kfree(buffer); | 310 | kfree(buffer); |
307 | release_firmware(fw); | 311 | release_firmware(fw); |
308 | snd_printk(KERN_ERR PREFIX "unable to upload fpga firmware: " | 312 | dev_err(&intf->dev, |
309 | "begin urb.\n"); | 313 | "unable to upload fpga firmware: begin urb.\n"); |
310 | return ret; | 314 | return ret; |
311 | } | 315 | } |
312 | 316 | ||
@@ -318,8 +322,8 @@ static int usb6fire_fw_fpga_upload( | |||
318 | if (ret < 0) { | 322 | if (ret < 0) { |
319 | release_firmware(fw); | 323 | release_firmware(fw); |
320 | kfree(buffer); | 324 | kfree(buffer); |
321 | snd_printk(KERN_ERR PREFIX "unable to upload fpga " | 325 | dev_err(&intf->dev, |
322 | "firmware: fw urb.\n"); | 326 | "unable to upload fpga firmware: fw urb.\n"); |
323 | return ret; | 327 | return ret; |
324 | } | 328 | } |
325 | } | 329 | } |
@@ -328,8 +332,8 @@ static int usb6fire_fw_fpga_upload( | |||
328 | 332 | ||
329 | ret = usb6fire_fw_ezusb_write(device, 9, 0, NULL, 0); | 333 | ret = usb6fire_fw_ezusb_write(device, 9, 0, NULL, 0); |
330 | if (ret < 0) { | 334 | if (ret < 0) { |
331 | snd_printk(KERN_ERR PREFIX "unable to upload fpga firmware: " | 335 | dev_err(&intf->dev, |
332 | "end urb.\n"); | 336 | "unable to upload fpga firmware: end urb.\n"); |
333 | return ret; | 337 | return ret; |
334 | } | 338 | } |
335 | return 0; | 339 | return 0; |
@@ -338,7 +342,7 @@ static int usb6fire_fw_fpga_upload( | |||
338 | /* check, if the firmware version the devices has currently loaded | 342 | /* check, if the firmware version the devices has currently loaded |
339 | * is known by this driver. 'version' needs to have 4 bytes version | 343 | * is known by this driver. 'version' needs to have 4 bytes version |
340 | * info data. */ | 344 | * info data. */ |
341 | static int usb6fire_fw_check(u8 *version) | 345 | static int usb6fire_fw_check(struct usb_interface *intf, const u8 *version) |
342 | { | 346 | { |
343 | int i; | 347 | int i; |
344 | 348 | ||
@@ -346,7 +350,7 @@ static int usb6fire_fw_check(u8 *version) | |||
346 | if (!memcmp(version, known_fw_versions + i, 2)) | 350 | if (!memcmp(version, known_fw_versions + i, 2)) |
347 | return 0; | 351 | return 0; |
348 | 352 | ||
349 | snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %4ph. " | 353 | dev_err(&intf->dev, "invalid fimware version in device: %4ph. " |
350 | "please reconnect to power. if this failure " | 354 | "please reconnect to power. if this failure " |
351 | "still happens, check your firmware installation.", | 355 | "still happens, check your firmware installation.", |
352 | version); | 356 | version); |
@@ -364,16 +368,16 @@ int usb6fire_fw_init(struct usb_interface *intf) | |||
364 | 368 | ||
365 | ret = usb6fire_fw_ezusb_read(device, 1, 0, buffer, 8); | 369 | ret = usb6fire_fw_ezusb_read(device, 1, 0, buffer, 8); |
366 | if (ret < 0) { | 370 | if (ret < 0) { |
367 | snd_printk(KERN_ERR PREFIX "unable to receive device " | 371 | dev_err(&intf->dev, |
368 | "firmware state.\n"); | 372 | "unable to receive device firmware state.\n"); |
369 | return ret; | 373 | return ret; |
370 | } | 374 | } |
371 | if (buffer[0] != 0xeb || buffer[1] != 0xaa || buffer[2] != 0x55) { | 375 | if (buffer[0] != 0xeb || buffer[1] != 0xaa || buffer[2] != 0x55) { |
372 | snd_printk(KERN_ERR PREFIX "unknown device firmware state " | 376 | dev_err(&intf->dev, |
373 | "received from device: "); | 377 | "unknown device firmware state received from device:"); |
374 | for (i = 0; i < 8; i++) | 378 | for (i = 0; i < 8; i++) |
375 | snd_printk("%02x ", buffer[i]); | 379 | printk(KERN_CONT "%02x ", buffer[i]); |
376 | snd_printk("\n"); | 380 | printk(KERN_CONT "\n"); |
377 | return -EIO; | 381 | return -EIO; |
378 | } | 382 | } |
379 | /* do we need fpga loader ezusb firmware? */ | 383 | /* do we need fpga loader ezusb firmware? */ |
@@ -386,7 +390,7 @@ int usb6fire_fw_init(struct usb_interface *intf) | |||
386 | } | 390 | } |
387 | /* do we need fpga firmware and application ezusb firmware? */ | 391 | /* do we need fpga firmware and application ezusb firmware? */ |
388 | else if (buffer[3] == 0x02) { | 392 | else if (buffer[3] == 0x02) { |
389 | ret = usb6fire_fw_check(buffer + 4); | 393 | ret = usb6fire_fw_check(intf, buffer + 4); |
390 | if (ret < 0) | 394 | if (ret < 0) |
391 | return ret; | 395 | return ret; |
392 | ret = usb6fire_fw_fpga_upload(intf, "6fire/dmx6firecf.bin"); | 396 | ret = usb6fire_fw_fpga_upload(intf, "6fire/dmx6firecf.bin"); |
@@ -402,14 +406,14 @@ int usb6fire_fw_init(struct usb_interface *intf) | |||
402 | } | 406 | } |
403 | /* all fw loaded? */ | 407 | /* all fw loaded? */ |
404 | else if (buffer[3] == 0x03) | 408 | else if (buffer[3] == 0x03) |
405 | return usb6fire_fw_check(buffer + 4); | 409 | return usb6fire_fw_check(intf, buffer + 4); |
406 | /* unknown data? */ | 410 | /* unknown data? */ |
407 | else { | 411 | else { |
408 | snd_printk(KERN_ERR PREFIX "unknown device firmware state " | 412 | dev_err(&intf->dev, |
409 | "received from device: "); | 413 | "unknown device firmware state received from device: "); |
410 | for (i = 0; i < 8; i++) | 414 | for (i = 0; i < 8; i++) |
411 | snd_printk("%02x ", buffer[i]); | 415 | printk(KERN_CONT "%02x ", buffer[i]); |
412 | snd_printk("\n"); | 416 | printk(KERN_CONT "\n"); |
413 | return -EIO; | 417 | return -EIO; |
414 | } | 418 | } |
415 | return 0; | 419 | return 0; |
diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c index f3dd7266c391..3d410969553e 100644 --- a/sound/usb/6fire/midi.c +++ b/sound/usb/6fire/midi.c | |||
@@ -41,8 +41,9 @@ static void usb6fire_midi_out_handler(struct urb *urb) | |||
41 | 41 | ||
42 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 42 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
43 | if (ret < 0) | 43 | if (ret < 0) |
44 | snd_printk(KERN_ERR PREFIX "midi out urb " | 44 | dev_err(&urb->dev->dev, |
45 | "submit failed: %d\n", ret); | 45 | "midi out urb submit failed: %d\n", |
46 | ret); | ||
46 | } else /* no more data to transmit */ | 47 | } else /* no more data to transmit */ |
47 | rt->out = NULL; | 48 | rt->out = NULL; |
48 | } | 49 | } |
@@ -94,8 +95,9 @@ static void usb6fire_midi_out_trigger( | |||
94 | 95 | ||
95 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 96 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
96 | if (ret < 0) | 97 | if (ret < 0) |
97 | snd_printk(KERN_ERR PREFIX "midi out urb " | 98 | dev_err(&urb->dev->dev, |
98 | "submit failed: %d\n", ret); | 99 | "midi out urb submit failed: %d\n", |
100 | ret); | ||
99 | else | 101 | else |
100 | rt->out = alsa_sub; | 102 | rt->out = alsa_sub; |
101 | } | 103 | } |
@@ -181,7 +183,7 @@ int usb6fire_midi_init(struct sfire_chip *chip) | |||
181 | if (ret < 0) { | 183 | if (ret < 0) { |
182 | kfree(rt->out_buffer); | 184 | kfree(rt->out_buffer); |
183 | kfree(rt); | 185 | kfree(rt); |
184 | snd_printk(KERN_ERR PREFIX "unable to create midi.\n"); | 186 | dev_err(&chip->dev->dev, "unable to create midi.\n"); |
185 | return ret; | 187 | return ret; |
186 | } | 188 | } |
187 | rt->instance->private_data = rt; | 189 | rt->instance->private_data = rt; |
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index b5eb97fdc842..ba40489b2de4 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c | |||
@@ -79,32 +79,35 @@ static int usb6fire_pcm_set_rate(struct pcm_runtime *rt) | |||
79 | ctrl_rt->usb_streaming = false; | 79 | ctrl_rt->usb_streaming = false; |
80 | ret = ctrl_rt->update_streaming(ctrl_rt); | 80 | ret = ctrl_rt->update_streaming(ctrl_rt); |
81 | if (ret < 0) { | 81 | if (ret < 0) { |
82 | snd_printk(KERN_ERR PREFIX "error stopping streaming while " | 82 | dev_err(&rt->chip->dev->dev, |
83 | "setting samplerate %d.\n", rates[rt->rate]); | 83 | "error stopping streaming while setting samplerate %d.\n", |
84 | rates[rt->rate]); | ||
84 | return ret; | 85 | return ret; |
85 | } | 86 | } |
86 | 87 | ||
87 | ret = ctrl_rt->set_rate(ctrl_rt, rt->rate); | 88 | ret = ctrl_rt->set_rate(ctrl_rt, rt->rate); |
88 | if (ret < 0) { | 89 | if (ret < 0) { |
89 | snd_printk(KERN_ERR PREFIX "error setting samplerate %d.\n", | 90 | dev_err(&rt->chip->dev->dev, |
90 | rates[rt->rate]); | 91 | "error setting samplerate %d.\n", |
92 | rates[rt->rate]); | ||
91 | return ret; | 93 | return ret; |
92 | } | 94 | } |
93 | 95 | ||
94 | ret = ctrl_rt->set_channels(ctrl_rt, OUT_N_CHANNELS, IN_N_CHANNELS, | 96 | ret = ctrl_rt->set_channels(ctrl_rt, OUT_N_CHANNELS, IN_N_CHANNELS, |
95 | false, false); | 97 | false, false); |
96 | if (ret < 0) { | 98 | if (ret < 0) { |
97 | snd_printk(KERN_ERR PREFIX "error initializing channels " | 99 | dev_err(&rt->chip->dev->dev, |
98 | "while setting samplerate %d.\n", | 100 | "error initializing channels while setting samplerate %d.\n", |
99 | rates[rt->rate]); | 101 | rates[rt->rate]); |
100 | return ret; | 102 | return ret; |
101 | } | 103 | } |
102 | 104 | ||
103 | ctrl_rt->usb_streaming = true; | 105 | ctrl_rt->usb_streaming = true; |
104 | ret = ctrl_rt->update_streaming(ctrl_rt); | 106 | ret = ctrl_rt->update_streaming(ctrl_rt); |
105 | if (ret < 0) { | 107 | if (ret < 0) { |
106 | snd_printk(KERN_ERR PREFIX "error starting streaming while " | 108 | dev_err(&rt->chip->dev->dev, |
107 | "setting samplerate %d.\n", rates[rt->rate]); | 109 | "error starting streaming while setting samplerate %d.\n", |
110 | rates[rt->rate]); | ||
108 | return ret; | 111 | return ret; |
109 | } | 112 | } |
110 | 113 | ||
@@ -124,7 +127,7 @@ static struct pcm_substream *usb6fire_pcm_get_substream( | |||
124 | return &rt->playback; | 127 | return &rt->playback; |
125 | else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) | 128 | else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) |
126 | return &rt->capture; | 129 | return &rt->capture; |
127 | snd_printk(KERN_ERR PREFIX "error getting pcm substream slot.\n"); | 130 | dev_err(&rt->chip->dev->dev, "error getting pcm substream slot.\n"); |
128 | return NULL; | 131 | return NULL; |
129 | } | 132 | } |
130 | 133 | ||
@@ -257,7 +260,7 @@ static void usb6fire_pcm_playback(struct pcm_substream *sub, | |||
257 | else if (alsa_rt->format == SNDRV_PCM_FORMAT_S24_LE) | 260 | else if (alsa_rt->format == SNDRV_PCM_FORMAT_S24_LE) |
258 | dest = (u32 *) (urb->buffer); | 261 | dest = (u32 *) (urb->buffer); |
259 | else { | 262 | else { |
260 | snd_printk(KERN_ERR PREFIX "Unknown sample format."); | 263 | dev_err(&rt->chip->dev->dev, "Unknown sample format."); |
261 | return; | 264 | return; |
262 | } | 265 | } |
263 | 266 | ||
@@ -307,8 +310,8 @@ static void usb6fire_pcm_in_urb_handler(struct urb *usb_urb) | |||
307 | } | 310 | } |
308 | 311 | ||
309 | if (rt->stream_state == STREAM_DISABLED) { | 312 | if (rt->stream_state == STREAM_DISABLED) { |
310 | snd_printk(KERN_ERR PREFIX "internal error: " | 313 | dev_err(&rt->chip->dev->dev, |
311 | "stream disabled in in-urb handler.\n"); | 314 | "internal error: stream disabled in in-urb handler.\n"); |
312 | return; | 315 | return; |
313 | } | 316 | } |
314 | 317 | ||
@@ -410,7 +413,7 @@ static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub) | |||
410 | 413 | ||
411 | if (!sub) { | 414 | if (!sub) { |
412 | mutex_unlock(&rt->stream_mutex); | 415 | mutex_unlock(&rt->stream_mutex); |
413 | snd_printk(KERN_ERR PREFIX "invalid stream type.\n"); | 416 | dev_err(&rt->chip->dev->dev, "invalid stream type.\n"); |
414 | return -EINVAL; | 417 | return -EINVAL; |
415 | } | 418 | } |
416 | 419 | ||
@@ -481,8 +484,9 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) | |||
481 | break; | 484 | break; |
482 | if (rt->rate == ARRAY_SIZE(rates)) { | 485 | if (rt->rate == ARRAY_SIZE(rates)) { |
483 | mutex_unlock(&rt->stream_mutex); | 486 | mutex_unlock(&rt->stream_mutex); |
484 | snd_printk("invalid rate %d in prepare.\n", | 487 | dev_err(&rt->chip->dev->dev, |
485 | alsa_rt->rate); | 488 | "invalid rate %d in prepare.\n", |
489 | alsa_rt->rate); | ||
486 | return -EINVAL; | 490 | return -EINVAL; |
487 | } | 491 | } |
488 | 492 | ||
@@ -494,8 +498,8 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) | |||
494 | ret = usb6fire_pcm_stream_start(rt); | 498 | ret = usb6fire_pcm_stream_start(rt); |
495 | if (ret) { | 499 | if (ret) { |
496 | mutex_unlock(&rt->stream_mutex); | 500 | mutex_unlock(&rt->stream_mutex); |
497 | snd_printk(KERN_ERR PREFIX | 501 | dev_err(&rt->chip->dev->dev, |
498 | "could not start pcm stream.\n"); | 502 | "could not start pcm stream.\n"); |
499 | return ret; | 503 | return ret; |
500 | } | 504 | } |
501 | } | 505 | } |
@@ -650,7 +654,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
650 | if (ret < 0) { | 654 | if (ret < 0) { |
651 | usb6fire_pcm_buffers_destroy(rt); | 655 | usb6fire_pcm_buffers_destroy(rt); |
652 | kfree(rt); | 656 | kfree(rt); |
653 | snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n"); | 657 | dev_err(&chip->dev->dev, "cannot create pcm instance.\n"); |
654 | return ret; | 658 | return ret; |
655 | } | 659 | } |
656 | 660 | ||
@@ -662,8 +666,8 @@ int usb6fire_pcm_init(struct sfire_chip *chip) | |||
662 | if (ret) { | 666 | if (ret) { |
663 | usb6fire_pcm_buffers_destroy(rt); | 667 | usb6fire_pcm_buffers_destroy(rt); |
664 | kfree(rt); | 668 | kfree(rt); |
665 | snd_printk(KERN_ERR PREFIX | 669 | dev_err(&chip->dev->dev, |
666 | "error preallocating pcm buffers.\n"); | 670 | "error preallocating pcm buffers.\n"); |
667 | return ret; | 671 | return ret; |
668 | } | 672 | } |
669 | rt->instance = pcm; | 673 | rt->instance = pcm; |
diff --git a/sound/usb/card.c b/sound/usb/card.c index 0cfdc2d3b631..893d5a1afc3c 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -139,8 +139,8 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int | |||
139 | struct usb_interface *iface = usb_ifnum_to_if(dev, interface); | 139 | struct usb_interface *iface = usb_ifnum_to_if(dev, interface); |
140 | 140 | ||
141 | if (!iface) { | 141 | if (!iface) { |
142 | snd_printk(KERN_ERR "%d:%u:%d : does not exist\n", | 142 | dev_err(&dev->dev, "%u:%d : does not exist\n", |
143 | dev->devnum, ctrlif, interface); | 143 | ctrlif, interface); |
144 | return -EINVAL; | 144 | return -EINVAL; |
145 | } | 145 | } |
146 | 146 | ||
@@ -165,8 +165,8 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int | |||
165 | } | 165 | } |
166 | 166 | ||
167 | if (usb_interface_claimed(iface)) { | 167 | if (usb_interface_claimed(iface)) { |
168 | snd_printdd(KERN_INFO "%d:%d:%d: skipping, already claimed\n", | 168 | dev_dbg(&dev->dev, "%d:%d: skipping, already claimed\n", |
169 | dev->devnum, ctrlif, interface); | 169 | ctrlif, interface); |
170 | return -EINVAL; | 170 | return -EINVAL; |
171 | } | 171 | } |
172 | 172 | ||
@@ -176,8 +176,9 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int | |||
176 | int err = snd_usbmidi_create(chip->card, iface, | 176 | int err = snd_usbmidi_create(chip->card, iface, |
177 | &chip->midi_list, NULL); | 177 | &chip->midi_list, NULL); |
178 | if (err < 0) { | 178 | if (err < 0) { |
179 | snd_printk(KERN_ERR "%d:%u:%d: cannot create sequencer device\n", | 179 | dev_err(&dev->dev, |
180 | dev->devnum, ctrlif, interface); | 180 | "%u:%d: cannot create sequencer device\n", |
181 | ctrlif, interface); | ||
181 | return -EINVAL; | 182 | return -EINVAL; |
182 | } | 183 | } |
183 | usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L); | 184 | usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L); |
@@ -188,14 +189,15 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int | |||
188 | if ((altsd->bInterfaceClass != USB_CLASS_AUDIO && | 189 | if ((altsd->bInterfaceClass != USB_CLASS_AUDIO && |
189 | altsd->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || | 190 | altsd->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || |
190 | altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIOSTREAMING) { | 191 | altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIOSTREAMING) { |
191 | snd_printdd(KERN_ERR "%d:%u:%d: skipping non-supported interface %d\n", | 192 | dev_dbg(&dev->dev, |
192 | dev->devnum, ctrlif, interface, altsd->bInterfaceClass); | 193 | "%u:%d: skipping non-supported interface %d\n", |
194 | ctrlif, interface, altsd->bInterfaceClass); | ||
193 | /* skip non-supported classes */ | 195 | /* skip non-supported classes */ |
194 | return -EINVAL; | 196 | return -EINVAL; |
195 | } | 197 | } |
196 | 198 | ||
197 | if (snd_usb_get_speed(dev) == USB_SPEED_LOW) { | 199 | if (snd_usb_get_speed(dev) == USB_SPEED_LOW) { |
198 | snd_printk(KERN_ERR "low speed audio streaming not supported\n"); | 200 | dev_err(&dev->dev, "low speed audio streaming not supported\n"); |
199 | return -EINVAL; | 201 | return -EINVAL; |
200 | } | 202 | } |
201 | 203 | ||
@@ -228,26 +230,27 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) | |||
228 | protocol = altsd->bInterfaceProtocol; | 230 | protocol = altsd->bInterfaceProtocol; |
229 | 231 | ||
230 | if (!control_header) { | 232 | if (!control_header) { |
231 | snd_printk(KERN_ERR "cannot find UAC_HEADER\n"); | 233 | dev_err(&dev->dev, "cannot find UAC_HEADER\n"); |
232 | return -EINVAL; | 234 | return -EINVAL; |
233 | } | 235 | } |
234 | 236 | ||
235 | switch (protocol) { | 237 | switch (protocol) { |
236 | default: | 238 | default: |
237 | snd_printdd(KERN_WARNING "unknown interface protocol %#02x, assuming v1\n", | 239 | dev_warn(&dev->dev, |
238 | protocol); | 240 | "unknown interface protocol %#02x, assuming v1\n", |
241 | protocol); | ||
239 | /* fall through */ | 242 | /* fall through */ |
240 | 243 | ||
241 | case UAC_VERSION_1: { | 244 | case UAC_VERSION_1: { |
242 | struct uac1_ac_header_descriptor *h1 = control_header; | 245 | struct uac1_ac_header_descriptor *h1 = control_header; |
243 | 246 | ||
244 | if (!h1->bInCollection) { | 247 | if (!h1->bInCollection) { |
245 | snd_printk(KERN_INFO "skipping empty audio interface (v1)\n"); | 248 | dev_info(&dev->dev, "skipping empty audio interface (v1)\n"); |
246 | return -EINVAL; | 249 | return -EINVAL; |
247 | } | 250 | } |
248 | 251 | ||
249 | if (h1->bLength < sizeof(*h1) + h1->bInCollection) { | 252 | if (h1->bLength < sizeof(*h1) + h1->bInCollection) { |
250 | snd_printk(KERN_ERR "invalid UAC_HEADER (v1)\n"); | 253 | dev_err(&dev->dev, "invalid UAC_HEADER (v1)\n"); |
251 | return -EINVAL; | 254 | return -EINVAL; |
252 | } | 255 | } |
253 | 256 | ||
@@ -277,7 +280,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) | |||
277 | } | 280 | } |
278 | 281 | ||
279 | if (!assoc) { | 282 | if (!assoc) { |
280 | snd_printk(KERN_ERR "Audio class v2 interfaces need an interface association\n"); | 283 | dev_err(&dev->dev, "Audio class v2 interfaces need an interface association\n"); |
281 | return -EINVAL; | 284 | return -EINVAL; |
282 | } | 285 | } |
283 | 286 | ||
@@ -351,14 +354,14 @@ static int snd_usb_audio_create(struct usb_interface *intf, | |||
351 | case USB_SPEED_SUPER: | 354 | case USB_SPEED_SUPER: |
352 | break; | 355 | break; |
353 | default: | 356 | default: |
354 | snd_printk(KERN_ERR "unknown device speed %d\n", snd_usb_get_speed(dev)); | 357 | dev_err(&dev->dev, "unknown device speed %d\n", snd_usb_get_speed(dev)); |
355 | return -ENXIO; | 358 | return -ENXIO; |
356 | } | 359 | } |
357 | 360 | ||
358 | err = snd_card_new(&intf->dev, index[idx], id[idx], THIS_MODULE, | 361 | err = snd_card_new(&intf->dev, index[idx], id[idx], THIS_MODULE, |
359 | 0, &card); | 362 | 0, &card); |
360 | if (err < 0) { | 363 | if (err < 0) { |
361 | snd_printk(KERN_ERR "cannot create card instance %d\n", idx); | 364 | dev_err(&dev->dev, "cannot create card instance %d\n", idx); |
362 | return err; | 365 | return err; |
363 | } | 366 | } |
364 | 367 | ||
@@ -499,7 +502,7 @@ snd_usb_audio_probe(struct usb_device *dev, | |||
499 | for (i = 0; i < SNDRV_CARDS; i++) { | 502 | for (i = 0; i < SNDRV_CARDS; i++) { |
500 | if (usb_chip[i] && usb_chip[i]->dev == dev) { | 503 | if (usb_chip[i] && usb_chip[i]->dev == dev) { |
501 | if (usb_chip[i]->shutdown) { | 504 | if (usb_chip[i]->shutdown) { |
502 | snd_printk(KERN_ERR "USB device is in the shutdown state, cannot create a card instance\n"); | 505 | dev_err(&dev->dev, "USB device is in the shutdown state, cannot create a card instance\n"); |
503 | goto __error; | 506 | goto __error; |
504 | } | 507 | } |
505 | chip = usb_chip[i]; | 508 | chip = usb_chip[i]; |
@@ -523,7 +526,7 @@ snd_usb_audio_probe(struct usb_device *dev, | |||
523 | break; | 526 | break; |
524 | } | 527 | } |
525 | if (!chip) { | 528 | if (!chip) { |
526 | printk(KERN_ERR "no available usb audio device\n"); | 529 | dev_err(&dev->dev, "no available usb audio device\n"); |
527 | goto __error; | 530 | goto __error; |
528 | } | 531 | } |
529 | } | 532 | } |
diff --git a/sound/usb/clock.c b/sound/usb/clock.c index 86f80c60b21f..03fed6611d9e 100644 --- a/sound/usb/clock.c +++ b/sound/usb/clock.c | |||
@@ -115,9 +115,9 @@ static int uac_clock_selector_set_val(struct snd_usb_audio *chip, int selector_i | |||
115 | return ret; | 115 | return ret; |
116 | 116 | ||
117 | if (ret != sizeof(pin)) { | 117 | if (ret != sizeof(pin)) { |
118 | snd_printk(KERN_ERR | 118 | usb_audio_err(chip, |
119 | "usb-audio:%d: setting selector (id %d) unexpected length %d\n", | 119 | "setting selector (id %d) unexpected length %d\n", |
120 | chip->dev->devnum, selector_id, ret); | 120 | selector_id, ret); |
121 | return -EINVAL; | 121 | return -EINVAL; |
122 | } | 122 | } |
123 | 123 | ||
@@ -126,9 +126,9 @@ static int uac_clock_selector_set_val(struct snd_usb_audio *chip, int selector_i | |||
126 | return ret; | 126 | return ret; |
127 | 127 | ||
128 | if (ret != pin) { | 128 | if (ret != pin) { |
129 | snd_printk(KERN_ERR | 129 | usb_audio_err(chip, |
130 | "usb-audio:%d: setting selector (id %d) to %x failed (current: %d)\n", | 130 | "setting selector (id %d) to %x failed (current: %d)\n", |
131 | chip->dev->devnum, selector_id, pin, ret); | 131 | selector_id, pin, ret); |
132 | return -EINVAL; | 132 | return -EINVAL; |
133 | } | 133 | } |
134 | 134 | ||
@@ -158,7 +158,8 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id) | |||
158 | &data, sizeof(data)); | 158 | &data, sizeof(data)); |
159 | 159 | ||
160 | if (err < 0) { | 160 | if (err < 0) { |
161 | snd_printk(KERN_WARNING "%s(): cannot get clock validity for id %d\n", | 161 | dev_warn(&dev->dev, |
162 | "%s(): cannot get clock validity for id %d\n", | ||
162 | __func__, source_id); | 163 | __func__, source_id); |
163 | return 0; | 164 | return 0; |
164 | } | 165 | } |
@@ -177,9 +178,9 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip, | |||
177 | entity_id &= 0xff; | 178 | entity_id &= 0xff; |
178 | 179 | ||
179 | if (test_and_set_bit(entity_id, visited)) { | 180 | if (test_and_set_bit(entity_id, visited)) { |
180 | snd_printk(KERN_WARNING | 181 | usb_audio_warn(chip, |
181 | "%s(): recursive clock topology detected, id %d.\n", | 182 | "%s(): recursive clock topology detected, id %d.\n", |
182 | __func__, entity_id); | 183 | __func__, entity_id); |
183 | return -EINVAL; | 184 | return -EINVAL; |
184 | } | 185 | } |
185 | 186 | ||
@@ -188,8 +189,9 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip, | |||
188 | if (source) { | 189 | if (source) { |
189 | entity_id = source->bClockID; | 190 | entity_id = source->bClockID; |
190 | if (validate && !uac_clock_source_is_valid(chip, entity_id)) { | 191 | if (validate && !uac_clock_source_is_valid(chip, entity_id)) { |
191 | snd_printk(KERN_ERR "usb-audio:%d: clock source %d is not valid, cannot use\n", | 192 | usb_audio_err(chip, |
192 | chip->dev->devnum, entity_id); | 193 | "clock source %d is not valid, cannot use\n", |
194 | entity_id); | ||
193 | return -ENXIO; | 195 | return -ENXIO; |
194 | } | 196 | } |
195 | return entity_id; | 197 | return entity_id; |
@@ -208,7 +210,7 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip, | |||
208 | /* Selector values are one-based */ | 210 | /* Selector values are one-based */ |
209 | 211 | ||
210 | if (ret > selector->bNrInPins || ret < 1) { | 212 | if (ret > selector->bNrInPins || ret < 1) { |
211 | snd_printk(KERN_ERR | 213 | usb_audio_err(chip, |
212 | "%s(): selector reported illegal value, id %d, ret %d\n", | 214 | "%s(): selector reported illegal value, id %d, ret %d\n", |
213 | __func__, selector->bClockID, ret); | 215 | __func__, selector->bClockID, ret); |
214 | 216 | ||
@@ -237,9 +239,9 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip, | |||
237 | if (err < 0) | 239 | if (err < 0) |
238 | continue; | 240 | continue; |
239 | 241 | ||
240 | snd_printk(KERN_INFO | 242 | usb_audio_info(chip, |
241 | "usb-audio:%d: found and selected valid clock source %d\n", | 243 | "found and selected valid clock source %d\n", |
242 | chip->dev->devnum, ret); | 244 | ret); |
243 | return ret; | 245 | return ret; |
244 | } | 246 | } |
245 | 247 | ||
@@ -296,8 +298,8 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface, | |||
296 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_OUT, | 298 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_OUT, |
297 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, | 299 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, |
298 | data, sizeof(data))) < 0) { | 300 | data, sizeof(data))) < 0) { |
299 | snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d to ep %#x\n", | 301 | dev_err(&dev->dev, "%d:%d: cannot set freq %d to ep %#x\n", |
300 | dev->devnum, iface, fmt->altsetting, rate, ep); | 302 | iface, fmt->altsetting, rate, ep); |
301 | return err; | 303 | return err; |
302 | } | 304 | } |
303 | 305 | ||
@@ -305,14 +307,14 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface, | |||
305 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN, | 307 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN, |
306 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, | 308 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, |
307 | data, sizeof(data))) < 0) { | 309 | data, sizeof(data))) < 0) { |
308 | snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq at ep %#x\n", | 310 | dev_err(&dev->dev, "%d:%d: cannot get freq at ep %#x\n", |
309 | dev->devnum, iface, fmt->altsetting, ep); | 311 | iface, fmt->altsetting, ep); |
310 | return 0; /* some devices don't support reading */ | 312 | return 0; /* some devices don't support reading */ |
311 | } | 313 | } |
312 | 314 | ||
313 | crate = data[0] | (data[1] << 8) | (data[2] << 16); | 315 | crate = data[0] | (data[1] << 8) | (data[2] << 16); |
314 | if (crate != rate) { | 316 | if (crate != rate) { |
315 | snd_printd(KERN_WARNING "current rate %d is different from the runtime rate %d\n", crate, rate); | 317 | dev_warn(&dev->dev, "current rate %d is different from the runtime rate %d\n", crate, rate); |
316 | // runtime->rate = crate; | 318 | // runtime->rate = crate; |
317 | } | 319 | } |
318 | 320 | ||
@@ -332,8 +334,8 @@ static int get_sample_rate_v2(struct snd_usb_audio *chip, int iface, | |||
332 | snd_usb_ctrl_intf(chip) | (clock << 8), | 334 | snd_usb_ctrl_intf(chip) | (clock << 8), |
333 | &data, sizeof(data)); | 335 | &data, sizeof(data)); |
334 | if (err < 0) { | 336 | if (err < 0) { |
335 | snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq (v2): err %d\n", | 337 | dev_warn(&dev->dev, "%d:%d: cannot get freq (v2): err %d\n", |
336 | dev->devnum, iface, altsetting, err); | 338 | iface, altsetting, err); |
337 | return 0; | 339 | return 0; |
338 | } | 340 | } |
339 | 341 | ||
@@ -369,8 +371,9 @@ static int set_sample_rate_v2(struct snd_usb_audio *chip, int iface, | |||
369 | snd_usb_ctrl_intf(chip) | (clock << 8), | 371 | snd_usb_ctrl_intf(chip) | (clock << 8), |
370 | &data, sizeof(data)); | 372 | &data, sizeof(data)); |
371 | if (err < 0) { | 373 | if (err < 0) { |
372 | snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d (v2): err %d\n", | 374 | usb_audio_err(chip, |
373 | dev->devnum, iface, fmt->altsetting, rate, err); | 375 | "%d:%d: cannot set freq %d (v2): err %d\n", |
376 | iface, fmt->altsetting, rate, err); | ||
374 | return err; | 377 | return err; |
375 | } | 378 | } |
376 | 379 | ||
@@ -381,14 +384,14 @@ static int set_sample_rate_v2(struct snd_usb_audio *chip, int iface, | |||
381 | 384 | ||
382 | if (cur_rate != rate) { | 385 | if (cur_rate != rate) { |
383 | if (!writeable) { | 386 | if (!writeable) { |
384 | snd_printk(KERN_WARNING | 387 | usb_audio_warn(chip, |
385 | "%d:%d:%d: freq mismatch (RO clock): req %d, clock runs @%d\n", | 388 | "%d:%d: freq mismatch (RO clock): req %d, clock runs @%d\n", |
386 | dev->devnum, iface, fmt->altsetting, rate, cur_rate); | 389 | iface, fmt->altsetting, rate, cur_rate); |
387 | return -ENXIO; | 390 | return -ENXIO; |
388 | } | 391 | } |
389 | snd_printd(KERN_WARNING | 392 | usb_audio_dbg(chip, |
390 | "current rate %d is different from the runtime rate %d\n", | 393 | "current rate %d is different from the runtime rate %d\n", |
391 | cur_rate, rate); | 394 | cur_rate, rate); |
392 | } | 395 | } |
393 | 396 | ||
394 | /* Some devices doesn't respond to sample rate changes while the | 397 | /* Some devices doesn't respond to sample rate changes while the |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 83aabea259d7..e70a87e0d9fe 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -333,8 +333,9 @@ static void queue_pending_output_urbs(struct snd_usb_endpoint *ep) | |||
333 | 333 | ||
334 | err = usb_submit_urb(ctx->urb, GFP_ATOMIC); | 334 | err = usb_submit_urb(ctx->urb, GFP_ATOMIC); |
335 | if (err < 0) | 335 | if (err < 0) |
336 | snd_printk(KERN_ERR "Unable to submit urb #%d: %d (urb %p)\n", | 336 | usb_audio_err(ep->chip, |
337 | ctx->index, err, ctx->urb); | 337 | "Unable to submit urb #%d: %d (urb %p)\n", |
338 | ctx->index, err, ctx->urb); | ||
338 | else | 339 | else |
339 | set_bit(ctx->index, &ep->active_mask); | 340 | set_bit(ctx->index, &ep->active_mask); |
340 | } | 341 | } |
@@ -387,7 +388,7 @@ static void snd_complete_urb(struct urb *urb) | |||
387 | if (err == 0) | 388 | if (err == 0) |
388 | return; | 389 | return; |
389 | 390 | ||
390 | snd_printk(KERN_ERR "cannot submit urb (err = %d)\n", err); | 391 | usb_audio_err(ep->chip, "cannot submit urb (err = %d)\n", err); |
391 | //snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); | 392 | //snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); |
392 | 393 | ||
393 | exit_clear: | 394 | exit_clear: |
@@ -426,13 +427,14 @@ struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip, | |||
426 | if (ep->ep_num == ep_num && | 427 | if (ep->ep_num == ep_num && |
427 | ep->iface == alts->desc.bInterfaceNumber && | 428 | ep->iface == alts->desc.bInterfaceNumber && |
428 | ep->altsetting == alts->desc.bAlternateSetting) { | 429 | ep->altsetting == alts->desc.bAlternateSetting) { |
429 | snd_printdd(KERN_DEBUG "Re-using EP %x in iface %d,%d @%p\n", | 430 | usb_audio_dbg(ep->chip, |
431 | "Re-using EP %x in iface %d,%d @%p\n", | ||
430 | ep_num, ep->iface, ep->altsetting, ep); | 432 | ep_num, ep->iface, ep->altsetting, ep); |
431 | goto __exit_unlock; | 433 | goto __exit_unlock; |
432 | } | 434 | } |
433 | } | 435 | } |
434 | 436 | ||
435 | snd_printdd(KERN_DEBUG "Creating new %s %s endpoint #%x\n", | 437 | usb_audio_dbg(chip, "Creating new %s %s endpoint #%x\n", |
436 | is_playback ? "playback" : "capture", | 438 | is_playback ? "playback" : "capture", |
437 | type == SND_USB_ENDPOINT_TYPE_DATA ? "data" : "sync", | 439 | type == SND_USB_ENDPOINT_TYPE_DATA ? "data" : "sync", |
438 | ep_num); | 440 | ep_num); |
@@ -496,8 +498,9 @@ static int wait_clear_urbs(struct snd_usb_endpoint *ep) | |||
496 | } while (time_before(jiffies, end_time)); | 498 | } while (time_before(jiffies, end_time)); |
497 | 499 | ||
498 | if (alive) | 500 | if (alive) |
499 | snd_printk(KERN_ERR "timeout: still %d active urbs on EP #%x\n", | 501 | usb_audio_err(ep->chip, |
500 | alive, ep->ep_num); | 502 | "timeout: still %d active urbs on EP #%x\n", |
503 | alive, ep->ep_num); | ||
501 | clear_bit(EP_FLAG_STOPPING, &ep->flags); | 504 | clear_bit(EP_FLAG_STOPPING, &ep->flags); |
502 | 505 | ||
503 | return 0; | 506 | return 0; |
@@ -794,8 +797,9 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, | |||
794 | int err; | 797 | int err; |
795 | 798 | ||
796 | if (ep->use_count != 0) { | 799 | if (ep->use_count != 0) { |
797 | snd_printk(KERN_WARNING "Unable to change format on ep #%x: already in use\n", | 800 | usb_audio_warn(ep->chip, |
798 | ep->ep_num); | 801 | "Unable to change format on ep #%x: already in use\n", |
802 | ep->ep_num); | ||
799 | return -EBUSY; | 803 | return -EBUSY; |
800 | } | 804 | } |
801 | 805 | ||
@@ -830,8 +834,9 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, | |||
830 | err = -EINVAL; | 834 | err = -EINVAL; |
831 | } | 835 | } |
832 | 836 | ||
833 | snd_printdd(KERN_DEBUG "Setting params for ep #%x (type %d, %d urbs), ret=%d\n", | 837 | usb_audio_dbg(ep->chip, |
834 | ep->ep_num, ep->type, ep->nurbs, err); | 838 | "Setting params for ep #%x (type %d, %d urbs), ret=%d\n", |
839 | ep->ep_num, ep->type, ep->nurbs, err); | ||
835 | 840 | ||
836 | return err; | 841 | return err; |
837 | } | 842 | } |
@@ -906,8 +911,9 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep) | |||
906 | 911 | ||
907 | err = usb_submit_urb(urb, GFP_ATOMIC); | 912 | err = usb_submit_urb(urb, GFP_ATOMIC); |
908 | if (err < 0) { | 913 | if (err < 0) { |
909 | snd_printk(KERN_ERR "cannot submit urb %d, error %d: %s\n", | 914 | usb_audio_err(ep->chip, |
910 | i, err, usb_error_string(err)); | 915 | "cannot submit urb %d, error %d: %s\n", |
916 | i, err, usb_error_string(err)); | ||
911 | goto __error; | 917 | goto __error; |
912 | } | 918 | } |
913 | set_bit(i, &ep->active_mask); | 919 | set_bit(i, &ep->active_mask); |
diff --git a/sound/usb/format.c b/sound/usb/format.c index d244fd3703d8..8bcc87cf5667 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c | |||
@@ -74,8 +74,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
74 | if ((pcm_formats == 0) && | 74 | if ((pcm_formats == 0) && |
75 | (format == 0 || format == (1 << UAC_FORMAT_TYPE_I_UNDEFINED))) { | 75 | (format == 0 || format == (1 << UAC_FORMAT_TYPE_I_UNDEFINED))) { |
76 | /* some devices don't define this correctly... */ | 76 | /* some devices don't define this correctly... */ |
77 | snd_printdd(KERN_INFO "%d:%u:%d : format type 0 is detected, processed as PCM\n", | 77 | usb_audio_info(chip, "%u:%d : format type 0 is detected, processed as PCM\n", |
78 | chip->dev->devnum, fp->iface, fp->altsetting); | 78 | fp->iface, fp->altsetting); |
79 | format = 1 << UAC_FORMAT_TYPE_I_PCM; | 79 | format = 1 << UAC_FORMAT_TYPE_I_PCM; |
80 | } | 80 | } |
81 | if (format & (1 << UAC_FORMAT_TYPE_I_PCM)) { | 81 | if (format & (1 << UAC_FORMAT_TYPE_I_PCM)) { |
@@ -83,9 +83,9 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
83 | sample_width == 24 && sample_bytes == 2) | 83 | sample_width == 24 && sample_bytes == 2) |
84 | sample_bytes = 3; | 84 | sample_bytes = 3; |
85 | else if (sample_width > sample_bytes * 8) { | 85 | else if (sample_width > sample_bytes * 8) { |
86 | snd_printk(KERN_INFO "%d:%u:%d : sample bitwidth %d in over sample bytes %d\n", | 86 | usb_audio_info(chip, "%u:%d : sample bitwidth %d in over sample bytes %d\n", |
87 | chip->dev->devnum, fp->iface, fp->altsetting, | 87 | fp->iface, fp->altsetting, |
88 | sample_width, sample_bytes); | 88 | sample_width, sample_bytes); |
89 | } | 89 | } |
90 | /* check the format byte size */ | 90 | /* check the format byte size */ |
91 | switch (sample_bytes) { | 91 | switch (sample_bytes) { |
@@ -108,9 +108,10 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
108 | pcm_formats |= SNDRV_PCM_FMTBIT_S32_LE; | 108 | pcm_formats |= SNDRV_PCM_FMTBIT_S32_LE; |
109 | break; | 109 | break; |
110 | default: | 110 | default: |
111 | snd_printk(KERN_INFO "%d:%u:%d : unsupported sample bitwidth %d in %d bytes\n", | 111 | usb_audio_info(chip, |
112 | chip->dev->devnum, fp->iface, fp->altsetting, | 112 | "%u:%d : unsupported sample bitwidth %d in %d bytes\n", |
113 | sample_width, sample_bytes); | 113 | fp->iface, fp->altsetting, |
114 | sample_width, sample_bytes); | ||
114 | break; | 115 | break; |
115 | } | 116 | } |
116 | } | 117 | } |
@@ -132,8 +133,9 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
132 | pcm_formats |= SNDRV_PCM_FMTBIT_MU_LAW; | 133 | pcm_formats |= SNDRV_PCM_FMTBIT_MU_LAW; |
133 | } | 134 | } |
134 | if (format & ~0x3f) { | 135 | if (format & ~0x3f) { |
135 | snd_printk(KERN_INFO "%d:%u:%d : unsupported format bits %#x\n", | 136 | usb_audio_info(chip, |
136 | chip->dev->devnum, fp->iface, fp->altsetting, format); | 137 | "%u:%d : unsupported format bits %#x\n", |
138 | fp->iface, fp->altsetting, format); | ||
137 | } | 139 | } |
138 | 140 | ||
139 | pcm_formats |= snd_usb_interface_dsd_format_quirks(chip, fp, sample_bytes); | 141 | pcm_formats |= snd_usb_interface_dsd_format_quirks(chip, fp, sample_bytes); |
@@ -158,8 +160,9 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof | |||
158 | int nr_rates = fmt[offset]; | 160 | int nr_rates = fmt[offset]; |
159 | 161 | ||
160 | if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) { | 162 | if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) { |
161 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_FORMAT_TYPE desc\n", | 163 | usb_audio_err(chip, |
162 | chip->dev->devnum, fp->iface, fp->altsetting); | 164 | "%u:%d : invalid UAC_FORMAT_TYPE desc\n", |
165 | fp->iface, fp->altsetting); | ||
163 | return -EINVAL; | 166 | return -EINVAL; |
164 | } | 167 | } |
165 | 168 | ||
@@ -171,7 +174,7 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof | |||
171 | 174 | ||
172 | fp->rate_table = kmalloc(sizeof(int) * nr_rates, GFP_KERNEL); | 175 | fp->rate_table = kmalloc(sizeof(int) * nr_rates, GFP_KERNEL); |
173 | if (fp->rate_table == NULL) { | 176 | if (fp->rate_table == NULL) { |
174 | snd_printk(KERN_ERR "cannot malloc\n"); | 177 | usb_audio_err(chip, "cannot malloc\n"); |
175 | return -ENOMEM; | 178 | return -ENOMEM; |
176 | } | 179 | } |
177 | 180 | ||
@@ -222,7 +225,8 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof | |||
222 | * get to know how many sample rates we have to expect. | 225 | * get to know how many sample rates we have to expect. |
223 | * Then fp->rate_table can be allocated and filled. | 226 | * Then fp->rate_table can be allocated and filled. |
224 | */ | 227 | */ |
225 | static int parse_uac2_sample_rate_range(struct audioformat *fp, int nr_triplets, | 228 | static int parse_uac2_sample_rate_range(struct snd_usb_audio *chip, |
229 | struct audioformat *fp, int nr_triplets, | ||
226 | const unsigned char *data) | 230 | const unsigned char *data) |
227 | { | 231 | { |
228 | int i, nr_rates = 0; | 232 | int i, nr_rates = 0; |
@@ -261,7 +265,7 @@ static int parse_uac2_sample_rate_range(struct audioformat *fp, int nr_triplets, | |||
261 | 265 | ||
262 | nr_rates++; | 266 | nr_rates++; |
263 | if (nr_rates >= MAX_NR_RATES) { | 267 | if (nr_rates >= MAX_NR_RATES) { |
264 | snd_printk(KERN_ERR "invalid uac2 rates\n"); | 268 | usb_audio_err(chip, "invalid uac2 rates\n"); |
265 | break; | 269 | break; |
266 | } | 270 | } |
267 | 271 | ||
@@ -287,7 +291,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, | |||
287 | int clock = snd_usb_clock_find_source(chip, fp->clock, false); | 291 | int clock = snd_usb_clock_find_source(chip, fp->clock, false); |
288 | 292 | ||
289 | if (clock < 0) { | 293 | if (clock < 0) { |
290 | snd_printk(KERN_ERR "%s(): unable to find clock source (clock %d)\n", | 294 | dev_err(&dev->dev, |
295 | "%s(): unable to find clock source (clock %d)\n", | ||
291 | __func__, clock); | 296 | __func__, clock); |
292 | goto err; | 297 | goto err; |
293 | } | 298 | } |
@@ -300,7 +305,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, | |||
300 | tmp, sizeof(tmp)); | 305 | tmp, sizeof(tmp)); |
301 | 306 | ||
302 | if (ret < 0) { | 307 | if (ret < 0) { |
303 | snd_printk(KERN_ERR "%s(): unable to retrieve number of sample rates (clock %d)\n", | 308 | dev_err(&dev->dev, |
309 | "%s(): unable to retrieve number of sample rates (clock %d)\n", | ||
304 | __func__, clock); | 310 | __func__, clock); |
305 | goto err; | 311 | goto err; |
306 | } | 312 | } |
@@ -321,7 +327,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, | |||
321 | data, data_size); | 327 | data, data_size); |
322 | 328 | ||
323 | if (ret < 0) { | 329 | if (ret < 0) { |
324 | snd_printk(KERN_ERR "%s(): unable to retrieve sample rate range (clock %d)\n", | 330 | dev_err(&dev->dev, |
331 | "%s(): unable to retrieve sample rate range (clock %d)\n", | ||
325 | __func__, clock); | 332 | __func__, clock); |
326 | ret = -EINVAL; | 333 | ret = -EINVAL; |
327 | goto err_free; | 334 | goto err_free; |
@@ -332,7 +339,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, | |||
332 | * will have to deal with. */ | 339 | * will have to deal with. */ |
333 | kfree(fp->rate_table); | 340 | kfree(fp->rate_table); |
334 | fp->rate_table = NULL; | 341 | fp->rate_table = NULL; |
335 | fp->nr_rates = parse_uac2_sample_rate_range(fp, nr_triplets, data); | 342 | fp->nr_rates = parse_uac2_sample_rate_range(chip, fp, nr_triplets, data); |
336 | 343 | ||
337 | if (fp->nr_rates == 0) { | 344 | if (fp->nr_rates == 0) { |
338 | /* SNDRV_PCM_RATE_CONTINUOUS */ | 345 | /* SNDRV_PCM_RATE_CONTINUOUS */ |
@@ -348,7 +355,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, | |||
348 | 355 | ||
349 | /* Call the triplet parser again, but this time, fp->rate_table is | 356 | /* Call the triplet parser again, but this time, fp->rate_table is |
350 | * allocated, so the rates will be stored */ | 357 | * allocated, so the rates will be stored */ |
351 | parse_uac2_sample_rate_range(fp, nr_triplets, data); | 358 | parse_uac2_sample_rate_range(chip, fp, nr_triplets, data); |
352 | 359 | ||
353 | err_free: | 360 | err_free: |
354 | kfree(data); | 361 | kfree(data); |
@@ -408,8 +415,9 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, | |||
408 | } | 415 | } |
409 | 416 | ||
410 | if (fp->channels < 1) { | 417 | if (fp->channels < 1) { |
411 | snd_printk(KERN_ERR "%d:%u:%d : invalid channels %d\n", | 418 | usb_audio_err(chip, |
412 | chip->dev->devnum, fp->iface, fp->altsetting, fp->channels); | 419 | "%u:%d : invalid channels %d\n", |
420 | fp->iface, fp->altsetting, fp->channels); | ||
413 | return -EINVAL; | 421 | return -EINVAL; |
414 | } | 422 | } |
415 | 423 | ||
@@ -435,8 +443,9 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
435 | fp->formats = SNDRV_PCM_FMTBIT_MPEG; | 443 | fp->formats = SNDRV_PCM_FMTBIT_MPEG; |
436 | break; | 444 | break; |
437 | default: | 445 | default: |
438 | snd_printd(KERN_INFO "%d:%u:%d : unknown format tag %#x is detected. processed as MPEG.\n", | 446 | usb_audio_info(chip, |
439 | chip->dev->devnum, fp->iface, fp->altsetting, format); | 447 | "%u:%d : unknown format tag %#x is detected. processed as MPEG.\n", |
448 | fp->iface, fp->altsetting, format); | ||
440 | fp->formats = SNDRV_PCM_FMTBIT_MPEG; | 449 | fp->formats = SNDRV_PCM_FMTBIT_MPEG; |
441 | break; | 450 | break; |
442 | } | 451 | } |
@@ -449,7 +458,7 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
449 | struct uac_format_type_ii_discrete_descriptor *fmt = _fmt; | 458 | struct uac_format_type_ii_discrete_descriptor *fmt = _fmt; |
450 | brate = le16_to_cpu(fmt->wMaxBitRate); | 459 | brate = le16_to_cpu(fmt->wMaxBitRate); |
451 | framesize = le16_to_cpu(fmt->wSamplesPerFrame); | 460 | framesize = le16_to_cpu(fmt->wSamplesPerFrame); |
452 | snd_printd(KERN_INFO "found format II with max.bitrate = %d, frame size=%d\n", brate, framesize); | 461 | usb_audio_info(chip, "found format II with max.bitrate = %d, frame size=%d\n", brate, framesize); |
453 | fp->frame_size = framesize; | 462 | fp->frame_size = framesize; |
454 | ret = parse_audio_format_rates_v1(chip, fp, _fmt, 8); /* fmt[8..] sample rates */ | 463 | ret = parse_audio_format_rates_v1(chip, fp, _fmt, 8); /* fmt[8..] sample rates */ |
455 | break; | 464 | break; |
@@ -458,7 +467,7 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
458 | struct uac_format_type_ii_ext_descriptor *fmt = _fmt; | 467 | struct uac_format_type_ii_ext_descriptor *fmt = _fmt; |
459 | brate = le16_to_cpu(fmt->wMaxBitRate); | 468 | brate = le16_to_cpu(fmt->wMaxBitRate); |
460 | framesize = le16_to_cpu(fmt->wSamplesPerFrame); | 469 | framesize = le16_to_cpu(fmt->wSamplesPerFrame); |
461 | snd_printd(KERN_INFO "found format II with max.bitrate = %d, frame size=%d\n", brate, framesize); | 470 | usb_audio_info(chip, "found format II with max.bitrate = %d, frame size=%d\n", brate, framesize); |
462 | fp->frame_size = framesize; | 471 | fp->frame_size = framesize; |
463 | ret = parse_audio_format_rates_v2(chip, fp); | 472 | ret = parse_audio_format_rates_v2(chip, fp); |
464 | break; | 473 | break; |
@@ -484,9 +493,10 @@ int snd_usb_parse_audio_format(struct snd_usb_audio *chip, | |||
484 | err = parse_audio_format_ii(chip, fp, format, fmt); | 493 | err = parse_audio_format_ii(chip, fp, format, fmt); |
485 | break; | 494 | break; |
486 | default: | 495 | default: |
487 | snd_printd(KERN_INFO "%d:%u:%d : format type %d is not supported yet\n", | 496 | usb_audio_info(chip, |
488 | chip->dev->devnum, fp->iface, fp->altsetting, | 497 | "%u:%d : format type %d is not supported yet\n", |
489 | fmt->bFormatType); | 498 | fp->iface, fp->altsetting, |
499 | fmt->bFormatType); | ||
490 | return -ENOTSUPP; | 500 | return -ENOTSUPP; |
491 | } | 501 | } |
492 | fp->fmt_type = fmt->bFormatType; | 502 | fp->fmt_type = fmt->bFormatType; |
diff --git a/sound/usb/midi.c b/sound/usb/midi.c index b901f468b67a..9da74d2e8eee 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c | |||
@@ -191,16 +191,16 @@ static int snd_usbmidi_submit_urb(struct urb* urb, gfp_t flags) | |||
191 | { | 191 | { |
192 | int err = usb_submit_urb(urb, flags); | 192 | int err = usb_submit_urb(urb, flags); |
193 | if (err < 0 && err != -ENODEV) | 193 | if (err < 0 && err != -ENODEV) |
194 | snd_printk(KERN_ERR "usb_submit_urb: %d\n", err); | 194 | dev_err(&urb->dev->dev, "usb_submit_urb: %d\n", err); |
195 | return err; | 195 | return err; |
196 | } | 196 | } |
197 | 197 | ||
198 | /* | 198 | /* |
199 | * Error handling for URB completion functions. | 199 | * Error handling for URB completion functions. |
200 | */ | 200 | */ |
201 | static int snd_usbmidi_urb_error(int status) | 201 | static int snd_usbmidi_urb_error(const struct urb *urb) |
202 | { | 202 | { |
203 | switch (status) { | 203 | switch (urb->status) { |
204 | /* manually unlinked, or device gone */ | 204 | /* manually unlinked, or device gone */ |
205 | case -ENOENT: | 205 | case -ENOENT: |
206 | case -ECONNRESET: | 206 | case -ECONNRESET: |
@@ -213,7 +213,7 @@ static int snd_usbmidi_urb_error(int status) | |||
213 | case -EILSEQ: | 213 | case -EILSEQ: |
214 | return -EIO; | 214 | return -EIO; |
215 | default: | 215 | default: |
216 | snd_printk(KERN_ERR "urb status %d\n", status); | 216 | dev_err(&urb->dev->dev, "urb status %d\n", urb->status); |
217 | return 0; /* continue */ | 217 | return 0; /* continue */ |
218 | } | 218 | } |
219 | } | 219 | } |
@@ -227,7 +227,7 @@ static void snd_usbmidi_input_data(struct snd_usb_midi_in_endpoint* ep, int port | |||
227 | struct usbmidi_in_port* port = &ep->ports[portidx]; | 227 | struct usbmidi_in_port* port = &ep->ports[portidx]; |
228 | 228 | ||
229 | if (!port->substream) { | 229 | if (!port->substream) { |
230 | snd_printd("unexpected port %d!\n", portidx); | 230 | dev_dbg(&ep->umidi->dev->dev, "unexpected port %d!\n", portidx); |
231 | return; | 231 | return; |
232 | } | 232 | } |
233 | if (!test_bit(port->substream->number, &ep->umidi->input_triggered)) | 233 | if (!test_bit(port->substream->number, &ep->umidi->input_triggered)) |
@@ -259,7 +259,7 @@ static void snd_usbmidi_in_urb_complete(struct urb* urb) | |||
259 | ep->umidi->usb_protocol_ops->input(ep, urb->transfer_buffer, | 259 | ep->umidi->usb_protocol_ops->input(ep, urb->transfer_buffer, |
260 | urb->actual_length); | 260 | urb->actual_length); |
261 | } else { | 261 | } else { |
262 | int err = snd_usbmidi_urb_error(urb->status); | 262 | int err = snd_usbmidi_urb_error(urb); |
263 | if (err < 0) { | 263 | if (err < 0) { |
264 | if (err != -ENODEV) { | 264 | if (err != -ENODEV) { |
265 | ep->error_resubmit = 1; | 265 | ep->error_resubmit = 1; |
@@ -289,7 +289,7 @@ static void snd_usbmidi_out_urb_complete(struct urb* urb) | |||
289 | } | 289 | } |
290 | spin_unlock(&ep->buffer_lock); | 290 | spin_unlock(&ep->buffer_lock); |
291 | if (urb->status < 0) { | 291 | if (urb->status < 0) { |
292 | int err = snd_usbmidi_urb_error(urb->status); | 292 | int err = snd_usbmidi_urb_error(urb); |
293 | if (err < 0) { | 293 | if (err < 0) { |
294 | if (err != -ENODEV) | 294 | if (err != -ENODEV) |
295 | mod_timer(&ep->umidi->error_timer, | 295 | mod_timer(&ep->umidi->error_timer, |
@@ -1668,7 +1668,7 @@ static void snd_usbmidi_init_substream(struct snd_usb_midi* umidi, | |||
1668 | 1668 | ||
1669 | struct snd_rawmidi_substream *substream = snd_usbmidi_find_substream(umidi, stream, number); | 1669 | struct snd_rawmidi_substream *substream = snd_usbmidi_find_substream(umidi, stream, number); |
1670 | if (!substream) { | 1670 | if (!substream) { |
1671 | snd_printd(KERN_ERR "substream %d:%d not found\n", stream, number); | 1671 | dev_err(&umidi->dev->dev, "substream %d:%d not found\n", stream, number); |
1672 | return; | 1672 | return; |
1673 | } | 1673 | } |
1674 | 1674 | ||
@@ -1717,7 +1717,7 @@ static int snd_usbmidi_create_endpoints(struct snd_usb_midi* umidi, | |||
1717 | } | 1717 | } |
1718 | } | 1718 | } |
1719 | } | 1719 | } |
1720 | snd_printdd(KERN_INFO "created %d output and %d input ports\n", | 1720 | dev_dbg(&umidi->dev->dev, "created %d output and %d input ports\n", |
1721 | out_ports, in_ports); | 1721 | out_ports, in_ports); |
1722 | return 0; | 1722 | return 0; |
1723 | } | 1723 | } |
@@ -1747,10 +1747,11 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1747 | ms_header->bLength >= 7 && | 1747 | ms_header->bLength >= 7 && |
1748 | ms_header->bDescriptorType == USB_DT_CS_INTERFACE && | 1748 | ms_header->bDescriptorType == USB_DT_CS_INTERFACE && |
1749 | ms_header->bDescriptorSubtype == UAC_HEADER) | 1749 | ms_header->bDescriptorSubtype == UAC_HEADER) |
1750 | snd_printdd(KERN_INFO "MIDIStreaming version %02x.%02x\n", | 1750 | dev_dbg(&umidi->dev->dev, "MIDIStreaming version %02x.%02x\n", |
1751 | ms_header->bcdMSC[1], ms_header->bcdMSC[0]); | 1751 | ms_header->bcdMSC[1], ms_header->bcdMSC[0]); |
1752 | else | 1752 | else |
1753 | snd_printk(KERN_WARNING "MIDIStreaming interface descriptor not found\n"); | 1753 | dev_warn(&umidi->dev->dev, |
1754 | "MIDIStreaming interface descriptor not found\n"); | ||
1754 | 1755 | ||
1755 | epidx = 0; | 1756 | epidx = 0; |
1756 | for (i = 0; i < intfd->bNumEndpoints; ++i) { | 1757 | for (i = 0; i < intfd->bNumEndpoints; ++i) { |
@@ -1767,7 +1768,8 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1767 | if (usb_endpoint_dir_out(ep)) { | 1768 | if (usb_endpoint_dir_out(ep)) { |
1768 | if (endpoints[epidx].out_ep) { | 1769 | if (endpoints[epidx].out_ep) { |
1769 | if (++epidx >= MIDI_MAX_ENDPOINTS) { | 1770 | if (++epidx >= MIDI_MAX_ENDPOINTS) { |
1770 | snd_printk(KERN_WARNING "too many endpoints\n"); | 1771 | dev_warn(&umidi->dev->dev, |
1772 | "too many endpoints\n"); | ||
1771 | break; | 1773 | break; |
1772 | } | 1774 | } |
1773 | } | 1775 | } |
@@ -1782,12 +1784,13 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1782 | */ | 1784 | */ |
1783 | endpoints[epidx].out_interval = 1; | 1785 | endpoints[epidx].out_interval = 1; |
1784 | endpoints[epidx].out_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; | 1786 | endpoints[epidx].out_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; |
1785 | snd_printdd(KERN_INFO "EP %02X: %d jack(s)\n", | 1787 | dev_dbg(&umidi->dev->dev, "EP %02X: %d jack(s)\n", |
1786 | ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack); | 1788 | ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack); |
1787 | } else { | 1789 | } else { |
1788 | if (endpoints[epidx].in_ep) { | 1790 | if (endpoints[epidx].in_ep) { |
1789 | if (++epidx >= MIDI_MAX_ENDPOINTS) { | 1791 | if (++epidx >= MIDI_MAX_ENDPOINTS) { |
1790 | snd_printk(KERN_WARNING "too many endpoints\n"); | 1792 | dev_warn(&umidi->dev->dev, |
1793 | "too many endpoints\n"); | ||
1791 | break; | 1794 | break; |
1792 | } | 1795 | } |
1793 | } | 1796 | } |
@@ -1797,7 +1800,7 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1797 | else if (snd_usb_get_speed(umidi->dev) == USB_SPEED_LOW) | 1800 | else if (snd_usb_get_speed(umidi->dev) == USB_SPEED_LOW) |
1798 | endpoints[epidx].in_interval = 1; | 1801 | endpoints[epidx].in_interval = 1; |
1799 | endpoints[epidx].in_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; | 1802 | endpoints[epidx].in_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; |
1800 | snd_printdd(KERN_INFO "EP %02X: %d jack(s)\n", | 1803 | dev_dbg(&umidi->dev->dev, "EP %02X: %d jack(s)\n", |
1801 | ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack); | 1804 | ep->bEndpointAddress, ms_ep->bNumEmbMIDIJack); |
1802 | } | 1805 | } |
1803 | } | 1806 | } |
@@ -1865,7 +1868,7 @@ static void snd_usbmidi_switch_roland_altsetting(struct snd_usb_midi* umidi) | |||
1865 | (get_endpoint(hostif, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) | 1868 | (get_endpoint(hostif, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) |
1866 | return; | 1869 | return; |
1867 | 1870 | ||
1868 | snd_printdd(KERN_INFO "switching to altsetting %d with int ep\n", | 1871 | dev_dbg(&umidi->dev->dev, "switching to altsetting %d with int ep\n", |
1869 | intfd->bAlternateSetting); | 1872 | intfd->bAlternateSetting); |
1870 | usb_set_interface(umidi->dev, intfd->bInterfaceNumber, | 1873 | usb_set_interface(umidi->dev, intfd->bInterfaceNumber, |
1871 | intfd->bAlternateSetting); | 1874 | intfd->bAlternateSetting); |
@@ -2047,25 +2050,25 @@ static int snd_usbmidi_create_endpoints_midiman(struct snd_usb_midi* umidi, | |||
2047 | * input bulk endpoints (at indices 1 and 3) which aren't used. | 2050 | * input bulk endpoints (at indices 1 and 3) which aren't used. |
2048 | */ | 2051 | */ |
2049 | if (intfd->bNumEndpoints < (endpoint->out_cables > 0x0001 ? 5 : 3)) { | 2052 | if (intfd->bNumEndpoints < (endpoint->out_cables > 0x0001 ? 5 : 3)) { |
2050 | snd_printdd(KERN_ERR "not enough endpoints\n"); | 2053 | dev_dbg(&umidi->dev->dev, "not enough endpoints\n"); |
2051 | return -ENOENT; | 2054 | return -ENOENT; |
2052 | } | 2055 | } |
2053 | 2056 | ||
2054 | epd = get_endpoint(hostif, 0); | 2057 | epd = get_endpoint(hostif, 0); |
2055 | if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) { | 2058 | if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) { |
2056 | snd_printdd(KERN_ERR "endpoint[0] isn't interrupt\n"); | 2059 | dev_dbg(&umidi->dev->dev, "endpoint[0] isn't interrupt\n"); |
2057 | return -ENXIO; | 2060 | return -ENXIO; |
2058 | } | 2061 | } |
2059 | epd = get_endpoint(hostif, 2); | 2062 | epd = get_endpoint(hostif, 2); |
2060 | if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) { | 2063 | if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) { |
2061 | snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n"); | 2064 | dev_dbg(&umidi->dev->dev, "endpoint[2] isn't bulk output\n"); |
2062 | return -ENXIO; | 2065 | return -ENXIO; |
2063 | } | 2066 | } |
2064 | if (endpoint->out_cables > 0x0001) { | 2067 | if (endpoint->out_cables > 0x0001) { |
2065 | epd = get_endpoint(hostif, 4); | 2068 | epd = get_endpoint(hostif, 4); |
2066 | if (!usb_endpoint_dir_out(epd) || | 2069 | if (!usb_endpoint_dir_out(epd) || |
2067 | !usb_endpoint_xfer_bulk(epd)) { | 2070 | !usb_endpoint_xfer_bulk(epd)) { |
2068 | snd_printdd(KERN_ERR "endpoint[4] isn't bulk output\n"); | 2071 | dev_dbg(&umidi->dev->dev, "endpoint[4] isn't bulk output\n"); |
2069 | return -ENXIO; | 2072 | return -ENXIO; |
2070 | } | 2073 | } |
2071 | } | 2074 | } |
@@ -2289,7 +2292,7 @@ int snd_usbmidi_create(struct snd_card *card, | |||
2289 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); | 2292 | err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); |
2290 | break; | 2293 | break; |
2291 | default: | 2294 | default: |
2292 | snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); | 2295 | dev_err(&umidi->dev->dev, "invalid quirk type %d\n", quirk->type); |
2293 | err = -ENXIO; | 2296 | err = -ENXIO; |
2294 | break; | 2297 | break; |
2295 | } | 2298 | } |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 8c152b02da5a..fcd3ab9331d3 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -305,8 +305,9 @@ static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request, int v | |||
305 | goto out; | 305 | goto out; |
306 | } | 306 | } |
307 | } | 307 | } |
308 | snd_printdd(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", | 308 | usb_audio_dbg(chip, |
309 | request, validx, idx, cval->val_type); | 309 | "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", |
310 | request, validx, idx, cval->val_type); | ||
310 | err = -EINVAL; | 311 | err = -EINVAL; |
311 | 312 | ||
312 | out: | 313 | out: |
@@ -351,8 +352,9 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int v | |||
351 | 352 | ||
352 | if (ret < 0) { | 353 | if (ret < 0) { |
353 | error: | 354 | error: |
354 | snd_printk(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", | 355 | usb_audio_err(chip, |
355 | request, validx, idx, cval->val_type); | 356 | "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", |
357 | request, validx, idx, cval->val_type); | ||
356 | return ret; | 358 | return ret; |
357 | } | 359 | } |
358 | 360 | ||
@@ -413,7 +415,8 @@ static int get_cur_mix_value(struct usb_mixer_elem_info *cval, | |||
413 | err = get_cur_mix_raw(cval, channel, value); | 415 | err = get_cur_mix_raw(cval, channel, value); |
414 | if (err < 0) { | 416 | if (err < 0) { |
415 | if (!cval->mixer->ignore_ctl_error) | 417 | if (!cval->mixer->ignore_ctl_error) |
416 | snd_printd(KERN_ERR "cannot get current value for control %d ch %d: err = %d\n", | 418 | usb_audio_dbg(cval->mixer->chip, |
419 | "cannot get current value for control %d ch %d: err = %d\n", | ||
417 | cval->control, channel, err); | 420 | cval->control, channel, err); |
418 | return err; | 421 | return err; |
419 | } | 422 | } |
@@ -444,7 +447,7 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval, | |||
444 | 447 | ||
445 | /* FIXME */ | 448 | /* FIXME */ |
446 | if (request != UAC_SET_CUR) { | 449 | if (request != UAC_SET_CUR) { |
447 | snd_printdd(KERN_WARNING "RANGE setting not yet supported\n"); | 450 | usb_audio_dbg(chip, "RANGE setting not yet supported\n"); |
448 | return -EINVAL; | 451 | return -EINVAL; |
449 | } | 452 | } |
450 | 453 | ||
@@ -470,7 +473,7 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval, | |||
470 | goto out; | 473 | goto out; |
471 | } | 474 | } |
472 | } | 475 | } |
473 | snd_printdd(KERN_ERR "cannot set ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d, data = %#x/%#x\n", | 476 | usb_audio_dbg(chip, "cannot set ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d, data = %#x/%#x\n", |
474 | request, validx, idx, cval->val_type, buf[0], buf[1]); | 477 | request, validx, idx, cval->val_type, buf[0], buf[1]); |
475 | err = -EINVAL; | 478 | err = -EINVAL; |
476 | 479 | ||
@@ -494,7 +497,8 @@ static int set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel, | |||
494 | cval->ch_readonly & (1 << (channel - 1)); | 497 | cval->ch_readonly & (1 << (channel - 1)); |
495 | 498 | ||
496 | if (read_only) { | 499 | if (read_only) { |
497 | snd_printdd(KERN_INFO "%s(): channel %d of control %d is read_only\n", | 500 | usb_audio_dbg(cval->mixer->chip, |
501 | "%s(): channel %d of control %d is read_only\n", | ||
498 | __func__, channel, cval->control); | 502 | __func__, channel, cval->control); |
499 | return 0; | 503 | return 0; |
500 | } | 504 | } |
@@ -560,7 +564,7 @@ int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer, | |||
560 | while (snd_ctl_find_id(mixer->chip->card, &kctl->id)) | 564 | while (snd_ctl_find_id(mixer->chip->card, &kctl->id)) |
561 | kctl->id.index++; | 565 | kctl->id.index++; |
562 | if ((err = snd_ctl_add(mixer->chip->card, kctl)) < 0) { | 566 | if ((err = snd_ctl_add(mixer->chip->card, kctl)) < 0) { |
563 | snd_printd(KERN_ERR "cannot add control (err = %d)\n", err); | 567 | usb_audio_dbg(mixer->chip, "cannot add control (err = %d)\n", err); |
564 | return err; | 568 | return err; |
565 | } | 569 | } |
566 | cval->elem_id = &kctl->id; | 570 | cval->elem_id = &kctl->id; |
@@ -807,7 +811,8 @@ static void usb_mixer_elem_free(struct snd_kcontrol *kctl) | |||
807 | static void volume_control_quirks(struct usb_mixer_elem_info *cval, | 811 | static void volume_control_quirks(struct usb_mixer_elem_info *cval, |
808 | struct snd_kcontrol *kctl) | 812 | struct snd_kcontrol *kctl) |
809 | { | 813 | { |
810 | switch (cval->mixer->chip->usb_id) { | 814 | struct snd_usb_audio *chip = cval->mixer->chip; |
815 | switch (chip->usb_id) { | ||
811 | case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ | 816 | case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ |
812 | case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */ | 817 | case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */ |
813 | if (strcmp(kctl->id.name, "Effect Duration") == 0) { | 818 | if (strcmp(kctl->id.name, "Effect Duration") == 0) { |
@@ -839,8 +844,8 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, | |||
839 | case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */ | 844 | case USB_ID(0x0763, 0x2081): /* M-Audio Fast Track Ultra 8R */ |
840 | case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra */ | 845 | case USB_ID(0x0763, 0x2080): /* M-Audio Fast Track Ultra */ |
841 | if (strcmp(kctl->id.name, "Effect Duration") == 0) { | 846 | if (strcmp(kctl->id.name, "Effect Duration") == 0) { |
842 | snd_printk(KERN_INFO | 847 | usb_audio_info(chip, |
843 | "usb-audio: set quirk for FTU Effect Duration\n"); | 848 | "set quirk for FTU Effect Duration\n"); |
844 | cval->min = 0x0000; | 849 | cval->min = 0x0000; |
845 | cval->max = 0x7f00; | 850 | cval->max = 0x7f00; |
846 | cval->res = 0x0100; | 851 | cval->res = 0x0100; |
@@ -848,8 +853,8 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, | |||
848 | } | 853 | } |
849 | if (strcmp(kctl->id.name, "Effect Volume") == 0 || | 854 | if (strcmp(kctl->id.name, "Effect Volume") == 0 || |
850 | strcmp(kctl->id.name, "Effect Feedback Volume") == 0) { | 855 | strcmp(kctl->id.name, "Effect Feedback Volume") == 0) { |
851 | snd_printk(KERN_INFO | 856 | usb_audio_info(chip, |
852 | "usb-audio: set quirks for FTU Effect Feedback/Volume\n"); | 857 | "set quirks for FTU Effect Feedback/Volume\n"); |
853 | cval->min = 0x00; | 858 | cval->min = 0x00; |
854 | cval->max = 0x7f; | 859 | cval->max = 0x7f; |
855 | break; | 860 | break; |
@@ -867,7 +872,7 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, | |||
867 | */ | 872 | */ |
868 | if (!strcmp(kctl->id.name, "PCM Playback Volume") && | 873 | if (!strcmp(kctl->id.name, "PCM Playback Volume") && |
869 | cval->min == -15616) { | 874 | cval->min == -15616) { |
870 | snd_printk(KERN_INFO | 875 | usb_audio_info(chip, |
871 | "set volume quirk for UDA1321/N101 chip\n"); | 876 | "set volume quirk for UDA1321/N101 chip\n"); |
872 | cval->max = -256; | 877 | cval->max = -256; |
873 | } | 878 | } |
@@ -875,7 +880,7 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, | |||
875 | 880 | ||
876 | case USB_ID(0x046d, 0x09a4): | 881 | case USB_ID(0x046d, 0x09a4): |
877 | if (!strcmp(kctl->id.name, "Mic Capture Volume")) { | 882 | if (!strcmp(kctl->id.name, "Mic Capture Volume")) { |
878 | snd_printk(KERN_INFO | 883 | usb_audio_info(chip, |
879 | "set volume quirk for QuickCam E3500\n"); | 884 | "set volume quirk for QuickCam E3500\n"); |
880 | cval->min = 6080; | 885 | cval->min = 6080; |
881 | cval->max = 8768; | 886 | cval->max = 8768; |
@@ -895,7 +900,7 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, | |||
895 | * Proboly there is some logitech magic behind this number --fishor | 900 | * Proboly there is some logitech magic behind this number --fishor |
896 | */ | 901 | */ |
897 | if (!strcmp(kctl->id.name, "Mic Capture Volume")) { | 902 | if (!strcmp(kctl->id.name, "Mic Capture Volume")) { |
898 | snd_printk(KERN_INFO | 903 | usb_audio_info(chip, |
899 | "set resolution quirk: cval->res = 384\n"); | 904 | "set resolution quirk: cval->res = 384\n"); |
900 | cval->res = 384; | 905 | cval->res = 384; |
901 | } | 906 | } |
@@ -931,7 +936,8 @@ static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval, | |||
931 | } | 936 | } |
932 | if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || | 937 | if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || |
933 | get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) { | 938 | get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) { |
934 | snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", | 939 | usb_audio_err(cval->mixer->chip, |
940 | "%d:%d: cannot get min/max values for control %d (id %d)\n", | ||
935 | cval->id, snd_usb_ctrl_intf(cval->mixer->chip), cval->control, cval->id); | 941 | cval->id, snd_usb_ctrl_intf(cval->mixer->chip), cval->control, cval->id); |
936 | return -EINVAL; | 942 | return -EINVAL; |
937 | } | 943 | } |
@@ -1195,7 +1201,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, | |||
1195 | 1201 | ||
1196 | cval = kzalloc(sizeof(*cval), GFP_KERNEL); | 1202 | cval = kzalloc(sizeof(*cval), GFP_KERNEL); |
1197 | if (! cval) { | 1203 | if (! cval) { |
1198 | snd_printk(KERN_ERR "cannot malloc kcontrol\n"); | 1204 | usb_audio_err(state->chip, "cannot malloc kcontrol\n"); |
1199 | return; | 1205 | return; |
1200 | } | 1206 | } |
1201 | cval->mixer = state->mixer; | 1207 | cval->mixer = state->mixer; |
@@ -1224,7 +1230,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, | |||
1224 | kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval); | 1230 | kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval); |
1225 | 1231 | ||
1226 | if (! kctl) { | 1232 | if (! kctl) { |
1227 | snd_printk(KERN_ERR "cannot malloc kcontrol\n"); | 1233 | usb_audio_err(state->chip, "cannot malloc kcontrol\n"); |
1228 | kfree(cval); | 1234 | kfree(cval); |
1229 | return; | 1235 | return; |
1230 | } | 1236 | } |
@@ -1298,16 +1304,16 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, | |||
1298 | * devices. It will definitively catch all buggy Logitech devices. | 1304 | * devices. It will definitively catch all buggy Logitech devices. |
1299 | */ | 1305 | */ |
1300 | if (range > 384) { | 1306 | if (range > 384) { |
1301 | snd_printk(KERN_WARNING "usb_audio: Warning! Unlikely big " | 1307 | usb_audio_warn(state->chip, "Warning! Unlikely big " |
1302 | "volume range (=%u), cval->res is probably wrong.", | 1308 | "volume range (=%u), cval->res is probably wrong.", |
1303 | range); | 1309 | range); |
1304 | snd_printk(KERN_WARNING "usb_audio: [%d] FU [%s] ch = %d, " | 1310 | usb_audio_warn(state->chip, "[%d] FU [%s] ch = %d, " |
1305 | "val = %d/%d/%d", cval->id, | 1311 | "val = %d/%d/%d", cval->id, |
1306 | kctl->id.name, cval->channels, | 1312 | kctl->id.name, cval->channels, |
1307 | cval->min, cval->max, cval->res); | 1313 | cval->min, cval->max, cval->res); |
1308 | } | 1314 | } |
1309 | 1315 | ||
1310 | snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n", | 1316 | usb_audio_dbg(state->chip, "[%d] FU [%s] ch = %d, val = %d/%d/%d\n", |
1311 | cval->id, kctl->id.name, cval->channels, cval->min, cval->max, cval->res); | 1317 | cval->id, kctl->id.name, cval->channels, cval->min, cval->max, cval->res); |
1312 | snd_usb_mixer_add_control(state->mixer, kctl); | 1318 | snd_usb_mixer_add_control(state->mixer, kctl); |
1313 | } | 1319 | } |
@@ -1331,16 +1337,17 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void | |||
1331 | if (state->mixer->protocol == UAC_VERSION_1) { | 1337 | if (state->mixer->protocol == UAC_VERSION_1) { |
1332 | csize = hdr->bControlSize; | 1338 | csize = hdr->bControlSize; |
1333 | if (!csize) { | 1339 | if (!csize) { |
1334 | snd_printdd(KERN_ERR "usbaudio: unit %u: " | 1340 | usb_audio_dbg(state->chip, |
1335 | "invalid bControlSize == 0\n", unitid); | 1341 | "unit %u: invalid bControlSize == 0\n", |
1342 | unitid); | ||
1336 | return -EINVAL; | 1343 | return -EINVAL; |
1337 | } | 1344 | } |
1338 | channels = (hdr->bLength - 7) / csize - 1; | 1345 | channels = (hdr->bLength - 7) / csize - 1; |
1339 | bmaControls = hdr->bmaControls; | 1346 | bmaControls = hdr->bmaControls; |
1340 | if (hdr->bLength < 7 + csize) { | 1347 | if (hdr->bLength < 7 + csize) { |
1341 | snd_printk(KERN_ERR "usbaudio: unit %u: " | 1348 | usb_audio_err(state->chip, |
1342 | "invalid UAC_FEATURE_UNIT descriptor\n", | 1349 | "unit %u: invalid UAC_FEATURE_UNIT descriptor\n", |
1343 | unitid); | 1350 | unitid); |
1344 | return -EINVAL; | 1351 | return -EINVAL; |
1345 | } | 1352 | } |
1346 | } else { | 1353 | } else { |
@@ -1349,9 +1356,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void | |||
1349 | channels = (hdr->bLength - 6) / 4 - 1; | 1356 | channels = (hdr->bLength - 6) / 4 - 1; |
1350 | bmaControls = ftr->bmaControls; | 1357 | bmaControls = ftr->bmaControls; |
1351 | if (hdr->bLength < 6 + csize) { | 1358 | if (hdr->bLength < 6 + csize) { |
1352 | snd_printk(KERN_ERR "usbaudio: unit %u: " | 1359 | usb_audio_err(state->chip, |
1353 | "invalid UAC_FEATURE_UNIT descriptor\n", | 1360 | "unit %u: invalid UAC_FEATURE_UNIT descriptor\n", |
1354 | unitid); | 1361 | unitid); |
1355 | return -EINVAL; | 1362 | return -EINVAL; |
1356 | } | 1363 | } |
1357 | } | 1364 | } |
@@ -1369,14 +1376,14 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void | |||
1369 | /* master configuration quirks */ | 1376 | /* master configuration quirks */ |
1370 | switch (state->chip->usb_id) { | 1377 | switch (state->chip->usb_id) { |
1371 | case USB_ID(0x08bb, 0x2702): | 1378 | case USB_ID(0x08bb, 0x2702): |
1372 | snd_printk(KERN_INFO | 1379 | usb_audio_info(state->chip, |
1373 | "usbmixer: master volume quirk for PCM2702 chip\n"); | 1380 | "usbmixer: master volume quirk for PCM2702 chip\n"); |
1374 | /* disable non-functional volume control */ | 1381 | /* disable non-functional volume control */ |
1375 | master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME); | 1382 | master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME); |
1376 | break; | 1383 | break; |
1377 | case USB_ID(0x1130, 0xf211): | 1384 | case USB_ID(0x1130, 0xf211): |
1378 | snd_printk(KERN_INFO | 1385 | usb_audio_info(state->chip, |
1379 | "usbmixer: volume control quirk for Tenx TP6911 Audio Headset\n"); | 1386 | "usbmixer: volume control quirk for Tenx TP6911 Audio Headset\n"); |
1380 | /* disable non-functional volume control */ | 1387 | /* disable non-functional volume control */ |
1381 | channels = 0; | 1388 | channels = 0; |
1382 | break; | 1389 | break; |
@@ -1478,7 +1485,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state, | |||
1478 | 1485 | ||
1479 | kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval); | 1486 | kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval); |
1480 | if (! kctl) { | 1487 | if (! kctl) { |
1481 | snd_printk(KERN_ERR "cannot malloc kcontrol\n"); | 1488 | usb_audio_err(state->chip, "cannot malloc kcontrol\n"); |
1482 | kfree(cval); | 1489 | kfree(cval); |
1483 | return; | 1490 | return; |
1484 | } | 1491 | } |
@@ -1491,7 +1498,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state, | |||
1491 | len = sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1); | 1498 | len = sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1); |
1492 | append_ctl_name(kctl, " Volume"); | 1499 | append_ctl_name(kctl, " Volume"); |
1493 | 1500 | ||
1494 | snd_printdd(KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n", | 1501 | usb_audio_dbg(state->chip, "[%d] MU [%s] ch = %d, val = %d/%d\n", |
1495 | cval->id, kctl->id.name, cval->channels, cval->min, cval->max); | 1502 | cval->id, kctl->id.name, cval->channels, cval->min, cval->max); |
1496 | snd_usb_mixer_add_control(state->mixer, kctl); | 1503 | snd_usb_mixer_add_control(state->mixer, kctl); |
1497 | } | 1504 | } |
@@ -1508,12 +1515,12 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *r | |||
1508 | int pin, ich, err; | 1515 | int pin, ich, err; |
1509 | 1516 | ||
1510 | if (desc->bLength < 11 || ! (input_pins = desc->bNrInPins) || ! (num_outs = uac_mixer_unit_bNrChannels(desc))) { | 1517 | if (desc->bLength < 11 || ! (input_pins = desc->bNrInPins) || ! (num_outs = uac_mixer_unit_bNrChannels(desc))) { |
1511 | snd_printk(KERN_ERR "invalid MIXER UNIT descriptor %d\n", unitid); | 1518 | usb_audio_err(state->chip, "invalid MIXER UNIT descriptor %d\n", unitid); |
1512 | return -EINVAL; | 1519 | return -EINVAL; |
1513 | } | 1520 | } |
1514 | /* no bmControls field (e.g. Maya44) -> ignore */ | 1521 | /* no bmControls field (e.g. Maya44) -> ignore */ |
1515 | if (desc->bLength <= 10 + input_pins) { | 1522 | if (desc->bLength <= 10 + input_pins) { |
1516 | snd_printdd(KERN_INFO "MU %d has no bmControls field\n", unitid); | 1523 | usb_audio_dbg(state->chip, "MU %d has no bmControls field\n", unitid); |
1517 | return 0; | 1524 | return 0; |
1518 | } | 1525 | } |
1519 | 1526 | ||
@@ -1712,7 +1719,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw | |||
1712 | 1719 | ||
1713 | if (desc->bLength < 13 || desc->bLength < 13 + num_ins || | 1720 | if (desc->bLength < 13 || desc->bLength < 13 + num_ins || |
1714 | desc->bLength < num_ins + uac_processing_unit_bControlSize(desc, state->mixer->protocol)) { | 1721 | desc->bLength < num_ins + uac_processing_unit_bControlSize(desc, state->mixer->protocol)) { |
1715 | snd_printk(KERN_ERR "invalid %s descriptor (id %d)\n", name, unitid); | 1722 | usb_audio_err(state->chip, "invalid %s descriptor (id %d)\n", name, unitid); |
1716 | return -EINVAL; | 1723 | return -EINVAL; |
1717 | } | 1724 | } |
1718 | 1725 | ||
@@ -1738,7 +1745,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw | |||
1738 | continue; | 1745 | continue; |
1739 | cval = kzalloc(sizeof(*cval), GFP_KERNEL); | 1746 | cval = kzalloc(sizeof(*cval), GFP_KERNEL); |
1740 | if (! cval) { | 1747 | if (! cval) { |
1741 | snd_printk(KERN_ERR "cannot malloc kcontrol\n"); | 1748 | usb_audio_err(state->chip, "cannot malloc kcontrol\n"); |
1742 | return -ENOMEM; | 1749 | return -ENOMEM; |
1743 | } | 1750 | } |
1744 | cval->mixer = state->mixer; | 1751 | cval->mixer = state->mixer; |
@@ -1770,7 +1777,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw | |||
1770 | 1777 | ||
1771 | kctl = snd_ctl_new1(&mixer_procunit_ctl, cval); | 1778 | kctl = snd_ctl_new1(&mixer_procunit_ctl, cval); |
1772 | if (! kctl) { | 1779 | if (! kctl) { |
1773 | snd_printk(KERN_ERR "cannot malloc kcontrol\n"); | 1780 | usb_audio_err(state->chip, "cannot malloc kcontrol\n"); |
1774 | kfree(cval); | 1781 | kfree(cval); |
1775 | return -ENOMEM; | 1782 | return -ENOMEM; |
1776 | } | 1783 | } |
@@ -1792,7 +1799,8 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw | |||
1792 | append_ctl_name(kctl, " "); | 1799 | append_ctl_name(kctl, " "); |
1793 | append_ctl_name(kctl, valinfo->suffix); | 1800 | append_ctl_name(kctl, valinfo->suffix); |
1794 | 1801 | ||
1795 | snd_printdd(KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n", | 1802 | usb_audio_dbg(state->chip, |
1803 | "[%d] PU [%s] ch = %d, val = %d/%d\n", | ||
1796 | cval->id, kctl->id.name, cval->channels, cval->min, cval->max); | 1804 | cval->id, kctl->id.name, cval->channels, cval->min, cval->max); |
1797 | if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0) | 1805 | if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0) |
1798 | return err; | 1806 | return err; |
@@ -1917,7 +1925,8 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void | |||
1917 | char **namelist; | 1925 | char **namelist; |
1918 | 1926 | ||
1919 | if (!desc->bNrInPins || desc->bLength < 5 + desc->bNrInPins) { | 1927 | if (!desc->bNrInPins || desc->bLength < 5 + desc->bNrInPins) { |
1920 | snd_printk(KERN_ERR "invalid SELECTOR UNIT descriptor %d\n", unitid); | 1928 | usb_audio_err(state->chip, |
1929 | "invalid SELECTOR UNIT descriptor %d\n", unitid); | ||
1921 | return -EINVAL; | 1930 | return -EINVAL; |
1922 | } | 1931 | } |
1923 | 1932 | ||
@@ -1935,7 +1944,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void | |||
1935 | 1944 | ||
1936 | cval = kzalloc(sizeof(*cval), GFP_KERNEL); | 1945 | cval = kzalloc(sizeof(*cval), GFP_KERNEL); |
1937 | if (! cval) { | 1946 | if (! cval) { |
1938 | snd_printk(KERN_ERR "cannot malloc kcontrol\n"); | 1947 | usb_audio_err(state->chip, "cannot malloc kcontrol\n"); |
1939 | return -ENOMEM; | 1948 | return -ENOMEM; |
1940 | } | 1949 | } |
1941 | cval->mixer = state->mixer; | 1950 | cval->mixer = state->mixer; |
@@ -1954,7 +1963,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void | |||
1954 | 1963 | ||
1955 | namelist = kmalloc(sizeof(char *) * desc->bNrInPins, GFP_KERNEL); | 1964 | namelist = kmalloc(sizeof(char *) * desc->bNrInPins, GFP_KERNEL); |
1956 | if (! namelist) { | 1965 | if (! namelist) { |
1957 | snd_printk(KERN_ERR "cannot malloc\n"); | 1966 | usb_audio_err(state->chip, "cannot malloc\n"); |
1958 | kfree(cval); | 1967 | kfree(cval); |
1959 | return -ENOMEM; | 1968 | return -ENOMEM; |
1960 | } | 1969 | } |
@@ -1964,7 +1973,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void | |||
1964 | len = 0; | 1973 | len = 0; |
1965 | namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL); | 1974 | namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL); |
1966 | if (! namelist[i]) { | 1975 | if (! namelist[i]) { |
1967 | snd_printk(KERN_ERR "cannot malloc\n"); | 1976 | usb_audio_err(state->chip, "cannot malloc\n"); |
1968 | while (i--) | 1977 | while (i--) |
1969 | kfree(namelist[i]); | 1978 | kfree(namelist[i]); |
1970 | kfree(namelist); | 1979 | kfree(namelist); |
@@ -1981,7 +1990,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void | |||
1981 | 1990 | ||
1982 | kctl = snd_ctl_new1(&mixer_selectunit_ctl, cval); | 1991 | kctl = snd_ctl_new1(&mixer_selectunit_ctl, cval); |
1983 | if (! kctl) { | 1992 | if (! kctl) { |
1984 | snd_printk(KERN_ERR "cannot malloc kcontrol\n"); | 1993 | usb_audio_err(state->chip, "cannot malloc kcontrol\n"); |
1985 | kfree(namelist); | 1994 | kfree(namelist); |
1986 | kfree(cval); | 1995 | kfree(cval); |
1987 | return -ENOMEM; | 1996 | return -ENOMEM; |
@@ -2009,7 +2018,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void | |||
2009 | append_ctl_name(kctl, " Playback Source"); | 2018 | append_ctl_name(kctl, " Playback Source"); |
2010 | } | 2019 | } |
2011 | 2020 | ||
2012 | snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n", | 2021 | usb_audio_dbg(state->chip, "[%d] SU [%s] items = %d\n", |
2013 | cval->id, kctl->id.name, desc->bNrInPins); | 2022 | cval->id, kctl->id.name, desc->bNrInPins); |
2014 | if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0) | 2023 | if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0) |
2015 | return err; | 2024 | return err; |
@@ -2031,7 +2040,7 @@ static int parse_audio_unit(struct mixer_build *state, int unitid) | |||
2031 | 2040 | ||
2032 | p1 = find_audio_control_unit(state, unitid); | 2041 | p1 = find_audio_control_unit(state, unitid); |
2033 | if (!p1) { | 2042 | if (!p1) { |
2034 | snd_printk(KERN_ERR "usbaudio: unit %d not found!\n", unitid); | 2043 | usb_audio_err(state->chip, "unit %d not found!\n", unitid); |
2035 | return -EINVAL; | 2044 | return -EINVAL; |
2036 | } | 2045 | } |
2037 | 2046 | ||
@@ -2061,7 +2070,8 @@ static int parse_audio_unit(struct mixer_build *state, int unitid) | |||
2061 | case UAC2_EXTENSION_UNIT_V2: | 2070 | case UAC2_EXTENSION_UNIT_V2: |
2062 | return parse_audio_extension_unit(state, unitid, p1); | 2071 | return parse_audio_extension_unit(state, unitid, p1); |
2063 | default: | 2072 | default: |
2064 | snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]); | 2073 | usb_audio_err(state->chip, |
2074 | "unit %u: unexpected type 0x%02x\n", unitid, p1[2]); | ||
2065 | return -EINVAL; | 2075 | return -EINVAL; |
2066 | } | 2076 | } |
2067 | } | 2077 | } |
@@ -2209,8 +2219,9 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer, | |||
2209 | __u8 channel = value & 0xff; | 2219 | __u8 channel = value & 0xff; |
2210 | 2220 | ||
2211 | if (channel >= MAX_CHANNELS) { | 2221 | if (channel >= MAX_CHANNELS) { |
2212 | snd_printk(KERN_DEBUG "%s(): bogus channel number %d\n", | 2222 | usb_audio_dbg(mixer->chip, |
2213 | __func__, channel); | 2223 | "%s(): bogus channel number %d\n", |
2224 | __func__, channel); | ||
2214 | return; | 2225 | return; |
2215 | } | 2226 | } |
2216 | 2227 | ||
@@ -2239,8 +2250,9 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer, | |||
2239 | break; | 2250 | break; |
2240 | 2251 | ||
2241 | default: | 2252 | default: |
2242 | snd_printk(KERN_DEBUG "unknown attribute %d in interrupt\n", | 2253 | usb_audio_dbg(mixer->chip, |
2243 | attribute); | 2254 | "unknown attribute %d in interrupt\n", |
2255 | attribute); | ||
2244 | break; | 2256 | break; |
2245 | } /* switch */ | 2257 | } /* switch */ |
2246 | } | 2258 | } |
@@ -2261,7 +2273,7 @@ static void snd_usb_mixer_interrupt(struct urb *urb) | |||
2261 | for (status = urb->transfer_buffer; | 2273 | for (status = urb->transfer_buffer; |
2262 | len >= sizeof(*status); | 2274 | len >= sizeof(*status); |
2263 | len -= sizeof(*status), status++) { | 2275 | len -= sizeof(*status), status++) { |
2264 | snd_printd(KERN_DEBUG "status interrupt: %02x %02x\n", | 2276 | dev_dbg(&urb->dev->dev, "status interrupt: %02x %02x\n", |
2265 | status->bStatusType, | 2277 | status->bStatusType, |
2266 | status->bOriginator); | 2278 | status->bOriginator); |
2267 | 2279 | ||
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index f4b12c216f1c..f119a41ed9a9 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c | |||
@@ -600,8 +600,8 @@ static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol, | |||
600 | up_read(&mixer->chip->shutdown_rwsem); | 600 | up_read(&mixer->chip->shutdown_rwsem); |
601 | 601 | ||
602 | if (ret < 0) { | 602 | if (ret < 0) { |
603 | snd_printk(KERN_ERR | 603 | dev_err(&dev->dev, |
604 | "unable to issue vendor read request (ret = %d)", ret); | 604 | "unable to issue vendor read request (ret = %d)", ret); |
605 | return ret; | 605 | return ret; |
606 | } | 606 | } |
607 | 607 | ||
@@ -631,8 +631,8 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol, | |||
631 | up_read(&mixer->chip->shutdown_rwsem); | 631 | up_read(&mixer->chip->shutdown_rwsem); |
632 | 632 | ||
633 | if (ret < 0) { | 633 | if (ret < 0) { |
634 | snd_printk(KERN_ERR | 634 | dev_err(&dev->dev, |
635 | "unable to issue vendor write request (ret = %d)", ret); | 635 | "unable to issue vendor write request (ret = %d)", ret); |
636 | return ret; | 636 | return ret; |
637 | } | 637 | } |
638 | 638 | ||
@@ -1699,7 +1699,7 @@ void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer, | |||
1699 | snd_usb_mixer_notify_id(mixer, mixer->rc_cfg->mute_mixer_id); | 1699 | snd_usb_mixer_notify_id(mixer, mixer->rc_cfg->mute_mixer_id); |
1700 | break; | 1700 | break; |
1701 | default: | 1701 | default: |
1702 | snd_printd(KERN_DEBUG "memory change in unknown unit %d\n", unitid); | 1702 | usb_audio_dbg(mixer->chip, "memory change in unknown unit %d\n", unitid); |
1703 | break; | 1703 | break; |
1704 | } | 1704 | } |
1705 | } | 1705 | } |
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index ca3256d6fde3..49de5c1284f6 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -166,8 +166,8 @@ static int init_pitch_v1(struct snd_usb_audio *chip, int iface, | |||
166 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, | 166 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, |
167 | UAC_EP_CS_ATTR_PITCH_CONTROL << 8, ep, | 167 | UAC_EP_CS_ATTR_PITCH_CONTROL << 8, ep, |
168 | data, sizeof(data))) < 0) { | 168 | data, sizeof(data))) < 0) { |
169 | snd_printk(KERN_ERR "%d:%d:%d: cannot set enable PITCH\n", | 169 | usb_audio_err(chip, "%d:%d: cannot set enable PITCH\n", |
170 | dev->devnum, iface, ep); | 170 | iface, ep); |
171 | return err; | 171 | return err; |
172 | } | 172 | } |
173 | 173 | ||
@@ -187,8 +187,8 @@ static int init_pitch_v2(struct snd_usb_audio *chip, int iface, | |||
187 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_OUT, | 187 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_OUT, |
188 | UAC2_EP_CS_PITCH << 8, 0, | 188 | UAC2_EP_CS_PITCH << 8, 0, |
189 | data, sizeof(data))) < 0) { | 189 | data, sizeof(data))) < 0) { |
190 | snd_printk(KERN_ERR "%d:%d:%d: cannot set enable PITCH (v2)\n", | 190 | usb_audio_err(chip, "%d:%d: cannot set enable PITCH (v2)\n", |
191 | dev->devnum, iface, fmt->altsetting); | 191 | iface, fmt->altsetting); |
192 | return err; | 192 | return err; |
193 | } | 193 | } |
194 | 194 | ||
@@ -226,7 +226,7 @@ static int start_endpoints(struct snd_usb_substream *subs, bool can_sleep) | |||
226 | if (!test_and_set_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags)) { | 226 | if (!test_and_set_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags)) { |
227 | struct snd_usb_endpoint *ep = subs->data_endpoint; | 227 | struct snd_usb_endpoint *ep = subs->data_endpoint; |
228 | 228 | ||
229 | snd_printdd(KERN_DEBUG "Starting data EP @%p\n", ep); | 229 | dev_dbg(&subs->dev->dev, "Starting data EP @%p\n", ep); |
230 | 230 | ||
231 | ep->data_subs = subs; | 231 | ep->data_subs = subs; |
232 | err = snd_usb_endpoint_start(ep, can_sleep); | 232 | err = snd_usb_endpoint_start(ep, can_sleep); |
@@ -247,16 +247,15 @@ static int start_endpoints(struct snd_usb_substream *subs, bool can_sleep) | |||
247 | subs->sync_endpoint->altsetting); | 247 | subs->sync_endpoint->altsetting); |
248 | if (err < 0) { | 248 | if (err < 0) { |
249 | clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags); | 249 | clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags); |
250 | snd_printk(KERN_ERR | 250 | dev_err(&subs->dev->dev, |
251 | "%d:%d:%d: cannot set interface (%d)\n", | 251 | "%d:%d: cannot set interface (%d)\n", |
252 | subs->dev->devnum, | ||
253 | subs->sync_endpoint->iface, | 252 | subs->sync_endpoint->iface, |
254 | subs->sync_endpoint->altsetting, err); | 253 | subs->sync_endpoint->altsetting, err); |
255 | return -EIO; | 254 | return -EIO; |
256 | } | 255 | } |
257 | } | 256 | } |
258 | 257 | ||
259 | snd_printdd(KERN_DEBUG "Starting sync EP @%p\n", ep); | 258 | dev_dbg(&subs->dev->dev, "Starting sync EP @%p\n", ep); |
260 | 259 | ||
261 | ep->sync_slave = subs->data_endpoint; | 260 | ep->sync_slave = subs->data_endpoint; |
262 | err = snd_usb_endpoint_start(ep, can_sleep); | 261 | err = snd_usb_endpoint_start(ep, can_sleep); |
@@ -410,8 +409,9 @@ static int set_sync_endpoint(struct snd_usb_substream *subs, | |||
410 | if ((get_endpoint(alts, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_ISOC || | 409 | if ((get_endpoint(alts, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_ISOC || |
411 | (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | 410 | (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && |
412 | get_endpoint(alts, 1)->bSynchAddress != 0)) { | 411 | get_endpoint(alts, 1)->bSynchAddress != 0)) { |
413 | snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. bmAttributes %02x, bLength %d, bSynchAddress %02x\n", | 412 | dev_err(&dev->dev, |
414 | dev->devnum, fmt->iface, fmt->altsetting, | 413 | "%d:%d : invalid sync pipe. bmAttributes %02x, bLength %d, bSynchAddress %02x\n", |
414 | fmt->iface, fmt->altsetting, | ||
415 | get_endpoint(alts, 1)->bmAttributes, | 415 | get_endpoint(alts, 1)->bmAttributes, |
416 | get_endpoint(alts, 1)->bLength, | 416 | get_endpoint(alts, 1)->bLength, |
417 | get_endpoint(alts, 1)->bSynchAddress); | 417 | get_endpoint(alts, 1)->bSynchAddress); |
@@ -421,8 +421,9 @@ static int set_sync_endpoint(struct snd_usb_substream *subs, | |||
421 | if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | 421 | if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && |
422 | ((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || | 422 | ((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || |
423 | (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) { | 423 | (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) { |
424 | snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. is_playback %d, ep %02x, bSynchAddress %02x\n", | 424 | dev_err(&dev->dev, |
425 | dev->devnum, fmt->iface, fmt->altsetting, | 425 | "%d:%d : invalid sync pipe. is_playback %d, ep %02x, bSynchAddress %02x\n", |
426 | fmt->iface, fmt->altsetting, | ||
426 | is_playback, ep, get_endpoint(alts, 0)->bSynchAddress); | 427 | is_playback, ep, get_endpoint(alts, 0)->bSynchAddress); |
427 | return -EINVAL; | 428 | return -EINVAL; |
428 | } | 429 | } |
@@ -469,8 +470,9 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) | |||
469 | if (subs->interface >= 0 && subs->interface != fmt->iface) { | 470 | if (subs->interface >= 0 && subs->interface != fmt->iface) { |
470 | err = usb_set_interface(subs->dev, subs->interface, 0); | 471 | err = usb_set_interface(subs->dev, subs->interface, 0); |
471 | if (err < 0) { | 472 | if (err < 0) { |
472 | snd_printk(KERN_ERR "%d:%d:%d: return to setting 0 failed (%d)\n", | 473 | dev_err(&dev->dev, |
473 | dev->devnum, fmt->iface, fmt->altsetting, err); | 474 | "%d:%d: return to setting 0 failed (%d)\n", |
475 | fmt->iface, fmt->altsetting, err); | ||
474 | return -EIO; | 476 | return -EIO; |
475 | } | 477 | } |
476 | subs->interface = -1; | 478 | subs->interface = -1; |
@@ -482,12 +484,13 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) | |||
482 | subs->altset_idx != fmt->altset_idx) { | 484 | subs->altset_idx != fmt->altset_idx) { |
483 | err = usb_set_interface(dev, fmt->iface, fmt->altsetting); | 485 | err = usb_set_interface(dev, fmt->iface, fmt->altsetting); |
484 | if (err < 0) { | 486 | if (err < 0) { |
485 | snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed (%d)\n", | 487 | dev_err(&dev->dev, |
486 | dev->devnum, fmt->iface, fmt->altsetting, err); | 488 | "%d:%d: usb_set_interface failed (%d)\n", |
489 | fmt->iface, fmt->altsetting, err); | ||
487 | return -EIO; | 490 | return -EIO; |
488 | } | 491 | } |
489 | snd_printdd(KERN_INFO "setting usb interface %d:%d\n", | 492 | dev_dbg(&dev->dev, "setting usb interface %d:%d\n", |
490 | fmt->iface, fmt->altsetting); | 493 | fmt->iface, fmt->altsetting); |
491 | subs->interface = fmt->iface; | 494 | subs->interface = fmt->iface; |
492 | subs->altset_idx = fmt->altset_idx; | 495 | subs->altset_idx = fmt->altset_idx; |
493 | 496 | ||
@@ -523,20 +526,23 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) | |||
523 | * - Requested PCM format is not supported. | 526 | * - Requested PCM format is not supported. |
524 | * - Requested sample rate is not supported. | 527 | * - Requested sample rate is not supported. |
525 | */ | 528 | */ |
526 | static int match_endpoint_audioformats(struct audioformat *fp, | 529 | static int match_endpoint_audioformats(struct snd_usb_substream *subs, |
527 | struct audioformat *match, int rate, | 530 | struct audioformat *fp, |
528 | snd_pcm_format_t pcm_format) | 531 | struct audioformat *match, int rate, |
532 | snd_pcm_format_t pcm_format) | ||
529 | { | 533 | { |
530 | int i; | 534 | int i; |
531 | int score = 0; | 535 | int score = 0; |
532 | 536 | ||
533 | if (fp->channels < 1) { | 537 | if (fp->channels < 1) { |
534 | snd_printdd("%s: (fmt @%p) no channels\n", __func__, fp); | 538 | dev_dbg(&subs->dev->dev, |
539 | "%s: (fmt @%p) no channels\n", __func__, fp); | ||
535 | return 0; | 540 | return 0; |
536 | } | 541 | } |
537 | 542 | ||
538 | if (!(fp->formats & pcm_format_to_bits(pcm_format))) { | 543 | if (!(fp->formats & pcm_format_to_bits(pcm_format))) { |
539 | snd_printdd("%s: (fmt @%p) no match for format %d\n", __func__, | 544 | dev_dbg(&subs->dev->dev, |
545 | "%s: (fmt @%p) no match for format %d\n", __func__, | ||
540 | fp, pcm_format); | 546 | fp, pcm_format); |
541 | return 0; | 547 | return 0; |
542 | } | 548 | } |
@@ -548,7 +554,8 @@ static int match_endpoint_audioformats(struct audioformat *fp, | |||
548 | } | 554 | } |
549 | } | 555 | } |
550 | if (!score) { | 556 | if (!score) { |
551 | snd_printdd("%s: (fmt @%p) no match for rate %d\n", __func__, | 557 | dev_dbg(&subs->dev->dev, |
558 | "%s: (fmt @%p) no match for rate %d\n", __func__, | ||
552 | fp, rate); | 559 | fp, rate); |
553 | return 0; | 560 | return 0; |
554 | } | 561 | } |
@@ -556,7 +563,8 @@ static int match_endpoint_audioformats(struct audioformat *fp, | |||
556 | if (fp->channels == match->channels) | 563 | if (fp->channels == match->channels) |
557 | score++; | 564 | score++; |
558 | 565 | ||
559 | snd_printdd("%s: (fmt @%p) score %d\n", __func__, fp, score); | 566 | dev_dbg(&subs->dev->dev, |
567 | "%s: (fmt @%p) score %d\n", __func__, fp, score); | ||
560 | 568 | ||
561 | return score; | 569 | return score; |
562 | } | 570 | } |
@@ -587,7 +595,8 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs) | |||
587 | 595 | ||
588 | /* Try to find the best matching audioformat. */ | 596 | /* Try to find the best matching audioformat. */ |
589 | list_for_each_entry(fp, &sync_subs->fmt_list, list) { | 597 | list_for_each_entry(fp, &sync_subs->fmt_list, list) { |
590 | int score = match_endpoint_audioformats(fp, subs->cur_audiofmt, | 598 | int score = match_endpoint_audioformats(subs, |
599 | fp, subs->cur_audiofmt, | ||
591 | subs->cur_rate, subs->pcm_format); | 600 | subs->cur_rate, subs->pcm_format); |
592 | 601 | ||
593 | if (score > cur_score) { | 602 | if (score > cur_score) { |
@@ -597,7 +606,8 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs) | |||
597 | } | 606 | } |
598 | 607 | ||
599 | if (unlikely(sync_fp == NULL)) { | 608 | if (unlikely(sync_fp == NULL)) { |
600 | snd_printk(KERN_ERR "%s: no valid audioformat for sync ep %x found\n", | 609 | dev_err(&subs->dev->dev, |
610 | "%s: no valid audioformat for sync ep %x found\n", | ||
601 | __func__, sync_subs->ep_num); | 611 | __func__, sync_subs->ep_num); |
602 | return -EINVAL; | 612 | return -EINVAL; |
603 | } | 613 | } |
@@ -609,7 +619,8 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs) | |||
609 | if (sync_fp->channels != subs->channels) { | 619 | if (sync_fp->channels != subs->channels) { |
610 | sync_period_bytes = (subs->period_bytes / subs->channels) * | 620 | sync_period_bytes = (subs->period_bytes / subs->channels) * |
611 | sync_fp->channels; | 621 | sync_fp->channels; |
612 | snd_printdd("%s: adjusted sync ep period bytes (%d -> %d)\n", | 622 | dev_dbg(&subs->dev->dev, |
623 | "%s: adjusted sync ep period bytes (%d -> %d)\n", | ||
613 | __func__, subs->period_bytes, sync_period_bytes); | 624 | __func__, subs->period_bytes, sync_period_bytes); |
614 | } | 625 | } |
615 | 626 | ||
@@ -685,7 +696,8 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, | |||
685 | 696 | ||
686 | fmt = find_format(subs); | 697 | fmt = find_format(subs); |
687 | if (!fmt) { | 698 | if (!fmt) { |
688 | snd_printd(KERN_DEBUG "cannot set format: format = %#x, rate = %d, channels = %d\n", | 699 | dev_dbg(&subs->dev->dev, |
700 | "cannot set format: format = %#x, rate = %d, channels = %d\n", | ||
689 | subs->pcm_format, subs->cur_rate, subs->channels); | 701 | subs->pcm_format, subs->cur_rate, subs->channels); |
690 | return -EINVAL; | 702 | return -EINVAL; |
691 | } | 703 | } |
@@ -742,7 +754,7 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) | |||
742 | int ret; | 754 | int ret; |
743 | 755 | ||
744 | if (! subs->cur_audiofmt) { | 756 | if (! subs->cur_audiofmt) { |
745 | snd_printk(KERN_ERR "usbaudio: no format is specified!\n"); | 757 | dev_err(&subs->dev->dev, "no format is specified!\n"); |
746 | return -ENXIO; | 758 | return -ENXIO; |
747 | } | 759 | } |
748 | 760 | ||
@@ -1235,7 +1247,8 @@ static void retire_capture_urb(struct snd_usb_substream *subs, | |||
1235 | for (i = 0; i < urb->number_of_packets; i++) { | 1247 | for (i = 0; i < urb->number_of_packets; i++) { |
1236 | cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset + subs->pkt_offset_adj; | 1248 | cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset + subs->pkt_offset_adj; |
1237 | if (urb->iso_frame_desc[i].status && printk_ratelimit()) { | 1249 | if (urb->iso_frame_desc[i].status && printk_ratelimit()) { |
1238 | snd_printdd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status); | 1250 | dev_dbg(&subs->dev->dev, "frame %d active: %d\n", |
1251 | i, urb->iso_frame_desc[i].status); | ||
1239 | // continue; | 1252 | // continue; |
1240 | } | 1253 | } |
1241 | bytes = urb->iso_frame_desc[i].actual_length; | 1254 | bytes = urb->iso_frame_desc[i].actual_length; |
@@ -1245,7 +1258,8 @@ static void retire_capture_urb(struct snd_usb_substream *subs, | |||
1245 | if (bytes % (runtime->sample_bits >> 3) != 0) { | 1258 | if (bytes % (runtime->sample_bits >> 3) != 0) { |
1246 | int oldbytes = bytes; | 1259 | int oldbytes = bytes; |
1247 | bytes = frames * stride; | 1260 | bytes = frames * stride; |
1248 | snd_printdd(KERN_ERR "Corrected urb data len. %d->%d\n", | 1261 | dev_warn(&subs->dev->dev, |
1262 | "Corrected urb data len. %d->%d\n", | ||
1249 | oldbytes, bytes); | 1263 | oldbytes, bytes); |
1250 | } | 1264 | } |
1251 | /* update the current pointer */ | 1265 | /* update the current pointer */ |
@@ -1488,7 +1502,8 @@ static void retire_playback_urb(struct snd_usb_substream *subs, | |||
1488 | * on two reads of a counter updated every ms. | 1502 | * on two reads of a counter updated every ms. |
1489 | */ | 1503 | */ |
1490 | if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) | 1504 | if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) |
1491 | snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n", | 1505 | dev_dbg(&subs->dev->dev, |
1506 | "delay: estimated %d, actual %d\n", | ||
1492 | est_delay, subs->last_delay); | 1507 | est_delay, subs->last_delay); |
1493 | 1508 | ||
1494 | if (!subs->running) { | 1509 | if (!subs->running) { |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 89730707614c..7c57f2268dd7 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -110,7 +110,7 @@ static int create_standard_audio_quirk(struct snd_usb_audio *chip, | |||
110 | altsd = get_iface_desc(alts); | 110 | altsd = get_iface_desc(alts); |
111 | err = snd_usb_parse_audio_interface(chip, altsd->bInterfaceNumber); | 111 | err = snd_usb_parse_audio_interface(chip, altsd->bInterfaceNumber); |
112 | if (err < 0) { | 112 | if (err < 0) { |
113 | snd_printk(KERN_ERR "cannot setup if %d: error %d\n", | 113 | usb_audio_err(chip, "cannot setup if %d: error %d\n", |
114 | altsd->bInterfaceNumber, err); | 114 | altsd->bInterfaceNumber, err); |
115 | return err; | 115 | return err; |
116 | } | 116 | } |
@@ -135,7 +135,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, | |||
135 | 135 | ||
136 | fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL); | 136 | fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL); |
137 | if (!fp) { | 137 | if (!fp) { |
138 | snd_printk(KERN_ERR "cannot memdup\n"); | 138 | usb_audio_err(chip, "cannot memdup\n"); |
139 | return -ENOMEM; | 139 | return -ENOMEM; |
140 | } | 140 | } |
141 | if (fp->nr_rates > MAX_NR_RATES) { | 141 | if (fp->nr_rates > MAX_NR_RATES) { |
@@ -464,7 +464,7 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip, | |||
464 | fp->rate_max = fp->rate_min = 96000; | 464 | fp->rate_max = fp->rate_min = 96000; |
465 | break; | 465 | break; |
466 | default: | 466 | default: |
467 | snd_printk(KERN_ERR "unknown sample rate\n"); | 467 | usb_audio_err(chip, "unknown sample rate\n"); |
468 | kfree(fp); | 468 | kfree(fp); |
469 | return -ENXIO; | 469 | return -ENXIO; |
470 | } | 470 | } |
@@ -536,7 +536,7 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip, | |||
536 | if (quirk->type < QUIRK_TYPE_COUNT) { | 536 | if (quirk->type < QUIRK_TYPE_COUNT) { |
537 | return quirk_funcs[quirk->type](chip, iface, driver, quirk); | 537 | return quirk_funcs[quirk->type](chip, iface, driver, quirk); |
538 | } else { | 538 | } else { |
539 | snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type); | 539 | usb_audio_err(chip, "invalid quirk type %d\n", quirk->type); |
540 | return -ENXIO; | 540 | return -ENXIO; |
541 | } | 541 | } |
542 | } | 542 | } |
@@ -555,18 +555,21 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac | |||
555 | 555 | ||
556 | if (le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_OLD || | 556 | if (le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_OLD || |
557 | le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_NEW) { | 557 | le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_NEW) { |
558 | snd_printdd("sending Extigy boot sequence...\n"); | 558 | dev_dbg(&dev->dev, "sending Extigy boot sequence...\n"); |
559 | /* Send message to force it to reconnect with full interface. */ | 559 | /* Send message to force it to reconnect with full interface. */ |
560 | err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0), | 560 | err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0), |
561 | 0x10, 0x43, 0x0001, 0x000a, NULL, 0); | 561 | 0x10, 0x43, 0x0001, 0x000a, NULL, 0); |
562 | if (err < 0) snd_printdd("error sending boot message: %d\n", err); | 562 | if (err < 0) |
563 | dev_dbg(&dev->dev, "error sending boot message: %d\n", err); | ||
563 | err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, | 564 | err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, |
564 | &dev->descriptor, sizeof(dev->descriptor)); | 565 | &dev->descriptor, sizeof(dev->descriptor)); |
565 | config = dev->actconfig; | 566 | config = dev->actconfig; |
566 | if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err); | 567 | if (err < 0) |
568 | dev_dbg(&dev->dev, "error usb_get_descriptor: %d\n", err); | ||
567 | err = usb_reset_configuration(dev); | 569 | err = usb_reset_configuration(dev); |
568 | if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err); | 570 | if (err < 0) |
569 | snd_printdd("extigy_boot: new boot length = %d\n", | 571 | dev_dbg(&dev->dev, "error usb_reset_configuration: %d\n", err); |
572 | dev_dbg(&dev->dev, "extigy_boot: new boot length = %d\n", | ||
570 | le16_to_cpu(get_cfg_desc(config)->wTotalLength)); | 573 | le16_to_cpu(get_cfg_desc(config)->wTotalLength)); |
571 | return -ENODEV; /* quit this anyway */ | 574 | return -ENODEV; /* quit this anyway */ |
572 | } | 575 | } |
@@ -594,7 +597,7 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev) | |||
594 | int err; | 597 | int err; |
595 | 598 | ||
596 | if (dev->actconfig->desc.bConfigurationValue == 1) { | 599 | if (dev->actconfig->desc.bConfigurationValue == 1) { |
597 | snd_printk(KERN_INFO "usb-audio: " | 600 | dev_info(&dev->dev, |
598 | "Fast Track Pro switching to config #2\n"); | 601 | "Fast Track Pro switching to config #2\n"); |
599 | /* This function has to be available by the usb core module. | 602 | /* This function has to be available by the usb core module. |
600 | * if it is not avialable the boot quirk has to be left out | 603 | * if it is not avialable the boot quirk has to be left out |
@@ -603,14 +606,15 @@ static int snd_usb_fasttrackpro_boot_quirk(struct usb_device *dev) | |||
603 | */ | 606 | */ |
604 | err = usb_driver_set_configuration(dev, 2); | 607 | err = usb_driver_set_configuration(dev, 2); |
605 | if (err < 0) | 608 | if (err < 0) |
606 | snd_printdd("error usb_driver_set_configuration: %d\n", | 609 | dev_dbg(&dev->dev, |
607 | err); | 610 | "error usb_driver_set_configuration: %d\n", |
611 | err); | ||
608 | /* Always return an error, so that we stop creating a device | 612 | /* Always return an error, so that we stop creating a device |
609 | that will just be destroyed and recreated with a new | 613 | that will just be destroyed and recreated with a new |
610 | configuration */ | 614 | configuration */ |
611 | return -ENODEV; | 615 | return -ENODEV; |
612 | } else | 616 | } else |
613 | snd_printk(KERN_INFO "usb-audio: Fast Track Pro config OK\n"); | 617 | dev_info(&dev->dev, "Fast Track Pro config OK\n"); |
614 | 618 | ||
615 | return 0; | 619 | return 0; |
616 | } | 620 | } |
@@ -779,11 +783,11 @@ static int snd_usb_mbox2_boot_quirk(struct usb_device *dev) | |||
779 | fwsize = le16_to_cpu(get_cfg_desc(config)->wTotalLength); | 783 | fwsize = le16_to_cpu(get_cfg_desc(config)->wTotalLength); |
780 | 784 | ||
781 | if (fwsize != MBOX2_FIRMWARE_SIZE) { | 785 | if (fwsize != MBOX2_FIRMWARE_SIZE) { |
782 | snd_printk(KERN_ERR "usb-audio: Invalid firmware size=%d.\n", fwsize); | 786 | dev_err(&dev->dev, "Invalid firmware size=%d.\n", fwsize); |
783 | return -ENODEV; | 787 | return -ENODEV; |
784 | } | 788 | } |
785 | 789 | ||
786 | snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n"); | 790 | dev_dbg(&dev->dev, "Sending Digidesign Mbox 2 boot sequence...\n"); |
787 | 791 | ||
788 | count = 0; | 792 | count = 0; |
789 | bootresponse[0] = MBOX2_BOOT_LOADING; | 793 | bootresponse[0] = MBOX2_BOOT_LOADING; |
@@ -794,32 +798,32 @@ static int snd_usb_mbox2_boot_quirk(struct usb_device *dev) | |||
794 | 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); | 798 | 0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012); |
795 | if (bootresponse[0] == MBOX2_BOOT_READY) | 799 | if (bootresponse[0] == MBOX2_BOOT_READY) |
796 | break; | 800 | break; |
797 | snd_printd("usb-audio: device not ready, resending boot sequence...\n"); | 801 | dev_dbg(&dev->dev, "device not ready, resending boot sequence...\n"); |
798 | count++; | 802 | count++; |
799 | } | 803 | } |
800 | 804 | ||
801 | if (bootresponse[0] != MBOX2_BOOT_READY) { | 805 | if (bootresponse[0] != MBOX2_BOOT_READY) { |
802 | snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]); | 806 | dev_err(&dev->dev, "Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]); |
803 | return -ENODEV; | 807 | return -ENODEV; |
804 | } | 808 | } |
805 | 809 | ||
806 | snd_printdd("usb-audio: device initialised!\n"); | 810 | dev_dbg(&dev->dev, "device initialised!\n"); |
807 | 811 | ||
808 | err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, | 812 | err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, |
809 | &dev->descriptor, sizeof(dev->descriptor)); | 813 | &dev->descriptor, sizeof(dev->descriptor)); |
810 | config = dev->actconfig; | 814 | config = dev->actconfig; |
811 | if (err < 0) | 815 | if (err < 0) |
812 | snd_printd("error usb_get_descriptor: %d\n", err); | 816 | dev_dbg(&dev->dev, "error usb_get_descriptor: %d\n", err); |
813 | 817 | ||
814 | err = usb_reset_configuration(dev); | 818 | err = usb_reset_configuration(dev); |
815 | if (err < 0) | 819 | if (err < 0) |
816 | snd_printd("error usb_reset_configuration: %d\n", err); | 820 | dev_dbg(&dev->dev, "error usb_reset_configuration: %d\n", err); |
817 | snd_printdd("mbox2_boot: new boot length = %d\n", | 821 | dev_dbg(&dev->dev, "mbox2_boot: new boot length = %d\n", |
818 | le16_to_cpu(get_cfg_desc(config)->wTotalLength)); | 822 | le16_to_cpu(get_cfg_desc(config)->wTotalLength)); |
819 | 823 | ||
820 | mbox2_setup_48_24_magic(dev); | 824 | mbox2_setup_48_24_magic(dev); |
821 | 825 | ||
822 | snd_printk(KERN_INFO "usb-audio: Digidesign Mbox 2: 24bit 48kHz"); | 826 | dev_info(&dev->dev, "Digidesign Mbox 2: 24bit 48kHz"); |
823 | 827 | ||
824 | return 0; /* Successful boot */ | 828 | return 0; /* Successful boot */ |
825 | } | 829 | } |
@@ -865,7 +869,7 @@ static int quattro_skip_setting_quirk(struct snd_usb_audio *chip, | |||
865 | return 1; /* skip this altsetting */ | 869 | return 1; /* skip this altsetting */ |
866 | } | 870 | } |
867 | } | 871 | } |
868 | snd_printdd(KERN_INFO | 872 | usb_audio_dbg(chip, |
869 | "using altsetting %d for interface %d config %d\n", | 873 | "using altsetting %d for interface %d config %d\n", |
870 | altno, iface, chip->setup); | 874 | altno, iface, chip->setup); |
871 | return 0; /* keep this altsetting */ | 875 | return 0; /* keep this altsetting */ |
@@ -932,7 +936,7 @@ static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip, | |||
932 | return 1; | 936 | return 1; |
933 | } | 937 | } |
934 | 938 | ||
935 | snd_printdd(KERN_INFO | 939 | usb_audio_dbg(chip, |
936 | "using altsetting %d for interface %d config %d\n", | 940 | "using altsetting %d for interface %d config %d\n", |
937 | altno, iface, chip->setup); | 941 | altno, iface, chip->setup); |
938 | return 0; /* keep this altsetting */ | 942 | return 0; /* keep this altsetting */ |
diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 2fb71be5e100..310a3822d2b7 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c | |||
@@ -411,10 +411,9 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip, | |||
411 | 411 | ||
412 | if (!csep || csep->bLength < 7 || | 412 | if (!csep || csep->bLength < 7 || |
413 | csep->bDescriptorSubtype != UAC_EP_GENERAL) { | 413 | csep->bDescriptorSubtype != UAC_EP_GENERAL) { |
414 | snd_printk(KERN_WARNING "%d:%u:%d : no or invalid" | 414 | usb_audio_warn(chip, |
415 | " class specific endpoint descriptor\n", | 415 | "%u:%d : no or invalid class specific endpoint descriptor\n", |
416 | chip->dev->devnum, iface_no, | 416 | iface_no, altsd->bAlternateSetting); |
417 | altsd->bAlternateSetting); | ||
418 | return 0; | 417 | return 0; |
419 | } | 418 | } |
420 | 419 | ||
@@ -533,8 +532,8 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
533 | /* get audio formats */ | 532 | /* get audio formats */ |
534 | switch (protocol) { | 533 | switch (protocol) { |
535 | default: | 534 | default: |
536 | snd_printdd(KERN_WARNING "%d:%u:%d: unknown interface protocol %#02x, assuming v1\n", | 535 | dev_dbg(&dev->dev, "%u:%d: unknown interface protocol %#02x, assuming v1\n", |
537 | dev->devnum, iface_no, altno, protocol); | 536 | iface_no, altno, protocol); |
538 | protocol = UAC_VERSION_1; | 537 | protocol = UAC_VERSION_1; |
539 | /* fall through */ | 538 | /* fall through */ |
540 | 539 | ||
@@ -544,14 +543,16 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
544 | struct uac_input_terminal_descriptor *iterm; | 543 | struct uac_input_terminal_descriptor *iterm; |
545 | 544 | ||
546 | if (!as) { | 545 | if (!as) { |
547 | snd_printk(KERN_ERR "%d:%u:%d : UAC_AS_GENERAL descriptor not found\n", | 546 | dev_err(&dev->dev, |
548 | dev->devnum, iface_no, altno); | 547 | "%u:%d : UAC_AS_GENERAL descriptor not found\n", |
548 | iface_no, altno); | ||
549 | continue; | 549 | continue; |
550 | } | 550 | } |
551 | 551 | ||
552 | if (as->bLength < sizeof(*as)) { | 552 | if (as->bLength < sizeof(*as)) { |
553 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_AS_GENERAL desc\n", | 553 | dev_err(&dev->dev, |
554 | dev->devnum, iface_no, altno); | 554 | "%u:%d : invalid UAC_AS_GENERAL desc\n", |
555 | iface_no, altno); | ||
555 | continue; | 556 | continue; |
556 | } | 557 | } |
557 | 558 | ||
@@ -574,14 +575,16 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
574 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); | 575 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); |
575 | 576 | ||
576 | if (!as) { | 577 | if (!as) { |
577 | snd_printk(KERN_ERR "%d:%u:%d : UAC_AS_GENERAL descriptor not found\n", | 578 | dev_err(&dev->dev, |
578 | dev->devnum, iface_no, altno); | 579 | "%u:%d : UAC_AS_GENERAL descriptor not found\n", |
580 | iface_no, altno); | ||
579 | continue; | 581 | continue; |
580 | } | 582 | } |
581 | 583 | ||
582 | if (as->bLength < sizeof(*as)) { | 584 | if (as->bLength < sizeof(*as)) { |
583 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_AS_GENERAL desc\n", | 585 | dev_err(&dev->dev, |
584 | dev->devnum, iface_no, altno); | 586 | "%u:%d : invalid UAC_AS_GENERAL desc\n", |
587 | iface_no, altno); | ||
585 | continue; | 588 | continue; |
586 | } | 589 | } |
587 | 590 | ||
@@ -607,8 +610,9 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
607 | break; | 610 | break; |
608 | } | 611 | } |
609 | 612 | ||
610 | snd_printk(KERN_ERR "%d:%u:%d : bogus bTerminalLink %d\n", | 613 | dev_err(&dev->dev, |
611 | dev->devnum, iface_no, altno, as->bTerminalLink); | 614 | "%u:%d : bogus bTerminalLink %d\n", |
615 | iface_no, altno, as->bTerminalLink); | ||
612 | continue; | 616 | continue; |
613 | } | 617 | } |
614 | } | 618 | } |
@@ -616,14 +620,16 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
616 | /* get format type */ | 620 | /* get format type */ |
617 | fmt = snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_FORMAT_TYPE); | 621 | fmt = snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_FORMAT_TYPE); |
618 | if (!fmt) { | 622 | if (!fmt) { |
619 | snd_printk(KERN_ERR "%d:%u:%d : no UAC_FORMAT_TYPE desc\n", | 623 | dev_err(&dev->dev, |
620 | dev->devnum, iface_no, altno); | 624 | "%u:%d : no UAC_FORMAT_TYPE desc\n", |
625 | iface_no, altno); | ||
621 | continue; | 626 | continue; |
622 | } | 627 | } |
623 | if (((protocol == UAC_VERSION_1) && (fmt->bLength < 8)) || | 628 | if (((protocol == UAC_VERSION_1) && (fmt->bLength < 8)) || |
624 | ((protocol == UAC_VERSION_2) && (fmt->bLength < 6))) { | 629 | ((protocol == UAC_VERSION_2) && (fmt->bLength < 6))) { |
625 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_FORMAT_TYPE desc\n", | 630 | dev_err(&dev->dev, |
626 | dev->devnum, iface_no, altno); | 631 | "%u:%d : invalid UAC_FORMAT_TYPE desc\n", |
632 | iface_no, altno); | ||
627 | continue; | 633 | continue; |
628 | } | 634 | } |
629 | 635 | ||
@@ -644,7 +650,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
644 | 650 | ||
645 | fp = kzalloc(sizeof(*fp), GFP_KERNEL); | 651 | fp = kzalloc(sizeof(*fp), GFP_KERNEL); |
646 | if (! fp) { | 652 | if (! fp) { |
647 | snd_printk(KERN_ERR "cannot malloc\n"); | 653 | dev_err(&dev->dev, "cannot malloc\n"); |
648 | return -ENOMEM; | 654 | return -ENOMEM; |
649 | } | 655 | } |
650 | 656 | ||
@@ -707,7 +713,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) | |||
707 | chconfig = 0; | 713 | chconfig = 0; |
708 | fp->chmap = convert_chmap(fp->channels, chconfig, protocol); | 714 | fp->chmap = convert_chmap(fp->channels, chconfig, protocol); |
709 | 715 | ||
710 | snd_printdd(KERN_INFO "%d:%u:%d: add audio endpoint %#x\n", dev->devnum, iface_no, altno, fp->endpoint); | 716 | dev_dbg(&dev->dev, "%u:%d: add audio endpoint %#x\n", iface_no, altno, fp->endpoint); |
711 | err = snd_usb_add_audio_stream(chip, stream, fp); | 717 | err = snd_usb_add_audio_stream(chip, stream, fp); |
712 | if (err < 0) { | 718 | if (err < 0) { |
713 | kfree(fp->rate_table); | 719 | kfree(fp->rate_table); |
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 5d2fe0530745..25c4c7e217de 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -60,6 +60,15 @@ struct snd_usb_audio { | |||
60 | struct usb_host_interface *ctrl_intf; /* the audio control interface */ | 60 | struct usb_host_interface *ctrl_intf; /* the audio control interface */ |
61 | }; | 61 | }; |
62 | 62 | ||
63 | #define usb_audio_err(chip, fmt, args...) \ | ||
64 | dev_err(&(chip)->dev->dev, fmt, ##args) | ||
65 | #define usb_audio_warn(chip, fmt, args...) \ | ||
66 | dev_warn(&(chip)->dev->dev, fmt, ##args) | ||
67 | #define usb_audio_info(chip, fmt, args...) \ | ||
68 | dev_info(&(chip)->dev->dev, fmt, ##args) | ||
69 | #define usb_audio_dbg(chip, fmt, args...) \ | ||
70 | dev_dbg(&(chip)->dev->dev, fmt, ##args) | ||
71 | |||
63 | /* | 72 | /* |
64 | * Information about devices with broken descriptors | 73 | * Information about devices with broken descriptors |
65 | */ | 74 | */ |