From nobody Thu Nov 14 06:53:21 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF30CC636D3 for ; Wed, 8 Feb 2023 09:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230499AbjBHJJS (ORCPT ); Wed, 8 Feb 2023 04:09:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbjBHJJM (ORCPT ); Wed, 8 Feb 2023 04:09:12 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B242E807; Wed, 8 Feb 2023 01:09:05 -0800 (PST) X-UUID: 38bc11e6a79011eda06fc9ecc4dadd91-20230208 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=PNQ/c4X8QpCMyjROL94cdJJkeBw5oM04sBjsPBB+oSo=; b=ftaZ4qVfYdDbCGAjG5C8GeMIZw4wy/vyubI3d4Fw7GTnNRMy8tPWPGzLfQf0upvEMRLDAJKYmeSwuNUqe0pab/cAWQZP+A2Lv/UdekLReFAlo0NJUx5U2sfBne9LmH8KlNPe2DFmvhJ07iHsE/N2+ov/M819lVhHoGbmhboBzKM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:191e05d6-b687-4abc-8858-90aec0fed593,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:885ddb2,CLOUDID:0333d4f7-ff42-4fb0-b929-626456a83c14,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: 38bc11e6a79011eda06fc9ecc4dadd91-20230208 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 547091724; Wed, 08 Feb 2023 17:08:58 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 17:08:57 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 17:08:57 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil , Ping-Hsun Wu CC: , , , , , Moudy Ho Subject: [PATCH v6 04/12] media: platform: mtk-mdp3: chip config split about subcomponents Date: Wed, 8 Feb 2023 17:08:47 +0800 Message-ID: <20230208090855.18934-5-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208090855.18934-1-moudy.ho@mediatek.com> References: <20230208090855.18934-1-moudy.ho@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Integrate subcomponent related information into specific config file for further multi-chip compatibility. Signed-off-by: Moudy Ho --- .../media/platform/mediatek/mdp3/mdp_cfg_data.c | 12 ++++++++++++ .../media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 14 ++------------ .../media/platform/mediatek/mdp3/mtk-mdp3-core.h | 1 + 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mdp_cfg_data.c b/drivers/= media/platform/mediatek/mdp3/mdp_cfg_data.c index af2e75acf119..159f5ecb9c1b 100644 --- a/drivers/media/platform/mediatek/mdp3/mdp_cfg_data.c +++ b/drivers/media/platform/mediatek/mdp3/mdp_cfg_data.c @@ -144,12 +144,24 @@ static const struct mdp_comp_data mt8183_mdp_comp_dat= a[MDP_MAX_COMP_COUNT] =3D { }, }; =20 +static const struct of_device_id mt8183_sub_comp_dt_ids[] =3D { + { + .compatible =3D "mediatek,mt8183-mdp3-wdma", + .data =3D (void *)MDP_COMP_TYPE_PATH, + }, { + .compatible =3D "mediatek,mt8183-mdp3-wrot", + .data =3D (void *)MDP_COMP_TYPE_PATH, + }, + {} +}; + const struct mtk_mdp_driver_data mt8183_mdp_driver_data =3D { .mdp_probe_infra =3D mt8183_mdp_probe_infra, .mdp_cfg =3D &mt8183_plat_cfg, .mdp_mutex_table_idx =3D mt8183_mutex_idx, .comp_data =3D mt8183_mdp_comp_data, .comp_data_len =3D ARRAY_SIZE(mt8183_mdp_comp_data), + .mdp_sub_comp_dt_ids =3D mt8183_sub_comp_dt_ids, }; =20 s32 mdp_cfg_get_id_inner(struct mdp_dev *mdp_dev, enum mtk_mdp_comp_id id) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers= /media/platform/mediatek/mdp3/mtk-mdp3-comp.c index 1000b0ae3483..b65b708d0e3d 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c @@ -610,17 +610,6 @@ static const struct of_device_id mdp_comp_dt_ids[] =3D= { {} }; =20 -static const struct of_device_id mdp_sub_comp_dt_ids[] =3D { - { - .compatible =3D "mediatek,mt8183-mdp3-wdma", - .data =3D (void *)MDP_COMP_TYPE_PATH, - }, { - .compatible =3D "mediatek,mt8183-mdp3-wrot", - .data =3D (void *)MDP_COMP_TYPE_PATH, - }, - {} -}; - static inline bool is_dma_capable(const enum mdp_comp_type type) { return (type =3D=3D MDP_COMP_TYPE_RDMA || @@ -871,6 +860,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) { struct device *dev =3D &mdp->pdev->dev; struct device_node *node, *parent; + const struct mtk_mdp_driver_data *data =3D mdp->mdp_data; =20 parent =3D dev->of_node->parent; =20 @@ -880,7 +870,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) int id, alias_id; struct mdp_comp *comp; =20 - of_id =3D of_match_node(mdp_sub_comp_dt_ids, node); + of_id =3D 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.h b/drivers= /media/platform/mediatek/mdp3/mtk-mdp3-core.h index 0c398ef75616..41eeba49fb42 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h @@ -56,6 +56,7 @@ struct mtk_mdp_driver_data { const u32 *mdp_mutex_table_idx; const struct mdp_comp_data *comp_data; unsigned int comp_data_len; + const struct of_device_id *mdp_sub_comp_dt_ids; }; =20 struct mdp_dev { --=20 2.18.0