Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp431941pxv; Thu, 1 Jul 2021 01:11:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaM/9yrDyq/5JhQD23PbL7Tsn4wqhF4EkFazEm8NmDHttqJCX7r09EoaE9PhwcR4vEU00n X-Received: by 2002:a05:6402:27c7:: with SMTP id c7mr32567919ede.272.1625127086606; Thu, 01 Jul 2021 01:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625127086; cv=none; d=google.com; s=arc-20160816; b=hIpr4dKdnKmwcPRRMT4KLc7sfMjMISClv04rKtj6AvJaR8JisL9HlboCFjCPWi8CJw aI/gwy3UeDu5/lkMvWzSUQmCZzRvHUUMFk/PGuMTqWOzBSODOmtqqK1+WcUa/Fd+KiPO dEEV4GlxE1T2SU5zAtbqLVpHpzKLKqmRlMSDQ1im9qKAUdtDagyZUigh2E7xzR6/vuBA l3tcFR8rfhZajQsdyGmJmgV2x0tJkDsJExtZwum0iqEkYjX2s9ClTprhlk68+4f8kcb+ +ZCVCW20uPhrf2cvoMwP8LqW/uws9nUYNQdd6D0yNNG2MWWTAdZjF0pm9E+SGU5Gmu/5 AMFA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=05/l1i0MzcF43S74GFX7zHVjcwxLfLdqVO0nUEpbDV0=; b=Gsk9sRzXDy6cFBegNcNEkNlYJuiAAfZ2xsFWwxIpdPPCzfu4e1HB0er8qb+4HvJzIt 0LywmseivPV/opw5SeEfCTzN9zV9p07POkx1ws88S9YO+ArOqPhXhTvFvnZiX4i6PNaj YPn5mksYEtlCkuXfFw0HiyNqRSOOjA/Zt2TyaHWi7Kl1L7eXgR0OxhJm1akIeC10t7Wq 8rQ7/TYx04FnFo8R8444yDXMKCEWQ4dWWBQ1rc8acDZsq7Y/xwWH19AZMdgNnALoAkr3 7v35S+mxNtZ3BHCn789YBKWb5B+YaOYUcKZD4360s6KBzT8Yhuk5nEnE2NzO3EwGUxz5 fTVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=S3MMnrqX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh21si11371368ejb.428.2021.07.01.01.11.02; Thu, 01 Jul 2021 01:11:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=S3MMnrqX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234896AbhGAIMd (ORCPT + 99 others); Thu, 1 Jul 2021 04:12:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234760AbhGAIMd (ORCPT ); Thu, 1 Jul 2021 04:12:33 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 821B8C0617A8 for ; Thu, 1 Jul 2021 01:10:02 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso3451712pjp.2 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=MYb3yMD5C8VoAAb00wfpa2Z53IIuaZW0mHbiQi/vsC2Azl3AqxAvUf+0KslCzQx6iL riPQPL/DxNPzWfbnZOQPXBbDbZrxeK8WD07kTLBKjVSgYv10i9wQCGs0Kkd02geT6LOB QOU5XxwphxoCt1RJxyBjDkNJvTcWC1tNJiWBjHK1vvgXT6jNxyceZMbMu3lK6QFznBKt 8j35qWjpyGjRvPkV6E4m694ruZzPzhtUqs3nX4HrnXxJGn2JHOQ2DPZWQLe09Vwqfo50 LwrOUm/piWWFtHZDr5R/kMsrnRjkPr9Kf67Ny1eGYh/MvszPAkuDkcMK9ldV7h/liJ3d S73Q== X-Gm-Message-State: AOAM532xDQs3nrTs+WPAs7K6yCkBl8oBsv4RXKaUePzdveEJeQMYF/VB 7qpz4WsaZrbcunew4/dvEcmIieDvFe6UQg== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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); } } -- 2.32.0.93.g670b81a890-goog