• Home
  • Raw
  • Download

Lines Matching full:wcnss

123 	struct wcnss_ctrl *wcnss = dev_get_drvdata(&rpdev->dev);  in wcnss_ctrl_smd_callback()  local
131 dev_err(wcnss->dev, in wcnss_ctrl_smd_callback()
137 dev_info(wcnss->dev, "WCNSS Version %d.%d %d.%d\n", in wcnss_ctrl_smd_callback()
141 complete(&wcnss->ack); in wcnss_ctrl_smd_callback()
145 dev_err(wcnss->dev, in wcnss_ctrl_smd_callback()
151 wcnss->ack_status = nvresp->status; in wcnss_ctrl_smd_callback()
152 complete(&wcnss->ack); in wcnss_ctrl_smd_callback()
155 dev_dbg(wcnss->dev, "cold boot complete\n"); in wcnss_ctrl_smd_callback()
156 complete(&wcnss->cbc); in wcnss_ctrl_smd_callback()
159 dev_info(wcnss->dev, "unknown message type %d\n", hdr->type); in wcnss_ctrl_smd_callback()
167 * wcnss_request_version() - send a version request to WCNSS
168 * @wcnss: wcnss ctrl driver context
170 static int wcnss_request_version(struct wcnss_ctrl *wcnss) in wcnss_request_version() argument
177 ret = rpmsg_send(wcnss->channel, &msg, sizeof(msg)); in wcnss_request_version()
181 ret = wait_for_completion_timeout(&wcnss->ack, WCNSS_CBC_TIMEOUT); in wcnss_request_version()
183 dev_err(wcnss->dev, "timeout waiting for version response\n"); in wcnss_request_version()
191 * wcnss_download_nv() - send nv binary to WCNSS
192 * @wcnss: wcnss_ctrl state handle
197 static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc) in wcnss_download_nv() argument
209 ret = request_firmware(&fw, NVBIN_FILE, wcnss->dev); in wcnss_download_nv()
211 dev_err(wcnss->dev, "Failed to load nv file %s: %d\n", in wcnss_download_nv()
235 ret = rpmsg_send(wcnss->channel, req, req->hdr.len); in wcnss_download_nv()
237 dev_err(wcnss->dev, "failed to send smd packet\n"); in wcnss_download_nv()
248 ret = wait_for_completion_timeout(&wcnss->ack, WCNSS_REQUEST_TIMEOUT); in wcnss_download_nv()
250 dev_err(wcnss->dev, "timeout waiting for nv upload ack\n"); in wcnss_download_nv()
253 *expect_cbc = wcnss->ack_status == WCNSS_ACK_COLD_BOOTING; in wcnss_download_nv()
266 * qcom_wcnss_open_channel() - open additional SMD channel to WCNSS
267 * @wcnss: wcnss handle, retrieved from drvdata
271 struct rpmsg_endpoint *qcom_wcnss_open_channel(void *wcnss, const char *name, rpmsg_rx_cb_t cb, voi… in qcom_wcnss_open_channel() argument
274 struct wcnss_ctrl *_wcnss = wcnss; in qcom_wcnss_open_channel()
286 struct wcnss_ctrl *wcnss = container_of(work, struct wcnss_ctrl, probe_work); in wcnss_async_probe() local
290 ret = wcnss_request_version(wcnss); in wcnss_async_probe()
294 ret = wcnss_download_nv(wcnss, &expect_cbc); in wcnss_async_probe()
300 ret = wait_for_completion_timeout(&wcnss->cbc, WCNSS_REQUEST_TIMEOUT); in wcnss_async_probe()
302 dev_err(wcnss->dev, "expected cold boot completion\n"); in wcnss_async_probe()
305 of_platform_populate(wcnss->dev->of_node, NULL, NULL, wcnss->dev); in wcnss_async_probe()
310 struct wcnss_ctrl *wcnss; in wcnss_ctrl_probe() local
312 wcnss = devm_kzalloc(&rpdev->dev, sizeof(*wcnss), GFP_KERNEL); in wcnss_ctrl_probe()
313 if (!wcnss) in wcnss_ctrl_probe()
316 wcnss->dev = &rpdev->dev; in wcnss_ctrl_probe()
317 wcnss->channel = rpdev->ept; in wcnss_ctrl_probe()
319 init_completion(&wcnss->ack); in wcnss_ctrl_probe()
320 init_completion(&wcnss->cbc); in wcnss_ctrl_probe()
321 INIT_WORK(&wcnss->probe_work, wcnss_async_probe); in wcnss_ctrl_probe()
323 dev_set_drvdata(&rpdev->dev, wcnss); in wcnss_ctrl_probe()
325 schedule_work(&wcnss->probe_work); in wcnss_ctrl_probe()
332 struct wcnss_ctrl *wcnss = dev_get_drvdata(&rpdev->dev); in wcnss_ctrl_remove() local
334 cancel_work_sync(&wcnss->probe_work); in wcnss_ctrl_remove()
339 { .compatible = "qcom,wcnss", },
357 MODULE_DESCRIPTION("Qualcomm WCNSS control driver");