.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * sst_dsp.c - Intel SST Driver for audio engine |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * Dharageswari R <dharageswari.r@intel.com> |
---|
8 | 9 | * KP Jeeja <jeeja.kp@intel.com> |
---|
9 | 10 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
10 | | - * |
---|
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 | 11 | * |
---|
20 | 12 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
21 | 13 | * |
---|
.. | .. |
---|
37 | 29 | #include <asm/platform_sst_audio.h> |
---|
38 | 30 | #include "../sst-mfld-platform.h" |
---|
39 | 31 | #include "sst.h" |
---|
40 | | -#include "../../common/sst-dsp.h" |
---|
41 | 32 | |
---|
42 | 33 | void memcpy32_toio(void __iomem *dst, const void *src, int count) |
---|
43 | 34 | { |
---|
.. | .. |
---|
57 | 48 | |
---|
58 | 49 | /** |
---|
59 | 50 | * intel_sst_reset_dsp_mrfld - Resetting SST DSP |
---|
| 51 | + * @sst_drv_ctx: intel_sst_drv context pointer |
---|
60 | 52 | * |
---|
61 | 53 | * This resets DSP in case of MRFLD platfroms |
---|
62 | 54 | */ |
---|
.. | .. |
---|
85 | 77 | |
---|
86 | 78 | /** |
---|
87 | 79 | * sst_start_merrifield - Start the SST DSP processor |
---|
| 80 | + * @sst_drv_ctx: intel_sst_drv context pointer |
---|
88 | 81 | * |
---|
89 | 82 | * This starts the DSP in MERRIFIELD platfroms |
---|
90 | 83 | */ |
---|
.. | .. |
---|
269 | 262 | struct sst_memcpy_list *listnode; |
---|
270 | 263 | |
---|
271 | 264 | list_for_each_entry(listnode, memcpy_list, memcpylist) { |
---|
272 | | - if (listnode->is_io == true) |
---|
| 265 | + if (listnode->is_io) |
---|
273 | 266 | memcpy32_toio((void __iomem *)listnode->dstn, |
---|
274 | 267 | listnode->src, listnode->size); |
---|
275 | 268 | else |
---|
.. | .. |
---|
282 | 275 | struct sst_memcpy_list *listnode, *tmplistnode; |
---|
283 | 276 | |
---|
284 | 277 | /* Free the list */ |
---|
285 | | - if (!list_empty(&sst_drv_ctx->memcpy_list)) { |
---|
286 | | - list_for_each_entry_safe(listnode, tmplistnode, |
---|
287 | | - &sst_drv_ctx->memcpy_list, memcpylist) { |
---|
288 | | - list_del(&listnode->memcpylist); |
---|
289 | | - kfree(listnode); |
---|
290 | | - } |
---|
| 278 | + list_for_each_entry_safe(listnode, tmplistnode, |
---|
| 279 | + &sst_drv_ctx->memcpy_list, memcpylist) { |
---|
| 280 | + list_del(&listnode->memcpylist); |
---|
| 281 | + kfree(listnode); |
---|
291 | 282 | } |
---|
292 | 283 | } |
---|
293 | 284 | |
---|
.. | .. |
---|
395 | 386 | |
---|
396 | 387 | /** |
---|
397 | 388 | * sst_load_fw - function to load FW into DSP |
---|
| 389 | + * @sst_drv_ctx: intel_sst_drv context pointer |
---|
| 390 | + * |
---|
398 | 391 | * Transfers the FW to DSP using dma/memcpy |
---|
399 | 392 | */ |
---|
400 | 393 | int sst_load_fw(struct intel_sst_drv *sst_drv_ctx) |
---|
.. | .. |
---|
404 | 397 | |
---|
405 | 398 | dev_dbg(sst_drv_ctx->dev, "sst_load_fw\n"); |
---|
406 | 399 | |
---|
407 | | - if (sst_drv_ctx->sst_state != SST_RESET || |
---|
408 | | - sst_drv_ctx->sst_state == SST_SHUTDOWN) |
---|
| 400 | + if (sst_drv_ctx->sst_state != SST_RESET) |
---|
409 | 401 | return -EAGAIN; |
---|
410 | 402 | |
---|
411 | 403 | if (!sst_drv_ctx->fw_in_mem) { |
---|
.. | .. |
---|
420 | 412 | return -ENOMEM; |
---|
421 | 413 | |
---|
422 | 414 | /* Prevent C-states beyond C6 */ |
---|
423 | | - pm_qos_update_request(sst_drv_ctx->qos, 0); |
---|
| 415 | + cpu_latency_qos_update_request(sst_drv_ctx->qos, 0); |
---|
424 | 416 | |
---|
425 | 417 | sst_drv_ctx->sst_state = SST_FW_LOADING; |
---|
426 | 418 | |
---|
.. | .. |
---|
450 | 442 | |
---|
451 | 443 | restore: |
---|
452 | 444 | /* Re-enable Deeper C-states beyond C6 */ |
---|
453 | | - pm_qos_update_request(sst_drv_ctx->qos, PM_QOS_DEFAULT_VALUE); |
---|
| 445 | + cpu_latency_qos_update_request(sst_drv_ctx->qos, PM_QOS_DEFAULT_VALUE); |
---|
454 | 446 | sst_free_block(sst_drv_ctx, block); |
---|
455 | 447 | dev_dbg(sst_drv_ctx->dev, "fw load successful!!!\n"); |
---|
456 | 448 | |
---|