Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3211323yba; Sun, 28 Apr 2019 20:27:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqygDOZ4H++m5ObSxLCGBJFfpawGJeERGcirJNeH787uAlhdvVyqMKIaoqw5MUH/5pQj0VlU X-Received: by 2002:aa7:9aaa:: with SMTP id x10mr18149002pfi.225.1556508443503; Sun, 28 Apr 2019 20:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556508443; cv=none; d=google.com; s=arc-20160816; b=tTqxmAHT7VlqU5cjRQ/1c1NVfGmEoZ4Im5W9usV6+yXeKE9rF9x8U3P+9SC5fF2MHc MQGJvrXXcaVSXfGQftj6tNWIXKMNTN+Nl+IoQYeRexq3pXN6S+dBL9xcn7eNtUBs486D y5XWF+mYClweEZ8mteFbT+wPEdPyxI4T3kZpiXzpm1NGvqcY1KcZobFkncLVjTimVqeL tx6mgu92DFLCpN0McgZYb2x5JSMLghzEaRF0oZspB3Emq9ANuQ/AHTT74ICn7+MtWnxi uCrDUj1kn3NIe4PzIJwbkBi+GhsktWJyrxKpZsbkosy2JXxfaFF9xB7zyQH0I5o0THrZ J9Lg== 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=1t5XlT2MKDWHi6woYas868Il32PJ2FqSyI3/eucTk+M=; b=e9nuBtYYRj0eHkWfoQVsyOmJxNKnVxQiWGB1qjkN2nbNCUInpG982PnpogWm7hnAB7 K800Zin4+sBrIrHvoKrwWF/Jg+uf3+/wN4GP7hhdehocWXAzhaprGYxiwOWKsu8Eai7R d0GpaD+pHd9yZ/aEGKY8VZorv/yH2bB3VMNLZPMa3uY4zkwK9Epe5AWwhD/bHoRp2dw9 QvL8O/gJOoGva0N0yEdbbCXR35ipwR7Wpryx9jJmkhDARzBolhwFi8U48J7Hhx6K54Ac PecpOeJTP9BwcIxgYx2my29iobaPQAOxQzWHvKqgRPrmqteluEYosFfRC9vKI58cERMH tHPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Y/5zs/kx"; 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 i15si32873307pfj.115.2019.04.28.20.27.06; Sun, 28 Apr 2019 20:27:23 -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="Y/5zs/kx"; 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 S1727291AbfD2D0K (ORCPT + 99 others); Sun, 28 Apr 2019 23:26:10 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38221 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbfD2D0J (ORCPT ); Sun, 28 Apr 2019 23:26:09 -0400 Received: by mail-pg1-f194.google.com with SMTP id j26so4469996pgl.5 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=APsd+rlTn7xktHd70zi4s446L2c0RHKGUOhjw8u4ap6aRMODN5XYZpKFfTgNjAVzGl XK+idYjASjx/i8i8XO9MRY9i0Gy0/St4NOXCc7qbBKfcKBX4GsBTYugRgNMFR2X23Lte 7Pkd9iBlWbkwQhqDo5GeCzqTBruixETqsRii8CRNirSmUKkC8ONXlE7yQYnm3L7D2Ph+ ol8m8qTux0TO2zppXUJ5Ji1Z23LnJmdeLRYbced9CINI7/1AF9w9qsL0D6z3LKOJ7SRx fZDZm8UDxbPRF1pdFm4vvitGVcqLHvR6b/ICsVi+sWD3uY0LIMHjoij5P1qEt7ORTdMC fZyQ== X-Gm-Message-State: APjAAAVUop9wa5TrRzeNWzwEvA3+5ufHVdFAoNvF4X6m15zEhApUzE7L 7S1WIOZAC+p4yXqaTvZ1/EncTA== 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 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 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 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-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 */ -- 2.21.0.593.g511ec345e18-goog