From patchwork Wed Jan 16 07:52:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitao Shi X-Patchwork-Id: 10765465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13CE413B4 for ; Wed, 16 Jan 2019 07:54:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04C9B2AA97 for ; Wed, 16 Jan 2019 07:54:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECB022AAB9; Wed, 16 Jan 2019 07:54:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C47B2AA97 for ; Wed, 16 Jan 2019 07:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=08d832FNNzxicjv/OXHkP0towTuHplyrDN7kqw4BzjA=; b=EtKG9PGfZ+GC6J G+7GNTfVsGiZSRsuW+Z1pLCY7Grr4zbUhyJBVJSBtJXxgHqXIoLW8RKChL4Oi69qphPiVmFmSTYFF bPV7oVOytg6zlomw1W7ZJCfi4nBV4H+fMOBR8PYKZQwzsGo0gQ6AblAUN8l1C2KhhfyErjac04fyk QQPxP/1dOahU//VO5JEB4TcJXx8xiBnonIBsKRzsLnZmbLpdAld0YNW+w+fkvEvC9S0zdu3pNvhdk UM58LHpiEYl21uULenVKcEHTBpb9TLSnEBNg5KxHiIg1x69P3CRkFowihj5VBTDA4KYZfrPtbg0rF TwDiy/+6cPg548QT0cLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjg1V-0005YD-Lm; Wed, 16 Jan 2019 07:54:05 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjg1T-0005Xd-7c; Wed, 16 Jan 2019 07:54:04 +0000 X-UUID: 49ffe6c47eea408c8d25cd46cae6c07d-20190115 X-UUID: 49ffe6c47eea408c8d25cd46cae6c07d-20190115 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1602074943; Tue, 15 Jan 2019 23:53:35 -0800 Received: from MTKMBS33DR.mediatek.inc (172.27.6.106) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 15 Jan 2019 23:53:34 -0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS33DR.mediatek.inc (172.27.6.106) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 16 Jan 2019 15:53:31 +0800 Received: from mszsdaap41.mediatek.inc (10.16.6.141) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 16 Jan 2019 15:53:30 +0800 From: Jitao Shi To: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , Kumar Gala , David Airlie , "Matthias Brugger" Subject: [PATCH] pwm: Add MediaTek MT8183 display PWM driver support Date: Wed, 16 Jan 2019 15:52:52 +0800 Message-ID: <20190116075252.24124-1-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.12.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190115_235403_279484_D8D062D1 X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eddie.huang@mediatek.com, Jitao Shi , Sascha Hauer , srv_heupstream@mediatek.com, bibby.hsieh@mediatek.com, linux-mediatek@lists.infradead.org, Russell King , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Inki Dae , yingjoe.chen@mediatek.com, sj.huang@mediatek.com, Sean Paul , Philipp Zabel , Andy Yan , ck.hu@mediatek.com, Vincent Palatin , Thierry Reding , Ajay Kumar , linux-arm-kernel@lists.infradead.org, Rahul Sharma Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use the mtk_pwm_data struction to define different registers and add MT8183 specific register operations, such as MT8183 have commit register, needs to enable double buffer before writing register, and needs to select commit mode and use PWM_PERIOD/PWM_HIGH_WIDTH. Signed-off-by: Jitao Shi --- drivers/pwm/pwm-mtk-disp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c index 893940d45f0d..15803c71fe80 100644 --- a/drivers/pwm/pwm-mtk-disp.c +++ b/drivers/pwm/pwm-mtk-disp.c @@ -277,10 +277,21 @@ static const struct mtk_pwm_data mt8173_pwm_data = { .commit_mask = 0x1, }; +static const struct mtk_pwm_data mt8183_pwm_data = { + .enable_mask = BIT(0), + .con0 = 0x18, + .con0_sel = 0x0, + .con1 = 0x1c, + .has_commit = false, + .bls_debug = 0x80, + .bls_debug_mask = 0x3, +}; + static const struct of_device_id mtk_disp_pwm_of_match[] = { { .compatible = "mediatek,mt2701-disp-pwm", .data = &mt2701_pwm_data}, { .compatible = "mediatek,mt6595-disp-pwm", .data = &mt8173_pwm_data}, { .compatible = "mediatek,mt8173-disp-pwm", .data = &mt8173_pwm_data}, + { .compatible = "mediatek,mt8183-disp-pwm", .data = &mt8183_pwm_data}, { } }; MODULE_DEVICE_TABLE(of, mtk_disp_pwm_of_match);