Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1074659rwi; Thu, 3 Nov 2022 00:10:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6jDjeRnhfp8tuZjl7zPynAeJoOKLEdBVXl7ZGFT8ohJNb3xJBT6L8nNx4wVlvtx8SS94uo X-Received: by 2002:aa7:8ec1:0:b0:56b:fa67:1f6c with SMTP id b1-20020aa78ec1000000b0056bfa671f6cmr29224614pfr.69.1667459427792; Thu, 03 Nov 2022 00:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667459427; cv=none; d=google.com; s=arc-20160816; b=bnFk2Wq8QsjTZ2X6gZNXboghnCXKwxyV3fXwTB1R/umSP20xIq22f0a/RrOpAWWZyi 3ZS8WAbqCw/vg4be/wX83bT/nr5HJVza3WWy2sDmqWOxrWqiFwJPbZvPEJ3fF8REd+lk xwEMNnGmJs+MkfR77HGmJHQLHnCt0Y/oTE6+sZCUmXWcMAwtP4yYUXkSjmmY8CukjtPp QB7xBB7fj9CmTeJVRMXt2RDKwl2rue+eoT7sIRPvwlz7nAK/qwdzyyr59C/gEwP4qYSG b6vogxkvijrwon+leqGeh9jc85Nwznx1lgIoUzqYZErH7PRV4REf1kQ5Y0yz0ZjQHIL2 ImbA== 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:dkim-signature; bh=jyEudgx7WcgyCeL9KzWF01BbZwIXIznkx+/V9+/fATw=; b=C/DvpZ34c18D2ib+iMyD3TP1Hi6v0G7Dv8RD2jz2hTSe22OUvBQR0h+BnnrcI6qfwY bMuEzR/HnFDs8GIyO74JmebpXsvndNB25cYLh+OhPdNItTVRRpdF8W428PFiwbvmo74I BtmEXByFx4hFMIiSDgEGkIDBXugUwSkDm5/voezZ1JqUaNZ8KVqXa4VxkY1HQq74HUQg 0hHkfAulL3kghbD/LsTw0LQu3UozQnsWeo66UQ/GIeFRYX41oljnhxPl4vNmOFVhLWWT O4NpeO0Y0xrHicogtsadqcYzyslqZG+LrTdWj9BUObYzDzNrn2UGg5KAf1N5ChNcLDGY NZVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="bfM3p/DP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il14-20020a17090b164e00b0021328e7e073si311350pjb.165.2022.11.03.00.10.15; Thu, 03 Nov 2022 00:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="bfM3p/DP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbiKCGtI (ORCPT + 97 others); Thu, 3 Nov 2022 02:49:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbiKCGs7 (ORCPT ); Thu, 3 Nov 2022 02:48:59 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F19C96258; Wed, 2 Nov 2022 23:48:48 -0700 (PDT) X-UUID: 53faa9c9f24e4559a5a93c78930000a4-20221103 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=jyEudgx7WcgyCeL9KzWF01BbZwIXIznkx+/V9+/fATw=; b=bfM3p/DP41+dmlxPMw9oFJ7eYjL2CJllIKsE95pxkVllgrK4vgOVA5bD4LyewZL0Sd0CxhJOyuYTbCAwSt4Y4GoMBM9eLTLdnEAY0br9+tCEVkhvcCFuTWgIa2siuMT023KrDyuiP5c6DO5KADoZ8GDhUif2V1k30vkIK4JDC68=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.12,REQID:cf805be7-2585-48a9-8e9c-00a764f31531,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.12,REQID:cf805be7-2585-48a9-8e9c-00a764f31531,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:62cd327,CLOUDID:3e957490-1a78-4832-bd08-74b1519dcfbf,B ulkID:221103144847KI12NAHE,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 53faa9c9f24e4559a5a93c78930000a4-20221103 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1591921370; Thu, 03 Nov 2022 14:48:45 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 3 Nov 2022 14:48:44 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 3 Nov 2022 14:48:44 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v3 03/10] media: platform: mtk-mdp3: chip config split about subcomponents Date: Thu, 3 Nov 2022 14:48:35 +0800 Message-ID: <20221103064842.12042-4-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221103064842.12042-1-moudy.ho@mediatek.com> References: <20221103064842.12042-1-moudy.ho@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Integrate and move subcomponent related information into the chip config header file for compatibility with multiple chips Signed-off-by: Moudy Ho --- .../mediatek/mdp3/mt8183/mdp3-plat-mt8183.h | 11 +++++++++++ .../media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 14 ++------------ .../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 1 + .../media/platform/mediatek/mdp3/mtk-mdp3-core.h | 1 + 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h index 81fb80ec8ac2..a4bfde4a9e16 100644 --- a/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h +++ b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h @@ -32,6 +32,17 @@ static const u32 mt8183_mutex_idx[MDP_MAX_COMP_COUNT] = { [MDP_COMP_CCORR0] = MUTEX_MOD_IDX_MDP_CCORR0, }; +static const struct of_device_id mt8183_sub_comp_dt_ids[] = { + { + .compatible = "mediatek,mt8183-mdp3-wdma", + .data = (void *)MDP_COMP_TYPE_PATH, + }, { + .compatible = "mediatek,mt8183-mdp3-wrot", + .data = (void *)MDP_COMP_TYPE_PATH, + }, + {} +}; + enum mt8183_mdp_comp_id { /* MT8183 Comp id */ /* ISP */ diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c index 1ac9c46e27d4..8f4786cc4416 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c @@ -639,17 +639,6 @@ static const struct of_device_id mdp_comp_dt_ids[] = { {} }; -static const struct of_device_id mdp_sub_comp_dt_ids[] = { - { - .compatible = "mediatek,mt8183-mdp3-wdma", - .data = (void *)MDP_COMP_TYPE_PATH, - }, { - .compatible = "mediatek,mt8183-mdp3-wrot", - .data = (void *)MDP_COMP_TYPE_PATH, - }, - {} -}; - static inline bool is_dma_capable(const enum mdp_comp_type type) { return (type == MDP_COMP_TYPE_RDMA || @@ -900,6 +889,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) { struct device *dev = &mdp->pdev->dev; struct device_node *node, *parent; + const struct mtk_mdp_driver_data *data = mdp->mdp_data; parent = dev->of_node->parent; @@ -909,7 +899,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) int id, alias_id; struct mdp_comp *comp; - of_id = of_match_node(mdp_sub_comp_dt_ids, node); + of_id = of_match_node(data->mdp_sub_comp_dt_ids, node); if (!of_id) continue; if (!of_device_is_available(node)) { diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index ee7b5a1bbc88..277253c8c963 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -19,6 +19,7 @@ static const struct mtk_mdp_driver_data mt8183_mdp_driver_data = { .mdp_probe_infra = mt8183_mdp_probe_infra, + .mdp_sub_comp_dt_ids = mt8183_sub_comp_dt_ids, .mdp_cfg = &mt8183_plat_cfg, .mdp_mutex_table_idx = mt8183_mutex_idx, .comp_data = mt8183_mdp_comp_data, diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h index 0c398ef75616..b83b2c517730 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h @@ -52,6 +52,7 @@ enum mdp_pipe_id { struct mtk_mdp_driver_data { const struct of_device_id *mdp_probe_infra; + const struct of_device_id *mdp_sub_comp_dt_ids; const struct mdp_platform_config *mdp_cfg; const u32 *mdp_mutex_table_idx; const struct mdp_comp_data *comp_data; -- 2.18.0