Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7192744ybi; Mon, 8 Jul 2019 16:35:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqycd/n4ijKRHhfii6BRDz+nFG+PQ5wWdz5MCg/JQBg5TKI8ZkSfIG4dUuMfMdxCMnv60OQt X-Received: by 2002:a17:902:a40c:: with SMTP id p12mr28142291plq.146.1562628952676; Mon, 08 Jul 2019 16:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562628952; cv=none; d=google.com; s=arc-20160816; b=bT853KDGXKrRcbdipktlP3OzD2xnuJuJ9fw0SeM+RjWxemeIhBZjVPTroBuem49qPW OfOirY8hSNMr4nuVfxcQbrAFhtzGGzKuGRwjsLtg7IkSfKqAlp4Eo6iS0dYzNFx3fFTA E+iqwn2mihJQDHadqyjmItP47Y/tkGcK34Fz5GOj/IaEZXL8cD6jJBjE/72bUbfDbunk JS8GLLi/ffGYrDuHlEsUlknQBmrdh+aeuYpMzJG/55WWiL4NOfy/1Ek7DjJ2K+8YUu1r yYpIll8k49Pe30vfYVio3Oz7rl26ML71wRRkLTbY9mHtyn+5TYidGnCeZku65+24CtF6 KmSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=6KKrAzT9NO4hjOcombzMHE9dhUDuc1lY3LsOyDNsr5M=; b=B+uW7EBZSFtO1XQqT20O+DoM/UkdjLBzl87hTKgDosQNr6BS6VKafovoljzdjDonsj hGTaq9ryjCgzNF0J8QyYzbpjyFzleo2K6CFbFxHBRw51ozJvO/kv0uDbiNkNd1OBO1eQ 6OOibRjWfQkvR0BxeNsrGrOxyGKqjiCkzxFS3/QM9pMY8ogWeBrO7TBmOgg1gIqRPVoJ GfIBE4jcqTEueN/pgvQEA1scwJ8kOa8uNt40azZhGdfA93YSnLgii81EhAoQPosvUDA/ vLifuJXA3UmQkwig9PxQwepvRc9dAgQuBo9pB4G+IjitQPdVo2EW9ml/Q+vD4cGtTH3W NIAQ== 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 t36si22312888pga.32.2019.07.08.16.35.37; Mon, 08 Jul 2019 16:35:52 -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 S1727828AbfGHWe4 (ORCPT + 99 others); Mon, 8 Jul 2019 18:34:56 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:38629 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727581AbfGHWes (ORCPT ); Mon, 8 Jul 2019 18:34:48 -0400 X-UUID: 9bba3e1aa3164f38bfbc63f3b38e3a40-20190709 X-UUID: 9bba3e1aa3164f38bfbc63f3b38e3a40-20190709 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1373970199; Tue, 09 Jul 2019 06:34:43 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Jul 2019 06:34:41 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 9 Jul 2019 06:34:40 +0800 From: To: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger CC: David Airlie , Daniel Vetter , Mark Rutland , , , , , , Yongqiang Niu Subject: [PATCH v4, 24/33] drm/mediatek: distinguish ovl and ovl_2l by layer_nr Date: Tue, 9 Jul 2019 06:34:04 +0800 Message-ID: <1562625253-29254-25-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1562625253-29254-1-git-send-email-yongqiang.niu@mediatek.com> References: <1562625253-29254-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: DE96B3DC123185B251A9ADEA423ACA88EC1AAE419AE4A2EFC2E4E0006580B9E92000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yongqiang Niu distinguish ovl and ovl_2l by layer_nr when get comp id Signed-off-by: Yongqiang Niu --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 8ca4965..7e99827 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -326,7 +326,12 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) if (irq < 0) return irq; - comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DISP_OVL); + priv->data = of_device_get_match_data(dev); + + comp_id = mtk_ddp_comp_get_id(dev->of_node, + priv->data->layer_nr == 4 ? + MTK_DISP_OVL : + MTK_DISP_OVL_2L); if (comp_id < 0) { dev_err(dev, "Failed to identify by alias: %d\n", comp_id); return comp_id; @@ -339,8 +344,6 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) return ret; } - priv->data = of_device_get_match_data(dev); - platform_set_drvdata(pdev, priv); ret = devm_request_irq(dev, irq, mtk_disp_ovl_irq_handler, -- 1.8.1.1.dirty