Commit 20719914 authored by Icenowy Zheng's avatar Icenowy Zheng
Browse files

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: default avatarIcenowy Zheng <icenowy@aosc.io>
parent 7c26b6ec
...@@ -68,7 +68,11 @@ static void mentor_i2c_interrupt_clear(void) ...@@ -68,7 +68,11 @@ static void mentor_i2c_interrupt_clear(void)
uint32_t reg; uint32_t reg;
reg = mmio_read_32((uintptr_t)&base->control); reg = mmio_read_32((uintptr_t)&base->control);
#ifndef I2C_INTERRUPT_CLEAR_INVERTED
reg &= ~(I2C_CONTROL_IFLG); reg &= ~(I2C_CONTROL_IFLG);
#else
reg |= I2C_CONTROL_IFLG;
#endif
mmio_write_32((uintptr_t)&base->control, reg); mmio_write_32((uintptr_t)&base->control, reg);
/* Wait for 1 us for the clear to take effect */ /* Wait for 1 us for the clear to take effect */
udelay(1); udelay(1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment