Lines Matching refs:offset

78 	unsigned char offset;  member
275 int offset = 0; in tasdevice_rca_parser() local
290 fw_hdr->img_sz = get_unaligned_be32(&buf[offset]); in tasdevice_rca_parser()
291 offset += 4; in tasdevice_rca_parser()
301 fw_hdr->checksum = get_unaligned_be32(&buf[offset]); in tasdevice_rca_parser()
302 offset += 4; in tasdevice_rca_parser()
303 fw_hdr->binary_version_num = get_unaligned_be32(&buf[offset]); in tasdevice_rca_parser()
311 offset += 4; in tasdevice_rca_parser()
312 fw_hdr->drv_fw_version = get_unaligned_be32(&buf[offset]); in tasdevice_rca_parser()
313 offset += 8; in tasdevice_rca_parser()
314 fw_hdr->plat_type = buf[offset]; in tasdevice_rca_parser()
315 offset += 1; in tasdevice_rca_parser()
316 fw_hdr->dev_family = buf[offset]; in tasdevice_rca_parser()
317 offset += 1; in tasdevice_rca_parser()
318 fw_hdr->reserve = buf[offset]; in tasdevice_rca_parser()
319 offset += 1; in tasdevice_rca_parser()
320 fw_hdr->ndev = buf[offset]; in tasdevice_rca_parser()
321 offset += 1; in tasdevice_rca_parser()
330 if (offset + TASDEVICE_DEVICE_SUM > fw_hdr->img_sz) { in tasdevice_rca_parser()
337 for (i = 0; i < TASDEVICE_DEVICE_SUM; i++, offset++) in tasdevice_rca_parser()
338 fw_hdr->devs[i] = buf[offset]; in tasdevice_rca_parser()
340 fw_hdr->nconfig = get_unaligned_be32(&buf[offset]); in tasdevice_rca_parser()
341 offset += 4; in tasdevice_rca_parser()
344 fw_hdr->config_size[i] = get_unaligned_be32(&buf[offset]); in tasdevice_rca_parser()
345 offset += 4; in tasdevice_rca_parser()
349 if (fw_hdr->img_sz - total_config_sz != (unsigned int)offset) { in tasdevice_rca_parser()
366 cfg_info[i] = tasdevice_add_config(tas_priv, &buf[offset], in tasdevice_rca_parser()
372 offset += (int)fw_hdr->config_size[i]; in tasdevice_rca_parser()
411 struct tasdev_blk *block, const struct firmware *fmw, int offset) in fw_parse_block_data_kernel() argument
415 if (offset + 16 > fmw->size) { in fw_parse_block_data_kernel()
417 offset = -EINVAL; in fw_parse_block_data_kernel()
424 block->type = get_unaligned_be32(&data[offset]); in fw_parse_block_data_kernel()
425 offset += 4; in fw_parse_block_data_kernel()
427 block->is_pchksum_present = data[offset]; in fw_parse_block_data_kernel()
428 offset++; in fw_parse_block_data_kernel()
430 block->pchksum = data[offset]; in fw_parse_block_data_kernel()
431 offset++; in fw_parse_block_data_kernel()
433 block->is_ychksum_present = data[offset]; in fw_parse_block_data_kernel()
434 offset++; in fw_parse_block_data_kernel()
436 block->ychksum = data[offset]; in fw_parse_block_data_kernel()
437 offset++; in fw_parse_block_data_kernel()
439 block->blk_size = get_unaligned_be32(&data[offset]); in fw_parse_block_data_kernel()
440 offset += 4; in fw_parse_block_data_kernel()
442 block->nr_subblocks = get_unaligned_be32(&data[offset]); in fw_parse_block_data_kernel()
443 offset += 4; in fw_parse_block_data_kernel()
453 if (offset + block->blk_size > fmw->size) { in fw_parse_block_data_kernel()
455 offset = -EINVAL; in fw_parse_block_data_kernel()
459 block->data = kmemdup(&data[offset], block->blk_size, GFP_KERNEL); in fw_parse_block_data_kernel()
461 offset = -ENOMEM; in fw_parse_block_data_kernel()
464 offset += block->blk_size; in fw_parse_block_data_kernel()
467 return offset; in fw_parse_block_data_kernel()
472 int offset) in fw_parse_data_kernel() argument
478 if (offset + 4 > fmw->size) { in fw_parse_data_kernel()
480 offset = -EINVAL; in fw_parse_data_kernel()
483 img_data->nr_blk = get_unaligned_be32(&data[offset]); in fw_parse_data_kernel()
484 offset += 4; in fw_parse_data_kernel()
489 offset = -ENOMEM; in fw_parse_data_kernel()
495 offset = fw_parse_block_data_kernel(tas_fmw, blk, fmw, offset); in fw_parse_data_kernel()
496 if (offset < 0) { in fw_parse_data_kernel()
497 offset = -EINVAL; in fw_parse_data_kernel()
503 return offset; in fw_parse_data_kernel()
508 const struct firmware *fmw, int offset) in fw_parse_program_data_kernel() argument
515 if (offset + 72 > fmw->size) { in fw_parse_program_data_kernel()
517 offset = -EINVAL; in fw_parse_program_data_kernel()
521 offset += 72; in fw_parse_program_data_kernel()
523 offset = fw_parse_data_kernel(tas_fmw, &(program->dev_data), in fw_parse_program_data_kernel()
524 fmw, offset); in fw_parse_program_data_kernel()
525 if (offset < 0) in fw_parse_program_data_kernel()
530 return offset; in fw_parse_program_data_kernel()
535 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_configuration_data_kernel() argument
543 if (offset + 80 > fmw->size) { in fw_parse_configuration_data_kernel()
545 offset = -EINVAL; in fw_parse_configuration_data_kernel()
548 memcpy(config->name, &data[offset], 64); in fw_parse_configuration_data_kernel()
550 offset += 80; in fw_parse_configuration_data_kernel()
552 offset = fw_parse_data_kernel(tas_fmw, &(config->dev_data), in fw_parse_configuration_data_kernel()
553 fmw, offset); in fw_parse_configuration_data_kernel()
554 if (offset < 0) in fw_parse_configuration_data_kernel()
559 return offset; in fw_parse_configuration_data_kernel()
564 int offset) in fw_parse_variable_header_kernel() argument
574 if (offset + 12 + 4 * TASDEVICE_MAXPROGRAM_NUM_KERNEL > fmw->size) { in fw_parse_variable_header_kernel()
576 offset = -EINVAL; in fw_parse_variable_header_kernel()
579 fw_hdr->device_family = get_unaligned_be16(&buf[offset]); in fw_parse_variable_header_kernel()
582 offset = -EINVAL; in fw_parse_variable_header_kernel()
585 offset += 2; in fw_parse_variable_header_kernel()
586 fw_hdr->device = get_unaligned_be16(&buf[offset]); in fw_parse_variable_header_kernel()
590 offset = -EINVAL; in fw_parse_variable_header_kernel()
593 offset += 2; in fw_parse_variable_header_kernel()
600 offset = -EINVAL; in fw_parse_variable_header_kernel()
604 tas_fmw->nr_programs = get_unaligned_be32(&buf[offset]); in fw_parse_variable_header_kernel()
605 offset += 4; in fw_parse_variable_header_kernel()
610 offset = -EINVAL; in fw_parse_variable_header_kernel()
617 offset = -ENOMEM; in fw_parse_variable_header_kernel()
623 program->prog_size = get_unaligned_be32(&buf[offset]); in fw_parse_variable_header_kernel()
624 offset += 4; in fw_parse_variable_header_kernel()
628 offset += 4 * (TASDEVICE_MAXPROGRAM_NUM_KERNEL - tas_fmw->nr_programs); in fw_parse_variable_header_kernel()
630 tas_fmw->nr_configurations = get_unaligned_be32(&buf[offset]); in fw_parse_variable_header_kernel()
631 offset += 4; in fw_parse_variable_header_kernel()
643 offset = -EINVAL; in fw_parse_variable_header_kernel()
647 if (offset + 4 * max_confs > fmw->size) { in fw_parse_variable_header_kernel()
649 offset = -EINVAL; in fw_parse_variable_header_kernel()
656 offset = -ENOMEM; in fw_parse_variable_header_kernel()
662 config->cfg_size = get_unaligned_be32(&buf[offset]); in fw_parse_variable_header_kernel()
663 offset += 4; in fw_parse_variable_header_kernel()
667 offset += 4 * (max_confs - tas_fmw->nr_programs); in fw_parse_variable_header_kernel()
670 return offset; in fw_parse_variable_header_kernel()
896 const struct firmware *fmw, int offset) in fw_parse_variable_hdr() argument
899 int len = strlen((char *)&buf[offset]); in fw_parse_variable_hdr()
903 if (offset + len + 8 > fmw->size) { in fw_parse_variable_hdr()
905 offset = -EINVAL; in fw_parse_variable_hdr()
909 offset += len; in fw_parse_variable_hdr()
911 fw_hdr->device_family = get_unaligned_be32(&buf[offset]); in fw_parse_variable_hdr()
914 offset = -EINVAL; in fw_parse_variable_hdr()
917 offset += 4; in fw_parse_variable_hdr()
919 fw_hdr->device = get_unaligned_be32(&buf[offset]); in fw_parse_variable_hdr()
923 offset = -EINVAL; in fw_parse_variable_hdr()
926 offset += 4; in fw_parse_variable_hdr()
930 return offset; in fw_parse_variable_hdr()
934 *tas_priv, const struct firmware *fmw, int offset) in fw_parse_variable_header_git() argument
939 offset = fw_parse_variable_hdr(tas_priv, fw_hdr, fmw, offset); in fw_parse_variable_header_git()
940 if (offset < 0) in fw_parse_variable_header_git()
946 offset = -EINVAL; in fw_parse_variable_header_git()
950 return offset; in fw_parse_variable_header_git()
954 struct tasdev_blk *block, const struct firmware *fmw, int offset) in fw_parse_block_data() argument
959 if (offset + 8 > fmw->size) { in fw_parse_block_data()
961 offset = -EINVAL; in fw_parse_block_data()
964 block->type = get_unaligned_be32(&data[offset]); in fw_parse_block_data()
965 offset += 4; in fw_parse_block_data()
968 if (offset + 8 > fmw->size) { in fw_parse_block_data()
970 offset = -EINVAL; in fw_parse_block_data()
973 block->is_pchksum_present = data[offset]; in fw_parse_block_data()
974 offset++; in fw_parse_block_data()
976 block->pchksum = data[offset]; in fw_parse_block_data()
977 offset++; in fw_parse_block_data()
979 block->is_ychksum_present = data[offset]; in fw_parse_block_data()
980 offset++; in fw_parse_block_data()
982 block->ychksum = data[offset]; in fw_parse_block_data()
983 offset++; in fw_parse_block_data()
989 block->nr_cmds = get_unaligned_be32(&data[offset]); in fw_parse_block_data()
990 offset += 4; in fw_parse_block_data()
993 if (offset + n > fmw->size) { in fw_parse_block_data()
996 __func__, (unsigned long)fmw->size, offset, n); in fw_parse_block_data()
997 offset = -EINVAL; in fw_parse_block_data()
1001 block->data = kmemdup(&data[offset], n, GFP_KERNEL); in fw_parse_block_data()
1003 offset = -ENOMEM; in fw_parse_block_data()
1006 offset += n; in fw_parse_block_data()
1009 return offset; in fw_parse_block_data()
1017 int offset) in fw_parse_data() argument
1024 if (offset + 64 > fmw->size) { in fw_parse_data()
1026 offset = -EINVAL; in fw_parse_data()
1029 memcpy(img_data->name, &data[offset], 64); in fw_parse_data()
1030 offset += 64; in fw_parse_data()
1032 n = strlen((char *)&data[offset]); in fw_parse_data()
1034 if (offset + n + 2 > fmw->size) { in fw_parse_data()
1036 offset = -EINVAL; in fw_parse_data()
1039 offset += n; in fw_parse_data()
1040 img_data->nr_blk = get_unaligned_be16(&data[offset]); in fw_parse_data()
1041 offset += 2; in fw_parse_data()
1046 offset = -ENOMEM; in fw_parse_data()
1051 offset = fw_parse_block_data(tas_fmw, blk, fmw, offset); in fw_parse_data()
1052 if (offset < 0) { in fw_parse_data()
1053 offset = -EINVAL; in fw_parse_data()
1059 return offset; in fw_parse_data()
1066 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_program_data() argument
1072 if (offset + 2 > fmw->size) { in fw_parse_program_data()
1074 offset = -EINVAL; in fw_parse_program_data()
1077 tas_fmw->nr_programs = get_unaligned_be16(&buf[offset]); in fw_parse_program_data()
1078 offset += 2; in fw_parse_program_data()
1091 offset = -ENOMEM; in fw_parse_program_data()
1098 if (offset + 64 > fmw->size) { in fw_parse_program_data()
1100 offset = -EINVAL; in fw_parse_program_data()
1103 offset += 64; in fw_parse_program_data()
1105 n = strlen((char *)&buf[offset]); in fw_parse_program_data()
1108 if (offset + n > fmw->size) { in fw_parse_program_data()
1110 offset = -EINVAL; in fw_parse_program_data()
1114 offset += n; in fw_parse_program_data()
1116 offset = fw_parse_data(tas_fmw, &(program->dev_data), fmw, in fw_parse_program_data()
1117 offset); in fw_parse_program_data()
1118 if (offset < 0) in fw_parse_program_data()
1123 return offset; in fw_parse_program_data()
1132 const struct firmware *fmw, int offset) in fw_parse_configuration_data() argument
1139 if (offset + 2 > fmw->size) { in fw_parse_configuration_data()
1141 offset = -EINVAL; in fw_parse_configuration_data()
1144 tas_fmw->nr_configurations = get_unaligned_be16(&data[offset]); in fw_parse_configuration_data()
1145 offset += 2; in fw_parse_configuration_data()
1155 offset = -ENOMEM; in fw_parse_configuration_data()
1160 if (offset + 64 > fmw->size) { in fw_parse_configuration_data()
1162 offset = -EINVAL; in fw_parse_configuration_data()
1165 memcpy(config->name, &data[offset], 64); in fw_parse_configuration_data()
1166 offset += 64; in fw_parse_configuration_data()
1168 n = strlen((char *)&data[offset]); in fw_parse_configuration_data()
1170 if (offset + n > fmw->size) { in fw_parse_configuration_data()
1172 offset = -EINVAL; in fw_parse_configuration_data()
1176 offset += n; in fw_parse_configuration_data()
1178 offset = fw_parse_data(tas_fmw, &(config->dev_data), in fw_parse_configuration_data()
1179 fmw, offset); in fw_parse_configuration_data()
1180 if (offset < 0) in fw_parse_configuration_data()
1185 return offset; in fw_parse_configuration_data()
1200 cd->offset = reg; in check_inpage_yram_rg()
1204 cd->offset = TAS2781_YRAM5_START_REG; in check_inpage_yram_rg()
1220 cd->offset = reg; in check_inpage_yram_bk1()
1224 cd->offset = TAS2781_YRAM1_START_REG; in check_inpage_yram_bk1()
1265 cd->offset = reg; in check_inblock_yram_bk()
1270 cd->offset = TAS2781_YRAM2_START_REG; in check_inblock_yram_bk()
1346 TASDEVICE_REG(book, page, crc_data.offset), in tasdev_multibytes_chksum()
1355 && ((i + crc_data.offset) in tasdev_multibytes_chksum()
1357 && ((i + crc_data.offset) in tasdev_multibytes_chksum()
1534 unsigned char offset; in tasdev_load_blk() local
1558 offset = data[2]; in tasdev_load_blk()
1563 if (offset <= 0x7F) { in tasdev_load_blk()
1565 TASDEVICE_REG(book, page, offset), in tasdev_load_blk()
1571 block, chn, book, page, offset, in tasdev_load_blk()
1579 if (offset == 0x81) { in tasdev_load_blk()
1586 if (offset == 0x85) { in tasdev_load_blk()
1591 offset = data[2]; in tasdev_load_blk()
1593 block, chn, book, page, offset, data, in tasdev_load_blk()
1754 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_header() argument
1761 if (offset + 92 > fmw->size) { in fw_parse_header()
1763 offset = -EINVAL; in fw_parse_header()
1766 if (memcmp(&buf[offset], magic_number, 4)) { in fw_parse_header()
1768 offset = -EINVAL; in fw_parse_header()
1771 offset += 4; in fw_parse_header()
1776 fw_fixed_hdr->fwsize = get_unaligned_be32(&buf[offset]); in fw_parse_header()
1777 offset += 4; in fw_parse_header()
1781 offset = -EINVAL; in fw_parse_header()
1784 offset += 4; in fw_parse_header()
1785 fw_fixed_hdr->ppcver = get_unaligned_be32(&buf[offset]); in fw_parse_header()
1786 offset += 8; in fw_parse_header()
1787 fw_fixed_hdr->drv_ver = get_unaligned_be32(&buf[offset]); in fw_parse_header()
1788 offset += 72; in fw_parse_header()
1791 return offset; in fw_parse_header()
1795 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_variable_hdr_cal() argument
1799 offset = fw_parse_variable_hdr(tas_priv, fw_hdr, fmw, offset); in fw_parse_variable_hdr_cal()
1800 if (offset < 0) in fw_parse_variable_hdr_cal()
1806 offset = -EINVAL; in fw_parse_variable_hdr_cal()
1810 return offset; in fw_parse_variable_hdr_cal()
1818 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_calibration_data() argument
1824 if (offset + 2 > fmw->size) { in fw_parse_calibration_data()
1826 offset = -EINVAL; in fw_parse_calibration_data()
1829 tas_fmw->nr_calibrations = get_unaligned_be16(&data[offset]); in fw_parse_calibration_data()
1830 offset += 2; in fw_parse_calibration_data()
1842 offset = -ENOMEM; in fw_parse_calibration_data()
1846 if (offset + 64 > fmw->size) { in fw_parse_calibration_data()
1848 offset = -EINVAL; in fw_parse_calibration_data()
1852 offset += 64; in fw_parse_calibration_data()
1854 n = strlen((char *)&data[offset]); in fw_parse_calibration_data()
1857 if (offset + n > fmw->size) { in fw_parse_calibration_data()
1859 offset = -EINVAL; in fw_parse_calibration_data()
1862 offset += n; in fw_parse_calibration_data()
1864 offset = fw_parse_data(tas_fmw, &(calibration->dev_data), fmw, in fw_parse_calibration_data()
1865 offset); in fw_parse_calibration_data()
1866 if (offset < 0) in fw_parse_calibration_data()
1871 return offset; in fw_parse_calibration_data()
1882 int offset = 0; in tas2781_load_calibration() local
1908 offset = fw_parse_header(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1909 if (offset == -EINVAL) { in tas2781_load_calibration()
1911 ret = offset; in tas2781_load_calibration()
1914 offset = fw_parse_variable_hdr_cal(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1915 if (offset == -EINVAL) { in tas2781_load_calibration()
1918 ret = offset; in tas2781_load_calibration()
1921 offset = fw_parse_program_data(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1922 if (offset < 0) { in tas2781_load_calibration()
1924 ret = offset; in tas2781_load_calibration()
1927 offset = fw_parse_configuration_data(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1928 if (offset < 0) { in tas2781_load_calibration()
1930 ret = offset; in tas2781_load_calibration()
1933 offset = fw_parse_calibration_data(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1934 if (offset < 0) { in tas2781_load_calibration()
1936 ret = offset; in tas2781_load_calibration()
1954 int offset = 0; in tasdevice_dspfw_ready() local
1971 offset = fw_parse_header(tas_priv, tas_fmw, fmw, offset); in tasdevice_dspfw_ready()
1973 if (offset == -EINVAL) { in tasdevice_dspfw_ready()
2013 offset = tas_priv->fw_parse_variable_header(tas_priv, fmw, offset); in tasdevice_dspfw_ready()
2014 if (offset < 0) { in tasdevice_dspfw_ready()
2015 ret = offset; in tasdevice_dspfw_ready()
2018 offset = tas_priv->fw_parse_program_data(tas_priv, tas_fmw, fmw, in tasdevice_dspfw_ready()
2019 offset); in tasdevice_dspfw_ready()
2020 if (offset < 0) { in tasdevice_dspfw_ready()
2021 ret = offset; in tasdevice_dspfw_ready()
2024 offset = tas_priv->fw_parse_configuration_data(tas_priv, in tasdevice_dspfw_ready()
2025 tas_fmw, fmw, offset); in tasdevice_dspfw_ready()
2026 if (offset < 0) in tasdevice_dspfw_ready()
2027 ret = offset; in tasdevice_dspfw_ready()