Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2249344pxb; Mon, 19 Apr 2021 00:38:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpsp3sgQS+EN7JiuPboGmqiR0QveQ2KZsbQBH1GJHk1N/bMDKMCBaAABzIhkqffVHPY5wF X-Received: by 2002:a17:902:a9c2:b029:e7:147f:76a1 with SMTP id b2-20020a170902a9c2b02900e7147f76a1mr22201079plr.5.1618817901312; Mon, 19 Apr 2021 00:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618817901; cv=none; d=google.com; s=arc-20160816; b=AxaHtlUYOiJOs3jaUA5pd5rQAAmXnBBmONxxZD2gCmdApKaiHZmse8H7/GoE/QULZp IvtJAu2L3J48rr39FstEdUPJLKWFXQPyhgo91Q82RQpRhjT8WBPJ4GQNxU8rGDNYfndr XywPRFC3VHiN33pdzAzdLl5GfzCoWQuk+XzwbzB0Xg9H9Kgl6S8joN6Oc6qVO1W/V2LL ickl+BJItDZKi+DiA0EC4Zpdl24Y4etC/A20RD8+vqy2jXGxypBWMGlj5LNhoDfw8w4w PQxNJY6I2ZF/PEyJjRUIt1jwD/SUrEPYgYIh+C8UXkLPhupT1kfNgvq5m6Kv1Nw9sjlg NC2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=0+ERtxBLAKa344j/COpxgJf/tgpBFvh5Bj4l219hncw=; b=vM1Mwc9kGqImhjjwutHKOM8K0eq9xPGgn2SyRBA92MGu9hB9A8lk11iXKw9+gtKk2y GpCoH7Nd7g/WcjYO3lXqKJIahb3FbIz8oE4+8xQYcaMd44eGkzI19+bgngfvOak9Qqg3 rottRsdfLPfLedNBZTcNAL2M12D0E8Fnmhv49n45UMFpSUrbukQb1BIS5FdAz5uP6eQe AN0B4wcxOO19i1tZjIMOjOMRMuEi67VcpbK3AlSykUFdx24W+3LULrWAxl4QQU3xFQAF 6q4+BkGHcX3pSIUqujvUrRVHY8CBSeciUdifUNYvCmu52FI+0l5tUxAe1K+R9KEeqpQn 6xMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=qrk6vf1E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si16325473pfr.175.2021.04.19.00.38.07; Mon, 19 Apr 2021 00:38:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=qrk6vf1E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237745AbhDSHhM (ORCPT + 99 others); Mon, 19 Apr 2021 03:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233438AbhDSHhL (ORCPT ); Mon, 19 Apr 2021 03:37:11 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48CF5C06174A for ; Mon, 19 Apr 2021 00:36:42 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id f195-20020a1c1fcc0000b029012eb88126d7so7507931wmf.3 for ; Mon, 19 Apr 2021 00:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0+ERtxBLAKa344j/COpxgJf/tgpBFvh5Bj4l219hncw=; b=qrk6vf1EOZdLHLwAxVz1yLbK4ih6Ze0oyf5aUVfqKSeGfRpRrjHCeWDhSl0aK6r0G4 uBLiywKB0tytKu40gqqeJOkf9hpfwC0J6TGEFhZAZsNQt3ldmpVBWKUC4D7WqHH1JMTu C7lp/oFtxQMQ7CyuaDlrdh+auWRZItDHFPiForkAdJsU/ElCedxw98+ajBOPNccur+7d uricePPL9tXoIUHIGDPwnC9COfraCyMam0tUHiEhovXZfQBxRm6r4cWYWFFMLTcQMlAX E3CSk6AfNuqq98koEPfaulkns9/dJcV3OduT/xwJ83x4GL9+CAMRZCOxRsGqDqbPSOQn lMuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=0+ERtxBLAKa344j/COpxgJf/tgpBFvh5Bj4l219hncw=; b=E7/0xcVnGN0x1Ig+tEDs2HIQNLYYc75t6cO1LHxq5oyuEJND5NdQ7WbHjLZWoTxiHX 6uu0ggbOvtrRG5/hRJvMxchmgfBVfmXXWbRjHQV7TiMTzNrhcwaMSWCodgz7Gbief6mP RwxlWHhKCyaRWnfkaL1vC9xCNrq52AxB1H3+kkDpMyzf5YE30jeE7kTfmqoy85RyNVIQ wGlr8IE7sRHV2S8NiNpXsFV2e9/erf+9/mLVKViMnacLgpT6CEdbnRjUzNj0RQ5Wn89y j6rHh03lEcC0cs0PHfzVwKsK2FM7fsFo1TxQYhYCXLAeYWg2tE2DxfpQZhETUJ2T8DCq TD9Q== X-Gm-Message-State: AOAM531HFL6ns+l5JW/WpuXaTp4DJ/M3/whLgP7SoQ79hOw8eU5da6XO Q6ZzoWr0g9pVGizq7R4K6458Kw== X-Received: by 2002:a7b:cb82:: with SMTP id m2mr20362725wmi.105.1618817800987; Mon, 19 Apr 2021 00:36:40 -0700 (PDT) Received: from ?IPv6:2a01:e0a:90c:e290:2e82:31e6:67f1:4f33? ([2a01:e0a:90c:e290:2e82:31e6:67f1:4f33]) by smtp.gmail.com with ESMTPSA id i12sm18382688wmd.3.2021.04.19.00.36.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Apr 2021 00:36:40 -0700 (PDT) Subject: Re: [v2,PATCH 1/3] drm/mediatek: dpi dual edge sample mode support To: Rex-BC Chen , chunkuang.hu@kernel.org, matthias.bgg@gmail.com Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, Jitao Shi References: <1618407316-10042-1-git-send-email-rex-bc.chen@mediatek.com> <1618407316-10042-2-git-send-email-rex-bc.chen@mediatek.com> From: Neil Armstrong Organization: Baylibre Message-ID: Date: Mon, 19 Apr 2021 09:36:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <1618407316-10042-2-git-send-email-rex-bc.chen@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 14/04/2021 15:35, Rex-BC Chen wrote: > DPI can sample on falling, rising or both edge. > When DPI sample the data both rising and falling edge. > It can reduce half data io pins. > > Signed-off-by: Jitao Shi > Signed-off-by: Rex-BC Chen > --- > drivers/gpu/drm/mediatek/mtk_dpi.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c > index b05f900d9322..21a3a7b78835 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c > @@ -83,6 +83,7 @@ struct mtk_dpi { > struct pinctrl *pinctrl; > struct pinctrl_state *pins_gpio; > struct pinctrl_state *pins_dpi; > + bool ddr_edge_sel; > int refcount; > }; > > @@ -121,6 +122,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) > @@ -380,6 +382,15 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi, > } > } > > +static void mtk_dpi_dual_edge(struct mtk_dpi *dpi) > +{ > + if (dpi->conf->dual_edge) { > + mtk_dpi_mask(dpi, DPI_DDR_SETTING, DDR_EN | DDR_4PHASE, > + DDR_EN | DDR_4PHASE); > + mtk_dpi_mask(dpi, DPI_OUTPUT_SETTING, dpi->ddr_edge_sel ? EDGE_SEL : 0, EDGE_SEL); > + } > +} > + By using the downstream code as reference: - clk_set_rate(dpi->pixel_clk, vm.pixelclock); + clk_set_rate(dpi->pixel_clk, vm.pixelclock * (dpi->conf->dual_edge ? 2 : 1)); is missing in mtk_dpi_set_display_mode() > static void mtk_dpi_power_off(struct mtk_dpi *dpi) > { > if (WARN_ON(dpi->refcount == 0)) > @@ -518,6 +529,7 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi, > mtk_dpi_config_yc_map(dpi, dpi->yc_map); > mtk_dpi_config_color_format(dpi, dpi->color_format); > mtk_dpi_config_2n_h_fre(dpi); > + mtk_dpi_dual_edge(dpi); > mtk_dpi_config_disable_edge(dpi); > mtk_dpi_sw_reset(dpi, false); > > Neil