@@ -592,16 +592,5 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
}
EXPORT_SYMBOL_GPL(bxt_sst_dsp_init);
-void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl)
-{
-
- skl_release_library(skl->lib_info, skl->lib_count);
- if (skl->dsp->fw)
- release_firmware(skl->dsp->fw);
- skl_freeup_uuid_list(skl);
- skl->dsp->ops->free(skl->dsp);
-}
-EXPORT_SYMBOL_GPL(bxt_sst_dsp_cleanup);
-
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Intel Broxton IPC driver");
@@ -96,6 +96,5 @@ bool cnl_ipc_int_status(struct sst_dsp *ctx);
int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
const char *fw_name, struct skl_dsp_loader_ops dsp_ops,
struct skl_dev **dsp);
-void cnl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl);
#endif /*__CNL_SST_DSP_H__*/
@@ -464,16 +464,5 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
}
EXPORT_SYMBOL_GPL(cnl_sst_dsp_init);
-void cnl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl)
-{
- if (skl->dsp->fw)
- release_firmware(skl->dsp->fw);
-
- skl_freeup_uuid_list(skl);
-
- skl->dsp->ops->free(skl->dsp);
-}
-EXPORT_SYMBOL_GPL(cnl_sst_dsp_cleanup);
-
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Intel Cannonlake IPC driver");
@@ -172,49 +172,41 @@ static const struct skl_dsp_ops dsp_ops[] = {
.id = 0x9d70,
.loader_ops = skl_get_loader_ops,
.init = skl_sst_dsp_init,
- .cleanup = skl_sst_dsp_cleanup
},
{
.id = 0x9d71,
.loader_ops = skl_get_loader_ops,
.init = skl_sst_dsp_init,
- .cleanup = skl_sst_dsp_cleanup
},
{
.id = 0x5a98,
.loader_ops = bxt_get_loader_ops,
.init = bxt_sst_dsp_init,
- .cleanup = bxt_sst_dsp_cleanup
},
{
.id = 0x3198,
.loader_ops = bxt_get_loader_ops,
.init = bxt_sst_dsp_init,
- .cleanup = bxt_sst_dsp_cleanup
},
{
.id = 0x9dc8,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
- .cleanup = cnl_sst_dsp_cleanup
},
{
.id = 0xa348,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
- .cleanup = cnl_sst_dsp_cleanup
},
{
.id = 0x02c8,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
- .cleanup = cnl_sst_dsp_cleanup
},
{
.id = 0x06c8,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
- .cleanup = cnl_sst_dsp_cleanup
},
};
@@ -282,7 +274,7 @@ int skl_free_dsp(struct skl_dev *skl)
/* disable ppcap interrupt */
snd_hdac_ext_bus_ppcap_int_enable(bus, false);
- skl->dsp_ops->cleanup(bus->dev, skl);
+ skl_sst_dsp_cleanup(skl);
kfree(skl->hw_cfg.i2s_caps.ctrl_base_addr);
kfree(skl->cores.state);
@@ -226,8 +226,6 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
const char *fw_name, struct skl_dsp_loader_ops dsp_ops,
struct skl_dev **dsp);
-void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl);
-void bxt_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl);
int bxt_load_library(struct sst_dsp *ctx, struct skl_lib_info *linfo,
int lib_count);
@@ -613,17 +613,21 @@ int skl_sst_init_fw(struct skl_dev *skl)
}
EXPORT_SYMBOL_GPL(skl_sst_init_fw);
-void skl_sst_dsp_cleanup(struct device *dev, struct skl_dev *skl)
+void skl_sst_dsp_cleanup(struct skl_dev *skl)
{
+ struct sst_dsp *dsp = skl->dsp;
+
+ skl_release_library(skl->lib_info, skl->lib_count);
+ if (dsp->fw)
+ release_firmware(dsp->fw);
+ skl_clear_module_table(dsp);
- if (skl->dsp->fw)
- release_firmware(skl->dsp->fw);
- skl_clear_module_table(skl->dsp);
skl_freeup_uuid_list(skl);
- skl->dsp->ops->free(skl->dsp);
- if (skl->boot_complete) {
- skl->dsp->cl_dev.ops.cl_cleanup_controller(skl->dsp);
- skl_cldma_int_disable(skl->dsp);
+ dsp->ops->free(dsp);
+
+ if (skl->boot_complete && dsp->cl_dev.bufsize) {
+ dsp->cl_dev.ops.cl_cleanup_controller(dsp);
+ skl_cldma_int_disable(dsp);
}
}
EXPORT_SYMBOL_GPL(skl_sst_dsp_cleanup);
@@ -160,7 +160,6 @@ struct skl_dsp_ops {
int irq, const char *fw_name,
struct skl_dsp_loader_ops loader_ops,
struct skl_dev **skl_sst);
- void (*cleanup)(struct device *dev, struct skl_dev *skl);
};
int skl_platform_unregister(struct device *dev);
@@ -174,6 +173,7 @@ int skl_nhlt_update_topology_bin(struct skl_dev *skl);
int skl_init_dsp(struct skl_dev *skl);
int skl_free_dsp(struct skl_dev *skl);
int skl_sst_init_fw(struct skl_dev *skl);
+void skl_sst_dsp_cleanup(struct skl_dev *skl);
int skl_suspend_late_dsp(struct skl_dev *skl);
int skl_suspend_dsp(struct skl_dev *skl);
int skl_resume_dsp(struct skl_dev *skl);
Driver cleanup process is similar for all platforms and sst_ops::free provides enough customization already. Unify them. Also remove redundant disable interrupt calls from new cleanup method. This is yet another checkpoint in quest for simplification or, perhaps a removal of skl_dsp_ops. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> --- sound/soc/intel/skylake/bxt-sst.c | 11 ----------- sound/soc/intel/skylake/cnl-sst-dsp.h | 1 - sound/soc/intel/skylake/cnl-sst.c | 11 ----------- sound/soc/intel/skylake/skl-messages.c | 10 +--------- sound/soc/intel/skylake/skl-sst-dsp.h | 2 -- sound/soc/intel/skylake/skl-sst.c | 20 ++++++++++++-------- sound/soc/intel/skylake/skl.h | 2 +- 7 files changed, 14 insertions(+), 43 deletions(-)