Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3231602rwa; Tue, 23 Aug 2022 00:42:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR54U+TEcQORzYonUZ9buMzsBv4QhVEr5U1RlZQljtKPDENAZoSzYI/p8lakzY0l6d4mwKQq X-Received: by 2002:a17:906:2bc7:b0:72f:dc70:a3c6 with SMTP id n7-20020a1709062bc700b0072fdc70a3c6mr15644757ejg.645.1661240571894; Tue, 23 Aug 2022 00:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661240571; cv=none; d=google.com; s=arc-20160816; b=01Jy/U1zjJOEPwOuQ7XvnLGfOY7QV8Kb/635Zj+TIzRtYMjThVhtGOP6n10CutUOXo uoxLiEilZZuf+t67+WsiFbigPJHY7mBnkf4z+zedPw/tmh5b9aWrVX137PCT3CVP04Dc lj2ZmyPZkzUoi8PkqdMM3svIk+kaLZgpErHeGC546PzXTun8IAOQZ3O6B8NEBOvrYlEo c5b0xXHN0dSn0dUbRplbWbP8YzvWR4aiQ3wyBt5arEyW0bDIZqhLl+0It2hHUQrdt+U1 ZB4dZPKZy1P1BXnKg6fTGYCi7nkbyO/uZPVmQpk36ls/9XgRyoXU/yxlkAhmQ2jIkZiP rMiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aVdx2hN420cu+4Ovamm5y5Q9yoBGLcQi5iBtHMgF9S8=; b=WoFDckd1elWUzpzSfGzUScTs1Bjm1HyFGbWAhRuCmgdSoNaUJB+9AwuD4hE6KiFS4e EXL7an1VcHaYOmAwc/qyXrXH2Ve/4gO2lBYjf/gvfZqrViD/LrkttqHMamqaP7TFmc6R Wte9kzKIqrM5qIntk+17jZI95AQBHKswGpcRmFr2drMh3w4o2f2Ulnb/+qD/fLa9nflC LwXZoTmb3aj08vGrR3JE2sHxM/eXyLYYcCpgnswdXTOmiu0F/kTHe9txrALPWqZHSwc9 CeIh3DqP0vSr4fQlu32R/LdycQQVMtSmyXD6kPFOwFcbcRXuTYnBVLo55mgC69/0Qw01 dwqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qS4vOfNh; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a50aa8a000000b00446e790ca3csi1334505edc.522.2022.08.23.00.42.26; Tue, 23 Aug 2022 00:42:51 -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=@mediatek.com header.s=dk header.b=qS4vOfNh; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241041AbiHWHbn (ORCPT + 99 others); Tue, 23 Aug 2022 03:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241009AbiHWHbe (ORCPT ); Tue, 23 Aug 2022 03:31:34 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0A2463F11; Tue, 23 Aug 2022 00:31:31 -0700 (PDT) X-UUID: e2279ca205e5400bbac2001b09fcc192-20220823 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=aVdx2hN420cu+4Ovamm5y5Q9yoBGLcQi5iBtHMgF9S8=; b=qS4vOfNhDLbYyDOAV6BFR4xKOdv8ZNHvZ+IXfVOgqdZ/NkfSFoAAzdYyW76IE4PQsTqxYIhkdkSSTeLqJNEy/ICUWCilEwXcHdacpj3RuuYmDhUDa3dh+wtBAA6eSE/4eAwZTVk/7NwnBfJ5thAd0ot3Sd67awpDD1h2EKvufug=; X-CID-UNFAMILIAR: 1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:a71b8cea-dfd7-4606-9714-90186e26c2c5,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Releas e_Ham,ACTION:release,TS:100 X-CID-INFO: VERSION:1.1.10,REQID:a71b8cea-dfd7-4606-9714-90186e26c2c5,OB:0,LOB :0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Spam_GS9 81B3D,ACTION:quarantine,TS:100 X-CID-META: VersionHash:84eae18,CLOUDID:164983c9-6b09-4f60-bf82-12f039f5d530,C OID:910bc39e7dd8,Recheck:0,SF:28|16|19|48,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: e2279ca205e5400bbac2001b09fcc192-20220823 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1054897088; Tue, 23 Aug 2022 15:31:26 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 23 Aug 2022 15:31:25 +0800 Received: from mszsdaap41.gcn.mediatek.inc (10.16.6.141) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 23 Aug 2022 15:31:24 +0800 From: To: , , , , CC: , , , , , , xinlei lee Subject: [PATCH,2/2] pwm: mtk-disp: Fix the parameters calculated by the enabled flag of disp_pwm. Date: Tue, 23 Aug 2022 15:31:15 +0800 Message-ID: <1661239875-19841-3-git-send-email-xinlei.lee@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1661239875-19841-1-git-send-email-xinlei.lee@mediatek.com> References: <1661239875-19841-1-git-send-email-xinlei.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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: xinlei lee In the original mtk_disp_pwm_get_state() function, the result of reading con0 & BIT(0) is enabled as disp_pwm. In order to conform to the register table, we should use the disp_pwm base address as the enabled judgment. Fixes: 3f2b16734914 ("pwm: mtk-disp: Implement atomic API .get_state()") Signed-off-by: xinlei lee --- drivers/pwm/pwm-mtk-disp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c index c605013e4114..50425cd1de61 100644 --- a/drivers/pwm/pwm-mtk-disp.c +++ b/drivers/pwm/pwm-mtk-disp.c @@ -197,7 +197,7 @@ static void mtk_disp_pwm_get_state(struct pwm_chip *chip, rate = clk_get_rate(mdp->clk_main); con0 = readl(mdp->base + mdp->data->con0); con1 = readl(mdp->base + mdp->data->con1); - state->enabled = !!(con0 & BIT(0)); + state->enabled = !!(readl(mdp->base) & BIT(0)); clk_div = FIELD_GET(PWM_CLKDIV_MASK, con0); period = FIELD_GET(PWM_PERIOD_MASK, con1); /* -- 2.18.0