Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1236490imu; Thu, 13 Dec 2018 11:35:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZCs7Sv/KOTVreNdQqtKh095pf7y2e9IEw8Kl4w03A1IclxmI9m7XDJPwm1v4iY2669vgS X-Received: by 2002:a62:5003:: with SMTP id e3mr72250pfb.23.1544729721490; Thu, 13 Dec 2018 11:35:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544729721; cv=none; d=google.com; s=arc-20160816; b=qdsG2DlJW6Uq0znc6vA7ef5jrkxbBkJdoDgxr/MU1Nsk2cXu+00ltZXI/Q6cN0FwQ8 /N4m2oYe9/VY5g1CdoKuH4p3JQgDS7pCFRiy3EvxlocsA/d1U/wfjNlpOblSnNZTLZdy KdSOm/QmP8nnv2Sw3STeM+A3ejyu0I4hehHD6t3UDUEAc2cVn5U77xpT5pKeyoBWk8DE FByyOU3XpIeBxQqBlOIe0W/Y0QX9e6kjoJS5vG7OPxH7Hh77y/1ZuxGYKdoQh7eDKSD8 iwc9uxhalHm3Szs5Kha7+OFzQE5fhQaGk3n0RYtpknGzqjFiiz1AtHJvmgVsKRij3mdB mGyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Rcx6SwyPEI8NtQJ2z6vRCtyJ68kNlGuN/eX0ZujWIUI=; b=r4PeGl3+sMhi95QZfMfWl6idZ2e7QtWxpRXWA0fEd0Lg1ft88Z8IaPLpafmje24PzZ +AeT+R22NHwVOdDDIpQrZU6MtVS04LtxDzE4RV9JktQBnVt2s1NqrP6Qto0si8e95iuK 69Yl3b0GedDKCvje6oFnWudnMp4dvXC2ein4Frjh5daQfSjQQ4URanPL3YWmk+nEKzPM h0A3lyF3AFXbe/LKFrItOp6zqUW3LSAac0XZpSEO/EnbdCuTB9yG5bPO6CdFIXYFnfN5 gipV4+74vVybeIRhzphVwwVUB1uVcewa/0bzrqOQ6ql7PRabQtdBeGIaeX8YdFEExFYm 6BUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=183oY3Mk; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si2366129pfd.86.2018.12.13.11.35.05; Thu, 13 Dec 2018 11:35:21 -0800 (PST) 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=@kernel.org header.s=default header.b=183oY3Mk; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727864AbeLMTeI (ORCPT + 99 others); Thu, 13 Dec 2018 14:34:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:55690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbeLMTeI (ORCPT ); Thu, 13 Dec 2018 14:34:08 -0500 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6318F20870 for ; Thu, 13 Dec 2018 19:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544729646; bh=+2DwOz/MH+BB+HkI8y/EmWLob9eNm41yKPZRvzwGPgc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=183oY3MkNSyTam6gDEc+TnWQ5fXXTU7i0tMLCKRR5Fqx39ACy5YFSm4+JFDjOP1DJ OrHzpqsO3BgK7XW7AMHuwruRWxvGeyKONzi/VMHnXKyg7h2iyTYg6F3N71H1aS3+/c cFiGw2dzoW7cPKsHowDtfnczld4h73oU4WT2x2LE= Received: by mail-wm1-f44.google.com with SMTP id y185so14615757wmd.1 for ; Thu, 13 Dec 2018 11:34:06 -0800 (PST) X-Gm-Message-State: AA+aEWbJvzPIr2meSA+MZsp4sp6YuJ7r/sQCNZSVmtTbej4YJ98FG/R0 XuWtjWfS75fnOJ+2KE4M6miKrrvjhfi8Ux/HIbk= X-Received: by 2002:a1c:66c5:: with SMTP id a188mr605099wmc.129.1544729641513; Thu, 13 Dec 2018 11:34:01 -0800 (PST) MIME-Version: 1.0 References: <1544693783-25079-1-git-send-email-chuanjia.liu@mediatek.com> In-Reply-To: <1544693783-25079-1-git-send-email-chuanjia.liu@mediatek.com> From: Sean Wang Date: Thu, 13 Dec 2018 11:33:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] eint: add gpio vritual number select To: chuanjia.liu@mediatek.com Cc: Linus Walleij , Matthias Brugger , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, hongkun.cao@mediatek.com, youlin.pei@mediatek.com, eddie.huang@mediatek.com, zhiyong.tao@mediatek.com, hailong.fan@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 13, 2018 at 1:36 AM wrote: > > From: Chuanjia Liu > > This patch add gpio vritual number select,avoid virtual gpio set SMT. s/gpio/GPIO/ s/vritual/virtual/ Virtual GPIOs you said here that means these pins only used inside SoC and not being exported to outside SoC, right? It seems this kind of pins doesn't need SMT. > > Signed-off-by: Chuanjia Liu > --- > drivers/pinctrl/mediatek/mtk-eint.h | 1 + > drivers/pinctrl/mediatek/pinctrl-mt8183.c | 1 + > drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 9 ++++++--- > 3 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/pinctrl/mediatek/mtk-eint.h b/drivers/pinctrl/mediatek/mtk-eint.h > index 48468d0..c16beaf 100644 > --- a/drivers/pinctrl/mediatek/mtk-eint.h > +++ b/drivers/pinctrl/mediatek/mtk-eint.h > @@ -37,6 +37,7 @@ struct mtk_eint_hw { > u8 ports; > unsigned int ap_num; > unsigned int db_cnt; > + unsigned int vir_start; > }; > > struct mtk_eint; > diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8183.c b/drivers/pinctrl/mediatek/pinctrl-mt8183.c > index 6262fd3..bbeafd3 100644 > --- a/drivers/pinctrl/mediatek/pinctrl-mt8183.c > +++ b/drivers/pinctrl/mediatek/pinctrl-mt8183.c > @@ -497,6 +497,7 @@ > .ports = 6, > .ap_num = 212, > .db_cnt = 13, > + .vir_start = 180, > }; > > static const struct mtk_pin_soc mt8183_data = { > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > index 4a9e0d4..ca3bae1 100644 > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > @@ -289,9 +289,12 @@ static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n) > if (err) > return err; > > - err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE); > - if (err) > - return err; > + if (gpio_n < hw->eint->hw->vir_start) { > + err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, > + MTK_ENABLE); > + if (err) > + return err; > + } The changes will break these SoCs without a properly configured vir_start. If SMT seems unnecessary for these kinds of virtual GPIOs pin in the path, we can do it as err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE); /* please add comments for the exclusion condition */ if (err && err != -ENOTSUPP) return err; If there is getting much special on certain pins between SoCs, and then we can consider creating a desc->flag to split logic. > > return 0; > } > -- > 1.7.9.5