drivers: i3c: shell: add ccc deftgts command
Add a command for the ccc deftgts to the i3c shell. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
This commit is contained in:
parent
e31a96cbda
commit
0469de9626
1 changed files with 30 additions and 0 deletions
|
|
@ -1001,6 +1001,32 @@ static int cmd_i3c_ccc_setmwl_bc(const struct shell *shell_ctx, size_t argc, cha
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* i3c ccc deftgts <device> */
|
||||
static int cmd_i3c_ccc_deftgts(const struct shell *shell_ctx, size_t argc, char **argv)
|
||||
{
|
||||
const struct device *dev;
|
||||
int ret;
|
||||
|
||||
dev = device_get_binding(argv[ARGV_DEV]);
|
||||
if (!dev) {
|
||||
shell_error(shell_ctx, "I3C: Device driver %s not found.", argv[ARGV_DEV]);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!i3c_bus_has_sec_controller(dev)) {
|
||||
shell_error(shell_ctx, "I3C: No secondary controller on the bus");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
ret = i3c_bus_deftgts(dev);
|
||||
if (ret < 0) {
|
||||
shell_error(shell_ctx, "I3C: unable to send CCC DEFTGTS.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* i3c ccc enttm <device> <defining byte> */
|
||||
static int cmd_i3c_ccc_enttm(const struct shell *shell_ctx, size_t argc, char **argv)
|
||||
{
|
||||
|
|
@ -1981,6 +2007,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
|
|||
"Send CCC SETMWL BC\n"
|
||||
"Usage: ccc setmwl_bc <device> <max write length>",
|
||||
cmd_i3c_ccc_setmwl_bc, 3, 0),
|
||||
SHELL_CMD_ARG(deftgts, &dsub_i3c_device_name,
|
||||
"Send CCC DEFTGTS\n"
|
||||
"Usage: ccc deftgts <device>",
|
||||
cmd_i3c_ccc_deftgts, 2, 0),
|
||||
SHELL_CMD_ARG(enttm, &dsub_i3c_device_name,
|
||||
"Send CCC ENTTM\n"
|
||||
"Usage: ccc enttm <device> <defining byte>",
|
||||
|
|
|
|||
Loading…
Reference in a new issue