aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/f_acm.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-08 06:47:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-08 06:47:31 -0400
commit463311960e9312245418af98dce8c0161fd6b827 (patch)
tree9529b6063b10f1b85408ef4757d1917dfdb8292d /drivers/usb/gadget/function/f_acm.c
parent87d7bcee4f5973a593b0d50134364cfe5652ff33 (diff)
parent4ed9a3d455558406cad83d38764ee659de25851c (diff)
Merge tag 'usb-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH: "Here's the big USB patchset for 3.18-rc1. Also in here is the PHY tree, as it seems to fit well with the USB tree for various reasons... Anyway, lots of little changes in here, all over the place, full details in the changelog All have been in the linux-next tree for a while with no issues" * tag 'usb-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (244 commits) USB: host: st: fix typo 'CONFIG_USB_EHCI_HCD_ST' uas: Reduce number of function arguments for uas_alloc_foo functions xhci: Allow xHCI drivers to be built as separate modules xhci: Export symbols used by host-controller drivers xhci: Check for XHCI_COMP_MODE_QUIRK when disabling D3cold xhci: Introduce xhci_init_driver() usb: hcd: add generic PHY support usb: rename phy to usb_phy in HCD usb: gadget: uvc: fix up uvcg_v4l2_get_unmapped_area typo USB: host: st: fix ehci/ohci driver selection usb: host: ehci-exynos: Remove unnecessary usb-phy support usb: core: return -ENOTSUPP for all targeted hosts USB: Remove .owner field for driver usb: core: log higher level message on malformed LANGID descriptor usb: Add LED triggers for USB activity usb: Rename usb-common.c usb: gadget: Refactor request completion usb: gadget: Introduce usb_gadget_giveback_request() usb: dwc2/gadget: move phy bus legth initialization phy: remove .owner field for drivers using module_platform_driver ...
Diffstat (limited to 'drivers/usb/gadget/function/f_acm.c')
-rw-r--r--drivers/usb/gadget/function/f_acm.c49
1 files changed, 28 insertions, 21 deletions
diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c
index ab1065afbbd0..6da4685490ef 100644
--- a/drivers/usb/gadget/function/f_acm.c
+++ b/drivers/usb/gadget/function/f_acm.c
@@ -313,15 +313,15 @@ static void acm_complete_set_line_coding(struct usb_ep *ep,
313 struct usb_composite_dev *cdev = acm->port.func.config->cdev; 313 struct usb_composite_dev *cdev = acm->port.func.config->cdev;
314 314
315 if (req->status != 0) { 315 if (req->status != 0) {
316 DBG(cdev, "acm ttyGS%d completion, err %d\n", 316 dev_dbg(&cdev->gadget->dev, "acm ttyGS%d completion, err %d\n",
317 acm->port_num, req->status); 317 acm->port_num, req->status);
318 return; 318 return;
319 } 319 }
320 320
321 /* normal completion */ 321 /* normal completion */
322 if (req->actual != sizeof(acm->port_line_coding)) { 322 if (req->actual != sizeof(acm->port_line_coding)) {
323 DBG(cdev, "acm ttyGS%d short resp, len %d\n", 323 dev_dbg(&cdev->gadget->dev, "acm ttyGS%d short resp, len %d\n",
324 acm->port_num, req->actual); 324 acm->port_num, req->actual);
325 usb_ep_set_halt(ep); 325 usb_ep_set_halt(ep);
326 } else { 326 } else {
327 struct usb_cdc_line_coding *value = req->buf; 327 struct usb_cdc_line_coding *value = req->buf;
@@ -397,14 +397,16 @@ static int acm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
397 397
398 default: 398 default:
399invalid: 399invalid:
400 VDBG(cdev, "invalid control req%02x.%02x v%04x i%04x l%d\n", 400 dev_vdbg(&cdev->gadget->dev,
401 ctrl->bRequestType, ctrl->bRequest, 401 "invalid control req%02x.%02x v%04x i%04x l%d\n",
402 w_value, w_index, w_length); 402 ctrl->bRequestType, ctrl->bRequest,
403 w_value, w_index, w_length);
403 } 404 }
404 405
405 /* respond with data transfer or status phase? */ 406 /* respond with data transfer or status phase? */
406 if (value >= 0) { 407 if (value >= 0) {
407 DBG(cdev, "acm ttyGS%d req%02x.%02x v%04x i%04x l%d\n", 408 dev_dbg(&cdev->gadget->dev,
409 "acm ttyGS%d req%02x.%02x v%04x i%04x l%d\n",
408 acm->port_num, ctrl->bRequestType, ctrl->bRequest, 410 acm->port_num, ctrl->bRequestType, ctrl->bRequest,
409 w_value, w_index, w_length); 411 w_value, w_index, w_length);
410 req->zero = 0; 412 req->zero = 0;
@@ -428,10 +430,12 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
428 430
429 if (intf == acm->ctrl_id) { 431 if (intf == acm->ctrl_id) {
430 if (acm->notify->driver_data) { 432 if (acm->notify->driver_data) {
431 VDBG(cdev, "reset acm control interface %d\n", intf); 433 dev_vdbg(&cdev->gadget->dev,
434 "reset acm control interface %d\n", intf);
432 usb_ep_disable(acm->notify); 435 usb_ep_disable(acm->notify);
433 } else { 436 } else {
434 VDBG(cdev, "init acm ctrl interface %d\n", intf); 437 dev_vdbg(&cdev->gadget->dev,
438 "init acm ctrl interface %d\n", intf);
435 if (config_ep_by_speed(cdev->gadget, f, acm->notify)) 439 if (config_ep_by_speed(cdev->gadget, f, acm->notify))
436 return -EINVAL; 440 return -EINVAL;
437 } 441 }
@@ -440,11 +444,13 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
440 444
441 } else if (intf == acm->data_id) { 445 } else if (intf == acm->data_id) {
442 if (acm->port.in->driver_data) { 446 if (acm->port.in->driver_data) {
443 DBG(cdev, "reset acm ttyGS%d\n", acm->port_num); 447 dev_dbg(&cdev->gadget->dev,
448 "reset acm ttyGS%d\n", acm->port_num);
444 gserial_disconnect(&acm->port); 449 gserial_disconnect(&acm->port);
445 } 450 }
446 if (!acm->port.in->desc || !acm->port.out->desc) { 451 if (!acm->port.in->desc || !acm->port.out->desc) {
447 DBG(cdev, "activate acm ttyGS%d\n", acm->port_num); 452 dev_dbg(&cdev->gadget->dev,
453 "activate acm ttyGS%d\n", acm->port_num);
448 if (config_ep_by_speed(cdev->gadget, f, 454 if (config_ep_by_speed(cdev->gadget, f,
449 acm->port.in) || 455 acm->port.in) ||
450 config_ep_by_speed(cdev->gadget, f, 456 config_ep_by_speed(cdev->gadget, f,
@@ -467,7 +473,7 @@ static void acm_disable(struct usb_function *f)
467 struct f_acm *acm = func_to_acm(f); 473 struct f_acm *acm = func_to_acm(f);
468 struct usb_composite_dev *cdev = f->config->cdev; 474 struct usb_composite_dev *cdev = f->config->cdev;
469 475
470 DBG(cdev, "acm ttyGS%d deactivated\n", acm->port_num); 476 dev_dbg(&cdev->gadget->dev, "acm ttyGS%d deactivated\n", acm->port_num);
471 gserial_disconnect(&acm->port); 477 gserial_disconnect(&acm->port);
472 usb_ep_disable(acm->notify); 478 usb_ep_disable(acm->notify);
473 acm->notify->driver_data = NULL; 479 acm->notify->driver_data = NULL;
@@ -537,8 +543,8 @@ static int acm_notify_serial_state(struct f_acm *acm)
537 543
538 spin_lock(&acm->lock); 544 spin_lock(&acm->lock);
539 if (acm->notify_req) { 545 if (acm->notify_req) {
540 DBG(cdev, "acm ttyGS%d serial state %04x\n", 546 dev_dbg(&cdev->gadget->dev, "acm ttyGS%d serial state %04x\n",
541 acm->port_num, acm->serial_state); 547 acm->port_num, acm->serial_state);
542 status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE, 548 status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE,
543 0, &acm->serial_state, sizeof(acm->serial_state)); 549 0, &acm->serial_state, sizeof(acm->serial_state));
544 } else { 550 } else {
@@ -691,12 +697,13 @@ acm_bind(struct usb_configuration *c, struct usb_function *f)
691 if (status) 697 if (status)
692 goto fail; 698 goto fail;
693 699
694 DBG(cdev, "acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n", 700 dev_dbg(&cdev->gadget->dev,
695 acm->port_num, 701 "acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n",
696 gadget_is_superspeed(c->cdev->gadget) ? "super" : 702 acm->port_num,
697 gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", 703 gadget_is_superspeed(c->cdev->gadget) ? "super" :
698 acm->port.in->name, acm->port.out->name, 704 gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
699 acm->notify->name); 705 acm->port.in->name, acm->port.out->name,
706 acm->notify->name);
700 return 0; 707 return 0;
701 708
702fail: 709fail: