Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753656AbcDSMTc (ORCPT ); Tue, 19 Apr 2016 08:19:32 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:35714 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753495AbcDSMT0 (ORCPT ); Tue, 19 Apr 2016 08:19:26 -0400 From: To: , , , , CC: , , , , , , , , , , , Patrice Chotard Subject: [PATCH 4/8] gpio: stmpe: write int status register only when needed Date: Tue, 19 Apr 2016 14:18:33 +0200 Message-ID: <1461068317-28016-5-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461068317-28016-1-git-send-email-patrice.chotard@st.com> References: <1461068317-28016-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.1.66] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-19_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1263 Lines: 39 From: Patrice Chotard On STMPE801/1801 datasheets, it's mentionned writing in interrupt status register has no effect, bits are cleared when reading. Signed-off-by: Amelie DELAUNAY Signed-off-by: Patrice Chotard --- drivers/gpio/gpio-stmpe.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 225e075..f8c9d22 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -344,12 +344,16 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev) stat &= ~(1 << bit); } - 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) + /* + * 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]); stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_GPEDR_MSB] + i, status[i]); + } } return IRQ_HANDLED; -- 1.9.1