Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp971509imu; Wed, 16 Jan 2019 10:28:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN42RqnvBSuMjBik5jrsUQ3pS8o07EB7LSkFAxqB3uh8R1S0PBaQq4wvx5ONPznUfA5NdmMx X-Received: by 2002:a17:902:30a3:: with SMTP id v32mr11361792plb.26.1547663299756; Wed, 16 Jan 2019 10:28:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547663299; cv=none; d=google.com; s=arc-20160816; b=BbPeXqk3zin2T3S+4pJ6QR3ur9RYoZhJv46Z5OqZF5sL2bdNCeOMeHrty0sOMYFR8V ZPW0HAyH1LfBGIYANngaXzp9Ftfxj/IZ6JpOp9MpoWE+FKcO2xXdLS9fuNM5rmsWzgxs BRrBFv6jHo6dNuMyTFryH6qSQJpTutlFH7c2t76aqFgAYKPNTxyt9BirvhKpx7z57/Xz QpC4weOdWboOd1q5EI8KbM2PUHsMpBNlsFVODfUIPfEV6ltiscXFQmxMLG4ubZA6yhXc lo3RIjTMFBCAswVMdxzyZ0690u72SYHOYPeuLk0/rUf9yrpw5LeSe/HOpd+37jldSPTC g1yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=VwVyXB8T/NeTsWdM3eM2Rs2DKoGO+81jeyUJUN1mEdg=; b=RJROgjqKgTzzL4CaeymteNlAUBdrueufX/Y+9CiEGlJxYkC2IeWxMwoqPXYOUWjdwz P/z5EY5WXokvAPDyJ2WIGpPqnWbPoRqz1lO9sbV5zsulSe7EYCdKlgmNd6FHSdvZRddG piU6tzRdy1OH6ZmMXBe7+hJzvjsKfCzgExFvDP+X9VX3YcW588YqRaMQWlug4/uMkI3Q hESkvaGP9Ov4S3eMKcxaEmRyd7SLYQpiyOb2P2mp2DZwgwdhk9Seo3+9CPJQf0H+NWEt DH2GMuMuAz9fuOXumHS7q0GJ7J6sEbHLK0rsMhIrezbLIKGp8jqG/OpXyq5IHG3Esxjr Lh/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g83si7049560pfb.278.2019.01.16.10.28.01; Wed, 16 Jan 2019 10:28:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388524AbfAPHxm (ORCPT + 99 others); Wed, 16 Jan 2019 02:53:42 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:55863 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2388167AbfAPHxm (ORCPT ); Wed, 16 Jan 2019 02:53:42 -0500 X-UUID: 0c8637e80d2a4949a3074d5d4ff0879f-20190116 X-UUID: 0c8637e80d2a4949a3074d5d4ff0879f-20190116 Received: from mtkcas34.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 481533881; Wed, 16 Jan 2019 15:53:33 +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 CC: Jitao Shi , Thierry Reding , Ajay Kumar , Inki Dae , Rahul Sharma , Sean Paul , Vincent Palatin , Andy Yan , Philipp Zabel , Russell King , , , , , , Sascha Hauer , , , , , 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 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.12.5