Lines Matching refs:glink

160 	struct qcom_glink *glink;  member
211 static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink, in qcom_glink_alloc_channel() argument
225 channel->glink = glink; in qcom_glink_alloc_channel()
278 static size_t qcom_glink_rx_avail(struct qcom_glink *glink) in qcom_glink_rx_avail() argument
280 return glink->rx_pipe->avail(glink->rx_pipe); in qcom_glink_rx_avail()
283 static void qcom_glink_rx_peak(struct qcom_glink *glink, in qcom_glink_rx_peak() argument
286 glink->rx_pipe->peak(glink->rx_pipe, data, offset, count); in qcom_glink_rx_peak()
289 static void qcom_glink_rx_advance(struct qcom_glink *glink, size_t count) in qcom_glink_rx_advance() argument
291 glink->rx_pipe->advance(glink->rx_pipe, count); in qcom_glink_rx_advance()
294 static size_t qcom_glink_tx_avail(struct qcom_glink *glink) in qcom_glink_tx_avail() argument
296 return glink->tx_pipe->avail(glink->tx_pipe); in qcom_glink_tx_avail()
299 static void qcom_glink_tx_write(struct qcom_glink *glink, in qcom_glink_tx_write() argument
303 glink->tx_pipe->write(glink->tx_pipe, hdr, hlen, data, dlen); in qcom_glink_tx_write()
306 static void qcom_glink_send_read_notify(struct qcom_glink *glink) in qcom_glink_send_read_notify() argument
314 qcom_glink_tx_write(glink, &msg, sizeof(msg), NULL, 0); in qcom_glink_send_read_notify()
316 mbox_send_message(glink->mbox_chan, NULL); in qcom_glink_send_read_notify()
317 mbox_client_txdone(glink->mbox_chan, 0); in qcom_glink_send_read_notify()
320 static int qcom_glink_tx(struct qcom_glink *glink, in qcom_glink_tx() argument
329 if (tlen >= glink->tx_pipe->length) in qcom_glink_tx()
332 spin_lock_irqsave(&glink->tx_lock, flags); in qcom_glink_tx()
334 while (qcom_glink_tx_avail(glink) < tlen) { in qcom_glink_tx()
340 if (!glink->sent_read_notify) { in qcom_glink_tx()
341 glink->sent_read_notify = true; in qcom_glink_tx()
342 qcom_glink_send_read_notify(glink); in qcom_glink_tx()
346 spin_unlock_irqrestore(&glink->tx_lock, flags); in qcom_glink_tx()
348 wait_event_timeout(glink->tx_avail_notify, in qcom_glink_tx()
349 qcom_glink_tx_avail(glink) >= tlen, 10 * HZ); in qcom_glink_tx()
351 spin_lock_irqsave(&glink->tx_lock, flags); in qcom_glink_tx()
353 if (qcom_glink_tx_avail(glink) >= tlen) in qcom_glink_tx()
354 glink->sent_read_notify = false; in qcom_glink_tx()
357 qcom_glink_tx_write(glink, hdr, hlen, data, dlen); in qcom_glink_tx()
359 mbox_send_message(glink->mbox_chan, NULL); in qcom_glink_tx()
360 mbox_client_txdone(glink->mbox_chan, 0); in qcom_glink_tx()
363 spin_unlock_irqrestore(&glink->tx_lock, flags); in qcom_glink_tx()
368 static int qcom_glink_send_version(struct qcom_glink *glink) in qcom_glink_send_version() argument
374 msg.param2 = cpu_to_le32(glink->features); in qcom_glink_send_version()
376 return qcom_glink_tx(glink, &msg, sizeof(msg), NULL, 0, true); in qcom_glink_send_version()
379 static void qcom_glink_send_version_ack(struct qcom_glink *glink) in qcom_glink_send_version_ack() argument
385 msg.param2 = cpu_to_le32(glink->features); in qcom_glink_send_version_ack()
387 qcom_glink_tx(glink, &msg, sizeof(msg), NULL, 0, true); in qcom_glink_send_version_ack()
390 static void qcom_glink_send_open_ack(struct qcom_glink *glink, in qcom_glink_send_open_ack() argument
399 qcom_glink_tx(glink, &msg, sizeof(msg), NULL, 0, true); in qcom_glink_send_open_ack()
402 static void qcom_glink_handle_intent_req_ack(struct qcom_glink *glink, in qcom_glink_handle_intent_req_ack() argument
408 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_handle_intent_req_ack()
409 channel = idr_find(&glink->rcids, cid); in qcom_glink_handle_intent_req_ack()
410 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_handle_intent_req_ack()
412 dev_err(glink->dev, "unable to find channel\n"); in qcom_glink_handle_intent_req_ack()
430 static int qcom_glink_send_open_req(struct qcom_glink *glink, in qcom_glink_send_open_req() argument
444 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_send_open_req()
445 ret = idr_alloc_cyclic(&glink->lcids, channel, in qcom_glink_send_open_req()
448 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_send_open_req()
459 ret = qcom_glink_tx(glink, &req, req_len, NULL, 0, true); in qcom_glink_send_open_req()
466 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_send_open_req()
467 idr_remove(&glink->lcids, channel->lcid); in qcom_glink_send_open_req()
469 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_send_open_req()
474 static void qcom_glink_send_close_req(struct qcom_glink *glink, in qcom_glink_send_close_req() argument
483 qcom_glink_tx(glink, &req, sizeof(req), NULL, 0, true); in qcom_glink_send_close_req()
486 static void qcom_glink_send_close_ack(struct qcom_glink *glink, in qcom_glink_send_close_ack() argument
495 qcom_glink_tx(glink, &req, sizeof(req), NULL, 0, true); in qcom_glink_send_close_ack()
502 struct qcom_glink *glink = channel->glink; in qcom_glink_rx_done_work() local
526 qcom_glink_tx(glink, &cmd, sizeof(cmd), NULL, 0, true); in qcom_glink_rx_done_work()
536 static void qcom_glink_rx_done(struct qcom_glink *glink, in qcom_glink_rx_done() argument
541 if (glink->intentless) { in qcom_glink_rx_done()
572 static void qcom_glink_receive_version(struct qcom_glink *glink, in qcom_glink_receive_version() argument
580 glink->features &= features; in qcom_glink_receive_version()
583 qcom_glink_send_version_ack(glink); in qcom_glink_receive_version()
599 static void qcom_glink_receive_version_ack(struct qcom_glink *glink, in qcom_glink_receive_version_ack() argument
608 if (features == glink->features) in qcom_glink_receive_version_ack()
611 glink->features &= features; in qcom_glink_receive_version_ack()
614 qcom_glink_send_version(glink); in qcom_glink_receive_version_ack()
628 static int qcom_glink_send_intent_req_ack(struct qcom_glink *glink, in qcom_glink_send_intent_req_ack() argument
638 qcom_glink_tx(glink, &msg, sizeof(msg), NULL, 0, true); in qcom_glink_send_intent_req_ack()
652 static int qcom_glink_advertise_intent(struct qcom_glink *glink, in qcom_glink_advertise_intent() argument
671 qcom_glink_tx(glink, &cmd, sizeof(cmd), NULL, 0, true); in qcom_glink_advertise_intent()
677 qcom_glink_alloc_intent(struct qcom_glink *glink, in qcom_glink_alloc_intent() argument
715 static void qcom_glink_handle_rx_done(struct qcom_glink *glink, in qcom_glink_handle_rx_done() argument
723 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_handle_rx_done()
724 channel = idr_find(&glink->rcids, cid); in qcom_glink_handle_rx_done()
725 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_handle_rx_done()
727 dev_err(glink->dev, "invalid channel id received\n"); in qcom_glink_handle_rx_done()
736 dev_err(glink->dev, "invalid intent id received\n"); in qcom_glink_handle_rx_done()
759 static void qcom_glink_handle_intent_req(struct qcom_glink *glink, in qcom_glink_handle_intent_req() argument
766 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_handle_intent_req()
767 channel = idr_find(&glink->rcids, cid); in qcom_glink_handle_intent_req()
768 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_handle_intent_req()
775 intent = qcom_glink_alloc_intent(glink, channel, size, false); in qcom_glink_handle_intent_req()
777 qcom_glink_advertise_intent(glink, channel, intent); in qcom_glink_handle_intent_req()
779 qcom_glink_send_intent_req_ack(glink, channel, !!intent); in qcom_glink_handle_intent_req()
782 static int qcom_glink_rx_defer(struct qcom_glink *glink, size_t extra) in qcom_glink_rx_defer() argument
788 if (qcom_glink_rx_avail(glink) < sizeof(struct glink_msg) + extra) { in qcom_glink_rx_defer()
789 dev_dbg(glink->dev, "Insufficient data in rx fifo"); in qcom_glink_rx_defer()
799 qcom_glink_rx_peak(glink, &dcmd->msg, 0, sizeof(dcmd->msg) + extra); in qcom_glink_rx_defer()
801 spin_lock(&glink->rx_lock); in qcom_glink_rx_defer()
802 list_add_tail(&dcmd->node, &glink->rx_queue); in qcom_glink_rx_defer()
803 spin_unlock(&glink->rx_lock); in qcom_glink_rx_defer()
805 schedule_work(&glink->rx_work); in qcom_glink_rx_defer()
806 qcom_glink_rx_advance(glink, sizeof(dcmd->msg) + extra); in qcom_glink_rx_defer()
811 static int qcom_glink_rx_data(struct qcom_glink *glink, size_t avail) in qcom_glink_rx_data() argument
828 dev_dbg(glink->dev, "Not enough data in fifo\n"); in qcom_glink_rx_data()
832 qcom_glink_rx_peak(glink, &hdr, 0, sizeof(hdr)); in qcom_glink_rx_data()
837 dev_dbg(glink->dev, "Payload not yet in fifo\n"); in qcom_glink_rx_data()
842 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_rx_data()
843 channel = idr_find(&glink->rcids, rcid); in qcom_glink_rx_data()
844 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_data()
846 dev_dbg(glink->dev, "Data on non-existing channel\n"); in qcom_glink_rx_data()
852 if (glink->intentless) { in qcom_glink_rx_data()
882 dev_err(glink->dev, in qcom_glink_rx_data()
891 dev_err(glink->dev, "Insufficient space in intent\n"); in qcom_glink_rx_data()
897 qcom_glink_rx_peak(glink, intent->data + intent->offset, in qcom_glink_rx_data()
916 qcom_glink_rx_done(glink, channel, intent); in qcom_glink_rx_data()
920 qcom_glink_rx_advance(glink, ALIGN(sizeof(hdr) + chunk_size, 8)); in qcom_glink_rx_data()
925 static void qcom_glink_handle_intent(struct qcom_glink *glink, in qcom_glink_handle_intent() argument
948 dev_dbg(glink->dev, "Not enough data in fifo\n"); in qcom_glink_handle_intent()
952 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_handle_intent()
953 channel = idr_find(&glink->rcids, cid); in qcom_glink_handle_intent()
954 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_handle_intent()
956 dev_err(glink->dev, "intents for non-existing channel\n"); in qcom_glink_handle_intent()
964 qcom_glink_rx_peak(glink, msg, 0, msglen); in qcom_glink_handle_intent()
980 dev_err(glink->dev, "failed to store remote intent\n"); in qcom_glink_handle_intent()
984 qcom_glink_rx_advance(glink, ALIGN(msglen, 8)); in qcom_glink_handle_intent()
987 static int qcom_glink_rx_open_ack(struct qcom_glink *glink, unsigned int lcid) in qcom_glink_rx_open_ack() argument
991 spin_lock(&glink->idr_lock); in qcom_glink_rx_open_ack()
992 channel = idr_find(&glink->lcids, lcid); in qcom_glink_rx_open_ack()
993 spin_unlock(&glink->idr_lock); in qcom_glink_rx_open_ack()
995 dev_err(glink->dev, "Invalid open ack packet\n"); in qcom_glink_rx_open_ack()
1006 struct qcom_glink *glink = data; in qcom_glink_native_intr() local
1015 wake_up_all(&glink->tx_avail_notify); in qcom_glink_native_intr()
1018 avail = qcom_glink_rx_avail(glink); in qcom_glink_native_intr()
1022 qcom_glink_rx_peak(glink, &msg, 0, sizeof(msg)); in qcom_glink_native_intr()
1034 ret = qcom_glink_rx_defer(glink, 0); in qcom_glink_native_intr()
1037 ret = qcom_glink_rx_open_ack(glink, param1); in qcom_glink_native_intr()
1038 qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); in qcom_glink_native_intr()
1041 ret = qcom_glink_rx_defer(glink, param2); in qcom_glink_native_intr()
1045 ret = qcom_glink_rx_data(glink, avail); in qcom_glink_native_intr()
1048 qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); in qcom_glink_native_intr()
1050 mbox_send_message(glink->mbox_chan, NULL); in qcom_glink_native_intr()
1051 mbox_client_txdone(glink->mbox_chan, 0); in qcom_glink_native_intr()
1054 qcom_glink_handle_intent(glink, param1, param2, avail); in qcom_glink_native_intr()
1057 qcom_glink_handle_rx_done(glink, param1, param2, false); in qcom_glink_native_intr()
1058 qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); in qcom_glink_native_intr()
1061 qcom_glink_handle_rx_done(glink, param1, param2, true); in qcom_glink_native_intr()
1062 qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); in qcom_glink_native_intr()
1065 qcom_glink_handle_intent_req_ack(glink, param1, param2); in qcom_glink_native_intr()
1066 qcom_glink_rx_advance(glink, ALIGN(sizeof(msg), 8)); in qcom_glink_native_intr()
1069 dev_err(glink->dev, "unhandled rx cmd: %d\n", cmd); in qcom_glink_native_intr()
1082 static struct glink_channel *qcom_glink_create_local(struct qcom_glink *glink, in qcom_glink_create_local() argument
1089 channel = qcom_glink_alloc_channel(glink, name); in qcom_glink_create_local()
1093 ret = qcom_glink_send_open_req(glink, channel); in qcom_glink_create_local()
1105 qcom_glink_send_open_ack(glink, channel); in qcom_glink_create_local()
1111 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_create_local()
1112 idr_remove(&glink->lcids, channel->lcid); in qcom_glink_create_local()
1113 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_create_local()
1125 static int qcom_glink_create_remote(struct qcom_glink *glink, in qcom_glink_create_remote() argument
1130 qcom_glink_send_open_ack(glink, channel); in qcom_glink_create_remote()
1132 ret = qcom_glink_send_open_req(glink, channel); in qcom_glink_create_remote()
1151 qcom_glink_send_close_req(glink, channel); in qcom_glink_create_remote()
1164 struct qcom_glink *glink = parent->glink; in qcom_glink_create_ept() local
1171 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_create_ept()
1172 idr_for_each_entry(&glink->rcids, channel, cid) { in qcom_glink_create_ept()
1176 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_create_ept()
1179 channel = qcom_glink_create_local(glink, name); in qcom_glink_create_ept()
1183 ret = qcom_glink_create_remote(glink, channel); in qcom_glink_create_ept()
1201 struct qcom_glink *glink = channel->glink; in qcom_glink_announce_create() local
1210 if (glink->intentless || !completion_done(&channel->open_ack)) in qcom_glink_announce_create()
1224 intent = qcom_glink_alloc_intent(glink, channel, size, in qcom_glink_announce_create()
1229 qcom_glink_advertise_intent(glink, channel, intent); in qcom_glink_announce_create()
1238 struct qcom_glink *glink = channel->glink; in qcom_glink_destroy_ept() local
1248 qcom_glink_send_close_req(glink, channel); in qcom_glink_destroy_ept()
1251 static int qcom_glink_request_intent(struct qcom_glink *glink, in qcom_glink_request_intent() argument
1271 ret = qcom_glink_tx(glink, &cmd, sizeof(cmd), NULL, 0, true); in qcom_glink_request_intent()
1277 dev_err(glink->dev, "intent request timed out\n"); in qcom_glink_request_intent()
1291 struct qcom_glink *glink = channel->glink; in __qcom_glink_send() local
1305 if (!glink->intentless) { in __qcom_glink_send()
1329 ret = qcom_glink_request_intent(glink, channel, len); in __qcom_glink_send()
1347 ret = qcom_glink_tx(glink, &req, sizeof(req), data, chunk_size, wait); in __qcom_glink_send()
1368 ret = qcom_glink_tx(glink, &req, sizeof(req), data, in __qcom_glink_send()
1452 static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid, in qcom_glink_rx_open() argument
1463 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_rx_open()
1464 idr_for_each_entry(&glink->lcids, channel, lcid) { in qcom_glink_rx_open()
1468 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_open()
1471 channel = qcom_glink_alloc_channel(glink, name); in qcom_glink_rx_open()
1479 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_rx_open()
1480 ret = idr_alloc(&glink->rcids, channel, rcid, rcid + 1, GFP_ATOMIC); in qcom_glink_rx_open()
1482 dev_err(glink->dev, "Unable to insert channel into rcid list\n"); in qcom_glink_rx_open()
1483 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_open()
1487 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_open()
1504 node = qcom_glink_match_channel(glink->dev->of_node, name); in qcom_glink_rx_open()
1506 rpdev->dev.parent = glink->dev; in qcom_glink_rx_open()
1519 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_rx_open()
1520 idr_remove(&glink->rcids, channel->rcid); in qcom_glink_rx_open()
1522 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_open()
1531 static void qcom_glink_rx_close(struct qcom_glink *glink, unsigned int rcid) in qcom_glink_rx_close() argument
1537 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_rx_close()
1538 channel = idr_find(&glink->rcids, rcid); in qcom_glink_rx_close()
1539 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_close()
1551 rpmsg_unregister_device(glink->dev, &chinfo); in qcom_glink_rx_close()
1555 qcom_glink_send_close_ack(glink, channel->rcid); in qcom_glink_rx_close()
1557 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_rx_close()
1558 idr_remove(&glink->rcids, channel->rcid); in qcom_glink_rx_close()
1560 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_close()
1565 static void qcom_glink_rx_close_ack(struct qcom_glink *glink, unsigned int lcid) in qcom_glink_rx_close_ack() argument
1572 wake_up_all(&glink->tx_avail_notify); in qcom_glink_rx_close_ack()
1574 spin_lock_irqsave(&glink->idr_lock, flags); in qcom_glink_rx_close_ack()
1575 channel = idr_find(&glink->lcids, lcid); in qcom_glink_rx_close_ack()
1577 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_close_ack()
1581 idr_remove(&glink->lcids, channel->lcid); in qcom_glink_rx_close_ack()
1583 spin_unlock_irqrestore(&glink->idr_lock, flags); in qcom_glink_rx_close_ack()
1591 rpmsg_unregister_device(glink->dev, &chinfo); in qcom_glink_rx_close_ack()
1600 struct qcom_glink *glink = container_of(work, struct qcom_glink, in qcom_glink_work() local
1610 spin_lock_irqsave(&glink->rx_lock, flags); in qcom_glink_work()
1611 if (list_empty(&glink->rx_queue)) { in qcom_glink_work()
1612 spin_unlock_irqrestore(&glink->rx_lock, flags); in qcom_glink_work()
1615 dcmd = list_first_entry(&glink->rx_queue, in qcom_glink_work()
1618 spin_unlock_irqrestore(&glink->rx_lock, flags); in qcom_glink_work()
1627 qcom_glink_receive_version(glink, param1, param2); in qcom_glink_work()
1630 qcom_glink_receive_version_ack(glink, param1, param2); in qcom_glink_work()
1633 qcom_glink_rx_open(glink, param1, msg->data); in qcom_glink_work()
1636 qcom_glink_rx_close(glink, param1); in qcom_glink_work()
1639 qcom_glink_rx_close_ack(glink, param1); in qcom_glink_work()
1642 qcom_glink_handle_intent_req(glink, param1, param2); in qcom_glink_work()
1653 static void qcom_glink_cancel_rx_work(struct qcom_glink *glink) in qcom_glink_cancel_rx_work() argument
1659 cancel_work_sync(&glink->rx_work); in qcom_glink_cancel_rx_work()
1661 list_for_each_entry_safe(dcmd, tmp, &glink->rx_queue, node) in qcom_glink_cancel_rx_work()
1695 static int qcom_glink_create_chrdev(struct qcom_glink *glink) in qcom_glink_create_chrdev() argument
1704 channel = qcom_glink_alloc_channel(glink, "rpmsg_chrdev"); in qcom_glink_create_chrdev()
1713 rpdev->dev.parent = glink->dev; in qcom_glink_create_chrdev()
1727 struct qcom_glink *glink; in qcom_glink_native_probe() local
1729 glink = devm_kzalloc(dev, sizeof(*glink), GFP_KERNEL); in qcom_glink_native_probe()
1730 if (!glink) in qcom_glink_native_probe()
1733 glink->dev = dev; in qcom_glink_native_probe()
1734 glink->tx_pipe = tx; in qcom_glink_native_probe()
1735 glink->rx_pipe = rx; in qcom_glink_native_probe()
1737 glink->features = features; in qcom_glink_native_probe()
1738 glink->intentless = intentless; in qcom_glink_native_probe()
1740 spin_lock_init(&glink->tx_lock); in qcom_glink_native_probe()
1741 spin_lock_init(&glink->rx_lock); in qcom_glink_native_probe()
1742 INIT_LIST_HEAD(&glink->rx_queue); in qcom_glink_native_probe()
1743 INIT_WORK(&glink->rx_work, qcom_glink_work); in qcom_glink_native_probe()
1744 init_waitqueue_head(&glink->tx_avail_notify); in qcom_glink_native_probe()
1746 spin_lock_init(&glink->idr_lock); in qcom_glink_native_probe()
1747 idr_init(&glink->lcids); in qcom_glink_native_probe()
1748 idr_init(&glink->rcids); in qcom_glink_native_probe()
1750 glink->dev->groups = qcom_glink_groups; in qcom_glink_native_probe()
1756 glink->mbox_client.dev = dev; in qcom_glink_native_probe()
1757 glink->mbox_client.knows_txdone = true; in qcom_glink_native_probe()
1758 glink->mbox_chan = mbox_request_channel(&glink->mbox_client, 0); in qcom_glink_native_probe()
1759 if (IS_ERR(glink->mbox_chan)) { in qcom_glink_native_probe()
1760 if (PTR_ERR(glink->mbox_chan) != -EPROBE_DEFER) in qcom_glink_native_probe()
1762 return ERR_CAST(glink->mbox_chan); in qcom_glink_native_probe()
1769 "glink-native", glink); in qcom_glink_native_probe()
1775 glink->irq = irq; in qcom_glink_native_probe()
1777 ret = qcom_glink_send_version(glink); in qcom_glink_native_probe()
1781 ret = qcom_glink_create_chrdev(glink); in qcom_glink_native_probe()
1783 dev_err(glink->dev, "failed to register chrdev\n"); in qcom_glink_native_probe()
1785 return glink; in qcom_glink_native_probe()
1796 void qcom_glink_native_remove(struct qcom_glink *glink) in qcom_glink_native_remove() argument
1802 disable_irq(glink->irq); in qcom_glink_native_remove()
1803 qcom_glink_cancel_rx_work(glink); in qcom_glink_native_remove()
1805 ret = device_for_each_child(glink->dev, NULL, qcom_glink_remove_device); in qcom_glink_native_remove()
1807 dev_warn(glink->dev, "Can't remove GLINK devices: %d\n", ret); in qcom_glink_native_remove()
1810 idr_for_each_entry(&glink->lcids, channel, cid) in qcom_glink_native_remove()
1814 idr_for_each_entry(&glink->rcids, channel, cid) in qcom_glink_native_remove()
1817 idr_destroy(&glink->lcids); in qcom_glink_native_remove()
1818 idr_destroy(&glink->rcids); in qcom_glink_native_remove()
1819 mbox_free_channel(glink->mbox_chan); in qcom_glink_native_remove()
1823 void qcom_glink_native_unregister(struct qcom_glink *glink) in qcom_glink_native_unregister() argument
1825 device_unregister(glink->dev); in qcom_glink_native_unregister()