Lines Matching +full:max +full:- +full:msgs

4  * SPDX-License-Identifier: Apache-2.0
42 entry->syntax = NULL; \
43 entry->handler = NULL; \
44 entry->subcmd = NULL; \
45 entry->help = NULL; \
49 entry->syntax = i3c_desc->dev->name; \
66 entry->syntax = NULL; \
67 entry->handler = NULL; \
68 entry->subcmd = NULL; \
69 entry->help = NULL; \
71 config = (struct i3c_driver_config *)dev->config; \
72 if (idx < config->dev_list.num_i3c) { \
73 entry->syntax = config->dev_list.i3c[idx].dev->name; \
81 /* zephyr-keep-sorted-start */
86 /* zephyr-keep-sorted-stop */
96 /* zephyr-keep-sorted-start */
101 /* zephyr-keep-sorted-stop */
109 length -= 1; in get_bytes_count_for_hex()
121 config = (struct i3c_driver_config *)dev->config; in get_i3c_list_desc_from_dev_name()
122 for (i = 0; i < config->dev_list.num_i3c; i++) { in get_i3c_list_desc_from_dev_name()
123 if (strcmp(config->dev_list.i3c[i].dev->name, tdev_name) == 0) { in get_i3c_list_desc_from_dev_name()
125 return &config->dev_list.i3c[i]; in get_i3c_list_desc_from_dev_name()
139 if (strcmp(i3c_desc->dev->name, tdev_name) == 0) { in get_i3c_attached_desc_from_dev_name()
153 return -ENODEV; in i3c_parse_args()
158 return -ENODEV; in i3c_parse_args()
160 *desc = get_i3c_attached_desc_from_dev_name(*dev, (*tdev)->name); in i3c_parse_args()
162 shell_error(sh, "I3C: Device %s not attached to bus.", (*tdev)->name); in i3c_parse_args()
163 return -ENODEV; in i3c_parse_args()
182 return -ENODEV; in cmd_i3c_info()
184 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_info()
190 return -ENODEV; in cmd_i3c_info()
192 if (!sys_slist_is_empty(&data->attached_dev.devices.i3c)) { in cmd_i3c_info()
195 if (strcmp(desc->dev->name, tdev->name) == 0) { in cmd_i3c_info()
213 desc->dev->name, (uint64_t)desc->pid, in cmd_i3c_info()
214 desc->static_addr, desc->dynamic_addr, in cmd_i3c_info()
216 desc->group_addr, in cmd_i3c_info()
218 desc->bcr, desc->dcr, desc->data_speed.maxrd, in cmd_i3c_info()
219 desc->data_speed.maxwr, in cmd_i3c_info()
220 desc->data_speed.max_read_turnaround, in cmd_i3c_info()
221 desc->data_length.mrl, desc->data_length.mwl, in cmd_i3c_info()
222 desc->data_length.max_ibi, in cmd_i3c_info()
223 desc->getcaps.getcap1, desc->getcaps.getcap2, in cmd_i3c_info()
224 desc->getcaps.getcap3, desc->getcaps.getcap4); in cmd_i3c_info()
231 return -ENODEV; in cmd_i3c_info()
235 return -ENODEV; in cmd_i3c_info()
239 if (!sys_slist_is_empty(&data->attached_dev.devices.i3c)) { in cmd_i3c_info()
259 desc->dev->name, (uint64_t)desc->pid, desc->static_addr, in cmd_i3c_info()
260 desc->dynamic_addr, in cmd_i3c_info()
262 desc->group_addr, in cmd_i3c_info()
264 desc->bcr, desc->dcr, desc->data_speed.maxrd, in cmd_i3c_info()
265 desc->data_speed.maxwr, in cmd_i3c_info()
266 desc->data_speed.max_read_turnaround, in cmd_i3c_info()
267 desc->data_length.mrl, desc->data_length.mwl, in cmd_i3c_info()
268 desc->data_length.max_ibi, desc->getcaps.getcap1, in cmd_i3c_info()
269 desc->getcaps.getcap2, desc->getcaps.getcap3, in cmd_i3c_info()
270 desc->getcaps.getcap4); in cmd_i3c_info()
275 if (!sys_slist_is_empty(&data->attached_dev.devices.i2c)) { in cmd_i3c_info()
281 i2c_desc->addr, i2c_desc->lvr); in cmd_i3c_info()
304 return -ENODEV; in cmd_i3c_speed()
335 return -ENODEV; in cmd_i3c_recover()
354 uint8_t buf[MAX_I3C_BYTES + MAX_BYTES_FOR_REGISTER_INDEX - 1]; in i3c_write_from_buffer()
365 return -ENODEV; in i3c_write_from_buffer()
370 return -ENODEV; in i3c_write_from_buffer()
372 desc = get_i3c_attached_desc_from_dev_name(dev, tdev->name); in i3c_write_from_buffer()
374 shell_error(sh, "I3C: Device %s not attached to bus.", tdev->name); in i3c_write_from_buffer()
375 return -ENODEV; in i3c_write_from_buffer()
384 data_length = MAX_I3C_BYTES - reg_addr_bytes; in i3c_write_from_buffer()
386 MAX_I3C_BYTES - reg_addr_bytes); in i3c_write_from_buffer()
393 ret = i3c_write(desc, buf + MAX_BYTES_FOR_REGISTER_INDEX - reg_addr_bytes, in i3c_write_from_buffer()
396 shell_error(sh, "Failed to write to device: %s", tdev->name); in i3c_write_from_buffer()
397 return -EIO; in i3c_write_from_buffer()
407 argc - 4); in cmd_i3c_write()
430 return -ENODEV; in i3c_read_to_buffer()
435 return -ENODEV; in i3c_read_to_buffer()
437 desc = get_i3c_attached_desc_from_dev_name(dev, tdev->name); in i3c_read_to_buffer()
439 shell_error(sh, "I3C: Device %s not attached to bus.", tdev->name); in i3c_read_to_buffer()
440 return -ENODEV; in i3c_read_to_buffer()
448 ret = i3c_write_read(desc, reg_addr_buf + MAX_BYTES_FOR_REGISTER_INDEX - reg_addr_bytes, in i3c_read_to_buffer()
451 shell_error(sh, "Failed to read from device: %s", tdev->name); in i3c_read_to_buffer()
452 return -EIO; in i3c_read_to_buffer()
515 data_length = argc - 4; in cmd_i3c_hdr_ddr_write()
580 return -ENODEV; in cmd_i3c_ccc_rstdaa()
591 desc->dynamic_addr = 0; in cmd_i3c_ccc_rstdaa()
592 shell_print(sh, "Reset dynamic address for device %s", desc->dev->name); in cmd_i3c_ccc_rstdaa()
606 return -ENODEV; in cmd_i3c_ccc_entdaa()
622 return -ENODEV; in cmd_i3c_ccc_setaasa()
633 if ((desc->supports_setaasa) && (desc->dynamic_addr == 0) && in cmd_i3c_ccc_setaasa()
634 (desc->static_addr != 0)) { in cmd_i3c_ccc_setaasa()
635 desc->dynamic_addr = desc->static_addr; in cmd_i3c_ccc_setaasa()
657 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_ccc_setdasa()
661 if (!i3c_addr_slots_is_free(&data->attached_dev.addr_slots, dynamic_addr)) { in cmd_i3c_ccc_setdasa()
663 return -EINVAL; in cmd_i3c_ccc_setdasa()
672 desc->dynamic_addr = dynamic_addr; in cmd_i3c_ccc_setdasa()
673 if (desc->dynamic_addr != desc->static_addr) { in cmd_i3c_ccc_setdasa()
674 ret = i3c_reattach_i3c_device(desc, desc->static_addr); in cmd_i3c_ccc_setdasa()
700 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_ccc_setnewda()
704 if (!i3c_addr_slots_is_free(&data->attached_dev.addr_slots, dynamic_addr)) { in cmd_i3c_ccc_setnewda()
706 return -EINVAL; in cmd_i3c_ccc_setnewda()
716 old_da = desc->dynamic_addr; in cmd_i3c_ccc_setnewda()
717 desc->dynamic_addr = dynamic_addr; in cmd_i3c_ccc_setnewda()
747 desc->bcr = bcr.bcr; in cmd_i3c_ccc_getbcr()
772 desc->dcr = dcr.dcr; in cmd_i3c_ccc_getdcr()
820 desc->data_length.mrl = mrl.len; in cmd_i3c_ccc_getmrl()
821 if (desc->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE) { in cmd_i3c_ccc_getmrl()
823 desc->data_length.max_ibi = mrl.ibi_len; in cmd_i3c_ccc_getmrl()
826 desc->data_length.max_ibi = 0; in cmd_i3c_ccc_getmrl()
852 desc->data_length.mwl = mwl.len; in cmd_i3c_ccc_getmwl()
857 /* i3c ccc setmrl <device> <target> <max read length> [<max ibi length>] */
871 if ((desc->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE) && (argc < 5)) { in cmd_i3c_ccc_setmrl()
873 return -EINVAL; in cmd_i3c_ccc_setmrl()
887 desc->data_length.mrl = mrl.len; in cmd_i3c_ccc_setmrl()
889 desc->data_length.max_ibi = mrl.ibi_len; in cmd_i3c_ccc_setmrl()
895 /* i3c ccc setmwl <device> <target> <max write length> */
916 desc->data_length.mwl = mwl.len; in cmd_i3c_ccc_setmwl()
921 /* i3c ccc setmrl_bc <device> <max read length> [<max ibi length>] */
932 return -ENODEV; in cmd_i3c_ccc_setmrl_bc()
947 desc->data_length.mrl = mrl.len; in cmd_i3c_ccc_setmrl_bc()
948 if ((argc > 3) && (desc->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE)) { in cmd_i3c_ccc_setmrl_bc()
949 desc->data_length.max_ibi = mrl.ibi_len; in cmd_i3c_ccc_setmrl_bc()
956 /* i3c ccc setmwl_bc <device> <max write length> */
967 return -ENODEV; in cmd_i3c_ccc_setmwl_bc()
979 desc->data_length.mwl = mwl.len; in cmd_i3c_ccc_setmwl_bc()
994 return -ENODEV; in cmd_i3c_ccc_deftgts()
999 return -ENXIO; in cmd_i3c_ccc_deftgts()
1021 return -ENODEV; in cmd_i3c_ccc_enttm()
1045 return -ENODEV; in cmd_i3c_ccc_rstact_bc()
1081 return -EINVAL; in cmd_i3c_ccc_rstact()
1107 return -ENODEV; in cmd_i3c_ccc_enec_bc()
1131 return -ENODEV; in cmd_i3c_ccc_disec_bc()
1203 return -ENODEV; in cmd_i3c_ccc_entas0_bc()
1205 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_ccc_entas0_bc()
1226 return -ENODEV; in cmd_i3c_ccc_entas1_bc()
1228 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_ccc_entas1_bc()
1249 return -ENODEV; in cmd_i3c_ccc_entas2_bc()
1251 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_ccc_entas2_bc()
1272 return -ENODEV; in cmd_i3c_ccc_entas3_bc()
1274 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_ccc_entas3_bc()
1390 return -EINVAL; in cmd_i3c_ccc_getstatus()
1438 return -EINVAL; in cmd_i3c_ccc_getcaps()
1467 memcpy(&desc->getcaps, &caps, sizeof(desc->getcaps)); in cmd_i3c_ccc_getcaps()
1488 return -ENODEV; in cmd_i3c_ccc_getvendor()
1494 return -ENODEV; in cmd_i3c_ccc_getvendor()
1496 desc = get_i3c_attached_desc_from_dev_name(dev, tdev->name); in cmd_i3c_ccc_getvendor()
1498 shell_error(sh, "I3C: Device %s not attached to bus.", tdev->name); in cmd_i3c_ccc_getvendor()
1499 return -ENODEV; in cmd_i3c_ccc_getvendor()
1505 return -EINVAL; in cmd_i3c_ccc_getvendor()
1542 return -ENODEV; in cmd_i3c_ccc_setvendor()
1548 return -ENODEV; in cmd_i3c_ccc_setvendor()
1550 desc = get_i3c_attached_desc_from_dev_name(dev, tdev->name); in cmd_i3c_ccc_setvendor()
1552 shell_error(sh, "I3C: Device %s not attached to bus.", tdev->name); in cmd_i3c_ccc_setvendor()
1553 return -ENODEV; in cmd_i3c_ccc_setvendor()
1555 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_ccc_setvendor()
1560 return -EINVAL; in cmd_i3c_ccc_setvendor()
1563 data_length = argc - 4; in cmd_i3c_ccc_setvendor()
1591 return -ENODEV; in cmd_i3c_ccc_setvendor_bc()
1597 return -EINVAL; in cmd_i3c_ccc_setvendor_bc()
1600 data_length = argc - 3; in cmd_i3c_ccc_setvendor_bc()
1626 return -ENODEV; in cmd_i3c_ccc_setbuscon()
1629 data_length = argc - 2; in cmd_i3c_ccc_setbuscon()
1658 if (!(desc->bcr & I3C_BCR_MAX_DATA_SPEED_LIMIT)) { in cmd_i3c_ccc_getmxds()
1659 shell_error(sh, "I3C: Device %s does not support max data speed limit", in cmd_i3c_ccc_getmxds()
1660 desc->dev->name); in cmd_i3c_ccc_getmxds()
1661 return -ENOTSUP; in cmd_i3c_ccc_getmxds()
1670 return -EINVAL; in cmd_i3c_ccc_getmxds()
1688 desc->data_speed.maxwr = mxds.fmt3.wrrdturn[0]; in cmd_i3c_ccc_getmxds()
1689 desc->data_speed.maxrd = mxds.fmt3.wrrdturn[1]; in cmd_i3c_ccc_getmxds()
1690 desc->data_speed.max_read_turnaround = sys_get_le24(&mxds.fmt3.wrrdturn[2]); in cmd_i3c_ccc_getmxds()
1698 desc->data_speed.maxwr = mxds.fmt2.maxwr; in cmd_i3c_ccc_getmxds()
1699 desc->data_speed.maxrd = mxds.fmt2.maxrd; in cmd_i3c_ccc_getmxds()
1700 desc->data_speed.max_read_turnaround = sys_get_le24(mxds.fmt2.maxrdturn); in cmd_i3c_ccc_getmxds()
1715 return -ENODEV; in cmd_i3c_attach()
1720 return -ENODEV; in cmd_i3c_attach()
1722 desc = get_i3c_list_desc_from_dev_name(dev, tdev->name); in cmd_i3c_attach()
1724 shell_error(sh, "I3C: Device %s not attached to bus.", tdev->name); in cmd_i3c_attach()
1725 return -ENODEV; in cmd_i3c_attach()
1730 shell_error(sh, "I3C: unable to attach device %s.", tdev->name); in cmd_i3c_attach()
1754 shell_error(sh, "I3C: unable to reattach device %s.", tdev->name); in cmd_i3c_reattach()
1773 shell_error(sh, "I3C: unable to detach device %s.", tdev->name); in cmd_i3c_detach()
1789 return -ENODEV; in cmd_i3c_i2c_attach()
1795 return -ENODEV; in cmd_i3c_i2c_attach()
1816 return -ENODEV; in cmd_i3c_i2c_detach()
1822 return -ENODEV; in cmd_i3c_i2c_detach()
1852 * https://manpages.debian.org/buster/i2c-tools/i2cdetect.8.en.html
1866 return -ENODEV; in cmd_i3c_i2c_scan()
1869 data = (struct i3c_driver_data *)dev->data; in cmd_i3c_i2c_scan()
1880 slot = i3c_addr_slots_status(&data->attached_dev.addr_slots, i + j); in cmd_i3c_i2c_scan()
1882 struct i2c_msg msgs[1]; in cmd_i3c_i2c_scan() local
1898 msgs[0].buf = &dst; in cmd_i3c_i2c_scan()
1899 msgs[0].len = 0U; in cmd_i3c_i2c_scan()
1900 msgs[0].flags = I2C_MSG_WRITE | I2C_MSG_STOP; in cmd_i3c_i2c_scan()
1901 if (i2c_transfer(dev, &msgs[0], 1, i + j) == 0) { in cmd_i3c_i2c_scan()
1905 shell_fprintf_normal(sh, "-- "); in cmd_i3c_i2c_scan()
1920 shell_fprintf_normal(sh, "-- "); in cmd_i3c_i2c_scan()
1942 return -ENODEV; in cmd_i3c_ibi_hj()
1967 return -ENODEV; in cmd_i3c_ibi_cr()
1995 return -ENODEV; in cmd_i3c_ibi_tir()
1998 data_length = argc - 3; in cmd_i3c_ibi_tir()
2068 entry->syntax = i3c_list[idx].dev->name; in i3c_device_list_target_name_get()
2069 entry->handler = NULL; in i3c_device_list_target_name_get()
2070 entry->help = NULL; in i3c_device_list_target_name_get()
2071 entry->subcmd = i3c_list[idx].i3c_list_dev_subcmd; in i3c_device_list_target_name_get()
2073 entry->syntax = NULL; in i3c_device_list_target_name_get()
2082 entry->syntax = i3c_list[idx].dev->name; in i3c_device_attached_target_name_get()
2083 entry->handler = NULL; in i3c_device_attached_target_name_get()
2084 entry->help = NULL; in i3c_device_attached_target_name_get()
2085 entry->subcmd = i3c_list[idx].i3c_attached_dev_subcmd; in i3c_device_attached_target_name_get()
2087 entry->syntax = NULL; in i3c_device_attached_target_name_get()
2096 entry->syntax = i3c_list[idx].dev->name; in i3c_device_name_get()
2097 entry->handler = NULL; in i3c_device_name_get()
2098 entry->help = NULL; in i3c_device_name_get()
2099 entry->subcmd = NULL; in i3c_device_name_get()
2101 entry->syntax = NULL; in i3c_device_name_get()
2204 "Usage: ccc setmrl <device> <target> <max read length> [<max ibi length>]",
2208 "Usage: ccc setmwl <device> <target> <max write length>",
2212 "Usage: ccc setmrl_bc <device> <max read length> [<max ibi length>]",
2216 "Usage: ccc setmwl_bc <device> <max write length>",
2297 cmd_i3c_ccc_setbuscon, 3, MAX_I3C_BYTES - 1),