Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4250607imu; Mon, 24 Dec 2018 20:26:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN4dQIT845B6thdDRmpqHFJIH5q/UGhqXhdllu/8WsP9IYsdOHhYHWlGThfx/r290qsCFQrW X-Received: by 2002:a63:8ac4:: with SMTP id y187mr14565335pgd.446.1545711993133; Mon, 24 Dec 2018 20:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545711993; cv=none; d=google.com; s=arc-20160816; b=PAJPb4QVmtkCIto8q8XycvDFj+PYlX9E856pU2LRNv5ERqZZRKubN8dpzQMSH5Jc2+ cRZ+LtAMVbtNtAnJGDZP0v6BqS/i7DcrKiO2Iq+RejdQeyBBPR8spsFLmzwPu1+MEPM1 2ATsyAgTpdgqLYI+kYs7+titbw6boUc5U89YTpHLYZOnobjPLfc1WG0ymKqQkEF4Fi9w WRa1F8KRiAagg+G9G+3tb+Es56N6YhaV4WpQ+jMqA+qGw0va1hDrYeOfUCHxDKcujdA+ Xe/kp9vQb9od9gmn/tyrMqNbzURbQ+c25LiIrqO78N2lL+4jXzdjP5jYvMw7gTUH44VH eH1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=o3YT8yXyJcZJKizpjsRY82mbD9aDwE2bZV+H1VvtBE4=; b=ltacBtX6WZ9j9oNrbd1anFV+QowIY1deWC8ifxxhjkLqaCAjh8fMdFz2r983intr9o n5FdCAeT5/yd42QaV6EFW36hcXxsNchZ6UL/c6dxiwJr7520TXdrS9YoPbj27zd4Af7o SnFyCxCVYwJZi6PQGARBwvCwDS1WNISCWvex3fvjW+T617XMdcW6toxuCjvOE44BoOYj yCy86HXDKMdz2W4SsW5IvsKHuhs1g2QfCiBvCS5LJnpDdRV8pj+3mVY8C0ITHVJKwdnh wcKZuEQnYNO5/bO1utdTpQOvGDbqBmUb+4gMCb9JPAiME9oV9NtEClHEprRdrEHo4NGb xqeA== 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 x64si28852998pfx.87.2018.12.24.20.26.17; Mon, 24 Dec 2018 20:26:33 -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 S1725849AbeLYEZZ (ORCPT + 99 others); Mon, 24 Dec 2018 23:25:25 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:44532 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725806AbeLYEZY (ORCPT ); Mon, 24 Dec 2018 23:25:24 -0500 X-UUID: 8c966f9564934e5cad4f1eb6a4213bf5-20181225 X-UUID: 8c966f9564934e5cad4f1eb6a4213bf5-20181225 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 679132772; Tue, 25 Dec 2018 12:25:18 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 25 Dec 2018 12:25:16 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 25 Dec 2018 12:25:16 +0800 From: To: , , , , , , CC: , , , , Chuanjia Liu Subject: [PATCH v3] pinctrl:mediatek:add EINT support to virtual GPIOs Date: Tue, 25 Dec 2018 12:23:58 +0800 Message-ID: <1545711838-20444-1-git-send-email-chuanjia.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 709753F672622637475F74091239B3160F9481542974F72D2853B8419EB951A42000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuanjia Liu Virtual gpio only used inside SOC and not being exported to outside SOC. Some modules use virtual gpio as eint and doesn't nedd SMT. So this patch add EINT support to virtual GPIOs. Signed-off-by: Chuanjia Liu --- change note: v3 : 1. modify subject and description 2. modify comments --- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c index 4a9e0d4c2bbc..a0db145f798d 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c @@ -290,7 +290,15 @@ static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n) return err; err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE); - if (err) + /* + *SMT is supposed to be supported by every real GPIO and doesn't + *support virtual GPIOs, so the extra condition err != -ENOTSUPP + *is just for adding EINT support to these virtual GPIOs. It should + *add an extra flag in the pin descriptor when more pins with + *distinctive characteristic come out. + */ + + if (err && err != -ENOTSUPP) return err; return 0; -- 2.19.1