Lines Matching refs:sst_fw
328 struct sst_fw *sst_fw_new(struct sst_dsp *dsp, in sst_fw_new()
331 struct sst_fw *sst_fw; in sst_fw_new() local
337 sst_fw = kzalloc(sizeof(*sst_fw), GFP_KERNEL); in sst_fw_new()
338 if (sst_fw == NULL) in sst_fw_new()
341 sst_fw->dsp = dsp; in sst_fw_new()
342 sst_fw->private = private; in sst_fw_new()
343 sst_fw->size = fw->size; in sst_fw_new()
346 sst_fw->dma_buf = dma_alloc_coherent(dsp->dma_dev, sst_fw->size, in sst_fw_new()
347 &sst_fw->dmable_fw_paddr, GFP_DMA | GFP_KERNEL); in sst_fw_new()
348 if (!sst_fw->dma_buf) { in sst_fw_new()
350 kfree(sst_fw); in sst_fw_new()
355 memcpy((void *)sst_fw->dma_buf, (void *)fw->data, fw->size); in sst_fw_new()
364 err = dsp->ops->parse_fw(sst_fw); in sst_fw_new()
374 list_add(&sst_fw->list, &dsp->fw_list); in sst_fw_new()
377 return sst_fw; in sst_fw_new()
383 dma_free_coherent(dsp->dma_dev, sst_fw->size, in sst_fw_new()
384 sst_fw->dma_buf, in sst_fw_new()
385 sst_fw->dmable_fw_paddr); in sst_fw_new()
386 sst_fw->dma_buf = NULL; in sst_fw_new()
387 kfree(sst_fw); in sst_fw_new()
392 int sst_fw_reload(struct sst_fw *sst_fw) in sst_fw_reload() argument
394 struct sst_dsp *dsp = sst_fw->dsp; in sst_fw_reload()
400 ret = dsp->ops->parse_fw(sst_fw); in sst_fw_reload()
408 void sst_fw_unload(struct sst_fw *sst_fw) in sst_fw_unload() argument
410 struct sst_dsp *dsp = sst_fw->dsp; in sst_fw_unload()
420 if (module->sst_fw == sst_fw) { in sst_fw_unload()
445 void sst_fw_free(struct sst_fw *sst_fw) in sst_fw_free() argument
447 struct sst_dsp *dsp = sst_fw->dsp; in sst_fw_free()
450 list_del(&sst_fw->list); in sst_fw_free()
453 if (sst_fw->dma_buf) in sst_fw_free()
454 dma_free_coherent(dsp->dma_dev, sst_fw->size, sst_fw->dma_buf, in sst_fw_free()
455 sst_fw->dmable_fw_paddr); in sst_fw_free()
456 kfree(sst_fw); in sst_fw_free()
463 struct sst_fw *sst_fw, *t; in sst_fw_free_all() local
466 list_for_each_entry_safe(sst_fw, t, &dsp->fw_list, list) { in sst_fw_free_all()
468 list_del(&sst_fw->list); in sst_fw_free_all()
469 dma_free_coherent(dsp->dev, sst_fw->size, sst_fw->dma_buf, in sst_fw_free_all()
470 sst_fw->dmable_fw_paddr); in sst_fw_free_all()
471 kfree(sst_fw); in sst_fw_free_all()
478 struct sst_module *sst_module_new(struct sst_fw *sst_fw, in sst_module_new() argument
481 struct sst_dsp *dsp = sst_fw->dsp; in sst_module_new()
490 sst_module->sst_fw = sst_fw; in sst_module_new()
784 struct sst_fw *sst_fw = module->sst_fw; in sst_module_alloc_blocks() local
819 sst_fw->dmable_fw_paddr + module->data_offset, in sst_module_alloc_blocks()