Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2786581yba; Sat, 18 May 2019 02:59:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqykwsD/qA022LOJUZ3K+nSGdEbRjNvylb9hMRI5u56HEBf/TyquP4E47IfnyWqaabG0e+8C X-Received: by 2002:aa7:83d4:: with SMTP id j20mr45274747pfn.90.1558173592905; Sat, 18 May 2019 02:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558173592; cv=none; d=google.com; s=arc-20160816; b=XsxSX+p+ZKxEOTaU016EPCIDTa6bWkHyaTT55cC4JmD4UvxgAMuS1GwgGBRdVuNBU9 rFP7zvaT3fNp02JeRcpxAYp28wuIcTe1fYltsX7BsTIOUZ9J4Kv/X1ROJHpizMAV7yXm D1KERLBPTkBQ96S8cuGi7iH1pjAukk/NFLalff1mp8wUqLt7YX1FMkgwgyTJEE8OULGN A+p4Lfiq36pPt5t5ytIUJ4qFlSOvc6ALfj2J//v89NxC4phuhMbeOKm7uKORVP9AePpq nHIokj3xrBeXUQM+8nVaUa3GFQYfFXILmfw3o7IIpRqC21lGfNjyTlM7UmObbz7vhV1x C6Mw== 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=q2leoqSjX+FQO0spq/0cYScDkj0kq0/XThhnmEvnWIs=; b=c7iIruPH6vrVwGNn3z6nc4RdSNSicsgw+EiEzym15ctU/0+8am6cO1LibFuCul1nuj LpchqiZ+MNmdk/Y33tM6XQ+NpzjUNfXB2mWFWbtErNAoAbTnFB22WC0xBzhLOrGy0o2P nW9E3ZZLsMWoL1IJ/Joko1PZGeKA1wRL94hZTu7LEAAFEC1HKw17JYA6zoCtNB2dXnQV CRV4zK1iDNzP2xQpxK6gkQcP2/BeVdWbczZoR71iShhQeq9vR1nR4obJaiaQZqI0dJF4 wApThJtQrBceMQ6xXxcqhuQku/3XHpPuoyWRo1Zr2t7bn9Vme1Pt6jcPzlsY1nClsywq YuWQ== 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 o4si10727300pls.391.2019.05.18.02.59.38; Sat, 18 May 2019 02:59:52 -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 S1729972AbfERJ4i (ORCPT + 99 others); Sat, 18 May 2019 05:56:38 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:49148 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727001AbfERJ4g (ORCPT ); Sat, 18 May 2019 05:56:36 -0400 X-UUID: 701dff21825947f598315e9ef2de7a5d-20190518 X-UUID: 701dff21825947f598315e9ef2de7a5d-20190518 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2056482893; Sat, 18 May 2019 17:56: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, 18 May 2019 17:56: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, 18 May 2019 17:56:24 +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: [v4 3/5] drm/mediatek: add mt8183 dpi dual edge support Date: Sat, 18 May 2019 17:56:16 +0800 Message-ID: <20190518095618.18454-4-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190518095618.18454-1-jitao.shi@mediatek.com> References: <20190518095618.18454-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 Add mt8183 dual edge support. DPI sample the data both rising and falling edge. It can reduce half data io pins. Signed-off-by: Jitao Shi --- drivers/gpu/drm/mediatek/mtk_dpi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index ccef3ac1c560..77e6e0f99188 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -682,6 +682,16 @@ static unsigned int mt2701_calculate_factor(int clock) return 2; } +static unsigned int mt8183_calculate_factor(int clock) +{ + if (clock <= 27000) + return 8; + else if (clock <= 167000) + return 4; + else + return 2; +} + static const struct mtk_dpi_conf mt8173_conf = { .cal_factor = mt8173_calculate_factor, .reg_h_fre_con = 0xe0, @@ -693,6 +703,12 @@ static const struct mtk_dpi_conf mt2701_conf = { .edge_sel_en = true, }; +static const struct mtk_dpi_conf mt8183_conf = { + .cal_factor = mt8183_calculate_factor, + .reg_h_fre_con = 0xe0, + .dual_edge = true, +}; + static int mtk_dpi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -788,6 +804,9 @@ static const struct of_device_id mtk_dpi_of_ids[] = { { .compatible = "mediatek,mt8173-dpi", .data = &mt8173_conf, }, + { .compatible = "mediatek,mt8183-dpi", + .data = &mt8183_conf, + }, { }, }; -- 2.21.0