Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5027113ybh; Tue, 6 Aug 2019 23:04:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWJJnjNh3IFj2eOcK1Os/baBHQ173sWdjBd+sY2V7sTt++xFx0Ah/fr/wHO+l7GIc79tNw X-Received: by 2002:a62:cd45:: with SMTP id o66mr7778816pfg.112.1565157897904; Tue, 06 Aug 2019 23:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565157897; cv=none; d=google.com; s=arc-20160816; b=UdghFwFvtnXsWLyxFy1CRwL85DBbmm6LOYLTRWf23Oe8qMkhvGd1aW6K4cVVZnOk9k hNN/Xe9bvkAYSTrK8bxHb3wDdkh5hMRsw9p6ni2rAxm5FQcKPad1QdvJZjRg+9qp8D1k C9SiZR9/Nn012x7RyP3ne84okddZ2kqttT/dJ51nSH/VgzMtD/+yVxjFmtvKuZdUtcXQ zlJZs6VCe9WIBMaMM/lqaFRfEIbeveQrJn55n0oD30EYg6JMLCi2LgoslXSYy2PsqEYU wjumj+qu9ARc4mBv+JnWPvzbXISn5uOisyRQNoGvMkkn+XjAU81ctdcTnIMeN1WWPLBe /Asg== 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=RkanJVy/KWABzQtJzsmnyc0bfKm1X2QkpJdr60tlvI0=; b=UldqZkLOsWaF27W/qZVDB6UqjPpnD7DYTAaY/e1yzgXANEkQbGytsQ8+Hi8a6kv+QY ZqlmiUUlMOTbZKxCZusp/wpKYYz0Jcvz4Cg5rnqlB96yYA07oLAnA2u5aKL5OdcqKe5c B+eJqm7OTb94M73R1oF4q80j3UaCeXTMP99F3GUZfgv3vqiIhdKhwK/3c+V3KC+kj26A v2bBClQ7mEsYS3/UvTP/pdh2UIUo8vbU8+L30UYzj0QBZfiKirh4PsV2+b0xPwRJrREs V40M2wlVt60JRQfaf+Oi69T6z1RffczNiIV9dU5f5AvmwL3/BY3k27ddmsLIUD9NcSmr 4F6Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16si48797349pgh.410.2019.08.06.23.04.41; Tue, 06 Aug 2019 23:04:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727134AbfHGGDb (ORCPT + 99 others); Wed, 7 Aug 2019 02:03:31 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:59228 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726861AbfHGGDT (ORCPT ); Wed, 7 Aug 2019 02:03:19 -0400 X-UUID: 11cca7c1d3254cfcbab6bebdd5996c88-20190807 X-UUID: 11cca7c1d3254cfcbab6bebdd5996c88-20190807 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 202368417; Wed, 07 Aug 2019 14:03:09 +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; Wed, 7 Aug 2019 14:03:07 +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; Wed, 7 Aug 2019 14:03:06 +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: [PATCH v5 3/4] drm/mediatek: add mt8183 dpi clock factor Date: Wed, 7 Aug 2019 14:02:56 +0800 Message-ID: <20190807060257.57007-4-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190807060257.57007-1-jitao.shi@mediatek.com> References: <20190807060257.57007-1-jitao.shi@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-TM-SNTS-SMTP: 0C390326424C10AA3C3085083CFE39619D6B7E7D496F7D7C048FF37BC493A5D52000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The factor depends on the divider of DPI in MT8183, therefore, we should fix this factor to the right and new one. Signed-off-by: Jitao Shi --- drivers/gpu/drm/mediatek/mtk_dpi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 743230864ba0..4f2700cbfdb7 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -672,6 +672,16 @@ static unsigned int mt2701_calculate_factor(int clock) return 1; } +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, @@ -683,6 +693,11 @@ 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, +}; + static int mtk_dpi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -779,6 +794,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