Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp138528pxb; Mon, 2 Nov 2020 16:36:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxISUO9cpufPdh7hvrbMTc0MgytmIrc7itzoFxc1oeubkQE2flnDIqXWRmCOGK93ljyyToJ X-Received: by 2002:aa7:c6d9:: with SMTP id b25mr18610075eds.27.1604363794088; Mon, 02 Nov 2020 16:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604363794; cv=none; d=google.com; s=arc-20160816; b=NbCfgBTwYaWpqt5aUnyTyNgIMr1AA/8RI1+ZnFWf8SxDiSwP/rgftXJuFc0OAnUfeV D7N2EYwe24LCXrPhah/u1RidO64wrL3mMQ9mcMebWR3QamLf+TR0/L+NSTDF78fheJvp 7EYx2cmbQj3Oc2mGuyuGvRThxnU2kqaxHrMevcowOSR8GiXpBOulnavqS8JSVKpI8ESr mvQyPGnfVHRSmLtJ3qoXapnlhdF85+Hcnk+9SpAb6ADxJlSCYIgnfLVUlQH7/EBHNWUS 4zWJ8q3tWEjVoOHUo+CfrmP7nHYA1XRuR83LvoO2b2mnL8o3Unv1NYN3CUNgRTKTUzf/ m25w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=dZNs3YTL+VX1Dj6q8xGbFkqTNFXfssomStzIc3SPXqM=; b=SHsQ6G35MUFEylq+6iYKMe5onSOV6mWKFG1WFLOZaLnIFQrD3qOVXBihYzhVgtaiO5 LgnoJL8tn1xz6Qrkwcrm2QcJdqua2kWad9gtSSJLKkIcSkFKifqKwuj+AYRoFSudCiut mvfelxCmOvdvOaqD7vhQ/NEsL/nmkSfvrGW6SlSofUMJ5AOQGPsIBRYs0DE7sFaaFZKA XeAegL9hkLhJZeTODtjFNM9K5LQmsp8T9nnPB0+sA5Fz42ko1HWX/ynJ/lxOduVU1IWK sW9PP88lWrqT9qWLpO2s9Tyyl9SXmEdgtIt0lR7gBmVZ9sRmnNul+937NdcHRuqnuaDg 1SVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KZTTBc4Y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si1428458edz.277.2020.11.02.16.36.11; Mon, 02 Nov 2020 16:36:34 -0800 (PST) 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=@kernel.org header.s=default header.b=KZTTBc4Y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727385AbgKCAep (ORCPT + 99 others); Mon, 2 Nov 2020 19:34:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:43464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbgKCAeo (ORCPT ); Mon, 2 Nov 2020 19:34:44 -0500 Received: from DESKTOP-GFFITBK.localdomain (218-161-90-76.HINET-IP.hinet.net [218.161.90.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7170122275; Tue, 3 Nov 2020 00:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604363683; bh=gbZH1psqQVOfFYRVGDfdWFHWQcwRxb/FRqAHy3ZGQ1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KZTTBc4Y5TGlRxb+5S6Q1/vj2Hlz7rIRnb7gHHRYaTSTEJt0h5g2YIrPEfSfZ7EDq QIaAgSyYiIG17bu4uIWJfdDnxw22nTfVodvBrm4ra4p83tKgRQxDTi2KFVgh9Pkckd 62qI8QkxKkOyCwaOO9AsSeKbJ4Ou2x96rwJXxEfE= From: Chun-Kuang Hu To: Philipp Zabel , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Chun-Kuang Hu Subject: [PATCH 01/11] drm/mediatek: Get CMDQ client register for all ddp component Date: Tue, 3 Nov 2020 08:34:12 +0800 Message-Id: <20201103003422.17838-2-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201103003422.17838-1-chunkuang.hu@kernel.org> References: <20201103003422.17838-1-chunkuang.hu@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only OVL, RDMA,and WDMA get CMDQ client register information, but all ddp component should work with CMDQ, so get this information for all ddp component. Signed-off-by: Chun-Kuang Hu --- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c index 8eba44be3a8a..c17c0e4c030f 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c @@ -506,6 +506,20 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, if (IS_ERR(comp->clk)) return PTR_ERR(comp->clk); +#if IS_REACHABLE(CONFIG_MTK_CMDQ) + if (of_address_to_resource(node, 0, &res) != 0) { + dev_err(dev, "Missing reg in %s node\n", node->full_name); + return -EINVAL; + } + comp->regs_pa = res.start; + + ret = cmdq_dev_get_client_reg(dev, &cmdq_reg, 0); + if (ret) + dev_dbg(dev, "get mediatek,gce-client-reg fail!\n"); + else + comp->subsys = cmdq_reg.subsys; +#endif + /* Only DMA capable components need the LARB property */ comp->larb_dev = NULL; if (type != MTK_DISP_OVL && @@ -531,20 +545,6 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, comp->larb_dev = &larb_pdev->dev; -#if IS_REACHABLE(CONFIG_MTK_CMDQ) - if (of_address_to_resource(node, 0, &res) != 0) { - dev_err(dev, "Missing reg in %s node\n", node->full_name); - put_device(&larb_pdev->dev); - return -EINVAL; - } - comp->regs_pa = res.start; - - ret = cmdq_dev_get_client_reg(dev, &cmdq_reg, 0); - if (ret) - dev_dbg(dev, "get mediatek,gce-client-reg fail!\n"); - else - comp->subsys = cmdq_reg.subsys; -#endif return 0; } -- 2.17.1