Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1680000ybi; Sat, 1 Jun 2019 02:30:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyjmjkf35HggzY45TdoiWvQZBBnYnJi0gfc3S/3tMDB5Tw2KEuj6JnRVwLxf1CXk4/g0OD X-Received: by 2002:a63:31d8:: with SMTP id x207mr13423683pgx.403.1559381401116; Sat, 01 Jun 2019 02:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559381401; cv=none; d=google.com; s=arc-20160816; b=waq6OwREw8MWWXOsKMFxsO6GBMOBEVsscWIfPkVabR4SA+zOMXunKDrtgQAQ+5YfpV n1bPHlNZwxTr7OgJHkD+fDR5LPwpCn8gnqJUoVKniudawoOWpBljwaBcyGyTo+IwWd6Q JqUNVgRDiVdpqEETI/jCq9dgSoAzm2myRvUwQY3HvjrF2wp8QIas1akt91Rlb3J5q4Rt kOyhhrkEiKwyIxDBGMgbV/JlADDCo6AbPE9ypieyKfArcufQX8kEKReIp4q4CcPNTjVr zbrQSQbjDX1NhLFL326bhXRLFcEmnAvETdoFcDNN9RIvLdt0rnCSlteGiqYGqFGMcy/8 iV0g== 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=lWkthK8w774vpt+l43B+5OvSJmNFM1sfk/aQBMlSjQ0=; b=Gs89sXAFShIkJwP4ocr6j7NwLxBb3JyosRQ1VcZor+iTOL3ea3blYf++2XqFigljdN ShGf9j7p6xOrQL9HacVqQbipO3JvrWpRxWDxZrK+F4/EZKcpT34Rd/EOekhHktzJb19q hUkVNNCMlscft2qhkDYBi1ipP7mWc48MhxIkfxFw5plZXuc/Zji0Bp1SYSaUPvY98Q4O Jwkg92bAcCMLH4w77Rz4kJgLeOsC+ah2+zqhACQyJdf1P/zIEvZnk03RiSKHvj3H8ZSX jakAFZXZ3iiQNWbud5LQNU/A459ux370ih9DtzL2oealCxldctgnTtkvjbd3isrnJV3+ KUHw== 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 n10si9225581plk.257.2019.06.01.02.29.45; Sat, 01 Jun 2019 02:30:01 -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 S1727299AbfFAJ1C (ORCPT + 99 others); Sat, 1 Jun 2019 05:27:02 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:22862 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726109AbfFAJ0d (ORCPT ); Sat, 1 Jun 2019 05:26:33 -0400 X-UUID: 3e00882d8a9e47c7a0460bc89af5e646-20190601 X-UUID: 3e00882d8a9e47c7a0460bc89af5e646-20190601 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 996128453; Sat, 01 Jun 2019 17:26:27 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 1 Jun 2019 17:26:26 +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; Sat, 1 Jun 2019 17:26:24 +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: [v4 4/7] drm/mediatek: add frame size control Date: Sat, 1 Jun 2019 17:26:12 +0800 Message-ID: <20190601092615.67917-5-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190601092615.67917-1-jitao.shi@mediatek.com> References: <20190601092615.67917-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 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index eea47294079e..18a192656a89 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,9 @@ 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