Skip to content

Commit d3a7b7d

Browse files
XenuIsWatchingnashif
authored andcommitted
drivers: i3c: cdns: fix ibi length with no payload
If the BCR value is not set for ibi w/ payload, then it still has a ibi length of 1 due to the MDB. Set the PL accordingly. Signed-off-by: Ryan McClelland <[email protected]>
1 parent a673871 commit d3a7b7d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/i3c/i3c_cdns.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,13 @@ static int cdns_i3c_controller_ibi_enable(const struct device *dev, struct i3c_d
10851085
/* TODO: check for duplicate in SIR */
10861086

10871087
sir_cfg = SIR_MAP_DEV_ROLE(I3C_BCR_DEVICE_ROLE(target->bcr)) |
1088-
SIR_MAP_DEV_DA(target->dynamic_addr) |
1089-
SIR_MAP_DEV_PL(target->data_length.max_ibi);
1088+
SIR_MAP_DEV_DA(target->dynamic_addr);
1089+
if (i3c_ibi_has_payload(target)) {
1090+
sir_cfg |= SIR_MAP_DEV_PL(target->data_length.max_ibi);
1091+
} else {
1092+
/* Set to 1 for MDB */
1093+
sir_cfg |= SIR_MAP_DEV_PL(1);
1094+
}
10901095
/* ACK if there is an ibi tir cb or if it is controller capable*/
10911096
if ((target->ibi_cb != NULL) || i3c_device_is_controller_capable(target)) {
10921097
sir_cfg |= SIR_MAP_DEV_ACK;

0 commit comments

Comments
 (0)