Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6453476ybh; Thu, 8 Aug 2019 00:16:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKXUo9TXlRjCNqW7ebUKhF5rR2I+ncHK/6DTpLckJpiuFiE2zjvR8f4EdeaZNA18X1xw+P X-Received: by 2002:a62:483:: with SMTP id 125mr14242362pfe.245.1565248571055; Thu, 08 Aug 2019 00:16:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565248571; cv=none; d=google.com; s=arc-20160816; b=UdCFo6+eoQPsH9h9bws1pLXEXmGy6CeHHwoKQ5Pmc3F7uwPKOY7aturJPb1twC6bXx Spwnd/eApuz80K9SR50Tmm/TbGvaYIIEeBZhzcOdtGVUNERMSHpu8P5MdBj98DTCguan qEbE5BO6j3blAoydXrsaZ3QZUcsKjJrcwUlZI5hOmMevYSjFOUIUjkWqYB7khDNbxVTd 0eu85qiqSfMRG4ORUd3FlcnjNrRK6l5FHkS6wB5JmMQMW9V5bsE0dDRKezSyjVvEmn0I rcySBH4aN8O2e+n8op3M+oiiTmpYWSPOb1aXDasu9C/L5qvxw88dUbKlDVm1KqDc4LLJ gORg== 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:date:cc:to:from:subject:message-id; bh=HLy/snGyZ4a2n4qHeKpTAYfl0Elk4br9j+wNWbt+J+Y=; b=xaiN9/DDZXtU6z55sqqc4K6TarC3eSGX9AxVvJv1q4sCHtLV9Z29z15S3VWZOeTgMu t8CZtVAeEGWjDZZmv1sjGBQkyrOpET4JVZGl/4u45enetoIDMIfdSSoQEWyyMFSEDqy9 elElzPQXeN6EhdHCrCyoLcs32yV9BhMa5oOb8EC+lyd9j0TzIDajAdNQlLgu+109w5qB clqDaOgZGSsUrkNw0BSkCi2vjXhY/o5d/8vLwktpmwph+Mg4dh1cmEIcQpbfYquM+BvI 4nmKlgLZSIsjKHN16YyWFH4ZaaUUyBmwezo3001iYj7vgXZz7g9lA0J18uOo2JkZZvB1 EzKQ== 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 b62si7783101pgc.148.2019.08.08.00.15.54; Thu, 08 Aug 2019 00:16:11 -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 S1731274AbfHHHOv (ORCPT + 99 others); Thu, 8 Aug 2019 03:14:51 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:2751 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731038AbfHHHOu (ORCPT ); Thu, 8 Aug 2019 03:14:50 -0400 X-UUID: 28828ab66c3845e0bd6f50b3bdb4f73d-20190808 X-UUID: 28828ab66c3845e0bd6f50b3bdb4f73d-20190808 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2033063645; Thu, 08 Aug 2019 15:14:39 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS33N1.mediatek.inc (172.27.4.75) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 8 Aug 2019 15:14:35 +0800 Received: from [172.21.77.4] (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 8 Aug 2019 15:14:34 +0800 Message-ID: <1565248475.31636.0.camel@mtksdaap41> Subject: Re: [PATCH v5 3/4] drm/mediatek: add mt8183 dpi clock factor From: CK Hu To: Jitao Shi CC: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , , David Airlie , Matthias Brugger , "Thierry Reding" , Ajay Kumar , "Inki Dae" , Rahul Sharma , "Sean Paul" , Vincent Palatin , "Andy Yan" , Philipp Zabel , Russell King , , , , , , , Sascha Hauer , , , , , Date: Thu, 8 Aug 2019 15:14:35 +0800 In-Reply-To: <20190807060257.57007-4-jitao.shi@mediatek.com> References: <20190807060257.57007-1-jitao.shi@mediatek.com> <20190807060257.57007-4-jitao.shi@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: ACA0D368338ADFB945EC0DEE8709C7B8CB13598F3D79743A33E08B5CF2A1E74F2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jitao: On Wed, 2019-08-07 at 14:02 +0800, Jitao Shi wrote: > The factor depends on the divider of DPI in MT8183, therefore, > we should fix this factor to the right and new one. > Reviewed-by: CK Hu > 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, > + }, > { }, > }; >