Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7154222imu; Tue, 22 Jan 2019 01:05:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN7OOfpxN2mvUKoP4dUiushKwvpyhcQaIPFYRfa6TiVUeatWXD34EMkPb91ESYiuZ/jUfVfE X-Received: by 2002:a65:41c2:: with SMTP id b2mr30953605pgq.67.1548147922761; Tue, 22 Jan 2019 01:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548147922; cv=none; d=google.com; s=arc-20160816; b=OcdSJbIecA1HsRskDlHIyfMyGNIq4+ustGRfanCJTGl2dWXVfwhiT5hsbFWL7McOnp vPVNvGJpgZYB/rsnNfIR/M0WHTd4eXKKvDyV3eRfd0E2pBcx3F4axzeMNxE3tk9L4nA3 aMtPx47sMUd76tOMG5/VDdKv+8j8+zyi+6IlxEUgGKW7gkpvm8Mb0tAr6wFpsIELVGyR Umw5sHsaozmO06dkM/B+CPNNV7QrgDaKjtOzRaXUY/fUeYC8x0iQVPhJQ/MER8hRbTi3 WqOGjdFQXpWGa97Wc69SmeTemmzs4xMfurESTl+v+3WLZdNB1CCl4SRExf39tjtvbXAR 2uNQ== 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=0u6KGD+K77HvWIYGezXLLKDNnvUUZEdDmQTlvNOSSEU=; b=Azm8q/8x9n5Un03y4Kkaazv+8WBofwCjlqJ7lGIZNmEU04SGZYH8EPjC68ECIFlrwZ 8i9X0yYJzDtzGtqSN9t0lUgqwXBNbwZXd98bfa3a8nQMcSXbA97+Yq5NvFoz7bk7kp2J s5lAJ1etSfnoE3KfVtem19V3DI7VMp5TgCoLZ+Vf6S758yls0QBP5yFhzvtEMCgyPwE4 q1ky/xq7UPOYShjpuq1IwAaYr7tCoryU5CQSPhLT1p4didNqNtec/CSg0zhM8TVPppV/ lPSXuMH+JBAwJCnJ0JIvWNCpVGOvM/yjMhtq/dD1i6q3JBTFQFLFXyCx2Kd0neYqfdJU tAhw== 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 r81si16265709pfr.164.2019.01.22.01.05.07; Tue, 22 Jan 2019 01:05:22 -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 S1727552AbfAVJCw (ORCPT + 99 others); Tue, 22 Jan 2019 04:02:52 -0500 Received: from Mailgw01.mediatek.com ([1.203.163.78]:39387 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726953AbfAVJCw (ORCPT ); Tue, 22 Jan 2019 04:02:52 -0500 X-UUID: 4c350a30182046a19632d816d85fa704-20190122 X-UUID: 4c350a30182046a19632d816d85fa704-20190122 Received: from mtkcas34.mediatek.inc [(172.27.4.250)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 871938170; Tue, 22 Jan 2019 17:02:47 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS33N1.mediatek.inc (172.27.4.75) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 22 Jan 2019 17:02:46 +0800 Received: from mszsdaap41.mediatek.inc (10.16.6.141) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 22 Jan 2019 17:02:44 +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 V2] pwm: Add MediaTek MT8183 display PWM driver support Date: Tue, 22 Jan 2019 17:02:43 +0800 Message-ID: <20190122090243.27304-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 doesn't have commit register, needs to disable 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