From patchwork Wed Sep 27 12:58:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9974001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AA1860365 for ; Wed, 27 Sep 2017 12:58:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CDA528971 for ; Wed, 27 Sep 2017 12:58:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01AB0290FD; Wed, 27 Sep 2017 12:58:49 +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=-6.9 required=2.0 tests=BAYES_00,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 E252D28CBD for ; Wed, 27 Sep 2017 12:58:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbdI0M6r (ORCPT ); Wed, 27 Sep 2017 08:58:47 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:20258 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752828AbdI0M6q (ORCPT ); Wed, 27 Sep 2017 08:58:46 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20170927125844epoutp0191181e644cd1268f488f7268ae71375d~oOVe3jFS01950619506epoutp01X; Wed, 27 Sep 2017 12:58:44 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.66]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20170927125843epcas1p2fecf9b985c0229d20de6663f5e056118~oOVegVhnS1960919609epcas1p2t; Wed, 27 Sep 2017 12:58:43 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 21.57.04232.380ABC95; Wed, 27 Sep 2017 21:58:43 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20170927125843epcas2p3a703ab81e165bdaf5bfd100dc08f9ae1~oOVeMMQjj1150611506epcas2p3l; Wed, 27 Sep 2017 12:58:43 +0000 (GMT) X-AuditID: b6c32a45-d23ff70000001088-31-59cba083911c Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id EA.AF.06856.380ABC95; Wed, 27 Sep 2017 21:58:43 +0900 (KST) Received: from localhost.localdomain ([10.113.62.47]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OWX00GQRW1SV380@mmp1.samsung.com>; Wed, 27 Sep 2017 21:58:43 +0900 (KST) From: Andi Shyti To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH] Input: stmfts: set IRQ_NOAUTOEN to the irq flag Date: Wed, 27 Sep 2017 21:58:31 +0900 Message-id: <20170927125831.11759-1-andi.shyti@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZdljTTLd5welIgz1vjSy2H3nGarH4x3Mm i8OLXjBa3Pz0jdXi8q45bA6sHteXfGL22DnrLrtH35ZVjB6fN8kFsESl2mSkJqakFimk5iXn p2TmpdsqeQfHO8ebmhkY6hpaWpgrKeQl5qbaKrn4BOi6ZeYA7VVSKEvMKQUKBSQWFyvp29kU 5ZeWpCpk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AXuL9gvuMExi5FjAyrGKUTC0ozk3PLTYqMMpLLdcrTswtLs1L10vOz93ECPT7 tsNa/TsYHy+JP8QowMGoxMMbEXYqUog1say4MvcQowQHs5IIb/ic05FCvCmJlVWpRfnxRaU5 qcWHGKU5WJTEefnzj0UKCaQnlqRmp6YWpBbBZJk4OKUaGOdGiD6wNLta/HKlUtTjdRaLxDk8 YupbpZ6Xy5tGqGZ79YXubF66MHhrieeKwvwIWREOk0CP3QafbQQSShKmKrfciL3bF6uzeYb8 o+OfbsjGnud4d0J78r2Lpgd6rvnxBEcrLm+IF91dM1FWzfdUd4Gqf3Gya37havaVN6uXBT0O afa+/3O1EktxRqKhFnNRcSIAV/PPqfcBAAA= X-CMS-MailID: 20170927125843epcas2p3a703ab81e165bdaf5bfd100dc08f9ae1 X-Msg-Generator: CA X-Sender-IP: 182.195.42.143 X-Local-Sender: =?UTF-8?B?7JWI65SUG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLzthLAp?= =?UTF-8?B?G+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QW5kaSBTaHl0aRtUaXplbiBQbGF0Zm9ybSBMYWIuG1NhbXN1?= =?UTF-8?B?bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170927125843epcas2p3a703ab81e165bdaf5bfd100dc08f9ae1 X-RootMTR: 20170927125843epcas2p3a703ab81e165bdaf5bfd100dc08f9ae1 References: 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 The interrupt is requested before the device is powered on and it's value in some cases cannot be reliable. It happens on some devices that an interrupt is generated as soon as requested before having the chance to disable the irq. Set the irq flag as IRQ_NOAUTOEN before requesting it. This patch mutes the error: stmfts 2-0049: failed to read events: -11 received sometimes during boot time. Signed-off-by: Andi Shyti --- drivers/input/touchscreen/stmfts.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c index 2351199189a4..362de0001b33 100644 --- a/drivers/input/touchscreen/stmfts.c +++ b/drivers/input/touchscreen/stmfts.c @@ -689,6 +689,14 @@ static int stmfts_probe(struct i2c_client *client, input_set_drvdata(sdata->input, sdata); + /* + * stmfts_power_on expects interrupt to be disabled, but + * at this point the device is still off and I do not trust + * the status of the irq line that can generate some spurious + * interrupts. To be on the safe side it's better to not enable + * the interrupts during their request. + */ + irq_set_status_flags(client->irq, IRQ_NOAUTOEN); err = devm_request_threaded_irq(&client->dev, client->irq, NULL, stmfts_irq_handler, IRQF_ONESHOT, @@ -696,9 +704,6 @@ static int stmfts_probe(struct i2c_client *client, if (err) return err; - /* stmfts_power_on expects interrupt to be disabled */ - disable_irq(client->irq); - dev_dbg(&client->dev, "initializing ST-Microelectronics FTS...\n"); err = stmfts_power_on(sdata);