| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * sst.c - Intel SST Driver for audio engine |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * KP Jeeja <jeeja.kp@intel.com> |
|---|
| 9 | 10 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 10 | 11 | * |
|---|
| 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 | | - * |
|---|
| 20 | 12 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 21 | 13 | */ |
|---|
| 22 | 14 | #include <linux/module.h> |
|---|
| 23 | 15 | #include <linux/fs.h> |
|---|
| 24 | 16 | #include <linux/interrupt.h> |
|---|
| 17 | +#include <linux/io.h> |
|---|
| 25 | 18 | #include <linux/firmware.h> |
|---|
| 26 | 19 | #include <linux/pm_runtime.h> |
|---|
| 27 | 20 | #include <linux/pm_qos.h> |
|---|
| .. | .. |
|---|
| 33 | 26 | #include <asm/platform_sst_audio.h> |
|---|
| 34 | 27 | #include "../sst-mfld-platform.h" |
|---|
| 35 | 28 | #include "sst.h" |
|---|
| 36 | | -#include "../../common/sst-dsp.h" |
|---|
| 37 | 29 | |
|---|
| 38 | 30 | MODULE_AUTHOR("Vinod Koul <vinod.koul@intel.com>"); |
|---|
| 39 | 31 | MODULE_AUTHOR("Harsha Priya <priya.harsha@intel.com>"); |
|---|
| .. | .. |
|---|
| 56 | 48 | union ipc_header_mrfld header; |
|---|
| 57 | 49 | union sst_imr_reg_mrfld imr; |
|---|
| 58 | 50 | struct ipc_post *msg = NULL; |
|---|
| 59 | | - unsigned int size = 0; |
|---|
| 51 | + unsigned int size; |
|---|
| 60 | 52 | struct intel_sst_drv *drv = (struct intel_sst_drv *) context; |
|---|
| 61 | 53 | irqreturn_t retval = IRQ_HANDLED; |
|---|
| 62 | 54 | |
|---|
| .. | .. |
|---|
| 332 | 324 | ret = -ENOMEM; |
|---|
| 333 | 325 | goto do_free_mem; |
|---|
| 334 | 326 | } |
|---|
| 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); |
|---|
| 337 | 328 | |
|---|
| 338 | 329 | dev_dbg(ctx->dev, "Requesting FW %s now...\n", ctx->firmware_name); |
|---|
| 339 | 330 | ret = request_firmware_nowait(THIS_MODULE, true, ctx->firmware_name, |
|---|
| .. | .. |
|---|
| 371 | 362 | sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group); |
|---|
| 372 | 363 | flush_scheduled_work(); |
|---|
| 373 | 364 | destroy_workqueue(ctx->post_msg_wq); |
|---|
| 374 | | - pm_qos_remove_request(ctx->qos); |
|---|
| 365 | + cpu_latency_qos_remove_request(ctx->qos); |
|---|
| 375 | 366 | kfree(ctx->fw_sg_list.src); |
|---|
| 376 | 367 | kfree(ctx->fw_sg_list.dst); |
|---|
| 377 | 368 | ctx->fw_sg_list.list_len = 0; |
|---|
| 378 | 369 | kfree(ctx->fw_in_mem); |
|---|
| 379 | 370 | ctx->fw_in_mem = NULL; |
|---|
| 380 | 371 | sst_memcpy_free_resources(ctx); |
|---|
| 381 | | - ctx = NULL; |
|---|
| 382 | 372 | } |
|---|
| 383 | 373 | EXPORT_SYMBOL_GPL(sst_context_cleanup); |
|---|
| 384 | 374 | |
|---|
| .. | .. |
|---|
| 432 | 422 | { |
|---|
| 433 | 423 | struct intel_sst_drv *ctx = dev_get_drvdata(dev); |
|---|
| 434 | 424 | struct sst_fw_save *fw_save; |
|---|
| 435 | | - int i, ret = 0; |
|---|
| 425 | + int i, ret; |
|---|
| 436 | 426 | |
|---|
| 437 | 427 | /* check first if we are already in SW reset */ |
|---|
| 438 | 428 | if (ctx->sst_state == SST_RESET) |
|---|