Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1766376ybd; Thu, 27 Jun 2019 01:02:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2or9+XUHn4dS9JMC9OKoQ4BT1Onp4firyUI8SnrEXIPOrjs9Sx6Mza4dbFahNho6tdgtI X-Received: by 2002:a17:90a:3247:: with SMTP id k65mr4408140pjb.49.1561622539054; Thu, 27 Jun 2019 01:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561622539; cv=none; d=google.com; s=arc-20160816; b=T56ExDa5VLkPd3wir+qfNvj2uLzQqy8oMRHgC+83Oc9sccAbOv91KYZ1qj4irYsA9x w3z+qb5cC45KxoKi1TMOQqrd+NbnSV3O+jRlCIbWgYnCYTC28sXmJTP+pQgyNJ+vRFGH h3X7UGFbbe6M8O47KX6L3bDJfOvkaRZvuXbZvZerC8XJN0yJtNT5/iyOFiMzgPiNdANU fFj5dqsYRjkJOuOR8EOevirJtD65uHBvTyW6JZ05yj7yxh6I0T44zoHXyITs/PTVo7wB 1sXFxzuTxeqySM1SAVTP/lnBSrxZv7ZuTuuQhYKHCrva48UvW90wX95OKxuE1uITeurw Fsdw== 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=+zrz6RUg4GtyfhGparPB1XGI7TaAmLtUsAWC/lm/tS4=; b=NUrovQyM2rT6nOWwSgCxaDRV83E9Okn8wE6Y/LbVdmYhX6dkbZpXH/qZ8B0W06QxXW lqRInRkU9BjGDRU3VmO8DyKBrkFm4f/eBy0dTMhmt+4TjNZCetAIeZ7fMijcm89ox5HH qQT4njBquI2VJR6bXRaUotEvz1Ny5peDP1l9QXdgA5Kebhe71aitlnLmrqidcN14E3yk 1Bcy93v43iMZOOOMbxtkYHikP0vT6Asznoh6FhJoosafYsHacog8x7j3ZrtG09IbHS8Z yvt0+7mbZ6Sr7MDb0TnZuli0jDnoH3rXGTE0waLjUo9BGKzrILkpHrhM57+0G9cvvfN3 qhJg== 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 g7si1780110plb.29.2019.06.27.01.01.59; Thu, 27 Jun 2019 01:02:19 -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 S1726513AbfF0IBq (ORCPT + 99 others); Thu, 27 Jun 2019 04:01:46 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:5635 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726544AbfF0IBl (ORCPT ); Thu, 27 Jun 2019 04:01:41 -0400 X-UUID: af4a2c27b60c4198b5025a5939c6f097-20190627 X-UUID: af4a2c27b60c4198b5025a5939c6f097-20190627 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1262622998; Thu, 27 Jun 2019 16:01:27 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS33DR.mediatek.inc (172.27.6.106) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 27 Jun 2019 16:01:25 +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:23 +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 4/7] drm/mediatek: add frame size control Date: Thu, 27 Jun 2019 16:01:12 +0800 Message-ID: <20190627080116.40264-5-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-TM-AS-Product-Ver: SMEX-12.5.0.1684-8.5.1010-24720.003 X-TM-AS-Result: No-7.797800-8.000000-10 X-TMASE-MatchedRID: 4fIxLVRlVoz935chln091FZ85UImhNta+eBf9ovw8I2RoQLwUmtov7BZ szSz1qei2XHJ0L4jOITTDbyTDLiYnZxBJWVIsdLqA9lly13c/gE5B3KUNlRt51VkJxysad/IJTn jWSezJPZBXFYsxXKTlvssoJBke0RlqZWpk+GKRVNIUlKkz3wfmX0tCKdnhB589yM15V5aWpj6C0 ePs7A07RQEL0GGu6SDsXWDONKz/s5QaPnzkRZpYjy4hCRTklRkE6fTC+T7uQ4= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--7.797800-8.000000 X-TMASE-Version: SMEX-12.5.0.1684-8.5.1010-24720.003 X-TM-SNTS-SMTP: C8B5EEBD7AA18A239CFB080C5B9AB92E1996F13A41DB17C5AA1328425E81A0FC2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our new DSI chip has frame size control. So add the driver data to control for different chips. Signed-off-by: Jitao Shi Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_dsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 6b6550926db6..45e331055842 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -78,6 +78,7 @@ #define DSI_VBP_NL 0x24 #define DSI_VFP_NL 0x28 #define DSI_VACT_NL 0x2C +#define DSI_SIZE_CON 0x38 #define DSI_HSA_WC 0x50 #define DSI_HBP_WC 0x54 #define DSI_HFP_WC 0x58 @@ -162,6 +163,7 @@ struct phy; struct mtk_dsi_driver_data { const u32 reg_cmdq_off; bool has_shadow_ctl; + bool has_size_ctl; }; struct mtk_dsi { @@ -430,6 +432,10 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) writel(vm->vfront_porch, dsi->regs + DSI_VFP_NL); writel(vm->vactive, dsi->regs + DSI_VACT_NL); + if (dsi->driver_data->has_size_ctl) + writel(vm->vactive << 16 | vm->hactive, + dsi->regs + DSI_SIZE_CON); + horizontal_sync_active_byte = (vm->hsync_len * dsi_tmp_buf_bpp - 10); if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) -- 2.21.0