Lines Matching refs:cdx
34 static void cdx_mcdi_cancel_cmd(struct cdx_mcdi *cdx, struct cdx_mcdi_cmd *cmd);
35 static void cdx_mcdi_wait_for_cleanup(struct cdx_mcdi *cdx);
36 static int cdx_mcdi_rpc_async_internal(struct cdx_mcdi *cdx,
52 static void cdx_mcdi_mode_fail(struct cdx_mcdi *cdx, struct list_head *cleanup_list);
53 static void _cdx_mcdi_display_error(struct cdx_mcdi *cdx, unsigned int cmd,
98 static unsigned long cdx_mcdi_rpc_timeout(struct cdx_mcdi *cdx, unsigned int cmd) in cdx_mcdi_rpc_timeout() argument
100 if (!cdx->mcdi_ops->mcdi_rpc_timeout) in cdx_mcdi_rpc_timeout()
103 return cdx->mcdi_ops->mcdi_rpc_timeout(cdx, cmd); in cdx_mcdi_rpc_timeout()
106 int cdx_mcdi_init(struct cdx_mcdi *cdx) in cdx_mcdi_init() argument
111 cdx->mcdi = kzalloc(sizeof(*cdx->mcdi), GFP_KERNEL); in cdx_mcdi_init()
112 if (!cdx->mcdi) in cdx_mcdi_init()
115 mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_init()
116 mcdi->cdx = cdx; in cdx_mcdi_init()
130 kfree(cdx->mcdi); in cdx_mcdi_init()
131 cdx->mcdi = NULL; in cdx_mcdi_init()
136 void cdx_mcdi_finish(struct cdx_mcdi *cdx) in cdx_mcdi_finish() argument
140 mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_finish()
144 cdx_mcdi_wait_for_cleanup(cdx); in cdx_mcdi_finish()
147 kfree(cdx->mcdi); in cdx_mcdi_finish()
148 cdx->mcdi = NULL; in cdx_mcdi_finish()
163 static void cdx_mcdi_wait_for_cleanup(struct cdx_mcdi *cdx) in cdx_mcdi_wait_for_cleanup() argument
165 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_wait_for_cleanup()
174 int cdx_mcdi_wait_for_quiescence(struct cdx_mcdi *cdx, in cdx_mcdi_wait_for_quiescence() argument
177 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_wait_for_quiescence()
222 static void cdx_mcdi_send_request(struct cdx_mcdi *cdx, in cdx_mcdi_send_request() argument
225 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_send_request()
267 cdx->mcdi_ops->mcdi_request(cdx, hdr, hdr_len, inbuf, inlen); in cdx_mcdi_send_request()
272 static int cdx_mcdi_errno(struct cdx_mcdi *cdx, unsigned int mcdi_err) in cdx_mcdi_errno() argument
319 static void cdx_mcdi_process_cleanup_list(struct cdx_mcdi *cdx, in cdx_mcdi_process_cleanup_list() argument
322 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_process_cleanup_list()
332 cmd->completer(cdx, cmd->cookie, cmd->rc, in cdx_mcdi_process_cleanup_list()
379 static void cdx_mcdi_cancel_cmd(struct cdx_mcdi *cdx, struct cdx_mcdi_cmd *cmd) in cdx_mcdi_cancel_cmd() argument
381 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_cancel_cmd()
390 cdx_mcdi_process_cleanup_list(cdx, &cleanup_list); in cdx_mcdi_cancel_cmd()
408 static void cdx_mcdi_rpc_completer(struct cdx_mcdi *cdx, unsigned long cookie, in cdx_mcdi_rpc_completer() argument
426 static int cdx_mcdi_rpc_sync(struct cdx_mcdi *cdx, unsigned int cmd, in cdx_mcdi_rpc_sync() argument
465 rc = cdx_mcdi_rpc_async_internal(cdx, cmd_item, &handle); in cdx_mcdi_rpc_sync()
472 cdx_mcdi_rpc_timeout(cdx, cmd)) && in cdx_mcdi_rpc_sync()
477 cdx_mcdi_cancel_cmd(cdx, cmd_item); in cdx_mcdi_rpc_sync()
502 static int cdx_mcdi_rpc_async_internal(struct cdx_mcdi *cdx, in cdx_mcdi_rpc_async_internal() argument
506 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_rpc_async_internal()
534 struct cdx_mcdi *cdx = mcdi->cdx; in cdx_mcdi_cmd_start_or_queue() local
541 cdx_mcdi_send_request(cdx, cmd); in cdx_mcdi_cmd_start_or_queue()
560 void cdx_mcdi_process_cmd(struct cdx_mcdi *cdx, struct cdx_dword *outbuf, int len) in cdx_mcdi_process_cmd() argument
572 mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_process_cmd()
595 cdx_mcdi_process_cleanup_list(mcdi->cdx, &cleanup_list); in cdx_mcdi_process_cmd()
625 struct cdx_mcdi *cdx = mcdi->cdx; in cdx_mcdi_complete_cmd() local
675 _cdx_mcdi_display_error(cdx, cmd->cmd, in cdx_mcdi_complete_cmd()
677 cdx_mcdi_errno(cdx, rc)); in cdx_mcdi_complete_cmd()
679 rc = cdx_mcdi_errno(cdx, rc); in cdx_mcdi_complete_cmd()
720 struct cdx_mcdi *cdx = mcdi->cdx; in cdx_mcdi_timeout_cmd() local
729 cdx_mcdi_mode_fail(cdx, cleanup_list); in cdx_mcdi_timeout_cmd()
756 int cdx_mcdi_rpc(struct cdx_mcdi *cdx, unsigned int cmd, in cdx_mcdi_rpc() argument
761 return cdx_mcdi_rpc_sync(cdx, cmd, inbuf, inlen, outbuf, outlen, in cdx_mcdi_rpc()
784 cdx_mcdi_rpc_async(struct cdx_mcdi *cdx, unsigned int cmd, in cdx_mcdi_rpc_async() argument
804 return cdx_mcdi_rpc_async_internal(cdx, cmd_item, NULL); in cdx_mcdi_rpc_async()
807 static void _cdx_mcdi_display_error(struct cdx_mcdi *cdx, unsigned int cmd, in _cdx_mcdi_display_error() argument
819 static void cdx_mcdi_mode_fail(struct cdx_mcdi *cdx, struct list_head *cleanup_list) in cdx_mcdi_mode_fail() argument
821 struct cdx_mcdi_iface *mcdi = cdx_mcdi_if(cdx); in cdx_mcdi_mode_fail()