From 8d535fdb818b783fc30f58226b24ecd1a913b4a2 Mon Sep 17 00:00:00 2001 From: Elaine Zhang Date: Tue, 17 Aug 2021 17:11:20 +0800 Subject: [PATCH] thermal: rockchip: optimize static memory consume $ ./scripts/bloat-o-meter rockchip_thermal_olg.o rockchip_thermal.o add/remove: 0/32 grow/shrink: 1/1 up/down: 500/-6844 (-6344) Function old new delta rk_tsadcv2_get_temp 20 520 +500 temp_last 4 - -4 prob_last 4 - -4 bounding_cnt 4 - -4 rk_tsadcv2_irq_ack 16 - -16 rk_tsadcv3_control 24 - -24 rk_tsadcv2_tshut_mode 44 - -44 rk_tsadcv2_initialize 48 - -48 rk_tsadcv5_initialize 68 - -68 rk_tsadcv4_initialize 68 - -68 rv1108_tsadc_data 84 - -84 rk3568_tsadc_data 84 - -84 rk3399_tsadc_data 84 - -84 rk3368_tsadc_data 84 - -84 rk3366_tsadc_data 84 - -84 rk3328_tsadc_data 84 - -84 rk3308_tsadc_data 84 - -84 rk3288_tsadc_data 84 - -84 rk3228_tsadc_data 84 - -84 rk1808_tsadc_data 84 - -84 px30_tsadc_data 84 - -84 rk_tsadcv7_initialize 180 - -180 rk_tsadcv3_initialize 208 - -208 rk_tsadcv3_get_temp 244 - -244 rk3328_code_table 280 - -280 rv1108_table 288 - -288 rk3568_code_table 288 - -288 rk3399_code_table 288 - -288 rk3368_code_table 288 - -288 rk3288_code_table 288 - -288 rk3228_code_table 288 - -288 rk1808_code_table 288 - -288 rk_tsadcv2_code_to_temp 556 - -556 of_rockchip_thermal_match 2548 392 -2156 Total: Before=12093, After=5749, chg -52.46% Signed-off-by: Elaine Zhang Change-Id: I506a6135907942abcb60684f9f0888a238950421 --- drivers/thermal/rockchip_thermal.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index c4ade4b381b2..782261ce0098 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1454,53 +1454,77 @@ static const struct rockchip_tsadc_chip rk3568_tsadc_data = { }; static const struct of_device_id of_rockchip_thermal_match[] = { +#ifdef CONFIG_CPU_RV110X { .compatible = "rockchip,rv1108-tsadc", .data = (void *)&rv1108_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RV1126 { .compatible = "rockchip,rv1126-tsadc", .data = (void *)&rv1126_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_PX30 { .compatible = "rockchip,px30-tsadc", .data = (void *)&px30_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK1808 { .compatible = "rockchip,rk1808-tsadc", .data = (void *)&rk1808_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK322X { .compatible = "rockchip,rk3228-tsadc", .data = (void *)&rk3228_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK3288 { .compatible = "rockchip,rk3288-tsadc", .data = (void *)&rk3288_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK3308 { .compatible = "rockchip,rk3308-tsadc", .data = (void *)&rk3308_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK3328 { .compatible = "rockchip,rk3328-tsadc", .data = (void *)&rk3328_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK3366 { .compatible = "rockchip,rk3366-tsadc", .data = (void *)&rk3366_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK3368 { .compatible = "rockchip,rk3368-tsadc", .data = (void *)&rk3368_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK3399 { .compatible = "rockchip,rk3399-tsadc", .data = (void *)&rk3399_tsadc_data, }, +#endif +#ifdef CONFIG_CPU_RK3568 { .compatible = "rockchip,rk3568-tsadc", .data = (void *)&rk3568_tsadc_data, }, +#endif { /* end */ }, }; MODULE_DEVICE_TABLE(of, of_rockchip_thermal_match);