Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3036609imm; Tue, 4 Sep 2018 14:19:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZSkbLpdocWKCFuldLt+cvifjTGUcn0GIKDdkOeHOdT393BaztXRAb/hOoKK2pj8psMeoJQ X-Received: by 2002:a62:34c4:: with SMTP id b187-v6mr36391588pfa.15.1536095994563; Tue, 04 Sep 2018 14:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536095994; cv=none; d=google.com; s=arc-20160816; b=w8uRHTx+Nmk0e+Y/MbvDQVSI4KjIsP/HOQ+bp+f1auiRc6JNq+zQn1+7WO7Gztg3AB 7d9fws1k3EQgQk6xQnPa2qawWFyl0sG3cHTDQYZoqSBFhm8m53Ih4g6hUhLzbB8L4Pb1 DNCcVWLbyDBlr7VssIznBcYnIE11Kt//6/et6mEZK9XE7jO4km/gjmilQQS6Qfqajry3 brCl8mIV8sdkDI/m04d9UiJG2CY8unVeggjC8jME0PhQs6YXbUC0bnP6itd7VDoBb+56 j9vvUaDRsXsgMqNM/SadPJEb+sEIPFzsNm59M/857Yfvt4ms7I0/pUverlPTDgc0U1Lv NAkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=RZ2HM6TJ+FbRXe6T6AB/ETvH98qRqS4HRGTc09PhMjg=; b=qUgPWJaW4T6zDXBNEvIJwz2sgxeaVkU2cfH5ySKCkYTaguRHePy7giGUeU9KCfcGm7 c7+XcGoq4YR4IpmE+assOIXw81LdwhLWrGsLlHb53SQ7dZ6ADlqukEWbfLIby3sCWvb9 RkMMsZ/tXhloOIoDctedy/NWMXygeimjimRj/seIlUn491CIm1h4DDztb5gdlC5I+Z7E rDIgNUajkQgFLHTL78e8QznouORdb2e+ZYPIUDVPii5fBOkd0wfx8uB9BwmGFYQZwc6g InR8DLs3HolZivIjr5hI+A1+lPr0ul4umcMB6HHt5YDapyDbPcgQhv3Y9WFgr3WZIvcX kkwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EcuusKyh; dkim=pass header.i=@codeaurora.org header.s=default header.b=oZfC8g66; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w135-v6si23977893pff.8.2018.09.04.14.19.38; Tue, 04 Sep 2018 14:19:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EcuusKyh; dkim=pass header.i=@codeaurora.org header.s=default header.b=oZfC8g66; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727388AbeIEBpZ (ORCPT + 99 others); Tue, 4 Sep 2018 21:45:25 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50880 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727330AbeIEBpY (ORCPT ); Tue, 4 Sep 2018 21:45:24 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 888ED60AA2; Tue, 4 Sep 2018 21:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536095909; bh=JJLAku1WEJzIGgkft3WYFW22LPq0PqPXFU9Kz0wRJhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EcuusKyhzPpaEdnLIaYMUh1/DsgLJRY/sQoivGTbxBTQwh1f6zddhHMxPboe2K2GX Bsyhb4QxR573bunZPCPgIPhHAVlRAvhwBXxSCC0lOT6CAfjgbIXtHg+6F5VX9bVEUz mZXiFt/Kw768eBB46EARzf4rpRqNeWkQZIUlXEgU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8D5F160997; Tue, 4 Sep 2018 21:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536095908; bh=JJLAku1WEJzIGgkft3WYFW22LPq0PqPXFU9Kz0wRJhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oZfC8g66pBlSZRvccsugIuDdDbBKD3TXKhrJi/8Zafo3nLSm4T2xMtsBb/wj9F5Fm Ua+ol989UrYzXud6NhBHljnso+1fLfX/n/L00HkOYN+5CeMniz0IDIFeNzfNxyMeiB I3LPwK3P4r+B5a7fzbWdWRyEwL7YiARa6ig0ebcs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8D5F160997 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org From: Lina Iyer To: marc.zyngier@arm.com, bjorn.andersson@linaro.org, sboyd@kernel.org, evgreen@chromium.org, linus.walleij@linaro.org Cc: rplsssn@codeaurora.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, rnayak@codeaurora.org, devicetree@vger.kernel.org, andy.gross@linaro.org, dianders@chromium.org, Lina Iyer Subject: [PATCH v3 4/5] drivers: pinctrl: qcom: sdm845: support GPIO wakeup from suspend Date: Tue, 4 Sep 2018 15:18:09 -0600 Message-Id: <20180904211810.5506-5-ilina@codeaurora.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180904211810.5506-1-ilina@codeaurora.org> References: <20180904211810.5506-1-ilina@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable TLMM IRQs to be sensed by PDC when we enter suspend. It is possible that the TLMM may be powered off and not detect GPIOs that are configured as wake up interrupts. By hooking into suspend callbacks, we allow PDC IRQs to take over and wake up the system if wakeup interrupts are triggered. Signed-off-by: Lina Iyer --- Changes in v3: - Move the common suspend ops definition to pinctrl-msm.c --- drivers/pinctrl/qcom/pinctrl-msm.c | 5 +++++ drivers/pinctrl/qcom/pinctrl-msm.h | 2 ++ drivers/pinctrl/qcom/pinctrl-sdm845.c | 1 + 3 files changed, 8 insertions(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 01a455f86fcd..92887c075230 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -1142,6 +1142,11 @@ int __maybe_unused msm_pinctrl_resume_late(struct device *dev) return 0; } +const struct dev_pm_ops msm_pinctrl_dev_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(msm_pinctrl_suspend_late, + msm_pinctrl_resume_late) +}; + int msm_pinctrl_probe(struct platform_device *pdev, const struct msm_pinctrl_soc_data *soc_data) { diff --git a/drivers/pinctrl/qcom/pinctrl-msm.h b/drivers/pinctrl/qcom/pinctrl-msm.h index 21b56fb5dae9..9be1baa878a3 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.h +++ b/drivers/pinctrl/qcom/pinctrl-msm.h @@ -126,4 +126,6 @@ int msm_pinctrl_remove(struct platform_device *pdev); int msm_pinctrl_suspend_late(struct device *dev); int msm_pinctrl_resume_late(struct device *dev); +extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops; + #endif diff --git a/drivers/pinctrl/qcom/pinctrl-sdm845.c b/drivers/pinctrl/qcom/pinctrl-sdm845.c index 2ab7a8885757..0c82dc403268 100644 --- a/drivers/pinctrl/qcom/pinctrl-sdm845.c +++ b/drivers/pinctrl/qcom/pinctrl-sdm845.c @@ -1301,6 +1301,7 @@ static struct platform_driver sdm845_pinctrl_driver = { .driver = { .name = "sdm845-pinctrl", .of_match_table = sdm845_pinctrl_of_match, + .pm = &msm_pinctrl_dev_pm_ops, }, .probe = sdm845_pinctrl_probe, .remove = msm_pinctrl_remove, -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project