Lines Matching refs:cdx

30 static void cdx_mcdi_cancel_cmd(struct cdx_mcdi *cdx, struct cdx_mcdi_cmd *cmd);
31 static void cdx_mcdi_wait_for_cleanup(struct cdx_mcdi *cdx);
32 static int cdx_mcdi_rpc_async_internal(struct cdx_mcdi *cdx,
48 static void cdx_mcdi_mode_fail(struct cdx_mcdi *cdx, struct list_head *cleanup_list);
49 static void _cdx_mcdi_display_error(struct cdx_mcdi *cdx, unsigned int cmd,
94 static unsigned long cdx_mcdi_rpc_timeout(struct cdx_mcdi *cdx, unsigned int cmd) in cdx_mcdi_rpc_timeout() argument
96 if (!cdx->mcdi_ops->mcdi_rpc_timeout) in cdx_mcdi_rpc_timeout()
99 return cdx->mcdi_ops->mcdi_rpc_timeout(cdx, cmd); in cdx_mcdi_rpc_timeout()
102 int cdx_mcdi_init(struct cdx_mcdi *cdx) in cdx_mcdi_init() argument
107 cdx->mcdi = kzalloc(sizeof(*cdx->mcdi), GFP_KERNEL); in cdx_mcdi_init()
108 if (!cdx->mcdi) in cdx_mcdi_init()
111 mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_init()
112 mcdi->cdx = cdx; in cdx_mcdi_init()
126 kfree(cdx->mcdi); in cdx_mcdi_init()
127 cdx->mcdi = NULL; in cdx_mcdi_init()
132 void cdx_mcdi_finish(struct cdx_mcdi *cdx) in cdx_mcdi_finish() argument
136 mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_finish()
140 cdx_mcdi_wait_for_cleanup(cdx); in cdx_mcdi_finish()
143 kfree(cdx->mcdi); in cdx_mcdi_finish()
144 cdx->mcdi = NULL; in cdx_mcdi_finish()
159 static void cdx_mcdi_wait_for_cleanup(struct cdx_mcdi *cdx) in cdx_mcdi_wait_for_cleanup() argument
161 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_wait_for_cleanup()
170 int cdx_mcdi_wait_for_quiescence(struct cdx_mcdi *cdx, in cdx_mcdi_wait_for_quiescence() argument
173 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_wait_for_quiescence()
218 static void cdx_mcdi_send_request(struct cdx_mcdi *cdx, in cdx_mcdi_send_request() argument
221 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_send_request()
263 cdx->mcdi_ops->mcdi_request(cdx, hdr, hdr_len, inbuf, inlen); in cdx_mcdi_send_request()
268 static int cdx_mcdi_errno(struct cdx_mcdi *cdx, unsigned int mcdi_err) in cdx_mcdi_errno() argument
315 static void cdx_mcdi_process_cleanup_list(struct cdx_mcdi *cdx, in cdx_mcdi_process_cleanup_list() argument
318 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_process_cleanup_list()
328 cmd->completer(cdx, cmd->cookie, cmd->rc, in cdx_mcdi_process_cleanup_list()
375 static void cdx_mcdi_cancel_cmd(struct cdx_mcdi *cdx, struct cdx_mcdi_cmd *cmd) in cdx_mcdi_cancel_cmd() argument
377 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_cancel_cmd()
386 cdx_mcdi_process_cleanup_list(cdx, &cleanup_list); in cdx_mcdi_cancel_cmd()
404 static void cdx_mcdi_rpc_completer(struct cdx_mcdi *cdx, unsigned long cookie, in cdx_mcdi_rpc_completer() argument
422 static int cdx_mcdi_rpc_sync(struct cdx_mcdi *cdx, unsigned int cmd, in cdx_mcdi_rpc_sync() argument
461 rc = cdx_mcdi_rpc_async_internal(cdx, cmd_item, &handle); in cdx_mcdi_rpc_sync()
468 cdx_mcdi_rpc_timeout(cdx, cmd)) && in cdx_mcdi_rpc_sync()
473 cdx_mcdi_cancel_cmd(cdx, cmd_item); in cdx_mcdi_rpc_sync()
498 static int cdx_mcdi_rpc_async_internal(struct cdx_mcdi *cdx, in cdx_mcdi_rpc_async_internal() argument
502 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_rpc_async_internal()
530 struct cdx_mcdi *cdx = mcdi->cdx; in cdx_mcdi_cmd_start_or_queue() local
537 cdx_mcdi_send_request(cdx, cmd); in cdx_mcdi_cmd_start_or_queue()
556 void cdx_mcdi_process_cmd(struct cdx_mcdi *cdx, struct cdx_dword *outbuf, int len) in cdx_mcdi_process_cmd() argument
568 mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_process_cmd()
591 cdx_mcdi_process_cleanup_list(mcdi->cdx, &cleanup_list); in cdx_mcdi_process_cmd()
621 struct cdx_mcdi *cdx = mcdi->cdx; in cdx_mcdi_complete_cmd() local
671 _cdx_mcdi_display_error(cdx, cmd->cmd, in cdx_mcdi_complete_cmd()
673 cdx_mcdi_errno(cdx, rc)); in cdx_mcdi_complete_cmd()
675 rc = cdx_mcdi_errno(cdx, rc); in cdx_mcdi_complete_cmd()
716 struct cdx_mcdi *cdx = mcdi->cdx; in cdx_mcdi_timeout_cmd() local
725 cdx_mcdi_mode_fail(cdx, cleanup_list); in cdx_mcdi_timeout_cmd()
752 int cdx_mcdi_rpc(struct cdx_mcdi *cdx, unsigned int cmd, in cdx_mcdi_rpc() argument
757 return cdx_mcdi_rpc_sync(cdx, cmd, inbuf, inlen, outbuf, outlen, in cdx_mcdi_rpc()
780 cdx_mcdi_rpc_async(struct cdx_mcdi *cdx, unsigned int cmd, in cdx_mcdi_rpc_async() argument
800 return cdx_mcdi_rpc_async_internal(cdx, cmd_item, NULL); in cdx_mcdi_rpc_async()
803 static void _cdx_mcdi_display_error(struct cdx_mcdi *cdx, unsigned int cmd, in _cdx_mcdi_display_error() argument
815 static void cdx_mcdi_mode_fail(struct cdx_mcdi *cdx, struct list_head *cleanup_list) in cdx_mcdi_mode_fail() argument
817 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_mode_fail()