Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1016070pxb; Wed, 6 Apr 2022 06:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbDMI7P931rzM6jLZutaUE1s/zgcpgzFMcgG/3CkFjIcMWQ9N4oE06wfhQmb1tYI/schpi X-Received: by 2002:a17:90b:4a89:b0:1c7:3933:d802 with SMTP id lp9-20020a17090b4a8900b001c73933d802mr9807653pjb.75.1649252865057; Wed, 06 Apr 2022 06:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252865; cv=none; d=google.com; s=arc-20160816; b=iikUM1h4S5EccB7yq75Guc5btP5ZdXs/E/hoWH9incrvyp5irfKRAzjDFrNqkeFjdc d5eOaEgftT/N2EnyYi3lfP/10tyFs3tfRER+fiL52PB7Rzxew5f4l2sxSghCZxSbbwCP z1oG6TCeQfOD/0lJm3huAhsEnMkjTwee3/s4TqaaOjgJDaigVjSONaibsrtDQj67Z3PB +WSzCoSL9/LfuV+ltLS72itAEPQDzJvuRjW3A2HcuVrGaMKTzP1hzGhDfxe6o634kgMc HebZ2GyHRIfE1euVaRXlNf19gVZkQeLKKnwiyhLmBBYgQwrChxD4FzVW0DINNBgQzMXm KAfA== 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=XE6yDWwhyrwZAo3xxs30QnNSmSs3k2DK7MLE4uze97U=; b=wwX403BXKgrNhH6rTU44SVH7HVkXa4h+4s5tiBIXymOxkgA1UGLLVzqwl1CX/prjqm mBLAl8EoNDgKi7e8LBY8kwOCREvrjCEijxdGEXCflcNhyszoG/VSgvQm/bNZZs6kIY47 9YpmseshSL+mqjJJPTFZn25HvW2UQZPIuHcKXrLUZy0zwbcjPVpxCzErCthwcI0RCZDC SIZVJN1i5epgBGKVXLrKdTPf0sX9pFYuZXtPJYErC4pRNPCC0QYj9/Awcz3X6tLE3z+i ObExxi5BoG5HAiOSuoapnGPpP4HIWhLxdRtvgebdRnFT8RJ5m8F/hpB5+p5eLtBYnGlq AbJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ckMUq93W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u18-20020a056a00159200b004faac3a73f4si18375552pfk.17.2022.04.06.06.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:47:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ckMUq93W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51C9A2467C0; Wed, 6 Apr 2022 04:43:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1845047AbiDFBxu (ORCPT + 99 others); Tue, 5 Apr 2022 21:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349486AbiDEJt4 (ORCPT ); Tue, 5 Apr 2022 05:49:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A87910DA; Tue, 5 Apr 2022 02:47:23 -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 25F2EB818F3; Tue, 5 Apr 2022 09:47:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8362EC385A1; Tue, 5 Apr 2022 09:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152040; bh=CpOct01/8FH3RaGhR7d1DqVufDqPf72qFqtnN+RjAHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ckMUq93WndiNwoxIHKNlYbu+wThV2YlggFRLy0/QQR6CEUkd96EOGCs6+B3Dpdd76 cTxhlqZKcDrR13VJuBuDHajYvD6EdZk0fXd+MGaSo0VISsbRZRxsICP8b3SXJwn/I2 JSkob/Q8oS7BebT7Mw13X/ZUr0LEuE9KBJLBU2AU= 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.15 634/913] pinctrl: mediatek: paris: Fix pingroup pin config state readback Date: Tue, 5 Apr 2022 09:28:16 +0200 Message-Id: <20220405070358.844249783@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 bcf359256ed4..2133964dfd59 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -714,10 +714,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, @@ -733,8 +733,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