Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp412162rwb; Thu, 6 Oct 2022 21:24:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wr4n5wYkuaWW4jqlsDcl6gj6Vb6JsBZV4Ba+vSDkvi5Wiwiv/taPiqJRSmIzThIJV+53N X-Received: by 2002:a17:906:8a66:b0:78b:da52:b752 with SMTP id hy6-20020a1709068a6600b0078bda52b752mr2527358ejc.365.1665116642718; Thu, 06 Oct 2022 21:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665116642; cv=none; d=google.com; s=arc-20160816; b=FL9/Bf4vLPECFbArGPV5H/RqWWVRIXOxnLAiW39d5D8XRDw7e4ApXu8z+3ZbUyuqS8 Ez5RtsrNl2kk+C0LataQAcKSRUk07SppRay4NXKHFJwyjwPmxNDl6k1CSDqIZpXCGTAt MaQlldQipaslXjod9H7Mjtw/ppKbLfkRQB8hT30khey2GxHUNF5To5YraNaK7HRfLJOL iUWd6gAYBhEcL3/Tlhgj+Do6CWG7+dk6m89gMasLrKAbx0nly+PGqnU/iCnUQGUs/K6d ij5AFVZZWNpCvMRWRh5zYp8jRYp3/D1gucbilQRIwrOfu3lNtZS5jOPo9+HBdxpOHhDH ADuw== 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=QSUL7GcNUacLxavbivvjecl2Wz25ijel13t7txncnH4=; b=XsEz8Edp7UBffXvxWjDDU5s7Ewb1X4iROm1FGeQvah7S3LVvx+/f9fczYkor3PonEj DfzLjFl7Xu4siKekkHZow3Qxa8/6Ji34bL2O1bHOmNb9GgMlRLCMsyHZOprmqv/HKiVz rtmsFZKZz/Q7aonMllfcnCCvaKUM0VqfGRYgmY/ud4iOWgO8ISrCrIYXy+uPibn11XNv DV/lf4TxFTfQ5cg9ZJ7voK2TVT0v8M6l/jrhZFVlVYPQBOBbMEvjTYo0CeymOUf+5tUe Zvg6yO5XsOcHeXPYoPepQktiosD0tcNxGW003GjWDuh/b6xsVfNbxT61vPzMaLyBPYEa Y5Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=VyTzuNrs; 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 du18-20020a17090772d200b0078d2848bca9si1239827ejc.704.2022.10.06.21.23.35; Thu, 06 Oct 2022 21:24:02 -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=VyTzuNrs; 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 S229691AbiJGDR6 (ORCPT + 99 others); Thu, 6 Oct 2022 23:17:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbiJGDRu (ORCPT ); Thu, 6 Oct 2022 23:17:50 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E628C5132; Thu, 6 Oct 2022 20:17:42 -0700 (PDT) X-UUID: 36c4d72f0cd84959ba9ad652312a877d-20221007 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=QSUL7GcNUacLxavbivvjecl2Wz25ijel13t7txncnH4=; b=VyTzuNrsfzAeGwrtxRJJnyUp8+usgVRDifFiUchI0AmkBoL163LwjA9ANuwxHNIx3VfAlIX+n15C/7XgATWDdwjmOXlzrLEakuSzBOLzC1nmnG/n7u/O2DD3/cdgNvhGDN/rlHzD25EZssZBr/VsH37YEg6k7DygbLp3lIPT5Lk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:11eeb753-a0ec-4b8e-ae15-13c4971a984e,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.11,REQID:11eeb753-a0ec-4b8e-ae15-13c4971a984e,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:39a5ff1,CLOUDID:5a0f83fe-ee8c-4ff7-afe9-644435e96625,B ulkID:221007111740SVAEK5CD,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48|823| 824,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil, COL:0 X-UUID: 36c4d72f0cd84959ba9ad652312a877d-20221007 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 203982625; Fri, 07 Oct 2022 11:17:39 +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; Fri, 7 Oct 2022 11:17:38 +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; Fri, 7 Oct 2022 11:17:38 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v1 3/6] media: platform: mtk-mdp3: chip config split about subcomponents Date: Fri, 7 Oct 2022 11:17:34 +0800 Message-ID: <20221007031737.5125-4-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221007031737.5125-1-moudy.ho@mediatek.com> References: <20221007031737.5125-1-moudy.ho@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_SPF_TEMPERROR, UNPARSEABLE_RELAY,URIBL_CSS autolearn=no 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 --- drivers/media/platform/mediatek/mdp3/mt8183_mdp.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_mdp.h b/drivers/media/platform/mediatek/mdp3/mt8183_mdp.h index 537c23b54737..59132fce3494 100644 --- a/drivers/media/platform/mediatek/mdp3/mt8183_mdp.h +++ b/drivers/media/platform/mediatek/mdp3/mt8183_mdp.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 e74f132e12c5..65c2e52e8d19 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