Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6936e1f8 authored by Patrice Chotard's avatar Patrice Chotard Committed by Lee Jones
Browse files

gpio: stmpe: Write int status register only when needed



On STMPE801/1801 datasheets, it's mentionned writing
in interrupt status register has no effect, bits are
cleared when reading.

Signed-off-by: default avatarAmelie DELAUNAY <amelie.delaunay@st.com>
Signed-off-by: default avatarPatrice Chotard <patrice.chotard@st.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 287849cb
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -371,13 +371,17 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev)
			stat &= ~(1 << bit);
		}

		/*
		 * interrupt status register write has no effect on
		 * 801 and 1801, bits are cleared when read.
		 * Edge detect register is not present on 801 and 1801
		 */
		if (stmpe->partnum != STMPE801 || stmpe->partnum != STMPE1801) {
			stmpe_reg_write(stmpe, statmsbreg + i, status[i]);

		/* Edge detect register is not present on 801 and 1801 */
		if (stmpe->partnum != STMPE801 || stmpe->partnum != STMPE1801)
			stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_GPEDR_MSB]
					+ i, status[i]);
		}
	}

	return IRQ_HANDLED;
}