@@ -1926,9 +1926,9 @@ static int cmd_i3c_i2c_scan(const struct shell *sh, size_t argc, char **argv)
1926
1926
return 0 ;
1927
1927
}
1928
1928
1929
- #ifdef I3C_USE_IBI
1929
+ #ifdef CONFIG_I3C_USE_IBI
1930
1930
/* i3c ibi hj <device> */
1931
- static void cmd_i3c_ibi_hj (const struct shell * sh , size_t argc , char * * argv )
1931
+ static int cmd_i3c_ibi_hj (const struct shell * sh , size_t argc , char * * argv )
1932
1932
{
1933
1933
const struct device * dev ;
1934
1934
struct i3c_ibi request ;
@@ -1948,10 +1948,12 @@ static void cmd_i3c_ibi_hj(const struct shell *sh, size_t argc, char **argv)
1948
1948
}
1949
1949
1950
1950
shell_print (sh , "I3C: Issued IBI HJ" );
1951
+
1952
+ return 0 ;
1951
1953
}
1952
1954
1953
1955
/* i3c ibi cr <device> */
1954
- static void cmd_i3c_ibi_cr (const struct shell * sh , size_t argc , char * * argv )
1956
+ static int cmd_i3c_ibi_cr (const struct shell * sh , size_t argc , char * * argv )
1955
1957
{
1956
1958
const struct device * dev ;
1957
1959
struct i3c_ibi request ;
@@ -1971,28 +1973,29 @@ static void cmd_i3c_ibi_cr(const struct shell *sh, size_t argc, char **argv)
1971
1973
}
1972
1974
1973
1975
shell_print (sh , "I3C: Issued IBI CR" );
1976
+
1977
+ return 0 ;
1974
1978
}
1975
1979
1976
1980
/* i3c ibi tir <device> [<bytes>]*/
1977
- static void cmd_i3c_ibi_tir (const struct shell * sh , size_t argc , char * * argv )
1981
+ static int cmd_i3c_ibi_tir (const struct shell * sh , size_t argc , char * * argv )
1978
1982
{
1979
1983
const struct device * dev ;
1980
1984
struct i3c_ibi request ;
1981
1985
uint16_t data_length ;
1982
- char * * data ;
1983
1986
uint8_t buf [MAX_I3C_BYTES ];
1984
1987
int ret ;
1988
+ uint8_t i ;
1985
1989
1986
1990
dev = device_get_binding (argv [ARGV_DEV ]);
1987
1991
if (!dev ) {
1988
1992
shell_error (sh , "I3C: Device driver %s not found." , argv [ARGV_DEV ]);
1989
1993
return - ENODEV ;
1990
1994
}
1991
1995
1992
- data = argv [3 ];
1993
1996
data_length = argc - 3 ;
1994
1997
for (i = 0 ; i < data_length ; i ++ ) {
1995
- buf [i ] = (uint8_t )strtol (data [ i ], NULL , 16 );
1998
+ buf [i ] = (uint8_t )strtol (argv [ 3 + i ], NULL , 16 );
1996
1999
}
1997
2000
1998
2001
request .ibi_type = I3C_IBI_TARGET_INTR ;
@@ -2006,10 +2009,12 @@ static void cmd_i3c_ibi_tir(const struct shell *sh, size_t argc, char **argv)
2006
2009
}
2007
2010
2008
2011
shell_print (sh , "I3C: Issued IBI TIR" );
2012
+
2013
+ return 0 ;
2009
2014
}
2010
2015
2011
2016
/* i3c ibi enable <device> <target> */
2012
- static void cmd_i3c_ibi_enable (const struct shell * sh , size_t argc , char * * argv )
2017
+ static int cmd_i3c_ibi_enable (const struct shell * sh , size_t argc , char * * argv )
2013
2018
{
2014
2019
const struct device * dev , * tdev ;
2015
2020
struct i3c_device_desc * desc ;
@@ -2027,10 +2032,12 @@ static void cmd_i3c_ibi_enable(const struct shell *sh, size_t argc, char **argv)
2027
2032
}
2028
2033
2029
2034
shell_print (sh , "I3C: Enabled IBI" );
2035
+
2036
+ return 0 ;
2030
2037
}
2031
2038
2032
2039
/* i3c ibi disable <device> <target> */
2033
- static void cmd_i3c_ibi_disable (const struct shell * sh , size_t argc , char * * argv )
2040
+ static int cmd_i3c_ibi_disable (const struct shell * sh , size_t argc , char * * argv )
2034
2041
{
2035
2042
const struct device * dev , * tdev ;
2036
2043
struct i3c_device_desc * desc ;
@@ -2048,6 +2055,8 @@ static void cmd_i3c_ibi_disable(const struct shell *sh, size_t argc, char **argv
2048
2055
}
2049
2056
2050
2057
shell_print (sh , "I3C: Disabled IBI" );
2058
+
2059
+ return 0 ;
2051
2060
}
2052
2061
#endif
2053
2062
@@ -2093,7 +2102,7 @@ static void i3c_device_name_get(size_t idx, struct shell_static_entry *entry)
2093
2102
2094
2103
SHELL_DYNAMIC_CMD_CREATE (dsub_i3c_device_name , i3c_device_name_get );
2095
2104
2096
- #ifdef I3C_USE_IBI
2105
+ #ifdef CONFIG_I3C_USE_IBI
2097
2106
/* L2 I3C IBI Shell Commands*/
2098
2107
SHELL_STATIC_SUBCMD_SET_CREATE (
2099
2108
sub_i3c_ibi_cmds ,
@@ -2362,7 +2371,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
2362
2371
"Send I3C HDR\n"
2363
2372
"Usage: hdr <sub cmd>" ,
2364
2373
NULL , 3 , 0 ),
2365
- #ifdef I3C_USE_IBI
2374
+ #ifdef CONFIG_I3C_USE_IBI
2366
2375
SHELL_CMD_ARG (ibi , & sub_i3c_ibi_cmds ,
2367
2376
"Send I3C IBI\n"
2368
2377
"Usage: ibi <sub cmd>" ,
0 commit comments