From patchwork Mon Apr 29 03:25:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 10921125 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 16DCB912 for ; Mon, 29 Apr 2019 03:26:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0380628658 for ; Mon, 29 Apr 2019 03:26:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9B9F28735; Mon, 29 Apr 2019 03:26:31 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B26928658 for ; Mon, 29 Apr 2019 03:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=epNzwW+k09cbVWVKu3eKNkYL5T2qN0r+yjFoKPAVXLY=; b=bHKq7XBj3FsYFY m2Bi61prX8fm14gV7uul5eHOohA8DfPTY2Q62wt/y0Ns6/pePsknzkxlnP8rPGHCLRGx6t0rLEGDF bEn7uqPHg3MF041+MFvuDH+6Xwha7QryodeMcYqiqtx8qJq4/X24oGjbYoBkdrJIVhu24+rKRFfzN +3CsSLIDojKOgF7AqStiqaabvMnaDqD9/iOfENsd/wLUO8LkCfXDpetwwhM8NZvWR7e0pZ6+CsWc5 8RhBYNm3p04LUmkQAxElB8thXoco2kNjwaghQsVrlSPh32EX3eBPmDZYbwSvvzUFEdDReOJ1TGZ0y vNQzU56PWcoaDWiegVXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hKww0-00056y-17; Mon, 29 Apr 2019 03:26:28 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hKwvh-0004mb-Sm for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2019 03:26:12 +0000 Received: by mail-pf1-x444.google.com with SMTP id e67so4601529pfe.10 for ; Sun, 28 Apr 2019 20:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1t5XlT2MKDWHi6woYas868Il32PJ2FqSyI3/eucTk+M=; b=Y/5zs/kxPAO6IznP7l9z6tSm542jICmYfTeptX9Pgu6+SP/6pjsy+VlsKri0qNx3bW 3CrDEh7MGVazLDHxtLnppmWeGBNx5qs9SjyrF8BGyDBmD5eGDy17qcfeFqswBBmiUIRW V78BmDvy9QIwm+aC9Xbe4TSHCO48cVQpBNwI4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1t5XlT2MKDWHi6woYas868Il32PJ2FqSyI3/eucTk+M=; b=JGwp4BIJYA5XIENw2XZ5ekbHtpJjW4X8giA7DjyzX5gGNf6pJhZi+JkL66xhUHZgHE 42b2vFDFZvLA+6r+wUF7sCZ2xkRsMy3ujjjvODgPWy/+huXqup0xsiOAcltrlCcR0pdT 44ntKNCdinL5RWYLZJrLpkWmWSGF9MBb3WJg2Ir4saFL73dW76h/3dgVjBkKzQll2CS4 GbDutJrUoEbzdj97J8/uWvlUiBqk0qQMkSgk1m07RX0myBJD4UfMgD0ZLkNPIcrJYbf0 Z6Tz4Lw7M/zmAzCD4RZNRG9Jj0Xx4ogUnY6ZX8Kme+xYJNW7UEBi+mTsg1UYK+7pS8is V46Q== X-Gm-Message-State: APjAAAXqB+bGQHcgfmAIXdqFbnZIQ1Pw4ruB10fgVherOAYJBTVVN5ub EzxwI4f2f99ADtx4kwJPSvCy4w== X-Google-Smtp-Source: APXvYqwcxJtRHeC+jJ4mkhX0VVM0VpONliBoEORgL2cg9CA+k0cwGAgIX09ALZvOAb8IaI6sFJjyLw== X-Received: by 2002:a63:161d:: with SMTP id w29mr33985281pgl.395.1556508369048; Sun, 28 Apr 2019 20:26:09 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:d8b7:33af:adcb:b648]) by smtp.gmail.com with ESMTPSA id a10sm41364938pfc.21.2019.04.28.20.26.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 20:26:08 -0700 (PDT) From: Nicolas Boichat To: linux-mediatek@lists.infradead.org Subject: [PATCH 1/2] pinctrl: mediatek: Add mtk_eint_pm_ops to common-v2 Date: Mon, 29 Apr 2019 11:25:50 +0800 Message-Id: <20190429032551.65975-2-drinkcat@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190429032551.65975-1-drinkcat@chromium.org> References: <20190429032551.65975-1-drinkcat@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190428_202609_928295_E0DF3AA2 X-CRM114-Status: GOOD ( 12.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chuanjia Liu , Linus Walleij , Sean Wang , linux-kernel@vger.kernel.org, evgreen@chromium.org, swboyd@chromium.org, linux-gpio@vger.kernel.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP pinctrl variants that include pinctrl-mtk-common-v2.h (and not pinctrl-mtk-common.h) also need to use mtk_eint_pm_ops to setup wake mask properly, so copy over the pm_ops to v2. It is not easy to merge the 2 copies (or move mtk_eint_suspend/resume to mtk-eint.c), as we need to dereference pctrl->eint, and struct mtk_pinctrl *pctl has a different structure definition for v1 and v2. Signed-off-by: Nicolas Boichat Reviewed-by: Chuanjia Liu --- .../pinctrl/mediatek/pinctrl-mtk-common-v2.c | 19 +++++++++++++++++++ .../pinctrl/mediatek/pinctrl-mtk-common-v2.h | 1 + 2 files changed, 20 insertions(+) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c index 20e1c890e73b30c..7e19b5a4748eafe 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c @@ -723,3 +723,22 @@ int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw, return 0; } + +static int mtk_eint_suspend(struct device *device) +{ + struct mtk_pinctrl *pctl = dev_get_drvdata(device); + + return mtk_eint_do_suspend(pctl->eint); +} + +static int mtk_eint_resume(struct device *device) +{ + struct mtk_pinctrl *pctl = dev_get_drvdata(device); + + return mtk_eint_do_resume(pctl->eint); +} + +const struct dev_pm_ops mtk_eint_pm_ops = { + .suspend_noirq = mtk_eint_suspend, + .resume_noirq = mtk_eint_resume, +}; diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h index 1b7da42aa1d53e4..e2048db5bb16671 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h @@ -299,4 +299,5 @@ int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw, int mtk_pinconf_adv_drive_get(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc, u32 *val); +extern const struct dev_pm_ops mtk_eint_pm_ops; #endif /* __PINCTRL_MTK_COMMON_V2_H */ From patchwork Mon Apr 29 03:25:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 10921129 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 4F857912 for ; Mon, 29 Apr 2019 03:26:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E0ED28658 for ; Mon, 29 Apr 2019 03:26:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3223628735; Mon, 29 Apr 2019 03:26:55 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD91C28658 for ; Mon, 29 Apr 2019 03:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SlvfRwQK4nz+zKUklO+aeJ/VcpOfTHtgofcUCwle1xU=; b=cGnfKihU3esNEp Ib9MfwoQ5JrUordsb3PCyPQgCFXmMLahQV/2KVgMJAlmLmf07TEM775G5Ixq1FZMS91XmOZPjx6j4 9laGSXdvbqPNQ0zjvK729j8a0XfiIBWpkZjme3+fJ7iTCcgsnhVfTgHkccxzeAOfqr7s/Q8DRio3T uScCc02K5/FkejHEaY9UiruK1BXhErtKqmEPPuWuXZrygwlUpWxf6sLOKf3/qEOdAVGxOJvtksCLS 0e/u+lYkyy4wItF1B9i3Hk6V+sSUqReiYPWRhHaPSFJXguRKzQabHTJmcOF7VECtUIpuUSd8Gvqs8 j3SjW0h8Cx5/1ezbCFIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hKwwK-0005Rt-UJ; Mon, 29 Apr 2019 03:26:48 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hKwvj-0004nn-Te for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2019 03:26:16 +0000 Received: by mail-pl1-x642.google.com with SMTP id l2so1626956plt.11 for ; Sun, 28 Apr 2019 20:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cjmbiwT3xx0O7Zw3eEqLKXpxbtx6F0HnsFgBh+Wws60=; b=CNgWhxrReeKSMttB9V3/AQpjze5DuX7cltNGhy/sDaNNUG7o+k1WqxOSMkKwKlDvW2 /9n0hGXDpt/Or05jBZQIIJVwxeyltEgOjCn83ff0quxl9zoHmE2m3a1M1H44l1FkUIzz fYB61oYgVr8AOx3UNCWaSDCzPBsI7r0sSZzRE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cjmbiwT3xx0O7Zw3eEqLKXpxbtx6F0HnsFgBh+Wws60=; b=dkpuM+jqfuRWAQJDpwUnzu4WHZAbWw2CvFT7+99Y/E71eOkKAovqFz2DfOB6OtezCi mhbTobLq03Q2imsE+9So7dypQqB9oyFBHAlL+5H485DkWRfPBr8Y7UBLj/1v0VdDWKxe +FdSs3qa1XGDectgqmWomqI3DgzNEq3bQPO6HZKEnT6Sbqv46sT9f+NeCjVFWCkX6AdK 4zHwUwSBwU44pE7Wd6kahHO2BfGXfrax4FczbT5FJiuTVMBkmHOamfBkiRbnxaNOJB6t b/P3SrOrZIGBBD2M0zV5uVp2M9e8qtLxk6GM176HCC3LAOHkqL5UvOg6LuZOnjEOoaeo WZGQ== X-Gm-Message-State: APjAAAXPrvf5yROIT0RHWP+EQ/bi+WpmQ8Z3CsJ5/QL9B3X9gnlbOZTk shcMIjjE75Z+dgEbqWG73SIl9g== X-Google-Smtp-Source: APXvYqy06pNWRUPq6DrNgZnE5+p+TnTL2fBYI+0TfPcqSXM5TfqsdN3IWuQyyVKhaxJhoe+spIIhgA== X-Received: by 2002:a17:902:a7:: with SMTP id a36mr59457611pla.111.1556508371342; Sun, 28 Apr 2019 20:26:11 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:d8b7:33af:adcb:b648]) by smtp.gmail.com with ESMTPSA id a10sm41364938pfc.21.2019.04.28.20.26.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 20:26:10 -0700 (PDT) From: Nicolas Boichat To: linux-mediatek@lists.infradead.org Subject: [PATCH 2/2] pinctrl: mediatek: mt8183: Add mtk_eint_pm_ops Date: Mon, 29 Apr 2019 11:25:51 +0800 Message-Id: <20190429032551.65975-3-drinkcat@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190429032551.65975-1-drinkcat@chromium.org> References: <20190429032551.65975-1-drinkcat@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190428_202612_164089_80E78520 X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chuanjia Liu , Linus Walleij , Sean Wang , linux-kernel@vger.kernel.org, evgreen@chromium.org, swboyd@chromium.org, linux-gpio@vger.kernel.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Setting this up will configure wake from suspend properly, and wake only for the interrupts that are setup in wake_mask, not all interrupts. Signed-off-by: Nicolas Boichat Reviewed-by: Chuanjia Liu --- drivers/pinctrl/mediatek/pinctrl-mt8183.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8183.c b/drivers/pinctrl/mediatek/pinctrl-mt8183.c index 2c7409ed16fae9c..ce93e55b79a435a 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt8183.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt8183.c @@ -583,6 +583,7 @@ static struct platform_driver mt8183_pinctrl_driver = { .driver = { .name = "mt8183-pinctrl", .of_match_table = mt8183_pinctrl_of_match, + .pm = &mtk_eint_pm_ops, }, .probe = mt8183_pinctrl_probe, };