mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-25 14:25:44 +00:00
drivers: mentor: mi2cv: add inverted interrupt clear flag quirk
The I2C controller on Allwinner SoCs after A31 has a inverted interrupt clear flag, which needs to be written 1 (rather than 0 on Marvell SoCs and old Allwinner SoCs) to clear. Add such a quirk to mi2cv driver common code. Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
This commit is contained in:
parent
7c26b6ecea
commit
2071991413
1 changed files with 4 additions and 0 deletions
|
@ -68,7 +68,11 @@ static void mentor_i2c_interrupt_clear(void)
|
|||
uint32_t reg;
|
||||
|
||||
reg = mmio_read_32((uintptr_t)&base->control);
|
||||
#ifndef I2C_INTERRUPT_CLEAR_INVERTED
|
||||
reg &= ~(I2C_CONTROL_IFLG);
|
||||
#else
|
||||
reg |= I2C_CONTROL_IFLG;
|
||||
#endif
|
||||
mmio_write_32((uintptr_t)&base->control, reg);
|
||||
/* Wait for 1 us for the clear to take effect */
|
||||
udelay(1);
|
||||
|
|
Loading…
Add table
Reference in a new issue