hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/intel/atom/sst/sst.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * sst.c - Intel SST Driver for audio engine
34 *
....@@ -8,20 +9,12 @@
89 * KP Jeeja <jeeja.kp@intel.com>
910 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1011 *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; version 2 of the License.
14
- *
15
- * This program is distributed in the hope that it will be useful, but
16
- * WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
2012 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2113 */
2214 #include <linux/module.h>
2315 #include <linux/fs.h>
2416 #include <linux/interrupt.h>
17
+#include <linux/io.h>
2518 #include <linux/firmware.h>
2619 #include <linux/pm_runtime.h>
2720 #include <linux/pm_qos.h>
....@@ -33,7 +26,6 @@
3326 #include <asm/platform_sst_audio.h>
3427 #include "../sst-mfld-platform.h"
3528 #include "sst.h"
36
-#include "../../common/sst-dsp.h"
3729
3830 MODULE_AUTHOR("Vinod Koul <vinod.koul@intel.com>");
3931 MODULE_AUTHOR("Harsha Priya <priya.harsha@intel.com>");
....@@ -56,7 +48,7 @@
5648 union ipc_header_mrfld header;
5749 union sst_imr_reg_mrfld imr;
5850 struct ipc_post *msg = NULL;
59
- unsigned int size = 0;
51
+ unsigned int size;
6052 struct intel_sst_drv *drv = (struct intel_sst_drv *) context;
6153 irqreturn_t retval = IRQ_HANDLED;
6254
....@@ -332,8 +324,7 @@
332324 ret = -ENOMEM;
333325 goto do_free_mem;
334326 }
335
- pm_qos_add_request(ctx->qos, PM_QOS_CPU_DMA_LATENCY,
336
- PM_QOS_DEFAULT_VALUE);
327
+ cpu_latency_qos_add_request(ctx->qos, PM_QOS_DEFAULT_VALUE);
337328
338329 dev_dbg(ctx->dev, "Requesting FW %s now...\n", ctx->firmware_name);
339330 ret = request_firmware_nowait(THIS_MODULE, true, ctx->firmware_name,
....@@ -371,14 +362,13 @@
371362 sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);
372363 flush_scheduled_work();
373364 destroy_workqueue(ctx->post_msg_wq);
374
- pm_qos_remove_request(ctx->qos);
365
+ cpu_latency_qos_remove_request(ctx->qos);
375366 kfree(ctx->fw_sg_list.src);
376367 kfree(ctx->fw_sg_list.dst);
377368 ctx->fw_sg_list.list_len = 0;
378369 kfree(ctx->fw_in_mem);
379370 ctx->fw_in_mem = NULL;
380371 sst_memcpy_free_resources(ctx);
381
- ctx = NULL;
382372 }
383373 EXPORT_SYMBOL_GPL(sst_context_cleanup);
384374
....@@ -432,7 +422,7 @@
432422 {
433423 struct intel_sst_drv *ctx = dev_get_drvdata(dev);
434424 struct sst_fw_save *fw_save;
435
- int i, ret = 0;
425
+ int i, ret;
436426
437427 /* check first if we are already in SW reset */
438428 if (ctx->sst_state == SST_RESET)