Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2187138imu; Sun, 16 Dec 2018 19:20:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/WUtPVV4opDiW7yKMQ7sH7qrafCN8ZfbefsGupJ1GIHNVkLaw7rKF0MvalKe6CLzlTvI1LA X-Received: by 2002:a62:30c3:: with SMTP id w186mr11449433pfw.39.1545016831930; Sun, 16 Dec 2018 19:20:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545016831; cv=none; d=google.com; s=arc-20160816; b=TlBAxK1nwlA2VQHtX5F65i84Swb9/fsHpQYuvy3OOz29UrmzuwB5PmoBSZy4Hs9GbN 7YwZvZweuYOMC+AuUo7/7HUFAxbRgq8JQEQ2tYVjrdjMHpLt9IkAl+uT9roUBV6yCl4G DV434fJpb8qqLvGNJO9e92Cle1oI2t5coiNve21Q274BfrV+wRwzxk61hdn4qujzfTZh dAoj3SANeRwdS+sfr5/SmatWnB/HbhGknyCRpn/RTsgWPU2QSqeY2YUsa41m7L22RmDv 7vPvjgQEtYXbnqT33FkzKMB/F118VDRcxTR6O/kIoUSiok6zBuc4PUnh7ZiEx6ZQ4Cps 4wcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=pU7/THQF8W5QvKiEJ3Kxr7y5hbuS5tYnRtZQpjJpwiE=; b=vohT8u6wX3x1a/KQFJlNmdqBFmabwUKt+kdQZbmV9DZdUekXnUwRzW8LxKLMFGJ/4X 9TyCNPmNjQFRels04peSO+HNOe7D874mOOF8X8orTXEFiZ85LkFPWiCMtDQHipoSTzB/ vvRhJweP/DamqZrZaLs0dqSu+SQrEcyWKvE+3A6ibJybhTlhL9W+CLPDtP1HmC/goZPl qLqLXc+owm4rbTFyS7g8A3MvrW+PR6XryVwLz1l2JCxvmFvvDv9rTBuG1yd1nwkBHpI1 AeVwUgztsX89NQ7SqglvlSYIah4s4dB2zDLBZHPuzSYRowdWWmof13WWE+zwM5qb5/Ks zM1Q== 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 k6si10745846pgr.500.2018.12.16.19.20.16; Sun, 16 Dec 2018 19:20:31 -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; 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 S1731326AbeLQDPM (ORCPT + 99 others); Sun, 16 Dec 2018 22:15:12 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:12383 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726267AbeLQDPL (ORCPT ); Sun, 16 Dec 2018 22:15:11 -0500 X-UUID: ef6fe58ba54b4183b52781f5e27b3d2b-20181217 X-UUID: ef6fe58ba54b4183b52781f5e27b3d2b-20181217 Received: from mtkcas34.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 333517610; Mon, 17 Dec 2018 11:15:07 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 17 Dec 2018 11:15:05 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 17 Dec 2018 11:15:04 +0800 Message-ID: <1545016504.29293.10.camel@mhfsdcap03> Subject: Re: [PATCH] eint: add gpio vritual number select From: Chuanjia Liu To: Sean Wang CC: Linus Walleij , Matthias Brugger , , , , , , , , Date: Mon, 17 Dec 2018 11:15:04 +0800 In-Reply-To: References: <1544693783-25079-1-git-send-email-chuanjia.liu@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-12-13 at 11:33 -0800, Sean Wang wrote: > 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. > Yes,virtual gpio only used inside SOC and these pins doesn't need set 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. Yes,SMT unnecessary for these kinds of virtual GPIOS pin in the path,if do it as err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE); if (err && err != -ENOTSUPP) return err; I wonder if system will lose -ENOTSUPP information when smt was not successfully set by real gpio? > > > > > return 0; > > } > > -- > > 1.7.9.5