From patchwork Thu Jul 1 08:09:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12353695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4808EC11F64 for ; Thu, 1 Jul 2021 08:12:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03B8A61601 for ; Thu, 1 Jul 2021 08:12:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03B8A61601 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=r7NmGeXdT8i5L5wdvK7lm+3Dp3t8XbRql+Z3fI0TBvE=; b=zqvQ4GuQKEZCtO ijQ5NFws4XSKKhCwz7+zz/vcGw1J+YjwlsRjAlMP+NLuMEEJNaj+hZoDKmNlw2/4oAb3nHebQC3zF q5iYC2Ebb6MKCCuCdf07b83Juzc+mVWsrkh9tkkt0PePXHkIye6r76TGEJ5u14FcJMEZx7s4ggcSm hg9gbNJWcnu//nB2gAsirpnML89uBwLud7jFkW31MRnenEQVNur8kAdnTPlLQ78cwwgipTb17F6UJ MPNZC/alyIg+NI8kygw/yKToWlFUkfTq7LP+JdBkcacA1M/vDE4/mNA8myZJp7qDDcRop31keyw/X jZpJxKWq0/QJ0SKJrALA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyrlv-00GTnG-5d; Thu, 01 Jul 2021 08:10:07 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyrlr-00GTlp-T2 for linux-arm-kernel@lists.infradead.org; Thu, 01 Jul 2021 08:10:05 +0000 Received: by mail-pj1-x102a.google.com with SMTP id cx9-20020a17090afd89b0290170a3e085edso3473051pjb.0 for ; Thu, 01 Jul 2021 01:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=05/l1i0MzcF43S74GFX7zHVjcwxLfLdqVO0nUEpbDV0=; b=S3MMnrqXhNiKGF5J0TPCRduqD0uIK0JAXHkIojST/KHNV2Hl4cWZkVYFqQ++/p2DTp R+oe9Lpwcdeg1hwXaxadt+3kbOnJQqdp8+Nx1mAyLdK8qlWpa3ybpx3nugkStTe6zAR7 wvbQmXdnS7/BdsqFi5Q1v36Xf77l+GnZQ2WIw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=05/l1i0MzcF43S74GFX7zHVjcwxLfLdqVO0nUEpbDV0=; b=s6cykS4sXnd9fPa6f6EwofvR0iV89s3sS6j0zASxD0HEvFP7lELUpipna98W+wH3lE KYHiPWvkWRsHcRzlPyk30CbBt6C1d7+Wt05ROj0iBfTMQpIVEQXXrf3iiulFLLgKfEW1 EBpLUKUJRyRPuywwraQQRYHcDDS9Rzfr8Hq2jghdnhyKiir6PTK3yRbNbL2NMuyZcDAz Ogs3STEjnWWZgtJnDEjatetIju10u27zenftA6xuWz7g1Si/YlAjcH1fijBoYzbRry84 FNfIKGDeZQIdOpoOMhwkOXwOjXO6KxLd/ojaRRpv+lBMh1C2AKh/+FqRIee/I1qilWF2 wVAA== X-Gm-Message-State: AOAM533FGUJ0wuQOALYMod9sVWbnzFb7AkddwKWhuRbb+mJG+H+pEsr0 SWUIuJ161fl4ESFq9+EBacFdFA== X-Google-Smtp-Source: ABdhPJyG0Ea3T12jyxm6vZmzBQnlz+cN3qJCWhrgNZuvdGCJTnAoQTyEUsEeYDaU6hrJms60UflVNw== X-Received: by 2002:a17:90a:17e7:: with SMTP id q94mr42915950pja.117.1625127001737; Thu, 01 Jul 2021 01:10:01 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:a18a:185:21d0:d5d6]) by smtp.gmail.com with ESMTPSA id h8sm6846396pjs.45.2021.07.01.01.09.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 01:10:01 -0700 (PDT) From: Hsin-Yi Wang To: Sean Wang , Linus Walleij , zhiyong.tao@mediatek.com Cc: Matthias Brugger , linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] pinctrl: mediatek: Fix fallback behavior for bias_set_combo Date: Thu, 1 Jul 2021 16:09:55 +0800 Message-Id: <20210701080955.2660294-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210701_011003_969014_BE87CC61 X-CRM114-Status: GOOD ( 13.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some pin doesn't support PUPD register, if it fails and fallbacks with bias_set_combo case, it will call mtk_pinconf_bias_set_pupd_r1_r0() to modify the PUPD pin again. Since the general bias set are either PU/PD or PULLSEL/PULLEN, try bias_set or bias_set_rev1 for the other fallback case. If the pin doesn't support neither PU/PD nor PULLSEL/PULLEN, it will return -ENOTSUPP. Fixes: 81bd1579b43e ("pinctrl: mediatek: Fix fallback call path") Signed-off-by: Hsin-Yi Wang Reviewed-by: Chen-Yu Tsai Reviewed-by: Zhiyong Tao --- v2: fix v1 comments --- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c index 7815426e7aeaa..10002b8497fea 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c @@ -926,12 +926,10 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw, err = hw->soc->bias_set(hw, desc, pullup); if (err) return err; - } else if (hw->soc->bias_set_combo) { - err = hw->soc->bias_set_combo(hw, desc, pullup, arg); - if (err) - return err; } else { - return -ENOTSUPP; + err = mtk_pinconf_bias_set_rev1(hw, desc, pullup); + if (err) + err = mtk_pinconf_bias_set(hw, desc, pullup); } }