diff options
Diffstat (limited to 'sound/soc/intel/skylake/skl-sst.c')
-rw-r--r-- | sound/soc/intel/skylake/skl-sst.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 70c3a604c381..61a8e4756a2b 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include "../common/sst-dsp.h" | 16 | #include "../common/sst-dsp.h" |
17 | #include "../common/sst-dsp-priv.h" | 17 | #include "../common/sst-dsp-priv.h" |
18 | #include "../common/sst-ipc.h" | 18 | #include "../common/sst-ipc.h" |
19 | #include "skl-sst-ipc.h" | 19 | #include "skl.h" |
20 | 20 | ||
21 | #define SKL_BASEFW_TIMEOUT 300 | 21 | #define SKL_BASEFW_TIMEOUT 300 |
22 | #define SKL_INIT_TIMEOUT 1000 | 22 | #define SKL_INIT_TIMEOUT 1000 |
@@ -66,7 +66,7 @@ static int skl_transfer_firmware(struct sst_dsp *ctx, | |||
66 | static int skl_load_base_firmware(struct sst_dsp *ctx) | 66 | static int skl_load_base_firmware(struct sst_dsp *ctx) |
67 | { | 67 | { |
68 | int ret = 0, i; | 68 | int ret = 0, i; |
69 | struct skl_sst *skl = ctx->thread_context; | 69 | struct skl_dev *skl = ctx->thread_context; |
70 | struct firmware stripped_fw; | 70 | struct firmware stripped_fw; |
71 | u32 reg; | 71 | u32 reg; |
72 | 72 | ||
@@ -161,7 +161,7 @@ static int skl_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) | |||
161 | { | 161 | { |
162 | int ret; | 162 | int ret; |
163 | struct skl_ipc_dxstate_info dx; | 163 | struct skl_ipc_dxstate_info dx; |
164 | struct skl_sst *skl = ctx->thread_context; | 164 | struct skl_dev *skl = ctx->thread_context; |
165 | unsigned int core_mask = SKL_DSP_CORE_MASK(core_id); | 165 | unsigned int core_mask = SKL_DSP_CORE_MASK(core_id); |
166 | 166 | ||
167 | /* If core0 is being turned on, we need to load the FW */ | 167 | /* If core0 is being turned on, we need to load the FW */ |
@@ -215,7 +215,7 @@ static int skl_set_dsp_D3(struct sst_dsp *ctx, unsigned int core_id) | |||
215 | { | 215 | { |
216 | int ret; | 216 | int ret; |
217 | struct skl_ipc_dxstate_info dx; | 217 | struct skl_ipc_dxstate_info dx; |
218 | struct skl_sst *skl = ctx->thread_context; | 218 | struct skl_dev *skl = ctx->thread_context; |
219 | unsigned int core_mask = SKL_DSP_CORE_MASK(core_id); | 219 | unsigned int core_mask = SKL_DSP_CORE_MASK(core_id); |
220 | 220 | ||
221 | dx.core_mask = core_mask; | 221 | dx.core_mask = core_mask; |
@@ -332,7 +332,7 @@ static int skl_transfer_module(struct sst_dsp *ctx, const void *data, | |||
332 | u32 size, u16 mod_id, u8 table_id, bool is_module) | 332 | u32 size, u16 mod_id, u8 table_id, bool is_module) |
333 | { | 333 | { |
334 | int ret, bytes_left, curr_pos; | 334 | int ret, bytes_left, curr_pos; |
335 | struct skl_sst *skl = ctx->thread_context; | 335 | struct skl_dev *skl = ctx->thread_context; |
336 | skl->mod_load_complete = false; | 336 | skl->mod_load_complete = false; |
337 | 337 | ||
338 | bytes_left = ctx->cl_dev.ops.cl_copy_to_dmabuf(ctx, data, size, false); | 338 | bytes_left = ctx->cl_dev.ops.cl_copy_to_dmabuf(ctx, data, size, false); |
@@ -384,7 +384,7 @@ out: | |||
384 | static int | 384 | static int |
385 | skl_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count) | 385 | skl_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo, int lib_count) |
386 | { | 386 | { |
387 | struct skl_sst *skl = ctx->thread_context; | 387 | struct skl_dev *skl = ctx->thread_context; |
388 | struct firmware stripped_fw; | 388 | struct firmware stripped_fw; |
389 | int ret, i; | 389 | int ret, i; |
390 | 390 | ||
@@ -413,8 +413,7 @@ static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, u8 *guid) | |||
413 | int ret = 0; | 413 | int ret = 0; |
414 | char mod_name[64]; /* guid str = 32 chars + 4 hyphens */ | 414 | char mod_name[64]; /* guid str = 32 chars + 4 hyphens */ |
415 | 415 | ||
416 | snprintf(mod_name, sizeof(mod_name), "%s%pUL%s", | 416 | snprintf(mod_name, sizeof(mod_name), "intel/dsp_fw_%pUL.bin", guid); |
417 | "intel/dsp_fw_", guid, ".bin"); | ||
418 | 417 | ||
419 | module_entry = skl_module_get_from_id(ctx, mod_id); | 418 | module_entry = skl_module_get_from_id(ctx, mod_id); |
420 | if (module_entry == NULL) { | 419 | if (module_entry == NULL) { |
@@ -443,7 +442,7 @@ static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, u8 *guid) | |||
443 | static int skl_unload_module(struct sst_dsp *ctx, u16 mod_id) | 442 | static int skl_unload_module(struct sst_dsp *ctx, u16 mod_id) |
444 | { | 443 | { |
445 | int usage_cnt; | 444 | int usage_cnt; |
446 | struct skl_sst *skl = ctx->thread_context; | 445 | struct skl_dev *skl = ctx->thread_context; |
447 | int ret = 0; | 446 | int ret = 0; |
448 | 447 | ||
449 | usage_cnt = skl_put_module(ctx, mod_id); | 448 | usage_cnt = skl_put_module(ctx, mod_id); |
@@ -518,9 +517,10 @@ static struct sst_dsp_device skl_dev = { | |||
518 | }; | 517 | }; |
519 | 518 | ||
520 | int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, | 519 | int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, |
521 | const char *fw_name, struct skl_dsp_loader_ops dsp_ops, struct skl_sst **dsp) | 520 | const char *fw_name, struct skl_dsp_loader_ops dsp_ops, |
521 | struct skl_dev **dsp) | ||
522 | { | 522 | { |
523 | struct skl_sst *skl; | 523 | struct skl_dev *skl; |
524 | struct sst_dsp *sst; | 524 | struct sst_dsp *sst; |
525 | int ret; | 525 | int ret; |
526 | 526 | ||
@@ -554,10 +554,10 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, | |||
554 | } | 554 | } |
555 | EXPORT_SYMBOL_GPL(skl_sst_dsp_init); | 555 | EXPORT_SYMBOL_GPL(skl_sst_dsp_init); |
556 | 556 | ||
557 | int skl_sst_init_fw(struct device *dev, struct skl_sst *ctx) | 557 | int skl_sst_init_fw(struct device *dev, struct skl_dev *skl) |
558 | { | 558 | { |
559 | int ret; | 559 | int ret; |
560 | struct sst_dsp *sst = ctx->dsp; | 560 | struct sst_dsp *sst = skl->dsp; |
561 | 561 | ||
562 | ret = sst->fw_ops.load_fw(sst); | 562 | ret = sst->fw_ops.load_fw(sst); |
563 | if (ret < 0) { | 563 | if (ret < 0) { |
@@ -567,32 +567,32 @@ int skl_sst_init_fw(struct device *dev, struct skl_sst *ctx) | |||
567 | 567 | ||
568 | skl_dsp_init_core_state(sst); | 568 | skl_dsp_init_core_state(sst); |
569 | 569 | ||
570 | if (ctx->lib_count > 1) { | 570 | if (skl->lib_count > 1) { |
571 | ret = sst->fw_ops.load_library(sst, ctx->lib_info, | 571 | ret = sst->fw_ops.load_library(sst, skl->lib_info, |
572 | ctx->lib_count); | 572 | skl->lib_count); |
573 | if (ret < 0) { | 573 | if (ret < 0) { |
574 | dev_err(dev, "Load Library failed : %x\n", ret); | 574 | dev_err(dev, "Load Library failed : %x\n", ret); |
575 | return ret; | 575 | return ret; |
576 | } | 576 | } |
577 | } | 577 | } |
578 | ctx->is_first_boot = false; | 578 | skl->is_first_boot = false; |
579 | 579 | ||
580 | return 0; | 580 | return 0; |
581 | } | 581 | } |
582 | EXPORT_SYMBOL_GPL(skl_sst_init_fw); | 582 | EXPORT_SYMBOL_GPL(skl_sst_init_fw); |
583 | 583 | ||
584 | void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx) | 584 | void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl) |
585 | { | 585 | { |
586 | 586 | ||
587 | if (ctx->dsp->fw) | 587 | if (skl->dsp->fw) |
588 | release_firmware(ctx->dsp->fw); | 588 | release_firmware(skl->dsp->fw); |
589 | skl_clear_module_table(ctx->dsp); | 589 | skl_clear_module_table(skl->dsp); |
590 | skl_freeup_uuid_list(ctx); | 590 | skl_freeup_uuid_list(skl); |
591 | skl_ipc_free(&ctx->ipc); | 591 | skl_ipc_free(&skl->ipc); |
592 | ctx->dsp->ops->free(ctx->dsp); | 592 | skl->dsp->ops->free(skl->dsp); |
593 | if (ctx->boot_complete) { | 593 | if (skl->boot_complete) { |
594 | ctx->dsp->cl_dev.ops.cl_cleanup_controller(ctx->dsp); | 594 | skl->dsp->cl_dev.ops.cl_cleanup_controller(skl->dsp); |
595 | skl_cldma_int_disable(ctx->dsp); | 595 | skl_cldma_int_disable(skl->dsp); |
596 | } | 596 | } |
597 | } | 597 | } |
598 | EXPORT_SYMBOL_GPL(skl_sst_dsp_cleanup); | 598 | EXPORT_SYMBOL_GPL(skl_sst_dsp_cleanup); |