Lines Matching full:wcnss
126 struct wcnss_ctrl *wcnss = dev_get_drvdata(&rpdev->dev); in wcnss_ctrl_smd_callback() local
134 dev_err(wcnss->dev, in wcnss_ctrl_smd_callback()
140 dev_info(wcnss->dev, "WCNSS Version %d.%d %d.%d\n", in wcnss_ctrl_smd_callback()
144 complete(&wcnss->ack); in wcnss_ctrl_smd_callback()
148 dev_err(wcnss->dev, in wcnss_ctrl_smd_callback()
154 wcnss->ack_status = nvresp->status; in wcnss_ctrl_smd_callback()
155 complete(&wcnss->ack); in wcnss_ctrl_smd_callback()
158 dev_dbg(wcnss->dev, "cold boot complete\n"); in wcnss_ctrl_smd_callback()
159 complete(&wcnss->cbc); in wcnss_ctrl_smd_callback()
162 dev_info(wcnss->dev, "unknown message type %d\n", hdr->type); in wcnss_ctrl_smd_callback()
170 * wcnss_request_version() - send a version request to WCNSS
171 * @wcnss: wcnss ctrl driver context
173 static int wcnss_request_version(struct wcnss_ctrl *wcnss) in wcnss_request_version() argument
180 ret = rpmsg_send(wcnss->channel, &msg, sizeof(msg)); in wcnss_request_version()
184 ret = wait_for_completion_timeout(&wcnss->ack, WCNSS_CBC_TIMEOUT); in wcnss_request_version()
186 dev_err(wcnss->dev, "timeout waiting for version response\n"); in wcnss_request_version()
194 * wcnss_download_nv() - send nv binary to WCNSS
195 * @wcnss: wcnss_ctrl state handle
200 static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc) in wcnss_download_nv() argument
203 struct device *dev = wcnss->dev; in wcnss_download_nv()
243 ret = rpmsg_send(wcnss->channel, req, req->hdr.len); in wcnss_download_nv()
256 ret = wait_for_completion_timeout(&wcnss->ack, WCNSS_REQUEST_TIMEOUT); in wcnss_download_nv()
261 *expect_cbc = wcnss->ack_status == WCNSS_ACK_COLD_BOOTING; in wcnss_download_nv()
272 * qcom_wcnss_open_channel() - open additional SMD channel to WCNSS
273 * @wcnss: wcnss handle, retrieved from drvdata
278 struct rpmsg_endpoint *qcom_wcnss_open_channel(void *wcnss, const char *name, rpmsg_rx_cb_t cb, voi… in qcom_wcnss_open_channel() argument
281 struct wcnss_ctrl *_wcnss = wcnss; in qcom_wcnss_open_channel()
293 struct wcnss_ctrl *wcnss = container_of(work, struct wcnss_ctrl, probe_work); in wcnss_async_probe() local
297 ret = wcnss_request_version(wcnss); in wcnss_async_probe()
301 ret = wcnss_download_nv(wcnss, &expect_cbc); in wcnss_async_probe()
307 ret = wait_for_completion_timeout(&wcnss->cbc, WCNSS_REQUEST_TIMEOUT); in wcnss_async_probe()
309 dev_err(wcnss->dev, "expected cold boot completion\n"); in wcnss_async_probe()
312 of_platform_populate(wcnss->dev->of_node, NULL, NULL, wcnss->dev); in wcnss_async_probe()
317 struct wcnss_ctrl *wcnss; in wcnss_ctrl_probe() local
319 wcnss = devm_kzalloc(&rpdev->dev, sizeof(*wcnss), GFP_KERNEL); in wcnss_ctrl_probe()
320 if (!wcnss) in wcnss_ctrl_probe()
323 wcnss->dev = &rpdev->dev; in wcnss_ctrl_probe()
324 wcnss->channel = rpdev->ept; in wcnss_ctrl_probe()
326 init_completion(&wcnss->ack); in wcnss_ctrl_probe()
327 init_completion(&wcnss->cbc); in wcnss_ctrl_probe()
328 INIT_WORK(&wcnss->probe_work, wcnss_async_probe); in wcnss_ctrl_probe()
330 dev_set_drvdata(&rpdev->dev, wcnss); in wcnss_ctrl_probe()
332 schedule_work(&wcnss->probe_work); in wcnss_ctrl_probe()
339 struct wcnss_ctrl *wcnss = dev_get_drvdata(&rpdev->dev); in wcnss_ctrl_remove() local
341 cancel_work_sync(&wcnss->probe_work); in wcnss_ctrl_remove()
346 { .compatible = "qcom,wcnss", },
363 MODULE_DESCRIPTION("Qualcomm WCNSS control driver");