Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4645644yba; Mon, 20 May 2019 00:53:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkDSpF3df3fASJhcLPpZ5eygFaDfuYSXpadBQ0hxhC99qJrBNWG3SCCt4Gp+hK6/RCuOLu X-Received: by 2002:a17:902:e683:: with SMTP id cn3mr51564726plb.86.1558338826582; Mon, 20 May 2019 00:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558338826; cv=none; d=google.com; s=arc-20160816; b=V8FbcCn6KE9QyOI6ApS58hE4R4qXts5KfPLOziy7xkbE/VzbE2ATzVn+hZbZt2vsh3 UD1JUaFO3AXe66iRW5uJGv/0wp4iNRtKj3HlIdwfHASPvlMuTbPTPJ/XJGu2l6TT5kmw Tmjqgvf3ZkRnHKhhngS2D9oM7vJa+qg2mW5ANmMgjrkYwqfM2zerOebP88gRsUcRCHrL Dfmw0kEv+kipVQzpLmqUVw+1EHweN+ksiHgc3NwDDlRinylFji0X6Ujk3X+VwjESb6EP MNnfiCgVCH/OY7u27wsND72aPDBzFDmWmsc7NmKYm+Dv8yX45l8O/SfZ+ads3Ho1SsuU PLpw== 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=6Q86RnlOlKuOzaxDJBAyQUaAdqDU/ERbNbTB0I3bcTU=; b=rRNbbyMj9fOfdFV/Y/JmhhYd+5n2WrjIXcjR6bGXp0eEhhgEq6JqgrrImtAcF3PpId mF7IM0JSbsjdhoggMoY4A6F80/bmmRNG2Gl4f/wB94AnpOzC6qWWjRRp7mR63fp1KeRv /hlMy4WH1elalYC16lqkMErcuBOfVOlSJjS0lsT5OC3/zQeZuTtvRynxUcnd4LJ9W1kN x0b5J20CxpeDl6eDZ1G7etLQUbTP4QOKGSWlFqMLffwPJjRgpYJZ5y2i2q5yPfde/Qsr vno1/H0bPqfnKqxXnktqHJL2Q780T4hUjufadvKaug078TEjmPiwk0b66D+aJD8CzVjI eEYw== 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 t63si17000015pgd.452.2019.05.20.00.53.31; Mon, 20 May 2019 00:53:46 -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 S1730417AbfETF47 (ORCPT + 99 others); Mon, 20 May 2019 01:56:59 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:58710 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725829AbfETF47 (ORCPT ); Mon, 20 May 2019 01:56:59 -0400 X-UUID: 05bdecd6d289420d988b3d3773fce335-20190520 X-UUID: 05bdecd6d289420d988b3d3773fce335-20190520 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1874507480; Mon, 20 May 2019 13:56:54 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 20 May 2019 13:56:53 +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; Mon, 20 May 2019 13:56:46 +0800 Message-ID: <1558331806.7311.26.camel@mtksdaap41> Subject: Re: [v4 2/5] drm/mediatek: dpi dual edge support From: CK Hu To: Jitao Shi CC: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , Kumar Gala , , 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: Mon, 20 May 2019 13:56:46 +0800 In-Reply-To: <20190518095618.18454-3-jitao.shi@mediatek.com> References: <20190518095618.18454-1-jitao.shi@mediatek.com> <20190518095618.18454-3-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-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jitao: On Sat, 2019-05-18 at 17:56 +0800, Jitao Shi wrote: > DPI sample the data both rising and falling edge. > It can reduce half data io pins. All the registers which you control in this patch exist in MT8173. So I think this is not a SoC-level feature. This feature depends on how much io pins you want to use in this platform. Could we get the io pins information from device tree or calling any driver's api to get? If there is no way to get this information, I could just temporarily apply this patch and need plan to fix this temporary solution. Regards, CK > > Signed-off-by: Jitao Shi > --- > drivers/gpu/drm/mediatek/mtk_dpi.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c > index 22e68a100e7b..ccef3ac1c560 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c > @@ -117,6 +117,7 @@ struct mtk_dpi_conf { > unsigned int (*cal_factor)(int clock); > u32 reg_h_fre_con; > bool edge_sel_en; > + bool dual_edge; > }; > > static void mtk_dpi_mask(struct mtk_dpi *dpi, u32 offset, u32 val, u32 mask) > @@ -353,6 +354,13 @@ static void mtk_dpi_config_disable_edge(struct mtk_dpi *dpi) > mtk_dpi_mask(dpi, dpi->conf->reg_h_fre_con, 0, EDGE_SEL_EN); > } > > +static void mtk_dpi_enable_dual_edge(struct mtk_dpi *dpi) > +{ > + mtk_dpi_mask(dpi, DPI_DDR_SETTING, DDR_EN | DDR_4PHASE, > + DDR_EN | DDR_4PHASE); > + mtk_dpi_mask(dpi, DPI_OUTPUT_SETTING, EDGE_SEL, EDGE_SEL); > +} > + > static void mtk_dpi_config_color_format(struct mtk_dpi *dpi, > enum mtk_dpi_out_color_format format) > { > @@ -444,7 +452,8 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi, > pll_rate = clk_get_rate(dpi->tvd_clk); > > vm.pixelclock = pll_rate / factor; > - clk_set_rate(dpi->pixel_clk, vm.pixelclock); > + clk_set_rate(dpi->pixel_clk, > + vm.pixelclock * (dpi->conf->dual_edge ? 2 : 1)); > vm.pixelclock = clk_get_rate(dpi->pixel_clk); > > dev_dbg(dpi->dev, "Got PLL %lu Hz, pixel clock %lu Hz\n", > @@ -509,6 +518,8 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi, > mtk_dpi_config_color_format(dpi, dpi->color_format); > mtk_dpi_config_2n_h_fre(dpi); > mtk_dpi_config_disable_edge(dpi); > + if (dpi->conf->dual_edge) > + mtk_dpi_enable_dual_edge(dpi); > mtk_dpi_sw_reset(dpi, false); > > return 0;