Lines Matching refs:sst_fw
326 struct sst_fw *sst_fw_new(struct sst_dsp *dsp, in sst_fw_new()
329 struct sst_fw *sst_fw; in sst_fw_new() local
335 sst_fw = kzalloc(sizeof(*sst_fw), GFP_KERNEL); in sst_fw_new()
336 if (sst_fw == NULL) in sst_fw_new()
339 sst_fw->dsp = dsp; in sst_fw_new()
340 sst_fw->private = private; in sst_fw_new()
341 sst_fw->size = fw->size; in sst_fw_new()
344 sst_fw->dma_buf = dma_alloc_coherent(dsp->dma_dev, sst_fw->size, in sst_fw_new()
345 &sst_fw->dmable_fw_paddr, GFP_DMA | GFP_KERNEL); in sst_fw_new()
346 if (!sst_fw->dma_buf) { in sst_fw_new()
348 kfree(sst_fw); in sst_fw_new()
353 memcpy((void *)sst_fw->dma_buf, (void *)fw->data, fw->size); in sst_fw_new()
362 err = dsp->ops->parse_fw(sst_fw); in sst_fw_new()
372 list_add(&sst_fw->list, &dsp->fw_list); in sst_fw_new()
375 return sst_fw; in sst_fw_new()
381 dma_free_coherent(dsp->dma_dev, sst_fw->size, in sst_fw_new()
382 sst_fw->dma_buf, in sst_fw_new()
383 sst_fw->dmable_fw_paddr); in sst_fw_new()
384 sst_fw->dma_buf = NULL; in sst_fw_new()
385 kfree(sst_fw); in sst_fw_new()
390 int sst_fw_reload(struct sst_fw *sst_fw) in sst_fw_reload() argument
392 struct sst_dsp *dsp = sst_fw->dsp; in sst_fw_reload()
398 ret = dsp->ops->parse_fw(sst_fw); in sst_fw_reload()
406 void sst_fw_unload(struct sst_fw *sst_fw) in sst_fw_unload() argument
408 struct sst_dsp *dsp = sst_fw->dsp; in sst_fw_unload()
418 if (module->sst_fw == sst_fw) { in sst_fw_unload()
443 void sst_fw_free(struct sst_fw *sst_fw) in sst_fw_free() argument
445 struct sst_dsp *dsp = sst_fw->dsp; in sst_fw_free()
448 list_del(&sst_fw->list); in sst_fw_free()
451 if (sst_fw->dma_buf) in sst_fw_free()
452 dma_free_coherent(dsp->dma_dev, sst_fw->size, sst_fw->dma_buf, in sst_fw_free()
453 sst_fw->dmable_fw_paddr); in sst_fw_free()
454 kfree(sst_fw); in sst_fw_free()
461 struct sst_fw *sst_fw, *t; in sst_fw_free_all() local
464 list_for_each_entry_safe(sst_fw, t, &dsp->fw_list, list) { in sst_fw_free_all()
466 list_del(&sst_fw->list); in sst_fw_free_all()
467 dma_free_coherent(dsp->dev, sst_fw->size, sst_fw->dma_buf, in sst_fw_free_all()
468 sst_fw->dmable_fw_paddr); in sst_fw_free_all()
469 kfree(sst_fw); in sst_fw_free_all()
476 struct sst_module *sst_module_new(struct sst_fw *sst_fw, in sst_module_new() argument
479 struct sst_dsp *dsp = sst_fw->dsp; in sst_module_new()
488 sst_module->sst_fw = sst_fw; in sst_module_new()
782 struct sst_fw *sst_fw = module->sst_fw; in sst_module_alloc_blocks() local
817 sst_fw->dmable_fw_paddr + module->data_offset, in sst_module_alloc_blocks()