Lines Matching refs:cinfo
602 struct scmi_chan_info *cinfo; in scmi_xfer_raw_channel_get() local
605 cinfo = idr_find(&info->tx_idr, protocol_id); in scmi_xfer_raw_channel_get()
606 if (!cinfo) { in scmi_xfer_raw_channel_get()
610 cinfo = idr_find(&info->tx_idr, SCMI_PROTOCOL_BASE); in scmi_xfer_raw_channel_get()
611 if (!cinfo) in scmi_xfer_raw_channel_get()
618 return cinfo; in scmi_xfer_raw_channel_get()
709 static inline int scmi_msg_response_validate(struct scmi_chan_info *cinfo, in scmi_msg_response_validate() argument
720 dev_err(cinfo->dev, in scmi_msg_response_validate()
736 dev_warn(cinfo->dev, in scmi_msg_response_validate()
798 scmi_xfer_command_acquire(struct scmi_chan_info *cinfo, u32 msg_hdr) in scmi_xfer_command_acquire() argument
803 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); in scmi_xfer_command_acquire()
812 dev_err(cinfo->dev, in scmi_xfer_command_acquire()
822 ret = scmi_msg_response_validate(cinfo, msg_type, xfer); in scmi_xfer_command_acquire()
837 dev_err(cinfo->dev, in scmi_xfer_command_acquire()
856 struct scmi_chan_info *cinfo) in scmi_clear_channel() argument
859 info->desc->ops->clear_channel(cinfo); in scmi_clear_channel()
862 static void scmi_handle_notification(struct scmi_chan_info *cinfo, in scmi_handle_notification() argument
866 struct device *dev = cinfo->dev; in scmi_handle_notification()
867 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); in scmi_handle_notification()
872 xfer = scmi_xfer_get(cinfo->handle, minfo); in scmi_handle_notification()
876 scmi_clear_channel(info, cinfo); in scmi_handle_notification()
884 info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size, in scmi_handle_notification()
887 trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id, in scmi_handle_notification()
891 scmi_notify(cinfo->handle, xfer->hdr.protocol_id, in scmi_handle_notification()
901 cinfo->id); in scmi_handle_notification()
906 scmi_clear_channel(info, cinfo); in scmi_handle_notification()
909 static void scmi_handle_response(struct scmi_chan_info *cinfo, in scmi_handle_response() argument
913 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); in scmi_handle_response()
915 xfer = scmi_xfer_command_acquire(cinfo, msg_hdr); in scmi_handle_response()
918 scmi_raw_error_report(info->raw, cinfo, msg_hdr, priv); in scmi_handle_response()
921 scmi_clear_channel(info, cinfo); in scmi_handle_response()
932 info->desc->ops->fetch_response(cinfo, xfer); in scmi_handle_response()
934 trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id, in scmi_handle_response()
947 scmi_clear_channel(info, cinfo); in scmi_handle_response()
962 cinfo->id); in scmi_handle_response()
981 void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, void *priv) in scmi_rx_callback() argument
987 scmi_handle_notification(cinfo, msg_hdr, priv); in scmi_rx_callback()
991 scmi_handle_response(cinfo, msg_hdr, priv); in scmi_rx_callback()
1014 static bool scmi_xfer_done_no_timeout(struct scmi_chan_info *cinfo, in scmi_xfer_done_no_timeout() argument
1017 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); in scmi_xfer_done_no_timeout()
1023 return info->desc->ops->poll_done(cinfo, xfer) || in scmi_xfer_done_no_timeout()
1029 struct scmi_chan_info *cinfo, in scmi_wait_for_reply() argument
1046 spin_until_cond(scmi_xfer_done_no_timeout(cinfo, in scmi_wait_for_reply()
1059 handle_to_scmi_info(cinfo->handle); in scmi_wait_for_reply()
1067 desc->ops->fetch_response(cinfo, xfer); in scmi_wait_for_reply()
1073 trace_scmi_msg_dump(info->id, cinfo->id, in scmi_wait_for_reply()
1082 handle_to_scmi_info(cinfo->handle); in scmi_wait_for_reply()
1086 cinfo->id); in scmi_wait_for_reply()
1114 static int scmi_wait_for_message_response(struct scmi_chan_info *cinfo, in scmi_wait_for_message_response() argument
1117 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); in scmi_wait_for_message_response()
1125 return scmi_wait_for_reply(dev, info->desc, cinfo, xfer, in scmi_wait_for_message_response()
1139 int scmi_xfer_raw_wait_for_message_response(struct scmi_chan_info *cinfo, in scmi_xfer_raw_wait_for_message_response() argument
1144 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); in scmi_xfer_raw_wait_for_message_response()
1147 ret = scmi_wait_for_reply(dev, info->desc, cinfo, xfer, timeout_ms); in scmi_xfer_raw_wait_for_message_response()
1172 struct scmi_chan_info *cinfo; in do_xfer() local
1182 cinfo = idr_find(&info->tx_idr, pi->proto->id); in do_xfer()
1183 if (unlikely(!cinfo)) in do_xfer()
1187 if (is_polling_enabled(cinfo, info->desc)) in do_xfer()
1214 ret = info->desc->ops->send_message(cinfo, xfer); in do_xfer()
1220 trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id, in do_xfer()
1224 ret = scmi_wait_for_message_response(cinfo, xfer); in do_xfer()
1229 info->desc->ops->mark_txdone(cinfo, ret, xfer); in do_xfer()
2303 struct scmi_chan_info *cinfo; in scmi_chan_setup() local
2312 cinfo = idr_find(idr, SCMI_PROTOCOL_BASE); in scmi_chan_setup()
2313 if (unlikely(!cinfo)) /* Possible only if platform has no Rx */ in scmi_chan_setup()
2318 cinfo = devm_kzalloc(info->dev, sizeof(*cinfo), GFP_KERNEL); in scmi_chan_setup()
2319 if (!cinfo) in scmi_chan_setup()
2322 cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms; in scmi_chan_setup()
2332 devm_kfree(info->dev, cinfo); in scmi_chan_setup()
2337 cinfo->id = prot_id; in scmi_chan_setup()
2338 cinfo->dev = &tdev->dev; in scmi_chan_setup()
2339 ret = info->desc->ops->chan_setup(cinfo, info->dev, tx); in scmi_chan_setup()
2343 devm_kfree(info->dev, cinfo); in scmi_chan_setup()
2347 if (tx && is_polling_required(cinfo, info->desc)) { in scmi_chan_setup()
2358 ret = idr_alloc(idr, cinfo, prot_id, prot_id + 1, GFP_KERNEL); in scmi_chan_setup()
2366 devm_kfree(info->dev, cinfo); in scmi_chan_setup()
2371 cinfo->handle = &info->handle; in scmi_chan_setup()
2441 struct scmi_chan_info *cinfo = p; in scmi_chan_destroy() local
2443 if (cinfo->dev) { in scmi_chan_destroy()
2444 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); in scmi_chan_destroy()
2445 struct scmi_device *sdev = to_scmi_dev(cinfo->dev); in scmi_chan_destroy()
2447 of_node_put(cinfo->dev->of_node); in scmi_chan_destroy()
2449 cinfo->dev = NULL; in scmi_chan_destroy()
2617 struct scmi_chan_info *cinfo; in scmi_debugfs_raw_mode_setup() local
2625 idr_for_each_entry(&info->tx_idr, cinfo, id) { in scmi_debugfs_raw_mode_setup()
2630 if (num_chans >= SCMI_MAX_CHANNELS || !cinfo) { in scmi_debugfs_raw_mode_setup()
2636 if (!test_bit(cinfo->id, protos)) { in scmi_debugfs_raw_mode_setup()
2637 channels[num_chans++] = cinfo->id; in scmi_debugfs_raw_mode_setup()
2638 set_bit(cinfo->id, protos); in scmi_debugfs_raw_mode_setup()