Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp349352pxb; Wed, 14 Apr 2021 17:29:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMANGKxPnMX87RVT7kRiAJfzzMuIW/7jDwYjQJ6UZt7mX1x+PTHKzlhl0tUtqsMGtalgBI X-Received: by 2002:a17:906:17ca:: with SMTP id u10mr686534eje.124.1618446540499; Wed, 14 Apr 2021 17:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446540; cv=none; d=google.com; s=arc-20160816; b=02aP/e8fmuCTUjYhp4a3nhfrpnPYMKkBtbud6juBzZAPPNHTPhRC2WpQIFzS95rkx7 bu5ziRTou3NYQ2fHssYUqwh7dhaDNsT0amV0bi53A3QBRcd24kwMp2eQDkdtO283SVpI BZ//92cFOgsGsTYfxjeMJuoFu3VpXMu38TKLmbVSRNwCRI5YSBijd1h5/YFKkODfnbCA xRWkquMsKwx1n27XB7nG4zSl84mMl7L2G28s0kPjJOnzqYhbQeb5JXN0iDmybX3mZgbZ xhMYPnSgDRtcrknzbcAPrl8ITFXOMaU3aFGrpAHBq2R+ZqhUWF46qGoHXgmX1WSKFVQR jqiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=GuhoE+y+K9pbKZcl8qBbNvIu8GUgyGh5nyUHUck9HrE=; b=1Gnxw+0bdd/E9hNhDnpCkEBbSeacTmzt3g1BW5B615c5bHlJ2ogMudnQhbO+r9Yury MBP7Bcd8wwIl18627Q56AHjTbB+EgKiFRTA9hF39ret9f3iZNHw85hHCVvOmnbXLsV/2 tSZGuVOL788QMP36F+Jg4C602/XZ3dilH1JKBbtVU8a90Jq76Z5v6cj0DaNd+GZiqjiq UUW8yt2lAHl2yDk223xZfymFdeplvfMQ6EBy9KYpsi6dsDsr3S0F+m97HCfY+2lsXNrb OmfjTYJb8esCV1c3gn9dxblAAvt+hsHQNx67SOZtB0EWXk7Sz/NymfIeaUiOnPmWSy2p tllQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si930132edo.476.2021.04.14.17.28.37; Wed, 14 Apr 2021 17:29:00 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344059AbhDNNf7 (ORCPT + 99 others); Wed, 14 Apr 2021 09:35:59 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:45498 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1351381AbhDNNfs (ORCPT ); Wed, 14 Apr 2021 09:35:48 -0400 X-UUID: 419c90ea240449aba2e77432cc2fcb04-20210414 X-UUID: 419c90ea240449aba2e77432cc2fcb04-20210414 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 690967049; Wed, 14 Apr 2021 21:35:23 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 14 Apr 2021 21:35:21 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 14 Apr 2021 21:35:22 +0800 From: Rex-BC Chen To: , CC: , , , , , Rex-BC Chen , Jitao Shi Subject: [v2,PATCH 1/3] drm/mediatek: dpi dual edge sample mode support Date: Wed, 14 Apr 2021 21:35:14 +0800 Message-ID: <1618407316-10042-2-git-send-email-rex-bc.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1618407316-10042-1-git-send-email-rex-bc.chen@mediatek.com> References: <1618407316-10042-1-git-send-email-rex-bc.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + } +} + 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); -- 2.18.0