Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7246564yba; Thu, 2 May 2019 06:50:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdTu/BA9RHzvCTkPWpo5kEuLnsv1hESKZB23Lv+4zAPOV+ngNNx6RBvER0CHkrn2o1iMlK X-Received: by 2002:a62:b40b:: with SMTP id h11mr4166744pfn.133.1556805004314; Thu, 02 May 2019 06:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556805004; cv=none; d=google.com; s=arc-20160816; b=Hs0kh3q2nvHhHA9mHa2F9wSjV6F4wk9dXiJc1ozy/wti0goh3/N4/teZGX3yBnzA2w WAiw/RQbbaV0fT0ey68qwEri4+MDxD66SAa2Cr+mz3PDOeI5lj72vSLyhoDE4E1V43jz PeOQlzCfEOXc0apjz0siHpL8oqqtv2Kmv76tOG56YC4K+RestARDFrweBZUEt2dDYrrj mriuhtfQU2ASQBIdjI1rRiKQ9PbIs+jTX47yDHD5ZWIP2wHawx1y67UCd+2o5nAq7oqw Nsd12w/2UqMDwgECR3xSwgIg00nOkmD46AGBk4Y8WOiSg31mxG5Z/DEIZXEA0fZQyF4H GCpQ== 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:date:cc:to:from:subject:message-id; bh=rRiRJyoXzILY7rz93SV3InHe6UW7YM3uapXwWCBcpVA=; b=vLTuIxJ/wq1GFyj16HXcgVCP4rZx3eBbNYK2Ex4fOoC/Tv+Kr2aWVmnxDgNOJkwnOM zWAxNAVVwO9M/2S2BDlPcKRTxgq6lESvaKQ7k0w6kNFj/34ZhiV73cPhPn3XzCxoVmob ggvmkbPl9cAI46p7e2XgkXpg2ugNHBxxf3nakFTSnNEEFl2cHqnqtZoTN0Biq513g08m gtt5plqPTlfd28GGiDMYUEm1MwkDAyGBHNk9fBPrSbRjgKlIIA4xy91zSyYbDXpj0gx2 0lg5FbplJQH4FXV89uysqTdVqmI6Bk6D9ZhVaPQ3WUslRcJXH5TyfN83y75kA/qtGKvR xQEQ== ARC-Authentication-Results: i=1; mx.google.com; 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 b3si40308618pgq.325.2019.05.02.06.49.48; Thu, 02 May 2019 06:50:04 -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; 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 S1726310AbfEBNsw (ORCPT + 99 others); Thu, 2 May 2019 09:48:52 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:65520 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726203AbfEBNsw (ORCPT ); Thu, 2 May 2019 09:48:52 -0400 X-UUID: de439af8b9254a9896a23ebec1854f85-20190502 X-UUID: de439af8b9254a9896a23ebec1854f85-20190502 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1561821656; Thu, 02 May 2019 21:48:22 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 2 May 2019 21:48:21 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 2 May 2019 21:48:08 +0800 Message-ID: <1556804888.28808.6.camel@mtksdaap41> Subject: Re: [PATCH 1/2] pinctrl: mediatek: Add mtk_eint_pm_ops to common-v2 From: Yingjoe Chen To: Nicolas Boichat CC: , Chuanjia Liu , Linus Walleij , Sean Wang , , , , , Matthias Brugger , Date: Thu, 2 May 2019 21:48:08 +0800 In-Reply-To: <20190429032551.65975-2-drinkcat@chromium.org> References: <20190429032551.65975-1-drinkcat@chromium.org> <20190429032551.65975-2-drinkcat@chromium.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-04-29 at 11:25 +0800, Nicolas Boichat wrote: > 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, > +}; This is identical to the one in pinctrl-mtk-common.c and will have name clash if both pinctrl-mtk-common.c and pinctrl-mtk-common-v2.c are built. It would be better if we try to merge both version into mtk-eint.c, this way we could also remove some global functions. Joe.C