回覆: [PATCH 4/8] i3c: mipi-i3c-hci: Add a quirk to clear the TX start threshold
From: Billy Tsai
Date: Wed Sep 09 2026 - 01:39:11 EST
> > + if (dma && (hci->quirks & HCI_QUIRK_TX_START_THLD) && hci->PIO_regs) {
> > + void __iomem *thld_reg = hci->PIO_regs + PIO_DATA_BUFFER_THLD_CTRL;
> > + u32 thld_val = readl(thld_reg);
> > +
> > + thld_val &= ~DATA_TX_START_THLD;
> > + writel(thld_val, thld_reg);
> don't move these defination, original isolate is quite good. Add API or
> callback to implement clean DATA_TX_START_THLD.
Okay.
Will revert the pio.h split and keep the PIO Access Area
register/bitfield definitions private to pio.c as before. Instead,
add a small accessor there:
void mipi_i3c_hci_pio_clr_tx_start_thld(struct i3c_hci *hci)
{
u32 val = pio_reg_read(DATA_BUFFER_THLD_CTRL);
pio_reg_write(DATA_BUFFER_THLD_CTRL, val & ~DATA_TX_START_THLD);
}
declared in hci.h next to the other pio.c-implemented cross-file
functions (mipi_i3c_hci_pio_reset(), mipi_i3c_hci_pio_reset_all_queues()).
i3c_hci_set_io_mode() then just calls it:
if (dma && (hci->quirks & HCI_QUIRK_TX_START_THLD) && hci->PIO_regs)
mipi_i3c_hci_pio_clr_tx_start_thld(hci);
core.c no longer needs to know the PIO register layout at all.
Billy