From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 93384C433EF for ; Tue, 11 Jan 2022 11:25:31 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=cxcp/2EUW6ttuKRmZB2rpvQijI1aq1mmOCyMGVIbsh8=; b=tFZpps57sLvHMU oTq90B2xEe1SWNiXtQaZGNGLN82LsWGTaaLbu2ZKVt6hdstSIMHmvPKfvmBxP0hcZhDXKjmdxyMw+ Rn4UouP3KfEHSBed8ni3Ho32McbE2EhfPCtwcznil+52EpvYqjeCptdVulryAhNXFJs/8fZrVT5Gy teaNGPGxp7qnhUtib4gxla0AbUd8T4yQCR6I6a8SUYlHGg+yUXOM5LrzBb9MerGrxe8ds0J8N39LZ 2zCpqW6sXdLUUAjy4uLQzPS2zvzmCxdohtS/u13biN8f41tBulU9mQtRbi1Hq7HnLAC4nxBi1mUGX B4GqiymeoLlIEr6Qqi1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7FFe-00G0TG-TB; Tue, 11 Jan 2022 11:23:43 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7FEx-00G0Ci-Q4 for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 11:23:01 +0000 Received: by mail-pj1-x1033.google.com with SMTP id o3so6401020pjs.1 for ; Tue, 11 Jan 2022 03:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9+ilDo9mJ+cpPuGCqkGmDZyvh/0Rruh2V0ekaWY5ySY=; b=XkXs2sVlbZdBPoaVV9J3sUozK4gTSDSKFBpUFuCVPECXindDuuQ1V+69UJz2wI+lx9 G6MHB4muSD4ctmT/HkVVxQo3zMvDGWsavRPYgTq7KpqN0X1y2YprO5D9lkL926BJZm/v bMjRRBKqfMAEvtXOqXCHy2Na2MY9YUo4VQ9qc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9+ilDo9mJ+cpPuGCqkGmDZyvh/0Rruh2V0ekaWY5ySY=; b=lvMOzDEFmvydpgyJyq4rHEoPi2iCn9HNsrNxGy1qb3A1839u9pUDTnvBiVm1Z0uYs2 h28YUZdce2n6bEWTEkrwghMLB6+CicWX/HIN0JF8DEOkLHeDt2z1Lw3/SCitI1iRPOyo WRpOn/qaN+FgM5CYsxudqUCpyIOl5EOtWRXtwPZOHDr9CDFKnQslthIexk9cYXKwhmjn xQGbwSpTfehOTGgaak8kkACReXOtSvvElpxO9KbCmKIZe6Me21X56LfD4XEBD+qR6rQD bruP95Fin9NeXvcaANiimiaoftI1Dw7cA3ogfqJVMtmAU/OgJk/rTfbPREXAo7tk1xt5 BOIQ== X-Gm-Message-State: AOAM533Yl0/UDLngLsj3kR6tid6nvJkBebl4a+tPeepBjwGaefLw9LIc 8m3iIHSVeFemTLmCx+hD0f/P6Q== X-Google-Smtp-Source: ABdhPJwJRu06xQL6ByRV/9lgZHfl9RI+kH9RbPfqsP9o1NoMgEXTitj6cL5swsO/MkT7xBO0RdfRUg== X-Received: by 2002:a17:90a:9f95:: with SMTP id o21mr2601030pjp.44.1641900178730; Tue, 11 Jan 2022 03:22:58 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:e7ee:1824:8575:bc5c]) by smtp.gmail.com with ESMTPSA id f9sm2053845pjh.18.2022.01.11.03.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 03:22:58 -0800 (PST) From: Chen-Yu Tsai To: Sean Wang , Linus Walleij , Matthias Brugger Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Zhiyong Tao , Guodong Liu Subject: [PATCH 4/7] pinctrl: mediatek: paris: Fix pingroup pin config state readback Date: Tue, 11 Jan 2022 19:22:41 +0800 Message-Id: <20220111112244.1483783-5-wenst@chromium.org> X-Mailer: git-send-email 2.34.1.575.g55b058a8bb-goog In-Reply-To: <20220111112244.1483783-1-wenst@chromium.org> References: <20220111112244.1483783-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_032259_872265_4B57823C X-CRM114-Status: GOOD ( 14.80 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 a 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. Fixes: 805250982bb5 ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings") Signed-off-by: Chen-Yu Tsai --- drivers/pinctrl/mediatek/pinctrl-paris.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index d720624d8cd2..d259f075c62d 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -736,10 +736,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, -- 2.34.1.575.g55b058a8bb-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel