Lines Matching +full:rpmsg +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
8 #include <linux/rpmsg.h>
21 { .name = "mcdi_ipc" },
24 MODULE_DEVICE_TABLE(rpmsg, cdx_rpmsg_id_table);
35 return -ENOMEM; in cdx_rpmsg_send()
40 ret = rpmsg_send(cdx_mcdi->ept, send_buf, hdr_len + sdu_len); in cdx_rpmsg_send()
55 dev = &pdev->dev; in cdx_attach_to_rproc()
57 cdx_mcdi = cdx_c->priv; in cdx_attach_to_rproc()
59 r5_core_node = of_parse_phandle(dev->of_node, "xlnx,rproc", 0); in cdx_attach_to_rproc()
61 dev_err(&pdev->dev, "xlnx,rproc: invalid phandle\n"); in cdx_attach_to_rproc()
62 return -EINVAL; in cdx_attach_to_rproc()
65 rp = rproc_get_by_phandle(r5_core_node->phandle); in cdx_attach_to_rproc()
67 ret = -EPROBE_DEFER; in cdx_attach_to_rproc()
74 dev_err(&pdev->dev, "Failed to attach to remote processor\n"); in cdx_attach_to_rproc()
79 cdx_mcdi->r5_rproc = rp; in cdx_attach_to_rproc()
91 cdx_mcdi = cdx_c->priv; in cdx_detach_to_r5()
93 rproc_detach(cdx_mcdi->r5_rproc); in cdx_detach_to_r5()
94 rproc_put(cdx_mcdi->r5_rproc); in cdx_detach_to_r5()
100 struct cdx_controller *cdx_c = dev_get_drvdata(&rpdev->dev); in cdx_rpmsg_cb()
101 struct cdx_mcdi *cdx_mcdi = cdx_c->priv; in cdx_rpmsg_cb()
104 return -EINVAL; in cdx_rpmsg_cb()
117 cdx_c = dev_get_drvdata(&cdx_mcdi->rpdev->dev); in cdx_rpmsg_post_probe_work()
128 cdx_mcdi = cdx_c->priv; in cdx_rpmsg_probe()
131 chinfo.dst = rpdev->dst; in cdx_rpmsg_probe()
132 strscpy(chinfo.name, cdx_rpmsg_id_table[0].name, in cdx_rpmsg_probe()
133 strlen(cdx_rpmsg_id_table[0].name)); in cdx_rpmsg_probe()
135 cdx_mcdi->ept = rpmsg_create_ept(rpdev, cdx_rpmsg_cb, NULL, chinfo); in cdx_rpmsg_probe()
136 if (!cdx_mcdi->ept) { in cdx_rpmsg_probe()
137 dev_err_probe(&rpdev->dev, -ENXIO, in cdx_rpmsg_probe()
139 chinfo.name); in cdx_rpmsg_probe()
140 return -EINVAL; in cdx_rpmsg_probe()
143 cdx_mcdi->rpdev = rpdev; in cdx_rpmsg_probe()
144 dev_set_drvdata(&rpdev->dev, cdx_c); in cdx_rpmsg_probe()
146 schedule_work(&cdx_mcdi->work); in cdx_rpmsg_probe()
152 struct cdx_controller *cdx_c = dev_get_drvdata(&rpdev->dev); in cdx_rpmsg_remove()
153 struct cdx_mcdi *cdx_mcdi = cdx_c->priv; in cdx_rpmsg_remove()
155 flush_work(&cdx_mcdi->work); in cdx_rpmsg_remove()
158 rpmsg_destroy_ept(cdx_mcdi->ept); in cdx_rpmsg_remove()
159 dev_set_drvdata(&rpdev->dev, NULL); in cdx_rpmsg_remove()
163 .drv.name = KBUILD_MODNAME,
182 cdx_mcdi = cdx_c->priv; in cdx_setup_rpmsg()
184 /* Register RPMsg driver */ in cdx_setup_rpmsg()
187 INIT_WORK(&cdx_mcdi->work, cdx_rpmsg_post_probe_work); in cdx_setup_rpmsg()
190 dev_err(&pdev->dev, in cdx_setup_rpmsg()
191 "Failed to register cdx RPMsg driver: %d\n", ret); in cdx_setup_rpmsg()