Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp658100pxb; Tue, 5 Apr 2022 17:36:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMMmLtFoKwTz+iQlX1CT4vKmmDne5B8rfPJiw4TUygIVTK0pF8kMQBbqvKwK40+YHG2YnY X-Received: by 2002:a05:6402:51d2:b0:41c:e157:84f1 with SMTP id r18-20020a05640251d200b0041ce15784f1mr6292499edd.135.1649205334648; Tue, 05 Apr 2022 17:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649205334; cv=none; d=google.com; s=arc-20160816; b=JNw+NQwL5lkhSg3B5YwVFiQP9UojF3TAXP1BNtL/S0GSXB4wwpNFdHy51mcM/cwdkV hxpNJp2SlIxbwUQlLHmpqUFODWw9HpIeu4jiGDh3YXFtNt/5i/RSs9rkZydDQYw9zgB8 +FLKScuqeJouMbZsO0b6qhwq/h953xLiBlSPKmIaphoZQFPn3gS7BMeSr6eFS+8JHO1R 3cKV0EbrzaHgUGazysT8X/oSmtrQo3Afk71ODRhoCiuRb90c05eO0rRi1bBTvlze+dR4 9hRe7NasMzoRO4gJ2Om4aEfFR4+7SXy7SDbq0V50jlkgzfmeBTUGrrYj96gxeSJGrlTR FfXw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CVqNQJN/JlcuQSG34PaR9CAz20J1nriP1+g6yaLFOBU=; b=feHN6w5rFbjJ3Wbc16bMQYcQH3hZj9taA0E0K/ocAmrp80D2Phcf0f+aaCR/UXPyas g1tygoI4KXy2k9YW94mVCAa430WWZ5Tw1BcyiVglP48Q1AdzNmvz3rRqp2zz8YWkhJQT QRe9iiWAQrVrdkExw2jYpGn46J0txlmILthoOkKefjkFXeQp2okGf1peJx/vpDPBsqKv Ue90OLCgaw6Pe6dy9o/gzRGN0DAHPbdSvTqYMZsWJ92gANeKwlHpmrfdBdASduYZTEoe 2kEF4OIi7AwZjC0NBO6tEY1r6kGG9xAYc22Zb89VFtbyL+yeO5hQpdkb2x+bOfyrq+zx Kkmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sbehzh39; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v5-20020a1709060b4500b006e76f053445si7277446ejg.55.2022.04.05.17.35.09; Tue, 05 Apr 2022 17:35:34 -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=@linuxfoundation.org header.s=korg header.b=sbehzh39; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354917AbiDENHb (ORCPT + 99 others); Tue, 5 Apr 2022 09:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343997AbiDEJQo (ORCPT ); Tue, 5 Apr 2022 05:16:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5CFEF0E; Tue, 5 Apr 2022 02:03:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 426E2614E4; Tue, 5 Apr 2022 09:03:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59E0EC385A0; Tue, 5 Apr 2022 09:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149395; bh=ClrTzo1Hr85pR7R4wb0upbLU92Y4S4CqGKJf0/yPmYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbehzh39+CSFtOWg7omhGqnj7xeWtN1lX4J9c06xkhiUONfvJVLir7ZZx2u7if1v/ 8exwE/fiftCuzz4xkm11gfs5ZZGHGuLk0WTMvyeIZDwjVHRD/Ev59J93GHNoAWv3a+ KhNJqzVaPqr4YwFvFHMb8zySvSIkjSjbOkHPD4oE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , AngeloGioacchino Del Regno , Linus Walleij , Sasha Levin Subject: [PATCH 5.16 0699/1017] pinctrl: mediatek: paris: Fix pingroup pin config state readback Date: Tue, 5 Apr 2022 09:26:52 +0200 Message-Id: <20220405070415.021128834@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Chen-Yu Tsai [ Upstream commit 54fe55fb384ade630ef20b9a8b8f3b2a89ad97f2 ] mtk_pconf_group_get(), used to read back pingroup pin config state, simply returns a set of configs saved from a previous invocation of mtk_pconf_group_set(). This is an unfiltered, unvalidated set passed in from the pinconf core, which does not match the current hardware state. Since the driver library is designed to have one pin per group, pass through mtk_pconf_group_get() to mtk_pinconf_get(), to read back the current pin config state of the only pin in the group. Also drop the assignment of pin config state to the group. Fixes: 805250982bb5 ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-5-wenst@chromium.org Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/mediatek/pinctrl-paris.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index cbaad89fbe17..faf11c9e1db3 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -732,10 +732,10 @@ static int mtk_pconf_group_get(struct pinctrl_dev *pctldev, unsigned group, unsigned long *config) { struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev); + struct mtk_pinctrl_group *grp = &hw->groups[group]; - *config = hw->groups[group].config; - - return 0; + /* One pin per group only */ + return mtk_pinconf_get(pctldev, grp->pin, config); } static int mtk_pconf_group_set(struct pinctrl_dev *pctldev, unsigned group, @@ -751,8 +751,6 @@ static int mtk_pconf_group_set(struct pinctrl_dev *pctldev, unsigned group, pinconf_to_config_argument(configs[i])); if (ret < 0) return ret; - - grp->config = configs[i]; } return 0; -- 2.34.1