• Home
  • Raw
  • Download

Lines Matching refs:tplg

24 static ssize_t twrite(snd_tplg_t *tplg, void *data, size_t data_size)  in twrite()  argument
26 if (tplg->bin_pos + data_size > tplg->bin_size) in twrite()
28 memcpy(tplg->bin + tplg->bin_pos, data, data_size); in twrite()
29 tplg->bin_pos += data_size; in twrite()
34 static ssize_t write_block_header(snd_tplg_t *tplg, unsigned int type, in write_block_header() argument
53 if (tplg->bin_pos != tplg->next_hdr_pos) { in write_block_header()
56 tplg->next_hdr_pos, tplg->bin_pos, in write_block_header()
57 tplg->bin_pos > tplg->next_hdr_pos ? "ahead" : "behind", in write_block_header()
58 tplg->bin_pos - tplg->next_hdr_pos); in write_block_header()
62 tplg_log(tplg, 'B', tplg->bin_pos, in write_block_header()
68 tplg->next_hdr_pos += hdr.payload_size + sizeof(hdr); in write_block_header()
70 return twrite(tplg, &hdr, sizeof(hdr)); in write_block_header()
73 static int write_elem_block(snd_tplg_t *tplg, in write_elem_block() argument
96 ret = write_block_header(tplg, tplg_type, elem->vendor_type, in write_elem_block()
97 tplg->version, elem->index, block_size, count); in write_elem_block()
112 tplg_log(tplg, 'B', tplg->bin_pos, in write_elem_block()
116 tplg_log(tplg, 'B', tplg->bin_pos, in write_elem_block()
122 wsize = twrite(tplg, elem->obj, elem->size); in write_elem_block()
149 static size_t calc_manifest_size(snd_tplg_t *tplg) in calc_manifest_size() argument
152 sizeof(tplg->manifest) + in calc_manifest_size()
153 tplg->manifest.priv.size; in calc_manifest_size()
205 static ssize_t write_manifest_data(snd_tplg_t *tplg) in write_manifest_data() argument
210 ret = write_block_header(tplg, SND_SOC_TPLG_TYPE_MANIFEST, 0, in write_manifest_data()
211 tplg->version, 0, in write_manifest_data()
212 sizeof(tplg->manifest) + tplg->manifest.priv.size, 1); in write_manifest_data()
218 tplg_log(tplg, 'B', tplg->bin_pos, "manifest: write %d bytes", in write_manifest_data()
219 sizeof(tplg->manifest)); in write_manifest_data()
220 ret = twrite(tplg, &tplg->manifest, sizeof(tplg->manifest)); in write_manifest_data()
222 tplg_log(tplg, 'B', tplg->bin_pos, in write_manifest_data()
224 tplg->manifest.priv.size); in write_manifest_data()
225 ret = twrite(tplg, tplg->manifest_pdata, tplg->manifest.priv.size); in write_manifest_data()
230 int tplg_write_data(snd_tplg_t *tplg) in tplg_write_data() argument
239 total_size = calc_manifest_size(tplg); in tplg_write_data()
244 list = (struct list_head *)((void *)tplg + tptr->loff); in tplg_write_data()
250 free(tplg->bin); in tplg_write_data()
251 tplg->bin = malloc(total_size); in tplg_write_data()
252 tplg->bin_pos = 0; in tplg_write_data()
253 tplg->bin_size = total_size; in tplg_write_data()
254 if (tplg->bin == NULL) { in tplg_write_data()
255 tplg->bin_size = 0; in tplg_write_data()
260 ret = write_manifest_data(tplg); in tplg_write_data()
271 list = (struct list_head *)((void *)tplg + tptr->loff); in tplg_write_data()
276 tplg_log(tplg, 'B', tplg->bin_pos, in tplg_write_data()
280 ret = write_elem_block(tplg, list, size, in tplg_write_data()
289 tplg_log(tplg, 'B', tplg->bin_pos, "total size is 0x%zx/%zd", in tplg_write_data()
290 tplg->bin_pos, tplg->bin_pos); in tplg_write_data()
292 if (total_size != tplg->bin_pos) { in tplg_write_data()
294 total_size, tplg->bin_pos); in tplg_write_data()