Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2866868yba; Mon, 15 Apr 2019 22:54:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqya8DodhvRBxyWL8Ze3K6VzBPiIiFqq1v5GOCfB7NIUD+8D1Co9ue6R5xqgk77tprKIUPyx X-Received: by 2002:aa7:8615:: with SMTP id p21mr80907475pfn.98.1555394076379; Mon, 15 Apr 2019 22:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555394076; cv=none; d=google.com; s=arc-20160816; b=zDrVLKV8Pp2uDEkh72xnI/acGYYMKewCkRc7Xllw6f7TDDYjgUBZpvz/wQVshuU0dB oN6tWvDEMthjZZuYlvdIgF9CuDbx7rdr1e/MMxLtzDGCwyeIHEXGEZWl4VVcOjiSO4t6 0yUxfHyd+XYUl/jA8fLoylX4wW2LxwYcfVmIIPb2Wm15Lc6kISm/XJ8531ZnTnvu8pAw +HUD64UGn58SOicLGcXrIZNk9YXWHr8uog3j409L2H/b/DzMwvLeoAb0wPDFmsgZFNL4 q/xvJ3BYnl/Gdl64n+psf99M72qYy7Eo/GRg5ajFSd+tFREQ4nk15tX3c6Ow2JJV1jvJ zKbQ== 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=LhZ78zrSCJF2uOXa4FTwm4J/P1y+36PLAtqY7/305sU=; b=E27LdDiMhoJ+r8gUKAHjBk4iA9Z/nIl0d7P0w1oz7DnZ3ZfBk0ZhyK+ZCTpfQZsvBp k7QE2CD4dsvphlS7zzelC0vYk1MNimr0hYgIETYD6/LtDkAcLZP3RxW6STXm23//3vz+ yJDlxdZN75dMvOiGlcKzaCS4GeXiuGJomiel+ef0emp4hjlfo8o2beVyalY2qsBeqNQG eSkbw6VgIbL7ShwsqVNS8o0mZBwbyBUsnnnsdbw9f8jKpBPG3E7GvYkL8Q56TAseUg4l 9RzEhkzv4LS4Hgpo8VpSLBIY+hCft9A/+e6ippzwRJ3Ceafg5KE92nhkeXY09QCRkCI+ WeTg== 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 m18si41057861pgv.209.2019.04.15.22.54.20; Mon, 15 Apr 2019 22:54:36 -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 S1726214AbfDPFxE (ORCPT + 99 others); Tue, 16 Apr 2019 01:53:04 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:15449 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727232AbfDPFxD (ORCPT ); Tue, 16 Apr 2019 01:53:03 -0400 X-UUID: 0cb809a7fb9f405da8993ccb2a09acce-20190416 X-UUID: 0cb809a7fb9f405da8993ccb2a09acce-20190416 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1885515486; Tue, 16 Apr 2019 13:52:51 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS33DR.mediatek.inc (172.27.6.106) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 13:52:50 +0800 Received: from mszsdclx1018.gcn.mediatek.inc (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 16 Apr 2019 13:52:48 +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: [v3 3/3] drm/mediatek: add mt8183 dpi support Date: Tue, 16 Apr 2019 13:52:42 +0800 Message-ID: <20190416055242.75764-4-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190416055242.75764-1-jitao.shi@mediatek.com> References: <20190416055242.75764-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 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 66405159141a..fbb087218775 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -681,6 +681,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, @@ -692,6 +702,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; @@ -787,6 +803,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