From patchwork Mon Apr 29 15:24:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 10921947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C542514D5 for ; Mon, 29 Apr 2019 15:24:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3BE61FFE6 for ; Mon, 29 Apr 2019 15:24:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A71542842D; Mon, 29 Apr 2019 15:24:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58BFC1FFE6 for ; Mon, 29 Apr 2019 15:24:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728681AbfD2PYU (ORCPT ); Mon, 29 Apr 2019 11:24:20 -0400 Received: from mail.bugwerft.de ([46.23.86.59]:50614 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728645AbfD2PYU (ORCPT ); Mon, 29 Apr 2019 11:24:20 -0400 Received: from localhost.localdomain (pD95EFAD5.dip0.t-ipconnect.de [217.94.250.213]) by mail.bugwerft.de (Postfix) with ESMTPSA id C83DC2A9DB0; Mon, 29 Apr 2019 15:22:19 +0000 (UTC) From: Daniel Mack To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Daniel Mack Subject: [PATCH v4 1/2] input: touch: eeti: move ISR code to own function Date: Mon, 29 Apr 2019 17:24:10 +0200 Message-Id: <20190429152411.12835-1-daniel@zonque.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the ISR handling code to its own function This allows us to call it at resume time to read the hardware state. Signed-off-by: Daniel Mack Signed-off-by: Daniel Mack Reported-by: Sven Neumann Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/eeti_ts.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index 7fe41965c5d1..3e13cc12aaaf 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c @@ -75,11 +75,9 @@ static void eeti_ts_report_event(struct eeti_ts *eeti, u8 *buf) input_sync(eeti->input); } -static irqreturn_t eeti_ts_isr(int irq, void *dev_id) +static void eeti_ts_read(struct eeti_ts *eeti) { - struct eeti_ts *eeti = dev_id; - int len; - int error; + int len, error; char buf[6]; do { @@ -92,12 +90,18 @@ static irqreturn_t eeti_ts_isr(int irq, void *dev_id) break; } - if (buf[0] & 0x80) { - /* Motion packet */ + /* Motion packet */ + if (buf[0] & 0x80) eeti_ts_report_event(eeti, buf); - } } while (eeti->running && eeti->attn_gpio && gpiod_get_value_cansleep(eeti->attn_gpio)); +} + +static irqreturn_t eeti_ts_isr(int irq, void *dev_id) +{ + struct eeti_ts *eeti = dev_id; + + eeti_ts_read(eeti); return IRQ_HANDLED; }