Lines Matching refs:xfer
264 struct ti_sci_xfer *xfer; in ti_sci_rx_callback() local
278 xfer = &minfo->xfer_block[xfer_id]; in ti_sci_rx_callback()
287 if (mbox_msg->len < xfer->rx_len) { in ti_sci_rx_callback()
289 mbox_msg->len, xfer->rx_len); in ti_sci_rx_callback()
296 memcpy(xfer->xfer_buf, mbox_msg->buf, xfer->rx_len); in ti_sci_rx_callback()
297 complete(&xfer->done); in ti_sci_rx_callback()
323 struct ti_sci_xfer *xfer; in ti_sci_get_one_xfer() local
363 xfer = &minfo->xfer_block[xfer_id]; in ti_sci_get_one_xfer()
365 hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_get_one_xfer()
366 xfer->tx_message.len = tx_message_size; in ti_sci_get_one_xfer()
367 xfer->rx_len = (u8)rx_message_size; in ti_sci_get_one_xfer()
369 reinit_completion(&xfer->done); in ti_sci_get_one_xfer()
376 return xfer; in ti_sci_get_one_xfer()
387 struct ti_sci_xfer *xfer) in ti_sci_put_one_xfer() argument
393 hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; in ti_sci_put_one_xfer()
419 struct ti_sci_xfer *xfer) in ti_sci_do_xfer() argument
425 ret = mbox_send_message(info->chan_tx, &xfer->tx_message); in ti_sci_do_xfer()
433 if (!wait_for_completion_timeout(&xfer->done, timeout)) { in ti_sci_do_xfer()
463 struct ti_sci_xfer *xfer; in ti_sci_cmd_get_revision() local
467 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_VERSION, in ti_sci_cmd_get_revision()
470 if (IS_ERR(xfer)) { in ti_sci_cmd_get_revision()
471 ret = PTR_ERR(xfer); in ti_sci_cmd_get_revision()
476 rev_info = (struct ti_sci_msg_resp_version *)xfer->xfer_buf; in ti_sci_cmd_get_revision()
478 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_get_revision()
491 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_get_revision()
523 struct ti_sci_xfer *xfer; in ti_sci_set_device_state() local
535 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_SET_DEVICE_STATE, in ti_sci_set_device_state()
538 if (IS_ERR(xfer)) { in ti_sci_set_device_state()
539 ret = PTR_ERR(xfer); in ti_sci_set_device_state()
543 req = (struct ti_sci_msg_req_set_device_state *)xfer->xfer_buf; in ti_sci_set_device_state()
547 ret = ti_sci_do_xfer(info, xfer); in ti_sci_set_device_state()
553 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_set_device_state()
558 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_set_device_state()
581 struct ti_sci_xfer *xfer; in ti_sci_get_device_state() local
597 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_GET_DEVICE_STATE, in ti_sci_get_device_state()
599 if (IS_ERR(xfer)) { in ti_sci_get_device_state()
600 ret = PTR_ERR(xfer); in ti_sci_get_device_state()
604 req = (struct ti_sci_msg_req_get_device_state *)xfer->xfer_buf; in ti_sci_get_device_state()
607 ret = ti_sci_do_xfer(info, xfer); in ti_sci_get_device_state()
613 resp = (struct ti_sci_msg_resp_get_device_state *)xfer->xfer_buf; in ti_sci_get_device_state()
628 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_get_device_state()
847 struct ti_sci_xfer *xfer; in ti_sci_cmd_set_device_resets() local
859 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_SET_DEVICE_RESETS, in ti_sci_cmd_set_device_resets()
862 if (IS_ERR(xfer)) { in ti_sci_cmd_set_device_resets()
863 ret = PTR_ERR(xfer); in ti_sci_cmd_set_device_resets()
867 req = (struct ti_sci_msg_req_set_device_resets *)xfer->xfer_buf; in ti_sci_cmd_set_device_resets()
871 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_set_device_resets()
877 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_set_device_resets()
882 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_set_device_resets()
922 struct ti_sci_xfer *xfer; in ti_sci_set_clock_state() local
934 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_SET_CLOCK_STATE, in ti_sci_set_clock_state()
937 if (IS_ERR(xfer)) { in ti_sci_set_clock_state()
938 ret = PTR_ERR(xfer); in ti_sci_set_clock_state()
942 req = (struct ti_sci_msg_req_set_clock_state *)xfer->xfer_buf; in ti_sci_set_clock_state()
947 ret = ti_sci_do_xfer(info, xfer); in ti_sci_set_clock_state()
953 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_set_clock_state()
958 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_set_clock_state()
982 struct ti_sci_xfer *xfer; in ti_sci_cmd_get_clock_state() local
997 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_GET_CLOCK_STATE, in ti_sci_cmd_get_clock_state()
1000 if (IS_ERR(xfer)) { in ti_sci_cmd_get_clock_state()
1001 ret = PTR_ERR(xfer); in ti_sci_cmd_get_clock_state()
1005 req = (struct ti_sci_msg_req_get_clock_state *)xfer->xfer_buf; in ti_sci_cmd_get_clock_state()
1009 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_get_clock_state()
1015 resp = (struct ti_sci_msg_resp_get_clock_state *)xfer->xfer_buf; in ti_sci_cmd_get_clock_state()
1028 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_get_clock_state()
1209 struct ti_sci_xfer *xfer; in ti_sci_cmd_clk_set_parent() local
1221 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_SET_CLOCK_PARENT, in ti_sci_cmd_clk_set_parent()
1224 if (IS_ERR(xfer)) { in ti_sci_cmd_clk_set_parent()
1225 ret = PTR_ERR(xfer); in ti_sci_cmd_clk_set_parent()
1229 req = (struct ti_sci_msg_req_set_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_set_parent()
1234 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_clk_set_parent()
1240 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_clk_set_parent()
1245 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_set_parent()
1267 struct ti_sci_xfer *xfer; in ti_sci_cmd_clk_get_parent() local
1279 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_GET_CLOCK_PARENT, in ti_sci_cmd_clk_get_parent()
1282 if (IS_ERR(xfer)) { in ti_sci_cmd_clk_get_parent()
1283 ret = PTR_ERR(xfer); in ti_sci_cmd_clk_get_parent()
1287 req = (struct ti_sci_msg_req_get_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_get_parent()
1291 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_clk_get_parent()
1297 resp = (struct ti_sci_msg_resp_get_clock_parent *)xfer->xfer_buf; in ti_sci_cmd_clk_get_parent()
1305 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_parent()
1328 struct ti_sci_xfer *xfer; in ti_sci_cmd_clk_get_num_parents() local
1340 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_GET_NUM_CLOCK_PARENTS, in ti_sci_cmd_clk_get_num_parents()
1343 if (IS_ERR(xfer)) { in ti_sci_cmd_clk_get_num_parents()
1344 ret = PTR_ERR(xfer); in ti_sci_cmd_clk_get_num_parents()
1348 req = (struct ti_sci_msg_req_get_clock_num_parents *)xfer->xfer_buf; in ti_sci_cmd_clk_get_num_parents()
1352 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_clk_get_num_parents()
1358 resp = (struct ti_sci_msg_resp_get_clock_num_parents *)xfer->xfer_buf; in ti_sci_cmd_clk_get_num_parents()
1366 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_num_parents()
1398 struct ti_sci_xfer *xfer; in ti_sci_cmd_clk_get_match_freq() local
1410 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_QUERY_CLOCK_FREQ, in ti_sci_cmd_clk_get_match_freq()
1413 if (IS_ERR(xfer)) { in ti_sci_cmd_clk_get_match_freq()
1414 ret = PTR_ERR(xfer); in ti_sci_cmd_clk_get_match_freq()
1418 req = (struct ti_sci_msg_req_query_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_match_freq()
1425 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_clk_get_match_freq()
1431 resp = (struct ti_sci_msg_resp_query_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_match_freq()
1439 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_match_freq()
1469 struct ti_sci_xfer *xfer; in ti_sci_cmd_clk_set_freq() local
1481 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_SET_CLOCK_FREQ, in ti_sci_cmd_clk_set_freq()
1484 if (IS_ERR(xfer)) { in ti_sci_cmd_clk_set_freq()
1485 ret = PTR_ERR(xfer); in ti_sci_cmd_clk_set_freq()
1489 req = (struct ti_sci_msg_req_set_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_set_freq()
1496 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_clk_set_freq()
1502 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_clk_set_freq()
1507 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_set_freq()
1529 struct ti_sci_xfer *xfer; in ti_sci_cmd_clk_get_freq() local
1541 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_GET_CLOCK_FREQ, in ti_sci_cmd_clk_get_freq()
1544 if (IS_ERR(xfer)) { in ti_sci_cmd_clk_get_freq()
1545 ret = PTR_ERR(xfer); in ti_sci_cmd_clk_get_freq()
1549 req = (struct ti_sci_msg_req_get_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_freq()
1553 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_clk_get_freq()
1559 resp = (struct ti_sci_msg_resp_get_clock_freq *)xfer->xfer_buf; in ti_sci_cmd_clk_get_freq()
1567 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_clk_get_freq()
1577 struct ti_sci_xfer *xfer; in ti_sci_cmd_core_reboot() local
1589 xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_SYS_RESET, in ti_sci_cmd_core_reboot()
1592 if (IS_ERR(xfer)) { in ti_sci_cmd_core_reboot()
1593 ret = PTR_ERR(xfer); in ti_sci_cmd_core_reboot()
1597 req = (struct ti_sci_msg_req_reboot *)xfer->xfer_buf; in ti_sci_cmd_core_reboot()
1599 ret = ti_sci_do_xfer(info, xfer); in ti_sci_cmd_core_reboot()
1605 resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf; in ti_sci_cmd_core_reboot()
1613 ti_sci_put_one_xfer(&info->minfo, xfer); in ti_sci_cmd_core_reboot()
1815 struct ti_sci_xfer *xfer; in ti_sci_probe() local
1866 for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) { in ti_sci_probe()
1867 xfer->xfer_buf = devm_kcalloc(dev, 1, desc->max_msg_size, in ti_sci_probe()
1869 if (!xfer->xfer_buf) in ti_sci_probe()
1872 xfer->tx_message.buf = xfer->xfer_buf; in ti_sci_probe()
1873 init_completion(&xfer->done); in ti_sci_probe()