From patchwork Wed May 8 07:33:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 10934545 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 BC76E13AD for ; Wed, 8 May 2019 07:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8AF327FB7 for ; Wed, 8 May 2019 07:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C8D528708; Wed, 8 May 2019 07:33:53 +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 4919827FB7 for ; Wed, 8 May 2019 07:33:53 +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=bBC1+IOwQNHCgwCIYJD/3tk9u4MaorLliA7hcp/X6JE=; b=FoAiH4DYkjBtFD zNpn6LuvmJHh7gMhf6lMMAclS4Z4+9Z/IARG1hZvGDLIumI1Um+FJ4dUs3pllgy5Q8SpyhpBSdYM5 CAgWtM/G2oYRwjLEODa11mNw5bPcyBKYR1optFjZ6ktrxHz26yG2yhXcv45oNAzIQP8IcmyUoZ38U WtbOvp+MEFJlJTHkFWRiEPkYHu7mypfvQWI536yd6uVlwcdjmf5TPh5XpBbQ1bdG8b22uWUPunJaa bcb2KAWO4sXwGxrWIoPkPVUDmw5FyZ592oLH4BeIsQnlkqfVCEUicFmt6zDqUsikRRXXg+9+0EOnP KxIoZodBFs1YGji7XPuw==; 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 1hOH5J-0001hC-E1; Wed, 08 May 2019 07:33:49 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOH5A-0001WB-4d for linux-arm-kernel@lists.infradead.org; Wed, 08 May 2019 07:33:41 +0000 Received: by mail-pf1-x442.google.com with SMTP id y13so10030979pfm.11 for ; Wed, 08 May 2019 00:33:40 -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=gYFoR4O/xJAOVdtzf1KO84jqKZdhkztW34riW/9p2p8=; b=R9/XG+XeN3PX0hPVPayizUpipfNj3Nty3nKih/eJLptpZmg0sKXL/78jJxpaObgd4F gn31yG/jV8baGAHB2a71oLwUehdb5yWcz53evRbE3koaBHGOpYv3IYon7P8OT+kqhsBi YwJBUX6kOHsrqeLts1KKXgIQaJksLkTxDe6lQ= 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=gYFoR4O/xJAOVdtzf1KO84jqKZdhkztW34riW/9p2p8=; b=mtqfXFS9gS0bJchHBtVYSVT5eg+bU0+opFOG979F3KxjxhSLcyIuoTfCyyDvbjAl8i rxRTO4QEaDJ0dkghtPrcKRC7outaRFBbT+XepYhxG6IU36r8B67f3mg+PScEVl/McIdf RMLsvEDy7vj5SDLbhaJnpPAiZlrpV9EtF2YCbGE++Olz/w0YszleufASMnJKt3NJj3io oo/ePBD1ynt5tagvcGHa1zKOgNIpjrN4pmrjkNf0ZXoctGXVOJFLGAWHjajjlD3FLOmG 22stASujuWNhaToMCZFPx+1pC1TXexUrI0v/a1YSCHX+sxed2q4OxRMqEyVtwdhtmLi1 4D5A== X-Gm-Message-State: APjAAAVfYxREGOnwmVjasxu6eQhZKvp3AunGWUxUJdY5de4eu+3MwFkj U5S/OlZ275IAC7OCIDcZVZwQhQ== X-Google-Smtp-Source: APXvYqwYR+C8pIy/mW/ntjAU5hcB/QYRY8s1HZ9+YEZj2WlaNk6OmhMsHTxoUDB0Wpphy383/FAE0g== X-Received: by 2002:aa7:980e:: with SMTP id e14mr46827749pfl.142.1557300819483; Wed, 08 May 2019 00:33:39 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:d8b7:33af:adcb:b648]) by smtp.gmail.com with ESMTPSA id n26sm29539047pfi.165.2019.05.08.00.33.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 00:33:38 -0700 (PDT) From: Nicolas Boichat To: linux-mediatek@lists.infradead.org Subject: [PATCH v2 1/2] pinctrl: mediatek: Add pm_ops to pinctrl-paris Date: Wed, 8 May 2019 15:33:30 +0800 Message-Id: <20190508073331.27475-2-drinkcat@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog In-Reply-To: <20190508073331.27475-1-drinkcat@chromium.org> References: <20190508073331.27475-1-drinkcat@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190508_003340_178856_261E36E8 X-CRM114-Status: GOOD ( 11.89 ) 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-paris.h (and not pinctrl-mtk-common.h) also need to use pm_ops to setup wake mask properly, so copy over the pm_ops from common to paris variant. 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 (which is what paris variant uses). Signed-off-by: Nicolas Boichat --- drivers/pinctrl/mediatek/pinctrl-paris.c | 19 +++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-paris.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index d3b34e9a7507ec6..923264d0e9ef2c5 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -926,3 +926,22 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev, return 0; } + +static int mtk_paris_pinctrl_suspend(struct device *device) +{ + struct mtk_pinctrl *pctl = dev_get_drvdata(device); + + return mtk_eint_do_suspend(pctl->eint); +} + +static int mtk_paris_pinctrl_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_paris_pinctrl_pm_ops = { + .suspend_noirq = mtk_paris_pinctrl_suspend, + .resume_noirq = mtk_paris_pinctrl_resume, +}; diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.h b/drivers/pinctrl/mediatek/pinctrl-paris.h index 37146caa667d8c8..3d43771074e6de0 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.h +++ b/drivers/pinctrl/mediatek/pinctrl-paris.h @@ -60,4 +60,6 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev, const struct mtk_pin_soc *soc); +extern const struct dev_pm_ops mtk_paris_pinctrl_pm_ops; + #endif /* __PINCTRL_PARIS_H */ From patchwork Wed May 8 07:33:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 10934551 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 E663113AD for ; Wed, 8 May 2019 07:34:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D23CC280FC for ; Wed, 8 May 2019 07:34:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C64C128758; Wed, 8 May 2019 07:34:07 +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 7C3A9280FC for ; Wed, 8 May 2019 07:34:07 +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=1M6Az+WfGYj4EMPBUeSA95g+0LiPVD30/5rSTJ+Qlxo=; b=FsjXum3ukuWJiY EcBbGgrhjD/leqgt1uaCOrkzu2/Y452gpPF6ssj/KkHZvzuhlhBBFmgJjJOPWCv9giP24BrrUyy5c ZVafTO7PHSoXX6cjlQxG9nJDIOhlnT6/fYrilh//f6JmP9vHakfnK3n848e0OfQR/fqwOVHB4hIWy xHsg010FPngVNQtrbIyJDs2ECrnOewGlm3MtoAJUbuN0T8Zpxnq+COJuLJOT8LN3hqCLQaQwGpzc8 lkCaTNzUbhwU7tSJ7yqwU+Jbx0ajmowHucE7Za4/pScPCAPO7T2R2VZO6krq44UZu2ZfD7nrKSQHD DW/PMAEOVf056CoiIzvQ==; 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 1hOH5W-00021C-BM; Wed, 08 May 2019 07:34:02 +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 1hOH5C-0001XS-HQ for linux-arm-kernel@lists.infradead.org; Wed, 08 May 2019 07:33:46 +0000 Received: by mail-pf1-x444.google.com with SMTP id g3so10041941pfi.4 for ; Wed, 08 May 2019 00:33:42 -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=yDsrcSSMgKGSHP0Nk2ne2DJD7hpeUAFwPm0h/OfCnfA=; b=AObE5Z8+K0moA2ZDjDuuVYvjyFV8h5J1tWcLuUJBcmiP/jFRjCim4AgJX0Nca0aIPX EypRszSAUAWGvknuUsSwSlHu8TWCt1PWuSqCE5eNuSgzXtrbVcSeOWbvgsUU1UVdolnE dfDbBe8Icbe2pSeTEhAANpRG20bTjfj6NIgbg= 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=yDsrcSSMgKGSHP0Nk2ne2DJD7hpeUAFwPm0h/OfCnfA=; b=mSNVhPNBUiRs6zOcDzF7ngQYJKU7H9N48ELJERv2dOOU79cUTQjznK4Z5/8wmSLmYM 8kuHDU8hmiMANjKDyedE8JlWcBtQRw33lHvt4BVNbgoynw15woR0wlUnB5xMKFvQP1My 9MtJ/orzhjdDOSNmFwJj8deANAyUXjMQuob4W/k4Fp36FlZFW/J0qqNs6nbotrZWkdXB bSfv51rVwDivos0BsKWe5Q7l/+RW5ItnndPEqPCy+IzqSBj/yYx3XSw7RHhMCFEnWO3j qcp2CCYJUoM8buJ8UPr2oQnleriFP1RXiw/4E0lOtJoRogtReyC8fNPEDcCS+sMZjjtS jAJw== X-Gm-Message-State: APjAAAW0gf5p/aL5Lkrc8CODCmzMQU6Gj8b3e3EXTAkQrzYlpheo6Mhi Z0w1duPzaG7v5zGS195B+t5+tQ== X-Google-Smtp-Source: APXvYqwWepJc8Vx1tWBJxhjhsou707KRMm7b8Hle1JQuHz0nesKvf5DEHLJ8HVvOxV5wR8OOx+46Mg== X-Received: by 2002:a62:e50a:: with SMTP id n10mr47328035pff.55.1557300821684; Wed, 08 May 2019 00:33:41 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:d8b7:33af:adcb:b648]) by smtp.gmail.com with ESMTPSA id n26sm29539047pfi.165.2019.05.08.00.33.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 00:33:41 -0700 (PDT) From: Nicolas Boichat To: linux-mediatek@lists.infradead.org Subject: [PATCH v2 2/2] pinctrl: mediatek: mt8183: Add pm_ops Date: Wed, 8 May 2019 15:33:31 +0800 Message-Id: <20190508073331.27475-3-drinkcat@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog In-Reply-To: <20190508073331.27475-1-drinkcat@chromium.org> References: <20190508073331.27475-1-drinkcat@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190508_003342_832534_AF71A5FF X-CRM114-Status: GOOD ( 11.60 ) 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 --- 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..9a74d5025be648d 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_paris_pinctrl_pm_ops, }, .probe = mt8183_pinctrl_probe, };