Skip to content

Commit e0f2688

Browse files
XenuIsWatchingDevansh0210
authored andcommitted
drivers: i3c: cdns: implement api for hj response
Implement the api for ibi hj response Signed-off-by: Ryan McClelland <[email protected]>
1 parent 69b1044 commit e0f2688

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/i3c/i3c_cdns.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,19 @@ static void cdns_i3c_program_controller_retaining_reg(const struct device *dev)
10201020
}
10211021

10221022
#ifdef CONFIG_I3C_USE_IBI
1023+
static int cdns_i3c_ibi_hj_response(const struct device *dev, bool ack)
1024+
{
1025+
const struct cdns_i3c_config *config = dev->config;
1026+
1027+
if (ack) {
1028+
sys_write32(CTRL_HJ_ACK | sys_read32(config->base + CTRL), config->base + CTRL);
1029+
} else {
1030+
sys_write32(~CTRL_HJ_ACK & sys_read32(config->base + CTRL), config->base + CTRL);
1031+
}
1032+
1033+
return 0;
1034+
}
1035+
10231036
static int cdns_i3c_controller_ibi_enable(const struct device *dev, struct i3c_device_desc *target)
10241037
{
10251038
uint32_t sir_map;
@@ -3309,6 +3322,7 @@ static DEVICE_API(i3c, api) = {
33093322
.target_unregister = cdns_i3c_target_unregister,
33103323

33113324
#ifdef CONFIG_I3C_USE_IBI
3325+
.ibi_hj_response = cdns_i3c_ibi_hj_response,
33123326
.ibi_enable = cdns_i3c_controller_ibi_enable,
33133327
.ibi_disable = cdns_i3c_controller_ibi_disable,
33143328
.ibi_raise = cdns_i3c_target_ibi_raise,

0 commit comments

Comments
 (0)