From patchwork Mon Feb 26 08:34:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhiyong.tao" X-Patchwork-Id: 10241645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 13C6460211 for ; Mon, 26 Feb 2018 08:44:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0495429D0E for ; Mon, 26 Feb 2018 08:44:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC90C29D29; Mon, 26 Feb 2018 08:44:44 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 75E8C29D0E for ; Mon, 26 Feb 2018 08:44:44 +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:References:In-Reply-To: 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: List-Owner; bh=qvoMWkWqB6+YZp9mu8UuQU7f1ojoMoT4xlkIER1YMMg=; b=aEgPSKw4uS+BIe CFih//tOu4/lDsWx2tRDNq5ftK/+SF2l66YyAIB7FI6GvIGpFts1MWoT6FsAXCBhUHUiZk8N0swra MUpiXqw7ahpUVLv3RqzXu13Z/ZFAlgTbjmEHouKrQ6LpV3YMAsdJigxgpbac4sm8xLRiG8souL9TK b+NyApT40mDpCuwp7+jnwchCoyyLRyKthsvOt9FfQ98hiPh0MsiOUP7h6xHhlRpUN7Z/1ujUax5lM 9SWYLZxdiP+Ut8/nKvjzcyb1XLSCjj9rpIYSFKD7V3fJhAiCtGKMFV2ue8REBhCLu3y4tyf2oJ16r 7zemRF6lLubJo1iW+i4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eqEOm-0001u1-NV; Mon, 26 Feb 2018 08:44:40 +0000 Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqEFW-0001ZZ-ER; Mon, 26 Feb 2018 08:36:02 +0000 X-UUID: 552bcbc2f19e425899a6f76255290eb7-20180226 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1729174754; Mon, 26 Feb 2018 16:34:14 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 26 Feb 2018 16:34:13 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Mon, 26 Feb 2018 16:34:12 +0800 From: Zhiyong Tao To: , , , Subject: [PATCH v2 4/4] pintcrl: support bias-disable of generic and special pins simultaneously Date: Mon, 26 Feb 2018 16:34:02 +0800 Message-ID: <1519634042-12063-5-git-send-email-zhiyong.tao@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519634042-12063-1-git-send-email-zhiyong.tao@mediatek.com> References: <1519634042-12063-1-git-send-email-zhiyong.tao@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180226_003507_471675_E399A328 X-CRM114-Status: GOOD ( 10.64 ) 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: devicetree@vger.kernel.org, hongkun.cao@mediatek.com, srv_heupstream@mediatek.com, linux-gpio@vger.kernel.org, biao.huang@mediatek.com, Zhiyong Tao , erin.lo@mediatek.com, liguo.zhang@mediatek.com, linux-kernel@vger.kernel.org, hongzhou.yang@mediatek.com, linux-mediatek@lists.infradead.org, yingjoe.chen@mediatek.com, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For generic pins, parameter "arg" is 0 or 1. For special pins, bias-disable is set by R0R1, so we need transmited "00" to set bias-disable When we set "bias-disable" as high-z property, the parameter should be "MTK_PUPD_SET_R1R0_00". Signed-off-by: Zhiyong Tao --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 3cf384f..e88ba04 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -301,8 +301,17 @@ static int mtk_pconf_set_pull_select(struct mtk_pinctrl *pctl, * resistor bit, so we need this special handle. */ if (pctl->devdata->spec_pull_set) { - ret = pctl->devdata->spec_pull_set(mtk_get_regmap(pctl, pin), - pin, pctl->devdata->port_align, isup, arg); + if (enable) { + ret = pctl->devdata->spec_pull_set( + mtk_get_regmap(pctl, pin), pin, + pctl->devdata->port_align, isup, + arg); + } else { + ret = pctl->devdata->spec_pull_set( + mtk_get_regmap(pctl, pin), pin, + pctl->devdata->port_align, isup, + MTK_PUPD_SET_R1R0_00); + } if (!ret) return 0; }