From patchwork Tue Dec 25 04:23:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuanjia Liu X-Patchwork-Id: 10742525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 278B691E for ; Tue, 25 Dec 2018 04:25:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF17288CF for ; Tue, 25 Dec 2018 04:25:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0157A28B12; Tue, 25 Dec 2018 04:25:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC61328AFB for ; Tue, 25 Dec 2018 04:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+0b883ZeqnK7D5MtCPwnqKGxyffn6HJleRzMjkOw/VQ=; b=AEem6wlCQ3wpKg xMMCWbiNEJUSgrejk2F3tGKHh1TwvZd6YRDGOgXWTmulw1Jk3/ohPVrjOK1Da69OXXuKQ6FBYbvsu +0p5as+yHhUYWhhLCTwOmI0+vxki7iePKdnGtuY3oRlMcZ9e6T4xF6Rcge+sQIcRTOfMhbyfpC9A1 ZikkvfchzgDJO7PHXICc5oDJZYlb0vRU+XymO6d34wIbVdChK+y4qw6nsG8gQOXIJXqJ1na8wuIt5 YSCKKKumj29HeZHCoFfUes6hla09JUX17Orptf1KYsgtGM2lft82xkmCrX5lRlPQpm44nc4EiljBd qazkgHGelH55ql4HQp4Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gbeHi-0001O9-Hv; Tue, 25 Dec 2018 04:25:38 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gbeHd-0001Mt-HB; Tue, 25 Dec 2018 04:25:37 +0000 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: , , , , , , 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 X-TM-SNTS-SMTP: 709753F672622637475F74091239B3160F9481542974F72D2853B8419EB951A42000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181224_202533_695601_7B6D1816 X-CRM114-Status: GOOD ( 11.67 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, zhiyong.tao@mediatek.com, eddie.huang@mediatek.com, hailong.fan@mediatek.com, Chuanjia Liu Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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;