From dc1407e301efaceedfeb3eff24e1335dfd429538 Mon Sep 17 00:00:00 2001 From: Guochun Huang Date: Wed, 27 Nov 2024 17:45:43 +0800 Subject: [PATCH] drm/rockchip: dsi: separate the of_device_id array by different SoC Separate the process of device matching by the different SoC macro definitions, which can reduce memory usage. Signed-off-by: Guochun Huang Change-Id: Ice50f15e64f7d1ae353ecfe462f7ba3fab017817 --- .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 372a27e3bfa4..10b433b66d8c 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -1858,31 +1858,54 @@ static const struct rockchip_dw_dsi_chip_data rv1126_chip_data[] = { }; static const struct of_device_id dw_mipi_dsi_rockchip_dt_ids[] = { +#if IS_ENABLED(CONFIG_CPU_PX30) { .compatible = "rockchip,px30-mipi-dsi", .data = &px30_chip_data, - }, { + }, +#endif +#if IS_ENABLED(CONFIG_CPU_RK312X) + { .compatible = "rockchip,rk3128-mipi-dsi", .data = &rk3128_chip_data, - }, { + }, +#endif +#if IS_ENABLED(CONFIG_CPU_RK3288) + { .compatible = "rockchip,rk3288-mipi-dsi", .data = &rk3288_chip_data, - }, { + }, +#endif +#if IS_ENABLED(CONFIG_CPU_RK3399) + { .compatible = "rockchip,rk3399-mipi-dsi", .data = &rk3399_chip_data, - }, { + }, +#endif +#if IS_ENABLED(CONFIG_CPU_RK3506) + { .compatible = "rockchip,rk3506-mipi-dsi", .data = &rk3506_chip_data, - }, { + }, +#endif +#if IS_ENABLED(CONFIG_CPU_RK3562) + { .compatible = "rockchip,rk3562-mipi-dsi", .data = &rk3562_chip_data, - }, { + }, +#endif +#if IS_ENABLED(CONFIG_CPU_RK3568) + { .compatible = "rockchip,rk3568-mipi-dsi", .data = &rk3568_chip_data, - }, { + }, +#endif +#if IS_ENABLED(CONFIG_CPU_RV1126) + { .compatible = "rockchip,rv1126-mipi-dsi", .data = &rv1126_chip_data, }, +#endif { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, dw_mipi_dsi_rockchip_dt_ids);