gpio: eic-sprd: Clear interrupt after set the interrupt type
authorWenhua Lin <Wenhua.Lin@unisoc.com>
Tue, 9 Jan 2024 07:38:48 +0000 (15:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:12 +0000 (16:19 -0800)
commit16b70a75daa770c4dfcf04920b1b7177a7f1fd92
treed8aaf417d215131f412f4ead97f85e59bcd1f241
parenta1703748bbafd602279318a30c4c575261238ecb
gpio: eic-sprd: Clear interrupt after set the interrupt type

[ Upstream commit 84aef4ed59705585d629e81d633a83b7d416f5fb ]

The raw interrupt status of eic maybe set before the interrupt is enabled,
since the eic interrupt has a latch function, which would trigger the
interrupt event once enabled it from user side. To solve this problem,
interrupts generated before setting the interrupt trigger type are ignored.

Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support")
Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-eic-sprd.c