Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp6762127imm; Sun, 20 May 2018 10:03:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqWneQ4hpDDRAKHrue+O8uJOMDu1oWwOPbi7vkCnj9TZRdxwhFrSEIX8T/vsSWUoiW2Sm1M X-Received: by 2002:a62:1fc8:: with SMTP id l69-v6mr17093185pfj.49.1526835822580; Sun, 20 May 2018 10:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526835822; cv=none; d=google.com; s=arc-20160816; b=xT2UuDyXckntwg1lfq5B3tkMefTlAS1LMbKhMZqHkxLzVYWmSCQ23E0N4YRZKZJSes 5TX/KMQ2ywT4G70EHak10JYrGIZXObnG6SsnFT3jiGpnngndrxQuS9Dg3sLnd1XglpY9 +EdfXo7jTLY2v7ivH9r+mQcB/AnxHI31e1A6KGedWutKjikvXkr+8YZ+1jjwcwyhej2l oPwtx7HYXIisAdISajrueDUmmw92ZI/q5hIxyN0hMzIfLilo9c33SSauyfOAWPPhq1Zw EzpR85sZBzBfbiBdRFU4l/JP2hefiQydhyvphJ2unjuB13z3CWMTh0TqevFydIIPWPGs ngIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Ltd+JNdfrBzucaPGxZWs7VNfWrYEQ/nzI6K2SmWTCHQ=; b=g3s5df0iNTZSrHbw5PGWDZkA/vf5pngkBXqGzWqaPm36B+mpfjcVweaWWiEuwimLPO svhijwABFsBaubL3t/HG7KnKvT/zP4OSzt90R70JhOUQAup94qH3WrvcX0ZVk1QiIz26 BYufq6Drp/LwBs2ScZHuK3O/PN5NuPba7jd/BDKTCCpM8NmFQrp9A12f6nDMTv+9YMGE oooxPzuev8AydUcSXU0Zx3+4O8Xw1CD6SIF8UhbsHOLlqEcB9iYdvxJTEF0q+k4G4/uo bNu/1232kmyRMxS7S7fhUSB4G9nRxyyKy44uddX7C9tAczqGY/HZUKTx8JHAHFueYOAt P8hA== 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 g8-v6si9550594pgv.151.2018.05.20.10.03.11; Sun, 20 May 2018 10:03: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; 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 S1752703AbeETRCh (ORCPT + 99 others); Sun, 20 May 2018 13:02:37 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:25249 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752566AbeETRCV (ORCPT ); Sun, 20 May 2018 13:02:21 -0400 X-UUID: 1c9363b3fa654863b4251a4e1a30454a-20180521 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 854222326; Mon, 21 May 2018 01:02:18 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 21 May 2018 01:02:11 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Mon, 21 May 2018 01:02:11 +0800 From: To: , , , , , CC: , , , Sean Wang Subject: [PATCH v1 4/7] pinctrl: mediatek: use generic EINT register maps for each SoC Date: Mon, 21 May 2018 01:01:50 +0800 Message-ID: <39738efefe94e3a4fb7668a27dd73ae49695dc3b.1526835466.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang So far, EINT on each SoC all used exactly identical register map and thus it's better that we apply generic register map already supported in EINT library and stop copy-n-pasting the same data block and filling into its platform data. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mt2701.c | 20 -------------------- drivers/pinctrl/mediatek/pinctrl-mt2712.c | 20 -------------------- drivers/pinctrl/mediatek/pinctrl-mt8127.c | 20 -------------------- drivers/pinctrl/mediatek/pinctrl-mt8135.c | 20 -------------------- drivers/pinctrl/mediatek/pinctrl-mt8173.c | 20 -------------------- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 6 +++++- drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 2 +- 7 files changed, 6 insertions(+), 102 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt2701.c b/drivers/pinctrl/mediatek/pinctrl-mt2701.c index e0963c6..db22250 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt2701.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt2701.c @@ -538,26 +538,6 @@ static const struct mtk_pinctrl_devdata mt2701_pinctrl_data = { .ap_num = 169, .db_cnt = 16, }, - .eint_regs = { - .stat = 0x000, - .ack = 0x040, - .mask = 0x080, - .mask_set = 0x0c0, - .mask_clr = 0x100, - .sens = 0x140, - .sens_set = 0x180, - .sens_clr = 0x1c0, - .soft = 0x200, - .soft_set = 0x240, - .soft_clr = 0x280, - .pol = 0x300, - .pol_set = 0x340, - .pol_clr = 0x380, - .dom_en = 0x400, - .dbnc_ctrl = 0x500, - .dbnc_set = 0x600, - .dbnc_clr = 0x700, - }, }; static int mt2701_pinctrl_probe(struct platform_device *pdev) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt2712.c b/drivers/pinctrl/mediatek/pinctrl-mt2712.c index 02aff28..6e2acef 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt2712.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt2712.c @@ -583,26 +583,6 @@ static const struct mtk_pinctrl_devdata mt2712_pinctrl_data = { .ap_num = 229, .db_cnt = 40, }, - .eint_regs = { - .stat = 0x000, - .ack = 0x040, - .mask = 0x080, - .mask_set = 0x0c0, - .mask_clr = 0x100, - .sens = 0x140, - .sens_set = 0x180, - .sens_clr = 0x1c0, - .soft = 0x200, - .soft_set = 0x240, - .soft_clr = 0x280, - .pol = 0x300, - .pol_set = 0x340, - .pol_clr = 0x380, - .dom_en = 0x400, - .dbnc_ctrl = 0x500, - .dbnc_set = 0x600, - .dbnc_clr = 0x700, - }, }; static int mt2712_pinctrl_probe(struct platform_device *pdev) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8127.c b/drivers/pinctrl/mediatek/pinctrl-mt8127.c index 71f6258..949a235 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt8127.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt8127.c @@ -307,26 +307,6 @@ static const struct mtk_pinctrl_devdata mt8127_pinctrl_data = { .ap_num = 143, .db_cnt = 16, }, - .eint_regs = { - .stat = 0x000, - .ack = 0x040, - .mask = 0x080, - .mask_set = 0x0c0, - .mask_clr = 0x100, - .sens = 0x140, - .sens_set = 0x180, - .sens_clr = 0x1c0, - .soft = 0x200, - .soft_set = 0x240, - .soft_clr = 0x280, - .pol = 0x300, - .pol_set = 0x340, - .pol_clr = 0x380, - .dom_en = 0x400, - .dbnc_ctrl = 0x500, - .dbnc_set = 0x600, - .dbnc_clr = 0x700, - }, }; static int mt8127_pinctrl_probe(struct platform_device *pdev) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8135.c b/drivers/pinctrl/mediatek/pinctrl-mt8135.c index fdfa357..974a1f43 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt8135.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt8135.c @@ -320,26 +320,6 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = { .ap_num = 192, .db_cnt = 16, }, - .eint_regs = { - .stat = 0x000, - .ack = 0x040, - .mask = 0x080, - .mask_set = 0x0c0, - .mask_clr = 0x100, - .sens = 0x140, - .sens_set = 0x180, - .sens_clr = 0x1c0, - .soft = 0x200, - .soft_set = 0x240, - .soft_clr = 0x280, - .pol = 0x300, - .pol_set = 0x340, - .pol_clr = 0x380, - .dom_en = 0x400, - .dbnc_ctrl = 0x500, - .dbnc_set = 0x600, - .dbnc_clr = 0x700, - }, }; static int mt8135_pinctrl_probe(struct platform_device *pdev) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8173.c b/drivers/pinctrl/mediatek/pinctrl-mt8173.c index 1466c95..a836cee3 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt8173.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt8173.c @@ -347,26 +347,6 @@ static const struct mtk_pinctrl_devdata mt8173_pinctrl_data = { .ap_num = 224, .db_cnt = 16, }, - .eint_regs = { - .stat = 0x000, - .ack = 0x040, - .mask = 0x080, - .mask_set = 0x0c0, - .mask_clr = 0x100, - .sens = 0x140, - .sens_set = 0x180, - .sens_clr = 0x1c0, - .soft = 0x200, - .soft_set = 0x240, - .soft_clr = 0x280, - .pol = 0x300, - .pol_set = 0x340, - .pol_clr = 0x380, - .dom_en = 0x400, - .dbnc_ctrl = 0x500, - .dbnc_set = 0x600, - .dbnc_clr = 0x700, - }, }; static int mt8173_pinctrl_probe(struct platform_device *pdev) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 11e0d0f..b379969 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -1014,7 +1014,11 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev) return -EINVAL; pctl->eint->dev = &pdev->dev; - pctl->eint->regs = &pctl->devdata->eint_regs; + /* + * If pctl->eint->regs == NULL, it would fall back into using a generic + * register map in mtk_eint_do_init calls. + */ + pctl->eint->regs = pctl->devdata->eint_regs; pctl->eint->hw = &pctl->devdata->eint_hw; pctl->eint->pctl = pctl; pctl->eint->gpio_xlate = &mtk_eint_xt; diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h index 346e3db..bf13eb0 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h @@ -261,7 +261,7 @@ struct mtk_pinctrl_devdata { unsigned char port_mask; unsigned char port_align; struct mtk_eint_hw eint_hw; - struct mtk_eint_regs eint_regs; + struct mtk_eint_regs *eint_regs; }; struct mtk_pinctrl { -- 2.7.4