Skip to content

Commit

Permalink
media: apple: isp: Clear IRQs when resetting coproc
Browse files Browse the repository at this point in the history
XXX this might be wrong on some chips?

Signed-off-by: Asahi Lina <lina@asahilina.net>
  • Loading branch information
asahilina authored and jannau committed Nov 19, 2024
1 parent 85e9981 commit a6472f8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/media/platform/apple/isp/isp-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ static int isp_reset_coproc(struct apple_isp *isp)
{
int retries;
u32 status;
u32 val;

isp_coproc_write32(isp, ISP_COPROC_EDPRCR, 0x2);

Expand All @@ -230,6 +231,18 @@ static int isp_reset_coproc(struct apple_isp *isp)
isp_coproc_write32(isp, ISP_COPROC_IRQ_MASK_4, 0xffffffff);
isp_coproc_write32(isp, ISP_COPROC_IRQ_MASK_5, 0xffffffff);

for (retries = 0; retries < 128; retries++) {
val = isp_coproc_read32(isp, 0x818);
if (val == 0)
break;
}

for (retries = 0; retries < 128; retries++) {
val = isp_coproc_read32(isp, 0x81c);
if (val == 0)
break;
}

for (retries = 0; retries < ISP_FIRMWARE_MAX_TRIES; retries++) {
status = isp_coproc_read32(isp, ISP_COPROC_STATUS);
if (status & ISP_COPROC_IN_WFI) {
Expand Down

0 comments on commit a6472f8

Please sign in to comment.