Lines Matching refs:aw_bin
25 static int aw_parse_bin_header(struct aw_device *aw_dev, struct aw_bin *bin);
27 static int aw_check_sum(struct aw_device *aw_dev, struct aw_bin *bin, int bin_num) in aw_check_sum()
53 static int aw_check_data_version(struct aw_device *aw_dev, struct aw_bin *bin, int bin_num) in aw_check_data_version()
64 static int aw_check_register_num(struct aw_device *aw_dev, struct aw_bin *bin, int bin_num) in aw_check_register_num()
91 static int aw_check_dsp_reg_num(struct aw_device *aw_dev, struct aw_bin *bin, int bin_num) in aw_check_dsp_reg_num()
122 static int aw_check_soc_app_num(struct aw_device *aw_dev, struct aw_bin *bin, int bin_num) in aw_check_soc_app_num()
151 static void aw_get_single_bin_header(struct aw_bin *bin) in aw_get_single_bin_header()
160 int bin_serial_num, struct aw_bin *bin) in aw_parse_one_of_multi_bins()
190 static int aw_get_multi_bin_header(struct aw_device *aw_dev, struct aw_bin *bin) in aw_get_multi_bin_header()
212 static int aw_parse_bin_header(struct aw_device *aw_dev, struct aw_bin *bin) in aw_parse_bin_header()
247 static int aw_check_bin_header_version(struct aw_device *aw_dev, struct aw_bin *bin) in aw_check_bin_header_version()
263 static int aw_parsing_bin_file(struct aw_device *aw_dev, struct aw_bin *bin) in aw_parsing_bin_file()
365 struct aw_bin *aw_bin; in aw_dev_prof_parse_multi_bin() local
369 aw_bin = devm_kzalloc(aw_dev->dev, data_len + sizeof(struct aw_bin), GFP_KERNEL); in aw_dev_prof_parse_multi_bin()
370 if (!aw_bin) in aw_dev_prof_parse_multi_bin()
373 aw_bin->info.len = data_len; in aw_dev_prof_parse_multi_bin()
374 memcpy(aw_bin->info.data, data, data_len); in aw_dev_prof_parse_multi_bin()
376 ret = aw_parsing_bin_file(aw_dev, aw_bin); in aw_dev_prof_parse_multi_bin()
382 for (i = 0; i < aw_bin->all_bin_parse_num; i++) { in aw_dev_prof_parse_multi_bin()
383 switch (aw_bin->header_info[i].bin_data_type) { in aw_dev_prof_parse_multi_bin()
386 aw_bin->header_info[i].valid_data_len; in aw_dev_prof_parse_multi_bin()
388 data + aw_bin->header_info[i].valid_data_addr; in aw_dev_prof_parse_multi_bin()
391 if (aw_bin->header_info[i].valid_data_len & 0x01) { in aw_dev_prof_parse_multi_bin()
396 swab16_array((u16 *)(data + aw_bin->header_info[i].valid_data_addr), in aw_dev_prof_parse_multi_bin()
397 aw_bin->header_info[i].valid_data_len >> 1); in aw_dev_prof_parse_multi_bin()
400 aw_bin->header_info[i].valid_data_len; in aw_dev_prof_parse_multi_bin()
402 data + aw_bin->header_info[i].valid_data_addr; in aw_dev_prof_parse_multi_bin()
406 if (aw_bin->header_info[i].valid_data_len & 0x01) { in aw_dev_prof_parse_multi_bin()
411 swab16_array((u16 *)(data + aw_bin->header_info[i].valid_data_addr), in aw_dev_prof_parse_multi_bin()
412 aw_bin->header_info[i].valid_data_len >> 1); in aw_dev_prof_parse_multi_bin()
414 prof_desc->fw_ver = aw_bin->header_info[i].app_version; in aw_dev_prof_parse_multi_bin()
416 aw_bin->header_info[i].valid_data_len; in aw_dev_prof_parse_multi_bin()
418 data + aw_bin->header_info[i].valid_data_addr; in aw_dev_prof_parse_multi_bin()
429 devm_kfree(aw_dev->dev, aw_bin); in aw_dev_prof_parse_multi_bin()
436 struct aw_bin *aw_bin; in aw_dev_parse_reg_bin_with_hdr() local
439 aw_bin = devm_kzalloc(aw_dev->dev, data_len + sizeof(*aw_bin), GFP_KERNEL); in aw_dev_parse_reg_bin_with_hdr()
440 if (!aw_bin) in aw_dev_parse_reg_bin_with_hdr()
443 aw_bin->info.len = data_len; in aw_dev_parse_reg_bin_with_hdr()
444 memcpy(aw_bin->info.data, data, data_len); in aw_dev_parse_reg_bin_with_hdr()
446 ret = aw_parsing_bin_file(aw_dev, aw_bin); in aw_dev_parse_reg_bin_with_hdr()
452 if ((aw_bin->all_bin_parse_num != 1) || in aw_dev_parse_reg_bin_with_hdr()
453 (aw_bin->header_info[0].bin_data_type != DATA_TYPE_REGISTER)) { in aw_dev_parse_reg_bin_with_hdr()
459 if (aw_bin->header_info[0].valid_data_len % 4) { in aw_dev_parse_reg_bin_with_hdr()
466 data + aw_bin->header_info[0].valid_data_addr; in aw_dev_parse_reg_bin_with_hdr()
468 aw_bin->header_info[0].valid_data_len; in aw_dev_parse_reg_bin_with_hdr()
471 devm_kfree(aw_dev->dev, aw_bin); in aw_dev_parse_reg_bin_with_hdr()
472 aw_bin = NULL; in aw_dev_parse_reg_bin_with_hdr()
477 devm_kfree(aw_dev->dev, aw_bin); in aw_dev_parse_reg_bin_with_hdr()
478 aw_bin = NULL; in aw_dev_parse_reg_bin_with_hdr()