From patchwork Tue Aug 23 07:31:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?WGlubGVpIExlZSAo5p2O5piV56OKKQ==?= X-Patchwork-Id: 12951845 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 68256C32774 for ; Tue, 23 Aug 2022 07:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oaBaN3zCKukH4pMWLopRptVLPEGWyvADJAlEfkIr294=; b=kp3sJCSiF1fohKLbep+Ccg85X5 PhPLhFt0J391w4WtqlN0bnCzvA2i8p6u5osQueHLgVBK+j98Lwqa+iHVAVQuxscTGmWDKDC4eX6Q3 s9sKTJdW4Tx0LaMdHRl97a9tNwNBbmZWgf1NIPb2b69uLOo0mFhfNRYEvCrSurqhXt8DjK3Fu5JeS nsLdQDW5lKEoSzw4gPMD15VTyab/Ibq3W9RxPkygl9Q9TZ2VaeGETcL0WM41MLYpizDGnhEHeGXm8 y90xOq8uaUXb+0fGk2HLWez5Ke9ao9n3uItupk0ZapoJtImlMz1dcvGxIOCUg15+6YO1+w8BNA7f8 68x+zfJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQOj4-003eNQ-W2; Tue, 23 Aug 2022 07:53:31 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQOhe-003dSF-4a; Tue, 23 Aug 2022 07:52:03 +0000 X-UUID: 83d2ffc222864b618e5c102e2e621ddf-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=oaBaN3zCKukH4pMWLopRptVLPEGWyvADJAlEfkIr294=; b=Cp3p4C2s2N+ghnvl0sVS2Gnpoh/tgWyi+BcLNYsyEbfrC6JVO/DrCPeo+Ucz7aFMN+kpmIDV/E4xy2egxnRRtuWM7xIa0IyJWsH2r8BmBcyLeJ54XUsn4VgTy/dAMvtLEjzeK7u1retfzVi/J51/0Qu3enh8/3vRc/daRbBl3vg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:2eef9da7-add5-4120-ab4f-a8ae542a70cd,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:7df583c9-6b09-4f60-bf82-12f039f5d530,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 83d2ffc222864b618e5c102e2e621ddf-20220823 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1481129802; Tue, 23 Aug 2022 00:51:57 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs11n2.mediatek.inc (172.21.101.187) 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:22 +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:21 +0800 From: To: , , , , CC: , , , , , , xinlei lee Subject: [PATCH,1/2] dt-bindings: pwm: Add compatible for Mediatek MT8188 Date: Tue, 23 Aug 2022 15:31:14 +0800 Message-ID: <1661239875-19841-2-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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220823_005202_245538_D2C344E1 X-CRM114-Status: UNSURE ( 7.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: xinlei lee Add dt-binding documentation of pwm for MediaTek MT8188 SoC. Signed-off-by: xinlei lee Acked-by: Krzysztof Kozlowski Acked-by: Uwe Kleine-König --- Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml b/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml index e4fe2d1bfef5..2dd93e8499f0 100644 --- a/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml +++ b/Documentation/devicetree/bindings/pwm/mediatek,pwm-disp.yaml @@ -27,6 +27,7 @@ properties: - items: - enum: - mediatek,mt8186-disp-pwm + - mediatek,mt8188-disp-pwm - mediatek,mt8192-disp-pwm - mediatek,mt8195-disp-pwm - const: mediatek,mt8183-disp-pwm From patchwork Tue Aug 23 07:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WGlubGVpIExlZSAo5p2O5piV56OKKQ==?= X-Patchwork-Id: 12951844 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 C8147C32793 for ; Tue, 23 Aug 2022 07:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aVdx2hN420cu+4Ovamm5y5Q9yoBGLcQi5iBtHMgF9S8=; b=hiaQlvzXzV9ADAGnebV78nto+2 ubMyU0sPdR/CsCEW/SmDEQJFSEg1cEV3hJCZts7ro9Q27CJ2mSO8SUnxqYqk69+J6k9hBl8Lu7eSi 27pU31hLtfQuZTrz0NTLND9icd23KcE2dPfFcFfUhFmUrvKhXa3kzpevVXat4ZDROWAqXhI0dCKmZ 0PdCtEJDSoz2R22vFoRXa1XL0ErnTiEbnnTth4EBG03Pb6827sWYbJX7KCT3sENduXfmsQe7ZdWvQ tvoREzoqXc+wn7Tgisxv2n7mYqlGn0Cupmls8RIa0rvsiWGXf9CXLss92mMm1uTqgODL6s2sHB+Yh xD6B19tQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQOiD-003dog-10; Tue, 23 Aug 2022 07:52:37 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQOhD-003dC4-Pt; Tue, 23 Aug 2022 07:51:37 +0000 X-UUID: 56b111cd2ea149bfa355d391225a3e17-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-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:9c15a266-3fcf-4e7d-a76f-26dbcbe0891c,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_ Ham,ACTION:release,TS:0 X-CID-META: VersionHash:84eae18,CLOUDID:3d200768-a9d9-4672-a3c8-12721739a220,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 56b111cd2ea149bfa355d391225a3e17-20220823 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 161501579; Tue, 23 Aug 2022 00:51:28 -0700 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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220823_005135_886232_088C3400 X-CRM114-Status: GOOD ( 12.15 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 Reviewed-by: Miles Chen --- 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); /*