Skip to content

Commit e22405a

Browse files
nxpfranklialexandrebelloni
authored andcommitted
i3c: master: svc: manually emit NACK/ACK for hotjoin
When the address is arbitrated at send address, the hardware can auto-send NACK if it is an IBI. However, manual emission of NACK/ACK is needed for hot join or controller request events. Add help function svc_i3c_master_handle_ibi_won() to check event type and send out NACK if the event is not an IBI. Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 3c6684a commit e22405a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

drivers/i3c/master/svc-i3c-master.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,24 @@ static void svc_i3c_master_nack_ibi(struct svc_i3c_master *master)
409409
master->regs + SVC_I3C_MCTRL);
410410
}
411411

412+
static int svc_i3c_master_handle_ibi_won(struct svc_i3c_master *master, u32 mstatus)
413+
{
414+
u32 ibitype;
415+
416+
ibitype = SVC_I3C_MSTATUS_IBITYPE(mstatus);
417+
418+
writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS);
419+
420+
/* Hardware can't auto emit NACK for hot join and master request */
421+
switch (ibitype) {
422+
case SVC_I3C_MSTATUS_IBITYPE_HOT_JOIN:
423+
case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST:
424+
svc_i3c_master_nack_ibi(master);
425+
}
426+
427+
return 0;
428+
}
429+
412430
static void svc_i3c_master_ibi_work(struct work_struct *work)
413431
{
414432
struct svc_i3c_master *master = container_of(work, struct svc_i3c_master, ibi_work);
@@ -1177,7 +1195,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master,
11771195
* start.
11781196
*/
11791197
if (SVC_I3C_MSTATUS_IBIWON(reg)) {
1180-
writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS);
1198+
svc_i3c_master_handle_ibi_won(master, reg);
11811199
continue;
11821200
}
11831201

0 commit comments

Comments
 (0)