Skip to content

Commit b385b99

Browse files
MoudyHoHans Verkuil
authored andcommitted
media: platform: mtk-mdp3: chip config split about subcomponents
Integrate subcomponent related information into specific config file for further multi-chip compatibility. Signed-off-by: Moudy Ho <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent b59ed26 commit b385b99

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

drivers/media/platform/mediatek/mdp3/mdp_cfg_data.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,24 @@ static const struct mdp_comp_data mt8183_mdp_comp_data[MDP_MAX_COMP_COUNT] = {
144144
},
145145
};
146146

147+
static const struct of_device_id mt8183_sub_comp_dt_ids[] = {
148+
{
149+
.compatible = "mediatek,mt8183-mdp3-wdma",
150+
.data = (void *)MDP_COMP_TYPE_PATH,
151+
}, {
152+
.compatible = "mediatek,mt8183-mdp3-wrot",
153+
.data = (void *)MDP_COMP_TYPE_PATH,
154+
},
155+
{}
156+
};
157+
147158
const struct mtk_mdp_driver_data mt8183_mdp_driver_data = {
148159
.mdp_probe_infra = mt8183_mdp_probe_infra,
149160
.mdp_cfg = &mt8183_plat_cfg,
150161
.mdp_mutex_table_idx = mt8183_mutex_idx,
151162
.comp_data = mt8183_mdp_comp_data,
152163
.comp_data_len = ARRAY_SIZE(mt8183_mdp_comp_data),
164+
.mdp_sub_comp_dt_ids = mt8183_sub_comp_dt_ids,
153165
};
154166

155167
s32 mdp_cfg_get_id_inner(struct mdp_dev *mdp_dev, enum mtk_mdp_comp_id id)

drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -610,17 +610,6 @@ static const struct of_device_id mdp_comp_dt_ids[] = {
610610
{}
611611
};
612612

613-
static const struct of_device_id mdp_sub_comp_dt_ids[] = {
614-
{
615-
.compatible = "mediatek,mt8183-mdp3-wdma",
616-
.data = (void *)MDP_COMP_TYPE_PATH,
617-
}, {
618-
.compatible = "mediatek,mt8183-mdp3-wrot",
619-
.data = (void *)MDP_COMP_TYPE_PATH,
620-
},
621-
{}
622-
};
623-
624613
static inline bool is_dma_capable(const enum mdp_comp_type type)
625614
{
626615
return (type == MDP_COMP_TYPE_RDMA ||
@@ -871,6 +860,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
871860
{
872861
struct device *dev = &mdp->pdev->dev;
873862
struct device_node *node, *parent;
863+
const struct mtk_mdp_driver_data *data = mdp->mdp_data;
874864

875865
parent = dev->of_node->parent;
876866

@@ -880,7 +870,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
880870
int id, alias_id;
881871
struct mdp_comp *comp;
882872

883-
of_id = of_match_node(mdp_sub_comp_dt_ids, node);
873+
of_id = of_match_node(data->mdp_sub_comp_dt_ids, node);
884874
if (!of_id)
885875
continue;
886876
if (!of_device_is_available(node)) {

drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ struct mtk_mdp_driver_data {
5656
const u32 *mdp_mutex_table_idx;
5757
const struct mdp_comp_data *comp_data;
5858
unsigned int comp_data_len;
59+
const struct of_device_id *mdp_sub_comp_dt_ids;
5960
};
6061

6162
struct mdp_dev {

0 commit comments

Comments
 (0)