Lines Matching refs:ec_rpmsg
82 struct cros_ec_rpmsg *ec_rpmsg = ec_dev->priv; in cros_ec_pkt_xfer_rpmsg() local
96 reinit_completion(&ec_rpmsg->xfer_ack); in cros_ec_pkt_xfer_rpmsg()
97 ret = rpmsg_send(ec_rpmsg->ept, ec_dev->dout, len); in cros_ec_pkt_xfer_rpmsg()
104 ret = wait_for_completion_timeout(&ec_rpmsg->xfer_ack, timeout); in cros_ec_pkt_xfer_rpmsg()
151 struct cros_ec_rpmsg *ec_rpmsg = container_of(host_event_work, in cros_ec_rpmsg_host_event_function() local
155 cros_ec_irq_thread(0, dev_get_drvdata(&ec_rpmsg->rpdev->dev)); in cros_ec_rpmsg_host_event_function()
162 struct cros_ec_rpmsg *ec_rpmsg = ec_dev->priv; in cros_ec_rpmsg_callback() local
181 complete(&ec_rpmsg->xfer_ack); in cros_ec_rpmsg_callback()
187 if (ec_rpmsg->probe_done) in cros_ec_rpmsg_callback()
188 schedule_work(&ec_rpmsg->host_event_work); in cros_ec_rpmsg_callback()
190 ec_rpmsg->has_pending_host_event = true; in cros_ec_rpmsg_callback()
215 struct cros_ec_rpmsg *ec_rpmsg; in cros_ec_rpmsg_probe() local
223 ec_rpmsg = devm_kzalloc(dev, sizeof(*ec_rpmsg), GFP_KERNEL); in cros_ec_rpmsg_probe()
224 if (!ec_rpmsg) in cros_ec_rpmsg_probe()
228 ec_dev->priv = ec_rpmsg; in cros_ec_rpmsg_probe()
237 ec_rpmsg->rpdev = rpdev; in cros_ec_rpmsg_probe()
238 init_completion(&ec_rpmsg->xfer_ack); in cros_ec_rpmsg_probe()
239 INIT_WORK(&ec_rpmsg->host_event_work, in cros_ec_rpmsg_probe()
242 ec_rpmsg->ept = cros_ec_rpmsg_create_ept(rpdev); in cros_ec_rpmsg_probe()
243 if (!ec_rpmsg->ept) in cros_ec_rpmsg_probe()
248 rpmsg_destroy_ept(ec_rpmsg->ept); in cros_ec_rpmsg_probe()
249 cancel_work_sync(&ec_rpmsg->host_event_work); in cros_ec_rpmsg_probe()
253 ec_rpmsg->probe_done = true; in cros_ec_rpmsg_probe()
255 if (ec_rpmsg->has_pending_host_event) in cros_ec_rpmsg_probe()
256 schedule_work(&ec_rpmsg->host_event_work); in cros_ec_rpmsg_probe()
264 struct cros_ec_rpmsg *ec_rpmsg = ec_dev->priv; in cros_ec_rpmsg_remove() local
267 rpmsg_destroy_ept(ec_rpmsg->ept); in cros_ec_rpmsg_remove()
268 cancel_work_sync(&ec_rpmsg->host_event_work); in cros_ec_rpmsg_remove()