Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1766425ybd; Thu, 27 Jun 2019 01:02:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSuetL7aSe+Lb7wliYnfPXGpbo+J+Zh/Wnv5vvEFrWCNjy+iJ29jbHPkbnDdTi5mvbjRoQ X-Received: by 2002:a63:f648:: with SMTP id u8mr2506369pgj.132.1561622541548; Thu, 27 Jun 2019 01:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561622541; cv=none; d=google.com; s=arc-20160816; b=MYbEUXYEB64MIAhreCx4cR/HreZOuVBxAZk6GoI2VtIThu+DNEubedX3HyZPyNOld3 QYgrhvdAPw6cToVotTqNBEo6mBmEYLugUGjh21z+ytLoObhcPOCXFB5EyZDCNfqS9ucN 1SeselU7wBq+fuQuPVIb2AhFTGJ0eBg9kgN54luAqQ7br9VtOhNTXvcI9c1V5EIsh1vC MsU+soSdOxGPHqmfQrMinzIrQvdLXVSbna/lYnjbJRgzmBjJ9N222ygcPLvMB3nxFSVa wtZFqv9Itck4RJCrOBOgyH2302nXeYgL1cvRNQChk+9C6n8Q+5zQ0ncI2uFeULs3PMTP 1euQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+hCRpFOg3rAByJb6H0RxyeCOuBsMfLTr9Q8pkpituso=; b=DbgsninSF0zxuFdIFCKawMwSdRDSCjop1MvgPe4toVbNBlyr5JzocGeOzD4yuEMNsS B0FTuPhc/6RL1+ktSOkeP/yIzGpix02bOFdWfYFA/z+mr9Smzl3Jb6P0p0LpN2GxxNiV wkFK/O5rvX7legNJVvAVPJe+VrhCdmIeDGSBCLibQk2ldrWNdYWQmcaxD5VtkD4q6gIP vdpX3+u66E8VNsrtEkOd1tUqtpNyMrg+gtzYPKAiwJNV40K69NQobltzRW+M09MUlS3n 6yVZ39aU+wtBZtefcUmCp3vqDd/9KEkYhLukTiUWfvruh63Lj+vF5wfopKKS3tBUu+8f U+gA== 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 j66si1681870plb.375.2019.06.27.01.02.01; Thu, 27 Jun 2019 01:02:21 -0700 (PDT) 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 S1726628AbfF0IBn (ORCPT + 99 others); Thu, 27 Jun 2019 04:01:43 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:51769 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726524AbfF0IBl (ORCPT ); Thu, 27 Jun 2019 04:01:41 -0400 X-UUID: bc444a135eeb4985afb7210d356ef3b4-20190627 X-UUID: bc444a135eeb4985afb7210d356ef3b4-20190627 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 836457811; Thu, 27 Jun 2019 16:01:25 +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; Thu, 27 Jun 2019 16:01:23 +0800 Received: from mszsdclx1018.gcn.mediatek.inc (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 27 Jun 2019 16:01:22 +0800 From: Jitao Shi To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , , 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: [v5 3/7] drm/mediatek: add dsi reg commit disable control Date: Thu, 27 Jun 2019 16:01:11 +0800 Message-ID: <20190627080116.40264-4-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190627080116.40264-1-jitao.shi@mediatek.com> References: <20190627080116.40264-1-jitao.shi@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org New DSI IP has shadow register and working reg. The register values are writen to shadow register. And then trigger with commit reg, the register values will be moved working register. This fucntion is defualt on. But this driver doesn't use this function. So add the disable control. Signed-off-by: Jitao Shi Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_dsi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index bd37d823c762..6b6550926db6 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -131,6 +131,10 @@ #define VM_CMD_EN BIT(0) #define TS_VFP_EN BIT(5) +#define DSI_SHADOW_DEBUG 0x190U +#define FORCE_COMMIT BIT(0) +#define BYPASS_SHADOW BIT(1) + #define CONFIG (0xff << 0) #define SHORT_PACKET 0 #define LONG_PACKET 2 @@ -157,6 +161,7 @@ struct phy; struct mtk_dsi_driver_data { const u32 reg_cmdq_off; + bool has_shadow_ctl; }; struct mtk_dsi { @@ -594,6 +599,11 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi) } mtk_dsi_enable(dsi); + + if (dsi->driver_data->has_shadow_ctl) + writel(FORCE_COMMIT | BYPASS_SHADOW, + dsi->regs + DSI_SHADOW_DEBUG); + mtk_dsi_reset_engine(dsi); mtk_dsi_phy_timconfig(dsi); -- 2.21.0