From patchwork Sat Apr 14 09:51:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vignesh Raghavendra X-Patchwork-Id: 10340961 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 124BC604D4 for ; Sat, 14 Apr 2018 09:52:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02C89289ED for ; Sat, 14 Apr 2018 09:52:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB87C28A41; Sat, 14 Apr 2018 09:52:03 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 91BAB289ED for ; Sat, 14 Apr 2018 09:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751246AbeDNJvr (ORCPT ); Sat, 14 Apr 2018 05:51:47 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:22222 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920AbeDNJvN (ORCPT ); Sat, 14 Apr 2018 05:51:13 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3E9pBMZ016818; Sat, 14 Apr 2018 04:51:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1523699471; bh=UlLH9RSkHDDfV2AUNgl4MASFWE+r2uehJz2tWlageTg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=V1Lcfnm2uANmRb5yvYbM/2MB9OM/jgjkrPfFxhW30ouNCpuor9qLS53EQJM8zbxnh kDGSnvFwS88vwLCsw32yLuS9W2Kh59waOZElwz3q+/3vPUHzQ0AsxWDFVCw1zzLf1T uALyAWmwZ9cfLUUHKYlgqAZ3ocpv964iAQcvbOZE= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3E9pBwd022097; Sat, 14 Apr 2018 04:51:11 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Sat, 14 Apr 2018 04:51:11 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Sat, 14 Apr 2018 04:51:11 -0500 Received: from a0132425.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3E9p6Dv017397; Sat, 14 Apr 2018 04:51:09 -0500 From: Vignesh R To: Dmitry Torokhov CC: Vignesh R , Grygorii Strashko , , , , Tony Lindgren Subject: [PATCH v2 1/3] Input: ti_am335x_tsc - Mark IRQ as wakeup capable Date: Sat, 14 Apr 2018 15:21:51 +0530 Message-ID: <20180414095153.32060-2-vigneshr@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180414095153.32060-1-vigneshr@ti.com> References: <20180414095153.32060-1-vigneshr@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On AM335x, ti_am335x_tsc can wake up the system from suspend, mark the IRQ as wakeup capable, so that device irq is not disabled during system suspend. Signed-off-by: Vignesh R --- v2: No changes drivers/input/touchscreen/ti_am335x_tsc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index f1043ae71dcc..810e05c9c4f5 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -432,6 +433,12 @@ static int titsc_probe(struct platform_device *pdev) goto err_free_mem; } + if (device_may_wakeup(tscadc_dev->dev)) { + err = dev_pm_set_wake_irq(tscadc_dev->dev, ts_dev->irq); + if (err) + dev_err(&pdev->dev, "irq wake enable failed.\n"); + } + titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES); titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_EOS); err = titsc_config_wires(ts_dev); @@ -462,6 +469,7 @@ static int titsc_probe(struct platform_device *pdev) return 0; err_free_irq: + dev_pm_clear_wake_irq(tscadc_dev->dev); free_irq(ts_dev->irq, ts_dev); err_free_mem: input_free_device(input_dev); @@ -474,6 +482,7 @@ static int titsc_remove(struct platform_device *pdev) struct titsc *ts_dev = platform_get_drvdata(pdev); u32 steps; + dev_pm_clear_wake_irq(ts_dev->mfd_tscadc->dev); free_irq(ts_dev->irq, ts_dev); /* total steps followed by the enable mask */