Lines Matching refs:cdev

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