Lines Matching defs:cdev
55 static void catpt_dsp_send_tx(struct catpt_dev *cdev,
63 memcpy_toio(catpt_outbox_addr(cdev), tx->data, tx->size);
64 catpt_writel_shim(cdev, IPCC, header);
67 static int catpt_wait_msg_completion(struct catpt_dev *cdev, int timeout)
69 struct catpt_ipc *ipc = &cdev->ipc;
85 static int catpt_dsp_do_send_msg(struct catpt_dev *cdev,
89 struct catpt_ipc *ipc = &cdev->ipc;
101 catpt_dsp_send_tx(cdev, &request);
104 ret = catpt_wait_msg_completion(cdev, timeout);
106 dev_crit(cdev->dev, "communication severed: %d, rebooting dsp..\n",
124 int catpt_dsp_send_msg_timeout(struct catpt_dev *cdev,
128 struct catpt_ipc *ipc = &cdev->ipc;
132 ret = catpt_dsp_do_send_msg(cdev, request, reply, timeout);
138 int catpt_dsp_send_msg(struct catpt_dev *cdev, struct catpt_ipc_msg request,
141 return catpt_dsp_send_msg_timeout(cdev, request, reply,
142 cdev->ipc.default_timeout);
146 catpt_dsp_notify_stream(struct catpt_dev *cdev, union catpt_notify_msg msg)
152 stream = catpt_stream_find(cdev, msg.stream_hw_id);
154 dev_warn(cdev->dev, "notify %d for non-existent stream %d\n",
161 memcpy_fromio(&pos, catpt_inbox_addr(cdev), sizeof(pos));
164 catpt_stream_update_position(cdev, stream, &pos);
168 memcpy_fromio(&glitch, catpt_inbox_addr(cdev), sizeof(glitch));
171 dev_warn(cdev->dev, "glitch %d at pos: 0x%08llx, wp: 0x%08x\n",
177 dev_warn(cdev->dev, "unknown notification: %d received\n",
183 static void catpt_dsp_copy_rx(struct catpt_dev *cdev, u32 header)
185 struct catpt_ipc *ipc = &cdev->ipc;
191 memcpy_fromio(ipc->rx.data, catpt_outbox_addr(cdev), ipc->rx.size);
195 static void catpt_dsp_process_response(struct catpt_dev *cdev, u32 header)
198 struct catpt_ipc *ipc = &cdev->ipc;
205 memcpy_fromio(&config, cdev->lpe_ba + off, sizeof(config));
209 complete(&cdev->fw_ready);
215 dev_err(cdev->dev, "ADSP device coredump received\n");
217 catpt_coredump(cdev);
224 catpt_dsp_notify_stream(cdev, msg);
227 catpt_dsp_copy_rx(cdev, header);
235 dev_warn(cdev->dev, "unknown response: %d received\n",
243 struct catpt_dev *cdev = dev_id;
246 ipcd = catpt_readl_shim(cdev, IPCD);
253 catpt_dsp_process_response(cdev, ipcd);
256 catpt_updatel_shim(cdev, IPCD, CATPT_IPCD_BUSY | CATPT_IPCD_DONE,
259 catpt_updatel_shim(cdev, IMC, CATPT_IMC_IPCDB, 0);
266 struct catpt_dev *cdev = dev_id;
270 isc = catpt_readl_shim(cdev, ISC);
276 catpt_updatel_shim(cdev, IMC, CATPT_IMC_IPCCD, CATPT_IMC_IPCCD);
278 ipcc = catpt_readl_shim(cdev, IPCC);
280 catpt_dsp_copy_rx(cdev, ipcc);
281 complete(&cdev->ipc.done_completion);
284 catpt_updatel_shim(cdev, IPCC, CATPT_IPCC_DONE, 0);
286 catpt_updatel_shim(cdev, IMC, CATPT_IMC_IPCCD, 0);
293 catpt_updatel_shim(cdev, IMC, CATPT_IMC_IPCDB, CATPT_IMC_IPCDB);