Use the correct variable to check which interrupt mode to use

In the PL061 driver we incorrectly used the mask rather than mode to find
how to configure the interrupt.

Sponsored by:	Innovate UK
This commit is contained in:
Andrew Turner 2020-09-10 09:37:30 +00:00
parent 2b32d93e55
commit 365ed84f28
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365557

View File

@ -335,22 +335,22 @@ pl061_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc,
PL061_LOCK(sc);
if (mask & GPIO_INTR_EDGE_BOTH) {
if (mode & GPIO_INTR_EDGE_BOTH) {
mask_and_set(sc, PL061_INTBOTHEDGES, mask, mask);
mask_and_set(sc, PL061_INTSENSE, mask, 0);
} else if (mask & GPIO_INTR_EDGE_RISING) {
} else if (mode & GPIO_INTR_EDGE_RISING) {
mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0);
mask_and_set(sc, PL061_INTSENSE, mask, 0);
mask_and_set(sc, PL061_INTEVENT, mask, mask);
} else if (mask & GPIO_INTR_EDGE_FALLING) {
} else if (mode & GPIO_INTR_EDGE_FALLING) {
mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0);
mask_and_set(sc, PL061_INTSENSE, mask, 0);
mask_and_set(sc, PL061_INTEVENT, mask, 0);
} else if (mask & GPIO_INTR_LEVEL_HIGH) {
} else if (mode & GPIO_INTR_LEVEL_HIGH) {
mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0);
mask_and_set(sc, PL061_INTSENSE, mask, mask);
mask_and_set(sc, PL061_INTEVENT, mask, mask);
} else if (mask & GPIO_INTR_LEVEL_LOW) {
} else if (mode & GPIO_INTR_LEVEL_LOW) {
mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0);
mask_and_set(sc, PL061_INTSENSE, mask, mask);
mask_and_set(sc, PL061_INTEVENT, mask, 0);