diff options
Diffstat (limited to 'drivers/staging/greybus/es2.c')
-rw-r--r-- | drivers/staging/greybus/es2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index 8803bc9..1817c35 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -765,6 +765,24 @@ static int es2_cport_connected(struct gb_host_device *hd, u16 cport_id) return 0; } +static int es2_cport_flush(struct gb_host_device *hd, u16 cport_id) +{ + struct es2_ap_dev *es2 = hd_to_es2(hd); + struct device *dev = &es2->usb_dev->dev; + struct arpc_cport_flush_req req; + int ret; + + req.cport_id = cpu_to_le16(cport_id); + ret = arpc_sync(es2, ARPC_TYPE_CPORT_FLUSH, &req, sizeof(req), + NULL, ES2_ARPC_CPORT_TIMEOUT); + if (ret) { + dev_err(dev, "failed to flush cport %u: %d\n", cport_id, ret); + return ret; + } + + return 0; +} + static int es2_cport_quiesce(struct gb_host_device *hd, u16 cport_id, size_t peer_space, unsigned int timeout) { @@ -997,6 +1015,7 @@ static struct gb_hd_driver es2_driver = { .cport_enable = cport_enable, .cport_disable = cport_disable, .cport_connected = es2_cport_connected, + .cport_flush = es2_cport_flush, .cport_quiesce = es2_cport_quiesce, .cport_clear = es2_cport_clear, .latency_tag_enable = latency_tag_enable, |