Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp679143pxb; Tue, 5 Apr 2022 18:27:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgzNt78UQCkOqLJ9ExUbC/2HYRUIvChzq/rM7QzeELSBVK69lRvKTFET2GDXS9YZBNhFN8 X-Received: by 2002:a17:906:c147:b0:6df:f047:1677 with SMTP id dp7-20020a170906c14700b006dff0471677mr5964643ejc.4.1649208434774; Tue, 05 Apr 2022 18:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649208434; cv=none; d=google.com; s=arc-20160816; b=KtktA//+Y6kZQavTadBN11Y+F5Y0cGUeZRAZzmrNURwjgj+/bdc9vOutDo6qmSx7H+ U097tamnFwGWp3WstFMUU8Pm1XQU7+6X54A/NYZsJ0eR0ZiNmWUWistOfwLQ1ZD+A8Wm ScbS/F5kyUoUAVGAJvP9aojofpXj4TNNEhZYEXDSB4xUy6zVrSP5mQ3Cnq10SuqRuv8L bYs0kV4styHGa4UDclJBpeiUwZkXDXeVw/ifrCc/1Si0DM/JsMWeqQeZoPUrumBOp8Cf zBVKKrO6F2UqT1bZYiOqyFzQS0tl0h7+1IeTQUBmkI6N+Ky+f3t/zOwyCJzcg+cD1wsw gxcw== 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=EkOVf7DuDO9Q44KTs5g0Fak8ltSenuv9qBvA8r2T9Do=; b=gxXrDeRe77ZIN12yTwoKQMWai2iSh+s1NI0dNOmJi/VDZzpA9cFk3aWMs4Kp17cbft 5xFZfy95nML2USGUc3K7C7bRiYI6kKoI4ihY0lbmAaKPAhyXk5hOvj/26WXrPTermvOM WCnte15aJpajij5if3VNHT8tk5PdvH+PJtUxCxvYn/HZ0irLuc/BS6wzxmlR2SBY4++M 0x4MWiCRe9z8Gnmbm3rsena8YzZ72ja4KCHzKR+PgbyPd088/gYvtN7g+r8n/vQCZyzF cmCuKD6OJ3h9Kz9QjVwlDUfU9rMLaej/UEDD7yEXsZCtvkXwu8+Kqb0ycj39i4fkBLE9 NSEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IPs4DqnY; 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 s17-20020a170906455100b006e7f3b2ef70si5861063ejq.31.2022.04.05.18.26.35; Tue, 05 Apr 2022 18:27:14 -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=IPs4DqnY; 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 S239405AbiDEJdh (ORCPT + 99 others); Tue, 5 Apr 2022 05:33:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239490AbiDEIUI (ORCPT ); Tue, 5 Apr 2022 04:20:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDED3B3C; Tue, 5 Apr 2022 01:14:20 -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 ams.source.kernel.org (Postfix) with ESMTPS id 95886B81BA7; Tue, 5 Apr 2022 08:14:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3CD7C385A1; Tue, 5 Apr 2022 08:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146458; bh=cWcCNbB+zyH5SVcQxLF5Oid3an5qQ0YrX540UlV8RGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPs4DqnYvJtCSH1OhulAkDwsuwO5n/J4Qo9gKhvO3c+VhnnyJIdEkJ4YPpuSVmYqX VxB8Fu05RUx9UJYQh+nUwXg+pNHsQr4tYSC5Q9d1Ji9j2xAJwJEehVelRpnCSFBTfc NM9q37SwvhE2BB2L4K+OqEVGWop65iP28N/s30ds= 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.17 0772/1126] pinctrl: mediatek: paris: Fix pingroup pin config state readback Date: Tue, 5 Apr 2022 09:25:19 +0200 Message-Id: <20220405070430.240824721@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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 c668191933a0..3bda1aac650b 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