From patchwork Sun Nov 6 08:01:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 16084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1381404wru; Sun, 6 Nov 2022 01:03:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4tPRLe/zNSXgqpu/dTi0Jga9FfYfrl+YppPGenhBTnypwPPzWas3OR6iZhG5Mc9vqacMQg X-Received: by 2002:a17:902:ea85:b0:187:1851:bb02 with SMTP id x5-20020a170902ea8500b001871851bb02mr38395354plb.57.1667721798302; Sun, 06 Nov 2022 01:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667721798; cv=none; d=google.com; s=arc-20160816; b=xOGP3z3wzX4L4xMOvXi77D+9ducX9BK6XF0FmBXSkkipqFIQwXoT6tsIlrK7jqG5Ke vepXx98cQ+mVA7mNNKI7i+0kZGiMjee4ihkrSAza4AX0zir5rVQ74xE2StPpKUEgJX3l LMy6LamUPQrikiuC5QZp8YuzZ8bRSBwjNNafUmjifm15GDS1NvHGJJpFikY0WhHufZiF 5d+VmFNOS/bpliHwYwlpzuKnI1reZMyX6nvhd2RZDa86I3wdSIsont6rZ5Rs5LvfeAuw bmnrin+/tGesxYPF3b9psSil3pg0uNH1gfXcESQRtDiVGaOvj1/iRjzYOLVNe83sYQZU ocZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=El1GKLp+WHT5eBOYelh41HPdJnJnhv3QxP1VgLX4sjE=; b=eoyZcNMtRL72a6Hm1S23AK9F+XGiC901V4EF8CPE6UmNZgbrDLLN606dT/NWwVDleI EizbW2qwb2XJxNMQjb+4ZhRsjdWd+Ji69iMV5ETAJ/WLOaup9gpvqNeOqJ9nwcJ7it/8 c0cV+ATj1d//yVKiVSy0qusUcLUDIusIpelwoJxS2diirPSCEscDCpvnacTBILabgfKL 5OqFC/lplSdzb0Gh/YDwYtBcgMxXKGH9SpR2H+lr1VLPZp3lY1AoW2AhoIZOIaTcFlZm 2uaP3lO1JKCIUF1p0MoLcvv8N9DPF20QVTCFZGt3S0FfgZrK14qXRWp+YdoY9Ld+TrC0 GGyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=QqwGZJNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt27-20020a056a00439b00b0052e4de9b806si5133350pfb.342.2022.11.06.01.03.05; Sun, 06 Nov 2022 01:03:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=QqwGZJNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiKFIB7 (ORCPT + 99 others); Sun, 6 Nov 2022 03:01:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbiKFIBh (ORCPT ); Sun, 6 Nov 2022 03:01:37 -0500 Received: from mxout4.routing.net (mxout4.routing.net [IPv6:2a03:2900:1:a::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C4F56353; Sun, 6 Nov 2022 01:01:33 -0700 (PDT) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout4.routing.net (Postfix) with ESMTP id 3158D10077E; Sun, 6 Nov 2022 08:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1667721692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=El1GKLp+WHT5eBOYelh41HPdJnJnhv3QxP1VgLX4sjE=; b=QqwGZJNVCarkqfKXJrYzkxHf4BpJO/wWU6Yi8JVnKKu1QuBlOAeoeFFWjaE6yIb0awivtq Ab2ZeINUwtdrMtWM3SYGP1wntJxXd54H76SmKIaaiQJvGbR+c+L5wizdk4l8A7tW1p8/yG v35raMlc5Qb8rdkhin8LMFKXXdgGEs8= Received: from frank-G5.. (fttx-pool-80.245.79.199.bambit.de [80.245.79.199]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 8820E360707; Sun, 6 Nov 2022 08:01:31 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Sean Wang , Sam Shih , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] pinctrl: mediatek: add pull_type attribute for mediatek MT7986 SoC Date: Sun, 6 Nov 2022 09:01:13 +0100 Message-Id: <20221106080114.7426-7-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221106080114.7426-1-linux@fw-web.de> References: <20221106080114.7426-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 1833dc4d-5032-4cbc-ab32-c25b5990d83b X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748733052223628061?= X-GMAIL-MSGID: =?utf-8?q?1748733052223628061?= From: Sam Shih Commit fb34a9ae383a ("pinctrl: mediatek: support rsel feature") add SoC specify 'pull_type' attribute for bias configuration. This patch add pull_type attribute to pinctrl-mt7986.c, and make bias_set_combo and bias_get_combo available to mediatek MT7986 SoC. Signed-off-by: Sam Shih Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno --- v2: - fix odd numbers in comments --- drivers/pinctrl/mediatek/pinctrl-mt7986.c | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7986.c b/drivers/pinctrl/mediatek/pinctrl-mt7986.c index d13c59510468..db3497d6787a 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7986.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7986.c @@ -407,6 +407,60 @@ static const struct mtk_pin_field_calc mt7986_pin_r1_range[] = { PIN_FIELD_BASE(66, 68, IOCFG_LB_BASE, 0x60, 0x10, 2, 1), }; +static const unsigned int mt7986_pull_type[] = { + MTK_PULL_PUPD_R1R0_TYPE,/*0*/ MTK_PULL_PUPD_R1R0_TYPE,/*1*/ + MTK_PULL_PUPD_R1R0_TYPE,/*2*/ MTK_PULL_PUPD_R1R0_TYPE,/*3*/ + MTK_PULL_PUPD_R1R0_TYPE,/*4*/ MTK_PULL_PUPD_R1R0_TYPE,/*5*/ + MTK_PULL_PUPD_R1R0_TYPE,/*6*/ MTK_PULL_PUPD_R1R0_TYPE,/*7*/ + MTK_PULL_PUPD_R1R0_TYPE,/*8*/ MTK_PULL_PUPD_R1R0_TYPE,/*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*/ MTK_PULL_PU_PD_TYPE,/*81*/ + MTK_PULL_PU_PD_TYPE,/*82*/ MTK_PULL_PU_PD_TYPE,/*83*/ + MTK_PULL_PU_PD_TYPE,/*84*/ MTK_PULL_PU_PD_TYPE,/*85*/ + MTK_PULL_PU_PD_TYPE,/*86*/ MTK_PULL_PU_PD_TYPE,/*87*/ + MTK_PULL_PU_PD_TYPE,/*88*/ MTK_PULL_PU_PD_TYPE,/*89*/ + MTK_PULL_PU_PD_TYPE,/*90*/ MTK_PULL_PU_PD_TYPE,/*91*/ + MTK_PULL_PU_PD_TYPE,/*92*/ MTK_PULL_PU_PD_TYPE,/*93*/ + MTK_PULL_PU_PD_TYPE,/*94*/ MTK_PULL_PU_PD_TYPE,/*95*/ + MTK_PULL_PU_PD_TYPE,/*96*/ MTK_PULL_PU_PD_TYPE,/*97*/ + MTK_PULL_PU_PD_TYPE,/*98*/ MTK_PULL_PU_PD_TYPE,/*99*/ + MTK_PULL_PU_PD_TYPE,/*100*/ +}; + static const struct mtk_pin_reg_calc mt7986_reg_cals[] = { [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7986_pin_mode_range), [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7986_pin_dir_range), @@ -866,6 +920,7 @@ static struct mtk_pin_soc mt7986a_data = { .ies_present = false, .base_names = mt7986_pinctrl_register_base_names, .nbase_names = ARRAY_SIZE(mt7986_pinctrl_register_base_names), + .pull_type = mt7986_pull_type, .bias_set_combo = mtk_pinconf_bias_set_combo, .bias_get_combo = mtk_pinconf_bias_get_combo, .drive_set = mtk_pinconf_drive_set_rev1, @@ -887,6 +942,7 @@ static struct mtk_pin_soc mt7986b_data = { .ies_present = false, .base_names = mt7986_pinctrl_register_base_names, .nbase_names = ARRAY_SIZE(mt7986_pinctrl_register_base_names), + .pull_type = mt7986_pull_type, .bias_set_combo = mtk_pinconf_bias_set_combo, .bias_get_combo = mtk_pinconf_bias_get_combo, .drive_set = mtk_pinconf_drive_set_rev1,