From patchwork Thu Jul 1 06:54:39 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: 12353635 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 9E258C11F64 for ; Thu, 1 Jul 2021 06:56:37 +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 6A5B86135B for ; Thu, 1 Jul 2021 06:56:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A5B86135B 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=Lp9wErWlKijsZPIRBEM/g4ZQLZAgYO48N6CW+FNv9+M=; b=OxY/zSr3fd8XnS i/lqLQNeI5zbkTEWfAe7HV3W/XBKzC55bw/O2+x5A+0JWKL+oKHixXfyqflYqsK8G7mvQs8e6RXiU zV96mPbrH6i5oA0qOAu7XemfEvDH8k8nHb7xUj/rHg7CBMupgU/hl3SADDAjcU9nh0FWRVja/kNVV 7lpyKbqk7X3KHeXrpT9L8sEBLZpy5v1uqktDuphrXs6prR0fp/FTGUboB4yOwqVRFqZJL5eA4d1rf dpbPs2UBcuoz1yB/fc7QAdLfKRAUpPTXQTyZmZOCbxQk23y/Keyrg/p5SJxA2kw0w/HPwlu0ib5f1 TXy8PD4VJ7hk4vBQoJrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyqb3-00GIrs-NN; Thu, 01 Jul 2021 06:54:49 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyqb0-00GIr1-CQ for linux-arm-kernel@lists.infradead.org; Thu, 01 Jul 2021 06:54:47 +0000 Received: by mail-pf1-x432.google.com with SMTP id w22so1413215pff.5 for ; Wed, 30 Jun 2021 23:54:45 -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=BaGoqmFP1tt0EpZeEpkj9x84y98y9BYCdG4DKqTdqyc=; b=jytw1fUdgseF6tkwK4vPEO6tMMLx7zUiWZECq+PuslI4xmtAklxm6BQi0CekZ+tkIT aqXLdrI5VN/Nc5msg6XIAk1fVxzUfAR+cKBijD9YUtszoyZNJz5//dHazXD96UAh9TOT CjyS7QVqbISwamkqJs9oz5XJJYFycLwO1/P+s= 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=BaGoqmFP1tt0EpZeEpkj9x84y98y9BYCdG4DKqTdqyc=; b=PaiVLqD0o1WsinnxAyiT7crCVNMR/ZZBp6JjUtxrQpepgEMpP8jda6RnAiNjUCRvM7 t9AxzCMVMDzsEf7Qv3RHwpo+uRPxu3g0a5r+qOtzr5CiRvu3oBk+F6gb+yfz7Oispzd+ aArFYhUR/xg3cj1FPD9j+Nyrm1N+a+n0DXY6du3suFzTaLSwb9m9clxTqB/XMurkpYWS ZW5ZNGym9hQ6C8E5ZZshulA4SQw0/yxDyUG4GqxILWTDKFgc8cD2nAfPOjyZM9P8JD5u kvkp0ExXg0mTqL8xhcdvA88FJGE96lPPaVWObCsAPFRBu4wU2qtamXlcUe/PNpC/O31h Swlw== X-Gm-Message-State: AOAM532ctfQJEXmPiGQFo46Y3YGhzgmiBQxBCKpgTwXlICntRvUGS5vl wypYTP47ZLL4hxqYTjh7UIcruw== X-Google-Smtp-Source: ABdhPJzxV7zCV9lAR3c0Jc9juDg8NFET/Z+3XOOmtNN2U0pMXdlVQZ61Yd8/oRnIU39J8a/TT842Sg== X-Received: by 2002:a05:6a00:2145:b029:30b:127:e0a3 with SMTP id o5-20020a056a002145b029030b0127e0a3mr25141688pfk.34.1625122484840; Wed, 30 Jun 2021 23:54:44 -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 l7sm24770126pgb.19.2021.06.30.23.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 23:54:44 -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] pinctrl: mediatek: Fix fallback behavior for bias_set_combo Date: Thu, 1 Jul 2021 14:54:39 +0800 Message-Id: <20210701065439.2527790-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-20210630_235446_479704_690D8E4C X-CRM114-Status: GOOD ( 12.77 ) 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 this fallback case. Fixes: 81bd1579b43e ("pinctrl: mediatek: Fix fallback call path") Signed-off-by: Hsin-Yi Wang --- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c index 5b3b048725cc8..0cdff487836fa 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c @@ -926,9 +926,12 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw, 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; + err = mtk_pinconf_bias_set_rev1(hw, desc, pullup); + if (err) { + err = mtk_pinconf_bias_set(hw, desc, pullup); + if (err) + return err; + } } else { return -ENOTSUPP; }