Lines Matching refs:offset
79 unsigned char offset; member
215 int offset = 0; in tasdevice_rca_parser() local
230 fw_hdr->img_sz = be32_to_cpup((__be32 *)&buf[offset]); in tasdevice_rca_parser()
231 offset += 4; in tasdevice_rca_parser()
241 fw_hdr->checksum = be32_to_cpup((__be32 *)&buf[offset]); in tasdevice_rca_parser()
242 offset += 4; in tasdevice_rca_parser()
243 fw_hdr->binary_version_num = be32_to_cpup((__be32 *)&buf[offset]); in tasdevice_rca_parser()
251 offset += 4; in tasdevice_rca_parser()
252 fw_hdr->drv_fw_version = be32_to_cpup((__be32 *)&buf[offset]); in tasdevice_rca_parser()
253 offset += 8; in tasdevice_rca_parser()
254 fw_hdr->plat_type = buf[offset]; in tasdevice_rca_parser()
255 offset += 1; in tasdevice_rca_parser()
256 fw_hdr->dev_family = buf[offset]; in tasdevice_rca_parser()
257 offset += 1; in tasdevice_rca_parser()
258 fw_hdr->reserve = buf[offset]; in tasdevice_rca_parser()
259 offset += 1; in tasdevice_rca_parser()
260 fw_hdr->ndev = buf[offset]; in tasdevice_rca_parser()
261 offset += 1; in tasdevice_rca_parser()
270 if (offset + TASDEVICE_DEVICE_SUM > fw_hdr->img_sz) { in tasdevice_rca_parser()
277 for (i = 0; i < TASDEVICE_DEVICE_SUM; i++, offset++) in tasdevice_rca_parser()
278 fw_hdr->devs[i] = buf[offset]; in tasdevice_rca_parser()
280 fw_hdr->nconfig = be32_to_cpup((__be32 *)&buf[offset]); in tasdevice_rca_parser()
281 offset += 4; in tasdevice_rca_parser()
284 fw_hdr->config_size[i] = be32_to_cpup((__be32 *)&buf[offset]); in tasdevice_rca_parser()
285 offset += 4; in tasdevice_rca_parser()
289 if (fw_hdr->img_sz - total_config_sz != (unsigned int)offset) { in tasdevice_rca_parser()
306 cfg_info[i] = tasdevice_add_config(tas_priv, &buf[offset], in tasdevice_rca_parser()
312 offset += (int)fw_hdr->config_size[i]; in tasdevice_rca_parser()
320 struct tasdev_blk *block, const struct firmware *fmw, int offset) in fw_parse_block_data_kernel() argument
324 if (offset + 16 > fmw->size) { in fw_parse_block_data_kernel()
326 offset = -EINVAL; in fw_parse_block_data_kernel()
333 block->type = be32_to_cpup((__be32 *)&data[offset]); in fw_parse_block_data_kernel()
334 offset += 4; in fw_parse_block_data_kernel()
336 block->is_pchksum_present = data[offset]; in fw_parse_block_data_kernel()
337 offset++; in fw_parse_block_data_kernel()
339 block->pchksum = data[offset]; in fw_parse_block_data_kernel()
340 offset++; in fw_parse_block_data_kernel()
342 block->is_ychksum_present = data[offset]; in fw_parse_block_data_kernel()
343 offset++; in fw_parse_block_data_kernel()
345 block->ychksum = data[offset]; in fw_parse_block_data_kernel()
346 offset++; in fw_parse_block_data_kernel()
348 block->blk_size = be32_to_cpup((__be32 *)&data[offset]); in fw_parse_block_data_kernel()
349 offset += 4; in fw_parse_block_data_kernel()
351 block->nr_subblocks = be32_to_cpup((__be32 *)&data[offset]); in fw_parse_block_data_kernel()
352 offset += 4; in fw_parse_block_data_kernel()
354 if (offset + block->blk_size > fmw->size) { in fw_parse_block_data_kernel()
356 offset = -EINVAL; in fw_parse_block_data_kernel()
360 block->data = kmemdup(&data[offset], block->blk_size, GFP_KERNEL); in fw_parse_block_data_kernel()
362 offset = -ENOMEM; in fw_parse_block_data_kernel()
365 offset += block->blk_size; in fw_parse_block_data_kernel()
368 return offset; in fw_parse_block_data_kernel()
373 int offset) in fw_parse_data_kernel() argument
379 if (offset + 4 > fmw->size) { in fw_parse_data_kernel()
381 offset = -EINVAL; in fw_parse_data_kernel()
384 img_data->nr_blk = be32_to_cpup((__be32 *)&data[offset]); in fw_parse_data_kernel()
385 offset += 4; in fw_parse_data_kernel()
390 offset = -ENOMEM; in fw_parse_data_kernel()
396 offset = fw_parse_block_data_kernel(tas_fmw, blk, fmw, offset); in fw_parse_data_kernel()
397 if (offset < 0) { in fw_parse_data_kernel()
398 offset = -EINVAL; in fw_parse_data_kernel()
404 return offset; in fw_parse_data_kernel()
409 const struct firmware *fmw, int offset) in fw_parse_program_data_kernel() argument
416 if (offset + 72 > fmw->size) { in fw_parse_program_data_kernel()
418 offset = -EINVAL; in fw_parse_program_data_kernel()
422 offset += 72; in fw_parse_program_data_kernel()
424 offset = fw_parse_data_kernel(tas_fmw, &(program->dev_data), in fw_parse_program_data_kernel()
425 fmw, offset); in fw_parse_program_data_kernel()
426 if (offset < 0) in fw_parse_program_data_kernel()
431 return offset; in fw_parse_program_data_kernel()
436 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_configuration_data_kernel() argument
444 if (offset + 80 > fmw->size) { in fw_parse_configuration_data_kernel()
446 offset = -EINVAL; in fw_parse_configuration_data_kernel()
449 memcpy(config->name, &data[offset], 64); in fw_parse_configuration_data_kernel()
451 offset += 80; in fw_parse_configuration_data_kernel()
453 offset = fw_parse_data_kernel(tas_fmw, &(config->dev_data), in fw_parse_configuration_data_kernel()
454 fmw, offset); in fw_parse_configuration_data_kernel()
455 if (offset < 0) in fw_parse_configuration_data_kernel()
460 return offset; in fw_parse_configuration_data_kernel()
465 int offset) in fw_parse_variable_header_kernel() argument
475 if (offset + 12 + 4 * TASDEVICE_MAXPROGRAM_NUM_KERNEL > fmw->size) { in fw_parse_variable_header_kernel()
477 offset = -EINVAL; in fw_parse_variable_header_kernel()
480 fw_hdr->device_family = be16_to_cpup((__be16 *)&buf[offset]); in fw_parse_variable_header_kernel()
483 offset = -EINVAL; in fw_parse_variable_header_kernel()
486 offset += 2; in fw_parse_variable_header_kernel()
487 fw_hdr->device = be16_to_cpup((__be16 *)&buf[offset]); in fw_parse_variable_header_kernel()
491 offset = -EINVAL; in fw_parse_variable_header_kernel()
494 offset += 2; in fw_parse_variable_header_kernel()
501 offset = -EINVAL; in fw_parse_variable_header_kernel()
505 tas_fmw->nr_programs = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_variable_header_kernel()
506 offset += 4; in fw_parse_variable_header_kernel()
511 offset = -EINVAL; in fw_parse_variable_header_kernel()
518 offset = -ENOMEM; in fw_parse_variable_header_kernel()
524 program->prog_size = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_variable_header_kernel()
525 offset += 4; in fw_parse_variable_header_kernel()
529 offset += 4 * (TASDEVICE_MAXPROGRAM_NUM_KERNEL - tas_fmw->nr_programs); in fw_parse_variable_header_kernel()
531 tas_fmw->nr_configurations = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_variable_header_kernel()
532 offset += 4; in fw_parse_variable_header_kernel()
544 offset = -EINVAL; in fw_parse_variable_header_kernel()
548 if (offset + 4 * max_confs > fmw->size) { in fw_parse_variable_header_kernel()
550 offset = -EINVAL; in fw_parse_variable_header_kernel()
557 offset = -ENOMEM; in fw_parse_variable_header_kernel()
563 config->cfg_size = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_variable_header_kernel()
564 offset += 4; in fw_parse_variable_header_kernel()
568 offset += 4 * (max_confs - tas_fmw->nr_programs); in fw_parse_variable_header_kernel()
571 return offset; in fw_parse_variable_header_kernel()
928 const struct firmware *fmw, int offset) in fw_parse_variable_hdr() argument
931 int len = strlen((char *)&buf[offset]); in fw_parse_variable_hdr()
935 if (offset + len + 8 > fmw->size) { in fw_parse_variable_hdr()
937 offset = -EINVAL; in fw_parse_variable_hdr()
941 offset += len; in fw_parse_variable_hdr()
943 fw_hdr->device_family = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_variable_hdr()
946 offset = -EINVAL; in fw_parse_variable_hdr()
949 offset += 4; in fw_parse_variable_hdr()
951 fw_hdr->device = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_variable_hdr()
955 offset = -EINVAL; in fw_parse_variable_hdr()
958 offset += 4; in fw_parse_variable_hdr()
962 return offset; in fw_parse_variable_hdr()
966 *tas_priv, const struct firmware *fmw, int offset) in fw_parse_variable_header_git() argument
971 offset = fw_parse_variable_hdr(tas_priv, fw_hdr, fmw, offset); in fw_parse_variable_header_git()
972 if (offset < 0) in fw_parse_variable_header_git()
978 offset = -EINVAL; in fw_parse_variable_header_git()
982 return offset; in fw_parse_variable_header_git()
986 struct tasdev_blk *block, const struct firmware *fmw, int offset) in fw_parse_block_data() argument
991 if (offset + 8 > fmw->size) { in fw_parse_block_data()
993 offset = -EINVAL; in fw_parse_block_data()
996 block->type = be32_to_cpup((__be32 *)&data[offset]); in fw_parse_block_data()
997 offset += 4; in fw_parse_block_data()
1000 if (offset + 8 > fmw->size) { in fw_parse_block_data()
1002 offset = -EINVAL; in fw_parse_block_data()
1005 block->is_pchksum_present = data[offset]; in fw_parse_block_data()
1006 offset++; in fw_parse_block_data()
1008 block->pchksum = data[offset]; in fw_parse_block_data()
1009 offset++; in fw_parse_block_data()
1011 block->is_ychksum_present = data[offset]; in fw_parse_block_data()
1012 offset++; in fw_parse_block_data()
1014 block->ychksum = data[offset]; in fw_parse_block_data()
1015 offset++; in fw_parse_block_data()
1021 block->nr_cmds = be32_to_cpup((__be32 *)&data[offset]); in fw_parse_block_data()
1022 offset += 4; in fw_parse_block_data()
1025 if (offset + n > fmw->size) { in fw_parse_block_data()
1028 __func__, (unsigned long)fmw->size, offset, n); in fw_parse_block_data()
1029 offset = -EINVAL; in fw_parse_block_data()
1033 block->data = kmemdup(&data[offset], n, GFP_KERNEL); in fw_parse_block_data()
1035 offset = -ENOMEM; in fw_parse_block_data()
1038 offset += n; in fw_parse_block_data()
1041 return offset; in fw_parse_block_data()
1049 int offset) in fw_parse_data() argument
1056 if (offset + 64 > fmw->size) { in fw_parse_data()
1058 offset = -EINVAL; in fw_parse_data()
1061 memcpy(img_data->name, &data[offset], 64); in fw_parse_data()
1062 offset += 64; in fw_parse_data()
1064 n = strlen((char *)&data[offset]); in fw_parse_data()
1066 if (offset + n + 2 > fmw->size) { in fw_parse_data()
1068 offset = -EINVAL; in fw_parse_data()
1071 offset += n; in fw_parse_data()
1072 img_data->nr_blk = be16_to_cpup((__be16 *)&data[offset]); in fw_parse_data()
1073 offset += 2; in fw_parse_data()
1078 offset = -ENOMEM; in fw_parse_data()
1083 offset = fw_parse_block_data(tas_fmw, blk, fmw, offset); in fw_parse_data()
1084 if (offset < 0) { in fw_parse_data()
1085 offset = -EINVAL; in fw_parse_data()
1091 return offset; in fw_parse_data()
1098 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_program_data() argument
1104 if (offset + 2 > fmw->size) { in fw_parse_program_data()
1106 offset = -EINVAL; in fw_parse_program_data()
1109 tas_fmw->nr_programs = be16_to_cpup((__be16 *)&buf[offset]); in fw_parse_program_data()
1110 offset += 2; in fw_parse_program_data()
1123 offset = -ENOMEM; in fw_parse_program_data()
1130 if (offset + 64 > fmw->size) { in fw_parse_program_data()
1132 offset = -EINVAL; in fw_parse_program_data()
1135 offset += 64; in fw_parse_program_data()
1137 n = strlen((char *)&buf[offset]); in fw_parse_program_data()
1140 if (offset + n > fmw->size) { in fw_parse_program_data()
1142 offset = -EINVAL; in fw_parse_program_data()
1146 offset += n; in fw_parse_program_data()
1148 offset = fw_parse_data(tas_fmw, &(program->dev_data), fmw, in fw_parse_program_data()
1149 offset); in fw_parse_program_data()
1150 if (offset < 0) in fw_parse_program_data()
1155 return offset; in fw_parse_program_data()
1164 const struct firmware *fmw, int offset) in fw_parse_configuration_data() argument
1171 if (offset + 2 > fmw->size) { in fw_parse_configuration_data()
1173 offset = -EINVAL; in fw_parse_configuration_data()
1176 tas_fmw->nr_configurations = be16_to_cpup((__be16 *)&data[offset]); in fw_parse_configuration_data()
1177 offset += 2; in fw_parse_configuration_data()
1187 offset = -ENOMEM; in fw_parse_configuration_data()
1192 if (offset + 64 > fmw->size) { in fw_parse_configuration_data()
1194 offset = -EINVAL; in fw_parse_configuration_data()
1197 memcpy(config->name, &data[offset], 64); in fw_parse_configuration_data()
1198 offset += 64; in fw_parse_configuration_data()
1200 n = strlen((char *)&data[offset]); in fw_parse_configuration_data()
1202 if (offset + n > fmw->size) { in fw_parse_configuration_data()
1204 offset = -EINVAL; in fw_parse_configuration_data()
1208 offset += n; in fw_parse_configuration_data()
1210 offset = fw_parse_data(tas_fmw, &(config->dev_data), in fw_parse_configuration_data()
1211 fmw, offset); in fw_parse_configuration_data()
1212 if (offset < 0) in fw_parse_configuration_data()
1217 return offset; in fw_parse_configuration_data()
1232 cd->offset = reg; in check_inpage_yram_rg()
1236 cd->offset = TAS2781_YRAM5_START_REG; in check_inpage_yram_rg()
1252 cd->offset = reg; in check_inpage_yram_bk1()
1256 cd->offset = TAS2781_YRAM1_START_REG; in check_inpage_yram_bk1()
1297 cd->offset = reg; in check_inblock_yram_bk()
1302 cd->offset = TAS2781_YRAM2_START_REG; in check_inblock_yram_bk()
1378 TASDEVICE_REG(book, page, crc_data.offset), in tasdev_multibytes_chksum()
1387 && ((i + crc_data.offset) in tasdev_multibytes_chksum()
1389 && ((i + crc_data.offset) in tasdev_multibytes_chksum()
1566 unsigned char offset; in tasdev_load_blk() local
1590 offset = data[2]; in tasdev_load_blk()
1595 if (offset <= 0x7F) { in tasdev_load_blk()
1597 TASDEVICE_REG(book, page, offset), in tasdev_load_blk()
1603 block, chn, book, page, offset, in tasdev_load_blk()
1611 if (offset == 0x81) { in tasdev_load_blk()
1618 if (offset == 0x85) { in tasdev_load_blk()
1623 offset = data[2]; in tasdev_load_blk()
1625 block, chn, book, page, offset, data, in tasdev_load_blk()
1786 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_header() argument
1793 if (offset + 92 > fmw->size) { in fw_parse_header()
1795 offset = -EINVAL; in fw_parse_header()
1798 if (memcmp(&buf[offset], magic_number, 4)) { in fw_parse_header()
1800 offset = -EINVAL; in fw_parse_header()
1803 offset += 4; in fw_parse_header()
1808 fw_fixed_hdr->fwsize = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_header()
1809 offset += 4; in fw_parse_header()
1813 offset = -EINVAL; in fw_parse_header()
1816 offset += 4; in fw_parse_header()
1817 fw_fixed_hdr->ppcver = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_header()
1818 offset += 8; in fw_parse_header()
1819 fw_fixed_hdr->drv_ver = be32_to_cpup((__be32 *)&buf[offset]); in fw_parse_header()
1820 offset += 72; in fw_parse_header()
1823 return offset; in fw_parse_header()
1827 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_variable_hdr_cal() argument
1831 offset = fw_parse_variable_hdr(tas_priv, fw_hdr, fmw, offset); in fw_parse_variable_hdr_cal()
1832 if (offset < 0) in fw_parse_variable_hdr_cal()
1838 offset = -EINVAL; in fw_parse_variable_hdr_cal()
1842 return offset; in fw_parse_variable_hdr_cal()
1850 struct tasdevice_fw *tas_fmw, const struct firmware *fmw, int offset) in fw_parse_calibration_data() argument
1856 if (offset + 2 > fmw->size) { in fw_parse_calibration_data()
1858 offset = -EINVAL; in fw_parse_calibration_data()
1861 tas_fmw->nr_calibrations = be16_to_cpup((__be16 *)&data[offset]); in fw_parse_calibration_data()
1862 offset += 2; in fw_parse_calibration_data()
1874 offset = -ENOMEM; in fw_parse_calibration_data()
1878 if (offset + 64 > fmw->size) { in fw_parse_calibration_data()
1880 offset = -EINVAL; in fw_parse_calibration_data()
1884 offset += 64; in fw_parse_calibration_data()
1886 n = strlen((char *)&data[offset]); in fw_parse_calibration_data()
1889 if (offset + n > fmw->size) { in fw_parse_calibration_data()
1891 offset = -EINVAL; in fw_parse_calibration_data()
1894 offset += n; in fw_parse_calibration_data()
1896 offset = fw_parse_data(tas_fmw, &(calibration->dev_data), fmw, in fw_parse_calibration_data()
1897 offset); in fw_parse_calibration_data()
1898 if (offset < 0) in fw_parse_calibration_data()
1903 return offset; in fw_parse_calibration_data()
1914 int offset = 0; in tas2781_load_calibration() local
1940 offset = fw_parse_header(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1941 if (offset == -EINVAL) { in tas2781_load_calibration()
1943 ret = offset; in tas2781_load_calibration()
1946 offset = fw_parse_variable_hdr_cal(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1947 if (offset == -EINVAL) { in tas2781_load_calibration()
1950 ret = offset; in tas2781_load_calibration()
1953 offset = fw_parse_program_data(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1954 if (offset < 0) { in tas2781_load_calibration()
1956 ret = offset; in tas2781_load_calibration()
1959 offset = fw_parse_configuration_data(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1960 if (offset < 0) { in tas2781_load_calibration()
1962 ret = offset; in tas2781_load_calibration()
1965 offset = fw_parse_calibration_data(tas_priv, tas_fmw, &fmw, offset); in tas2781_load_calibration()
1966 if (offset < 0) { in tas2781_load_calibration()
1968 ret = offset; in tas2781_load_calibration()
1986 int offset = 0; in tasdevice_dspfw_ready() local
2003 offset = fw_parse_header(tas_priv, tas_fmw, fmw, offset); in tasdevice_dspfw_ready()
2005 if (offset == -EINVAL) { in tasdevice_dspfw_ready()
2044 offset = tas_priv->fw_parse_variable_header(tas_priv, fmw, offset); in tasdevice_dspfw_ready()
2045 if (offset < 0) { in tasdevice_dspfw_ready()
2046 ret = offset; in tasdevice_dspfw_ready()
2049 offset = tas_priv->fw_parse_program_data(tas_priv, tas_fmw, fmw, in tasdevice_dspfw_ready()
2050 offset); in tasdevice_dspfw_ready()
2051 if (offset < 0) { in tasdevice_dspfw_ready()
2052 ret = offset; in tasdevice_dspfw_ready()
2055 offset = tas_priv->fw_parse_configuration_data(tas_priv, in tasdevice_dspfw_ready()
2056 tas_fmw, fmw, offset); in tasdevice_dspfw_ready()
2057 if (offset < 0) in tasdevice_dspfw_ready()
2058 ret = offset; in tasdevice_dspfw_ready()