Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: qcom: Constify few things in audioreach and

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>:

Several functions do not modify the pointed memory they receive, so
marking them as pointers to const would serve as self-explanatory code.
Also safer a bit.

+116 -105
+48 -39
sound/soc/qcom/qdsp6/audioreach.c
··· 309 309 EXPORT_SYMBOL_GPL(audioreach_set_default_channel_mapping); 310 310 311 311 static void apm_populate_container_config(struct apm_container_obj *cfg, 312 - struct audioreach_container *cont) 312 + const struct audioreach_container *cont) 313 313 { 314 314 315 315 /* Container Config */ ··· 339 339 } 340 340 341 341 static void apm_populate_sub_graph_config(struct apm_sub_graph_data *cfg, 342 - struct audioreach_sub_graph *sg) 342 + const struct audioreach_sub_graph *sg) 343 343 { 344 344 cfg->sub_graph_cfg.sub_graph_id = sg->sub_graph_id; 345 345 cfg->sub_graph_cfg.num_sub_graph_prop = APM_SUB_GRAPH_CFG_NPROP; ··· 361 361 } 362 362 363 363 static void apm_populate_module_prop_obj(struct apm_mod_prop_obj *obj, 364 - struct audioreach_module *module) 364 + const struct audioreach_module *module) 365 365 { 366 366 367 367 obj->instance_id = module->instance_id; ··· 373 373 } 374 374 375 375 static void apm_populate_module_list_obj(struct apm_mod_list_obj *obj, 376 - struct audioreach_container *container, 376 + const struct audioreach_container *container, 377 377 int sub_graph_id) 378 378 { 379 379 struct audioreach_module *module; ··· 390 390 } 391 391 } 392 392 393 - static void audioreach_populate_graph(struct q6apm *apm, struct audioreach_graph_info *info, 393 + static void audioreach_populate_graph(struct q6apm *apm, 394 + const struct audioreach_graph_info *info, 394 395 struct apm_graph_open_params *open, 395 - struct list_head *sg_list, 396 + const struct list_head *sg_list, 396 397 int num_sub_graphs) 397 398 { 398 399 struct apm_mod_conn_list_params *mc_data = open->mod_conn_list_data; ··· 465 464 } 466 465 } 467 466 468 - void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info *info) 467 + void *audioreach_alloc_graph_pkt(struct q6apm *apm, 468 + const struct audioreach_graph_info *info) 469 469 { 470 470 int payload_size, sg_sz, cont_sz, ml_sz, mp_sz, mc_sz; 471 471 struct apm_module_param_data *param_data; ··· 479 477 struct audioreach_module *module; 480 478 struct audioreach_sub_graph *sgs; 481 479 struct apm_mod_list_obj *mlobj; 482 - struct list_head *sg_list; 480 + const struct list_head *sg_list; 483 481 int num_connections = 0; 484 482 int num_containers = 0; 485 483 int num_sub_graphs = 0; ··· 632 630 EXPORT_SYMBOL_GPL(audioreach_graph_send_cmd_sync); 633 631 634 632 static int audioreach_display_port_set_media_format(struct q6apm_graph *graph, 635 - struct audioreach_module *module, 636 - struct audioreach_module_config *cfg) 633 + const struct audioreach_module *module, 634 + const struct audioreach_module_config *cfg) 637 635 { 638 636 struct apm_display_port_module_intf_cfg *intf_cfg; 639 637 struct apm_module_frame_size_factor_cfg *fs_cfg; ··· 689 687 690 688 /* LPASS Codec DMA port Module Media Format Setup */ 691 689 static int audioreach_codec_dma_set_media_format(struct q6apm_graph *graph, 692 - struct audioreach_module *module, 693 - struct audioreach_module_config *cfg) 690 + const struct audioreach_module *module, 691 + const struct audioreach_module_config *cfg) 694 692 { 695 693 struct apm_codec_dma_module_intf_cfg *intf_cfg; 696 694 struct apm_module_frame_size_factor_cfg *fs_cfg; ··· 755 753 return q6apm_send_cmd_sync(graph->apm, pkt, 0); 756 754 } 757 755 758 - int audioreach_send_u32_param(struct q6apm_graph *graph, struct audioreach_module *module, 756 + int audioreach_send_u32_param(struct q6apm_graph *graph, 757 + const struct audioreach_module *module, 759 758 uint32_t param_id, uint32_t param_val) 760 759 { 761 760 struct apm_module_param_data *param_data; ··· 785 782 EXPORT_SYMBOL_GPL(audioreach_send_u32_param); 786 783 787 784 static int audioreach_sal_limiter_enable(struct q6apm_graph *graph, 788 - struct audioreach_module *module, bool enable) 785 + const struct audioreach_module *module, 786 + bool enable) 789 787 { 790 788 return audioreach_send_u32_param(graph, module, PARAM_ID_SAL_LIMITER_ENABLE, enable); 791 789 } 792 790 793 791 static int audioreach_sal_set_media_format(struct q6apm_graph *graph, 794 - struct audioreach_module *module, 795 - struct audioreach_module_config *cfg) 792 + const struct audioreach_module *module, 793 + const struct audioreach_module_config *cfg) 796 794 { 797 795 return audioreach_send_u32_param(graph, module, PARAM_ID_SAL_OUTPUT_CFG, cfg->bit_width); 798 796 } 799 797 800 798 static int audioreach_module_enable(struct q6apm_graph *graph, 801 - struct audioreach_module *module, 799 + const struct audioreach_module *module, 802 800 bool enable) 803 801 { 804 802 return audioreach_send_u32_param(graph, module, PARAM_ID_MODULE_ENABLE, enable); 805 803 } 806 804 807 805 static int audioreach_gapless_set_media_format(struct q6apm_graph *graph, 808 - struct audioreach_module *module, 809 - struct audioreach_module_config *cfg) 806 + const struct audioreach_module *module, 807 + const struct audioreach_module_config *cfg) 810 808 { 811 809 return audioreach_send_u32_param(graph, module, PARAM_ID_EARLY_EOS_DELAY, 812 810 EARLY_EOS_DELAY_MS); 813 811 } 814 812 815 813 static int audioreach_set_module_config(struct q6apm_graph *graph, 816 - struct audioreach_module *module, 817 - struct audioreach_module_config *cfg) 814 + const struct audioreach_module *module, 815 + const struct audioreach_module_config *cfg) 818 816 { 819 817 int size = le32_to_cpu(module->data->size); 820 818 void *p; ··· 832 828 } 833 829 834 830 static int audioreach_mfc_set_media_format(struct q6apm_graph *graph, 835 - struct audioreach_module *module, 836 - struct audioreach_module_config *cfg) 831 + const struct audioreach_module *module, 832 + const struct audioreach_module_config *cfg) 837 833 { 838 834 struct apm_module_param_data *param_data; 839 835 struct param_id_mfc_media_format *media_format; ··· 867 863 } 868 864 869 865 static int audioreach_set_compr_media_format(struct media_format *media_fmt_hdr, 870 - void *p, struct audioreach_module_config *mcfg) 866 + void *p, 867 + const struct audioreach_module_config *mcfg) 871 868 { 872 869 struct payload_media_fmt_aac_t *aac_cfg; 873 870 struct payload_media_fmt_pcm *mp3_cfg; ··· 949 944 return 0; 950 945 } 951 946 952 - int audioreach_compr_set_param(struct q6apm_graph *graph, struct audioreach_module_config *mcfg) 947 + int audioreach_compr_set_param(struct q6apm_graph *graph, 948 + const struct audioreach_module_config *mcfg) 953 949 { 954 950 struct media_format *header; 955 951 int rc; ··· 975 969 EXPORT_SYMBOL_GPL(audioreach_compr_set_param); 976 970 977 971 static int audioreach_i2s_set_media_format(struct q6apm_graph *graph, 978 - struct audioreach_module *module, 979 - struct audioreach_module_config *cfg) 972 + const struct audioreach_module *module, 973 + const struct audioreach_module_config *cfg) 980 974 { 981 975 struct apm_module_frame_size_factor_cfg *fs_cfg; 982 976 struct apm_module_param_data *param_data; ··· 1043 1037 } 1044 1038 1045 1039 static int audioreach_logging_set_media_format(struct q6apm_graph *graph, 1046 - struct audioreach_module *module) 1040 + const struct audioreach_module *module) 1047 1041 { 1048 1042 struct apm_module_param_data *param_data; 1049 1043 struct data_logging_config *cfg; ··· 1072 1066 } 1073 1067 1074 1068 static int audioreach_pcm_set_media_format(struct q6apm_graph *graph, 1075 - struct audioreach_module *module, 1076 - struct audioreach_module_config *mcfg) 1069 + const struct audioreach_module *module, 1070 + const struct audioreach_module_config *mcfg) 1077 1071 { 1078 1072 struct payload_pcm_output_format_cfg *media_cfg; 1079 1073 uint32_t num_channels = mcfg->num_channels; ··· 1119 1113 } 1120 1114 1121 1115 static int audioreach_shmem_set_media_format(struct q6apm_graph *graph, 1122 - struct audioreach_module *module, 1123 - struct audioreach_module_config *mcfg) 1116 + const struct audioreach_module *module, 1117 + const struct audioreach_module_config *mcfg) 1124 1118 { 1125 1119 uint32_t num_channels = mcfg->num_channels; 1126 1120 struct apm_module_param_data *param_data; ··· 1176 1170 return audioreach_graph_send_cmd_sync(graph, pkt, 0); 1177 1171 } 1178 1172 1179 - int audioreach_gain_set_vol_ctrl(struct q6apm *apm, struct audioreach_module *module, int vol) 1173 + int audioreach_gain_set_vol_ctrl(struct q6apm *apm, 1174 + const struct audioreach_module *module, int vol) 1180 1175 { 1181 1176 struct param_id_vol_ctrl_master_gain *cfg; 1182 1177 struct apm_module_param_data *param_data; ··· 1202 1195 } 1203 1196 EXPORT_SYMBOL_GPL(audioreach_gain_set_vol_ctrl); 1204 1197 1205 - static int audioreach_gain_set(struct q6apm_graph *graph, struct audioreach_module *module) 1198 + static int audioreach_gain_set(struct q6apm_graph *graph, 1199 + const struct audioreach_module *module) 1206 1200 { 1207 1201 struct apm_module_param_data *param_data; 1208 1202 struct apm_gain_module_cfg *cfg; ··· 1226 1218 } 1227 1219 1228 1220 static int audioreach_speaker_protection(struct q6apm_graph *graph, 1229 - struct audioreach_module *module, 1221 + const struct audioreach_module *module, 1230 1222 uint32_t operation_mode) 1231 1223 { 1232 1224 return audioreach_send_u32_param(graph, module, PARAM_ID_SP_OP_MODE, ··· 1234 1226 } 1235 1227 1236 1228 static int audioreach_speaker_protection_vi(struct q6apm_graph *graph, 1237 - struct audioreach_module *module, 1238 - struct audioreach_module_config *mcfg) 1229 + const struct audioreach_module *module, 1230 + const struct audioreach_module_config *mcfg) 1239 1231 { 1240 1232 u32 num_channels = mcfg->num_channels; 1241 1233 struct apm_module_sp_vi_op_mode_cfg *op_cfg; ··· 1312 1304 return rc; 1313 1305 } 1314 1306 1315 - int audioreach_set_media_format(struct q6apm_graph *graph, struct audioreach_module *module, 1316 - struct audioreach_module_config *cfg) 1307 + int audioreach_set_media_format(struct q6apm_graph *graph, 1308 + const struct audioreach_module *module, 1309 + const struct audioreach_module_config *cfg) 1317 1310 { 1318 1311 int rc; 1319 1312
+9 -7
sound/soc/qcom/qdsp6/audioreach.h
··· 831 831 void *audioreach_alloc_pkt(int payload_size, uint32_t opcode, 832 832 uint32_t token, uint32_t src_port, 833 833 uint32_t dest_port); 834 - void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info 835 - *info); 834 + void *audioreach_alloc_graph_pkt(struct q6apm *apm, 835 + const struct audioreach_graph_info *info); 836 836 /* Topology specific */ 837 837 int audioreach_tplg_init(struct snd_soc_component *component); 838 838 ··· 848 848 int audioreach_graph_send_cmd_sync(struct q6apm_graph *graph, struct gpr_pkt *pkt, 849 849 uint32_t rsp_opcode); 850 850 int audioreach_set_media_format(struct q6apm_graph *graph, 851 - struct audioreach_module *module, 852 - struct audioreach_module_config *cfg); 851 + const struct audioreach_module *module, 852 + const struct audioreach_module_config *cfg); 853 853 int audioreach_shared_memory_send_eos(struct q6apm_graph *graph); 854 854 int audioreach_gain_set_vol_ctrl(struct q6apm *apm, 855 - struct audioreach_module *module, int vol); 856 - int audioreach_send_u32_param(struct q6apm_graph *graph, struct audioreach_module *module, 855 + const struct audioreach_module *module, int vol); 856 + int audioreach_send_u32_param(struct q6apm_graph *graph, 857 + const struct audioreach_module *module, 857 858 uint32_t param_id, uint32_t param_val); 858 - int audioreach_compr_set_param(struct q6apm_graph *graph, struct audioreach_module_config *mcfg); 859 + int audioreach_compr_set_param(struct q6apm_graph *graph, 860 + const struct audioreach_module_config *mcfg); 859 861 860 862 #endif /* __AUDIOREACH_H__ */
+59 -59
sound/soc/qcom/qdsp6/topology.c
··· 206 206 return mod; 207 207 } 208 208 209 - static struct snd_soc_tplg_vendor_array *audioreach_get_sg_array( 210 - struct snd_soc_tplg_private *private) 209 + static const struct snd_soc_tplg_vendor_array * 210 + audioreach_get_sg_array(const struct snd_soc_tplg_private *private) 211 211 { 212 - struct snd_soc_tplg_vendor_array *sg_array = NULL; 212 + const struct snd_soc_tplg_vendor_array *sg_array = NULL; 213 213 bool found = false; 214 214 int sz; 215 215 216 216 for (sz = 0; !found && (sz < le32_to_cpu(private->size)); ) { 217 - struct snd_soc_tplg_vendor_value_elem *sg_elem; 217 + const struct snd_soc_tplg_vendor_value_elem *sg_elem; 218 218 int tkn_count = 0; 219 219 220 220 sg_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz); ··· 239 239 return NULL; 240 240 } 241 241 242 - static struct snd_soc_tplg_vendor_array *audioreach_get_cont_array( 243 - struct snd_soc_tplg_private *private) 242 + static const struct snd_soc_tplg_vendor_array * 243 + audioreach_get_cont_array(const struct snd_soc_tplg_private *private) 244 244 { 245 - struct snd_soc_tplg_vendor_array *cont_array = NULL; 245 + const struct snd_soc_tplg_vendor_array *cont_array = NULL; 246 246 bool found = false; 247 247 int sz; 248 248 249 249 for (sz = 0; !found && (sz < le32_to_cpu(private->size)); ) { 250 - struct snd_soc_tplg_vendor_value_elem *cont_elem; 250 + const struct snd_soc_tplg_vendor_value_elem *cont_elem; 251 251 int tkn_count = 0; 252 252 253 253 cont_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz); ··· 272 272 return NULL; 273 273 } 274 274 275 - static struct snd_soc_tplg_vendor_array *audioreach_get_module_array( 276 - struct snd_soc_tplg_private *private) 275 + static const struct snd_soc_tplg_vendor_array * 276 + audioreach_get_module_array(const struct snd_soc_tplg_private *private) 277 277 { 278 - struct snd_soc_tplg_vendor_array *mod_array = NULL; 278 + const struct snd_soc_tplg_vendor_array *mod_array = NULL; 279 279 bool found = false; 280 280 int sz = 0; 281 281 282 282 for (sz = 0; !found && (sz < le32_to_cpu(private->size)); ) { 283 - struct snd_soc_tplg_vendor_value_elem *mod_elem; 283 + const struct snd_soc_tplg_vendor_value_elem *mod_elem; 284 284 int tkn_count = 0; 285 285 286 286 mod_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz); ··· 305 305 return NULL; 306 306 } 307 307 308 - static struct audioreach_module_priv_data *audioreach_get_module_priv_data( 309 - struct snd_soc_tplg_private *private) 308 + static struct audioreach_module_priv_data * 309 + audioreach_get_module_priv_data(const struct snd_soc_tplg_private *private) 310 310 { 311 311 int sz; 312 312 313 313 for (sz = 0; sz < le32_to_cpu(private->size); ) { 314 - struct snd_soc_tplg_vendor_array *mod_array; 314 + const struct snd_soc_tplg_vendor_array *mod_array; 315 315 316 316 mod_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz); 317 317 if (le32_to_cpu(mod_array->type) == SND_SOC_AR_TPLG_MODULE_CFG_TYPE) { ··· 334 334 } 335 335 336 336 static struct audioreach_sub_graph *audioreach_parse_sg_tokens(struct q6apm *apm, 337 - struct snd_soc_tplg_private *private) 337 + const struct snd_soc_tplg_private *private) 338 338 { 339 - struct snd_soc_tplg_vendor_value_elem *sg_elem; 340 - struct snd_soc_tplg_vendor_array *sg_array; 339 + const struct snd_soc_tplg_vendor_value_elem *sg_elem; 340 + const struct snd_soc_tplg_vendor_array *sg_array; 341 341 struct audioreach_graph_info *info = NULL; 342 342 int graph_id, sub_graph_id, tkn_count = 0; 343 343 struct audioreach_sub_graph *sg; ··· 392 392 393 393 static struct audioreach_container *audioreach_parse_cont_tokens(struct q6apm *apm, 394 394 struct audioreach_sub_graph *sg, 395 - struct snd_soc_tplg_private *private) 395 + const struct snd_soc_tplg_private *private) 396 396 { 397 - struct snd_soc_tplg_vendor_value_elem *cont_elem; 398 - struct snd_soc_tplg_vendor_array *cont_array; 397 + const struct snd_soc_tplg_vendor_value_elem *cont_elem; 398 + const struct snd_soc_tplg_vendor_array *cont_array; 399 399 struct audioreach_container *cont; 400 400 int container_id, tkn_count = 0; 401 401 bool found = false; ··· 437 437 438 438 static struct audioreach_module *audioreach_parse_common_tokens(struct q6apm *apm, 439 439 struct audioreach_container *cont, 440 - struct snd_soc_tplg_private *private, 440 + const struct snd_soc_tplg_private *private, 441 441 struct snd_soc_dapm_widget *w) 442 442 { 443 443 uint32_t max_ip_port = 0, max_op_port = 0; ··· 447 447 uint32_t src_mod_inst_id = 0; 448 448 449 449 int module_id = 0, instance_id = 0, tkn_count = 0; 450 - struct snd_soc_tplg_vendor_value_elem *mod_elem; 451 - struct snd_soc_tplg_vendor_array *mod_array; 450 + const struct snd_soc_tplg_vendor_value_elem *mod_elem; 451 + const struct snd_soc_tplg_vendor_array *mod_array; 452 452 struct audioreach_module *mod = NULL; 453 453 uint32_t token; 454 454 bool found; ··· 590 590 591 591 static int audioreach_widget_load_module_common(struct snd_soc_component *component, 592 592 int index, struct snd_soc_dapm_widget *w, 593 - struct snd_soc_tplg_dapm_widget *tplg_w) 593 + const struct snd_soc_tplg_dapm_widget *tplg_w) 594 594 { 595 595 struct q6apm *apm = dev_get_drvdata(component->dev); 596 596 struct audioreach_container *cont; ··· 620 620 621 621 static int audioreach_widget_load_enc_dec_cnv(struct snd_soc_component *component, 622 622 int index, struct snd_soc_dapm_widget *w, 623 - struct snd_soc_tplg_dapm_widget *tplg_w) 623 + const struct snd_soc_tplg_dapm_widget *tplg_w) 624 624 { 625 - struct snd_soc_tplg_vendor_value_elem *mod_elem; 626 - struct snd_soc_tplg_vendor_array *mod_array; 625 + const struct snd_soc_tplg_vendor_value_elem *mod_elem; 626 + const struct snd_soc_tplg_vendor_array *mod_array; 627 627 struct audioreach_module *mod; 628 628 struct snd_soc_dobj *dobj; 629 629 int tkn_count = 0; ··· 660 660 } 661 661 662 662 static int audioreach_widget_log_module_load(struct audioreach_module *mod, 663 - struct snd_soc_tplg_vendor_array *mod_array) 663 + const struct snd_soc_tplg_vendor_array *mod_array) 664 664 { 665 - struct snd_soc_tplg_vendor_value_elem *mod_elem; 665 + const struct snd_soc_tplg_vendor_value_elem *mod_elem; 666 666 int tkn_count = 0; 667 667 668 668 mod_elem = mod_array->value; ··· 690 690 } 691 691 692 692 static int audioreach_widget_dma_module_load(struct audioreach_module *mod, 693 - struct snd_soc_tplg_vendor_array *mod_array) 693 + const struct snd_soc_tplg_vendor_array *mod_array) 694 694 { 695 - struct snd_soc_tplg_vendor_value_elem *mod_elem; 695 + const struct snd_soc_tplg_vendor_value_elem *mod_elem; 696 696 int tkn_count = 0; 697 697 698 698 mod_elem = mod_array->value; ··· 719 719 } 720 720 721 721 static int audioreach_widget_i2s_module_load(struct audioreach_module *mod, 722 - struct snd_soc_tplg_vendor_array *mod_array) 722 + const struct snd_soc_tplg_vendor_array *mod_array) 723 723 { 724 - struct snd_soc_tplg_vendor_value_elem *mod_elem; 724 + const struct snd_soc_tplg_vendor_value_elem *mod_elem; 725 725 int tkn_count = 0; 726 726 727 727 mod_elem = mod_array->value; ··· 754 754 } 755 755 756 756 static int audioreach_widget_dp_module_load(struct audioreach_module *mod, 757 - struct snd_soc_tplg_vendor_array *mod_array) 757 + const struct snd_soc_tplg_vendor_array *mod_array) 758 758 { 759 - struct snd_soc_tplg_vendor_value_elem *mod_elem; 759 + const struct snd_soc_tplg_vendor_value_elem *mod_elem; 760 760 int tkn_count = 0; 761 761 762 762 mod_elem = mod_array->value; ··· 778 778 779 779 static int audioreach_widget_load_buffer(struct snd_soc_component *component, 780 780 int index, struct snd_soc_dapm_widget *w, 781 - struct snd_soc_tplg_dapm_widget *tplg_w) 781 + const struct snd_soc_tplg_dapm_widget *tplg_w) 782 782 { 783 - struct snd_soc_tplg_vendor_array *mod_array; 783 + const struct snd_soc_tplg_vendor_array *mod_array; 784 784 struct audioreach_module *mod; 785 785 struct snd_soc_dobj *dobj; 786 786 int ret; ··· 818 818 819 819 static int audioreach_widget_load_mixer(struct snd_soc_component *component, 820 820 int index, struct snd_soc_dapm_widget *w, 821 - struct snd_soc_tplg_dapm_widget *tplg_w) 821 + const struct snd_soc_tplg_dapm_widget *tplg_w) 822 822 { 823 - struct snd_soc_tplg_vendor_value_elem *w_elem; 824 - struct snd_soc_tplg_vendor_array *w_array; 823 + const struct snd_soc_tplg_vendor_value_elem *w_elem; 824 + const struct snd_soc_tplg_vendor_array *w_array; 825 825 struct snd_ar_control *scontrol; 826 826 struct q6apm *data = dev_get_drvdata(component->dev); 827 827 struct snd_soc_dobj *dobj; ··· 886 886 887 887 static int audioreach_widget_load_pga(struct snd_soc_component *component, 888 888 int index, struct snd_soc_dapm_widget *w, 889 - struct snd_soc_tplg_dapm_widget *tplg_w) 889 + const struct snd_soc_tplg_dapm_widget *tplg_w) 890 890 { 891 891 struct audioreach_module *mod; 892 892 struct snd_soc_dobj *dobj; ··· 947 947 static int audioreach_widget_unload(struct snd_soc_component *scomp, 948 948 struct snd_soc_dobj *dobj) 949 949 { 950 - struct snd_soc_dapm_widget *w = container_of(dobj, struct snd_soc_dapm_widget, dobj); 950 + const struct snd_soc_dapm_widget *w = container_of(dobj, struct snd_soc_dapm_widget, dobj); 951 951 struct q6apm *apm = dev_get_drvdata(scomp->dev); 952 952 struct audioreach_container *cont; 953 953 struct audioreach_module *mod; ··· 1032 1032 static int audioreach_route_load(struct snd_soc_component *scomp, int index, 1033 1033 struct snd_soc_dapm_route *route) 1034 1034 { 1035 - struct audioreach_module *src_module, *sink_module; 1035 + const struct audioreach_module *src_module, *sink_module; 1036 1036 struct snd_ar_control *control; 1037 1037 struct snd_soc_dapm_widget *w; 1038 1038 int i; ··· 1098 1098 } 1099 1099 1100 1100 static void audioreach_connect_sub_graphs(struct q6apm *apm, 1101 - struct snd_ar_control *m1, 1102 - struct snd_ar_control *m2, 1101 + const struct snd_ar_control *m1, 1102 + const struct snd_ar_control *m2, 1103 1103 bool connect) 1104 1104 { 1105 1105 struct audioreach_graph_info *info; ··· 1123 1123 } 1124 1124 1125 1125 static bool audioreach_is_vmixer_connected(struct q6apm *apm, 1126 - struct snd_ar_control *m1, 1127 - struct snd_ar_control *m2) 1126 + const struct snd_ar_control *m1, 1127 + const struct snd_ar_control *m2) 1128 1128 { 1129 - struct audioreach_graph_info *info; 1129 + const struct audioreach_graph_info *info; 1130 1130 1131 1131 mutex_lock(&apm->lock); 1132 1132 info = idr_find(&apm->graph_info_idr, m2->graph_id); ··· 1144 1144 { 1145 1145 struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; 1146 1146 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1147 - struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1147 + const struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1148 1148 struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); 1149 - struct snd_ar_control *dapm_scontrol = dw->dobj.private; 1150 - struct snd_ar_control *scontrol = mc->dobj.private; 1149 + const struct snd_ar_control *dapm_scontrol = dw->dobj.private; 1150 + const struct snd_ar_control *scontrol = mc->dobj.private; 1151 1151 struct q6apm *data = dev_get_drvdata(c->dev); 1152 1152 bool connected; 1153 1153 ··· 1167 1167 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); 1168 1168 struct snd_soc_dapm_widget *dw = snd_soc_dapm_kcontrol_to_widget(kcontrol); 1169 1169 struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); 1170 - struct snd_ar_control *dapm_scontrol = dw->dobj.private; 1171 - struct snd_ar_control *scontrol = mc->dobj.private; 1170 + const struct snd_ar_control *dapm_scontrol = dw->dobj.private; 1171 + const struct snd_ar_control *scontrol = mc->dobj.private; 1172 1172 struct q6apm *data = dev_get_drvdata(c->dev); 1173 1173 1174 1174 if (ucontrol->value.integer.value[0]) { ··· 1206 1206 static int audioreach_control_load_mix(struct snd_soc_component *scomp, 1207 1207 struct snd_ar_control *scontrol, 1208 1208 struct snd_kcontrol_new *kc, 1209 - struct snd_soc_tplg_ctl_hdr *hdr) 1209 + const struct snd_soc_tplg_ctl_hdr *hdr) 1210 1210 { 1211 - struct snd_soc_tplg_vendor_value_elem *c_elem; 1212 - struct snd_soc_tplg_vendor_array *c_array; 1213 - struct snd_soc_tplg_mixer_control *mc; 1211 + const struct snd_soc_tplg_vendor_value_elem *c_elem; 1212 + const struct snd_soc_tplg_vendor_array *c_array; 1213 + const struct snd_soc_tplg_mixer_control *mc; 1214 1214 int tkn_count = 0; 1215 1215 1216 - mc = container_of(hdr, struct snd_soc_tplg_mixer_control, hdr); 1216 + mc = container_of_const(hdr, struct snd_soc_tplg_mixer_control, hdr); 1217 1217 c_array = (struct snd_soc_tplg_vendor_array *)mc->priv.data; 1218 1218 1219 1219 c_elem = c_array->value;