Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4744243yba; Wed, 8 May 2019 01:55:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyadTaqp2jFixDwUbTZJdR3Mkv1IWv8D1uehytbGqSPKHn7YaNjOgTOEGS6qmTM8Mw4LPbp X-Received: by 2002:a62:1d0d:: with SMTP id d13mr47178897pfd.96.1557305742570; Wed, 08 May 2019 01:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557305742; cv=none; d=google.com; s=arc-20160816; b=wSoHK9G5/D5na/+sYzG7zSbzuRDJa0h8sJpKYcvb+Nu8HZumBedFp6Lxf3xrISVWaH XJ6IqeqeBhL5L/eIGHIblsLGsyBTXluUlKpkG9fSa/UCQJ1xBVmulD9HyyfPrt09yknq k3ad8sdLVkd9dHm9NTynu2argRHpFQ24WRr0mXq+SpuAgBgQsvuTP22+ly+0LM9UQDuQ 4Lpmp1wy6Ewn8krgcdrwz2K349gHGPA2ZfvHGQLsKOp4mMMXxhLCm7XxbZ/MHlbKFPdT dYWiNPHREMsUrgIz0/MCcnhLjNrMjMBHQCyWaiRnt9KZ73LSxrbtWdTiLwf7splxQ1WL xijA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gYFoR4O/xJAOVdtzf1KO84jqKZdhkztW34riW/9p2p8=; b=Yj6MhtyQbuCLNJlj4V+KzPm07x7Dh2yyz7qtAkjA/j3wx5te14Do16fCdJFe+JlGRW 7oPyarEqFlj31FFAdiFLL46b0Zbo/275OKdPlJHPuDWB2yxag8pTU08fTCE8uboZswM/ GJE2isc7iolkjNTE9IeI3aYEGr+SCu974noPzU7iezyEbLTQgmRtC8t9JbZAHQ7K61lA 09THRBHLdkkZyaq7y6OXxzcRn2Tuz3lm02K+3aJDKo3zGFUyY7BW6KVhKICyIramfg8O dEw1KKO5oBdNnX8VU8WJVovCmgBApmWCpGDzpX2dFd9DYnwHUn2JpNgYZHV01V+k10ou wfeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="R9/XG+Xe"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si7549942pgb.560.2019.05.08.01.55.26; Wed, 08 May 2019 01:55:42 -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=@chromium.org header.s=google header.b="R9/XG+Xe"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727108AbfEHHdl (ORCPT + 99 others); Wed, 8 May 2019 03:33:41 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36607 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbfEHHdk (ORCPT ); Wed, 8 May 2019 03:33:40 -0400 Received: by mail-pg1-f194.google.com with SMTP id a3so418293pgb.3 for ; Wed, 08 May 2019 00:33:39 -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=BBmCs9qejVhmRyxcJRD96XWGXrwv7ptTyXiK/r79VlJ6dT7HErsm+2+SpzvQl28vd+ R/8dUahZCHj56I66vyp59xdCOdYy7XQdOwXCwe2m5Yq+ybbDOJB4n8dxIGnZvgb+6U89 RPsZHsEBZzDu4JsojOZXS1G5RaKcYmc9ncwOaSm7rVkV00EN/HdVgi9IUK1U5a9vyP4X /xVGIAxRZnVVNyh2QcJHmJyKIL9gHYDCubLlaz2zJSffSEJ72HyVcGADS6tno7TUW6nU 7EtX4+Vea3mNAesd0Lr1CqEYx5Dse7MhcSbpS4m7ED6xTeEQAUni7GRssZXW1ZkP/Lgs hJQw== X-Gm-Message-State: APjAAAVgE8aqiG/lvNBo72KMp0GxaO9QB+MmStUJh0wson0ky1+1jQ6g zFfS0zLNfs5F/c9HKTehHKXDfg== 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 Cc: Sean Wang , Linus Walleij , Matthias Brugger , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chuanjia Liu , evgreen@chromium.org, swboyd@chromium.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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ -- 2.21.0.1020.gf2820cf01a-goog