diff options
author | Fabien Parent <fparent@baylibre.com> | 2016-02-23 18:46:10 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-02-24 17:21:58 -0800 |
commit | e70055b3fb62c7ff1c23d8d2076e4c5b4caf39a1 (patch) | |
tree | 406f8f970f49767e9798406191f3b0eb4d92cc35 | |
parent | 48a173030545472e4d0aa1b432b389ef59bf5cf0 (diff) |
greybus: es2: implement the fct flow control requests
Implement the control requests enabling/disabling the flow of FCT on APBA.
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-rw-r--r-- | drivers/staging/greybus/es2.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index 5ade51e83745..e920563351ff 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -574,6 +574,41 @@ static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id) return retval; } +static int fct_flow_enable(struct gb_host_device *hd, u16 cport_id) +{ + int retval; + struct es2_ap_dev *es2 = hd_to_es2(hd); + struct usb_device *udev = es2->usb_dev; + + retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), + GB_APB_REQUEST_FCT_FLOW_EN, + USB_DIR_OUT | USB_TYPE_VENDOR | + USB_RECIP_INTERFACE, cport_id, 0, NULL, + 0, ES2_TIMEOUT); + if (retval < 0) + dev_err(&udev->dev, "Cannot enable FCT flow for cport %u: %d\n", + cport_id, retval); + return retval; +} + +static int fct_flow_disable(struct gb_host_device *hd, u16 cport_id) +{ + int retval; + struct es2_ap_dev *es2 = hd_to_es2(hd); + struct usb_device *udev = es2->usb_dev; + + retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), + GB_APB_REQUEST_FCT_FLOW_DIS, + USB_DIR_OUT | USB_TYPE_VENDOR | + USB_RECIP_INTERFACE, cport_id, 0, NULL, + 0, ES2_TIMEOUT); + if (retval < 0) + dev_err(&udev->dev, + "Cannot disable FCT flow for cport %u: %d\n", + cport_id, retval); + return retval; +} + static struct gb_hd_driver es2_driver = { .hd_priv_size = sizeof(struct es2_ap_dev), .message_send = message_send, @@ -582,6 +617,8 @@ static struct gb_hd_driver es2_driver = { .latency_tag_enable = latency_tag_enable, .latency_tag_disable = latency_tag_disable, .output = output, + .fct_flow_enable = fct_flow_enable, + .fct_flow_disable = fct_flow_disable, }; /* Common function to report consistent warnings based on URB status */ |