Skip to content

Commit 5acb19e

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: avs: TGL-based platforms support
Define handlers specific to cAVS 2.5 platforms, that is TGL, ADL, RPL and all other variants based on this very version of AudioDSP architecture. Most operations are inherited from their predecessors with the major difference being AudioDSP cores management - firmware handlers that on its own so there is no need to interfere. Reviewed-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 275b583 commit 5acb19e

File tree

4 files changed

+90
-1
lines changed

4 files changed

+90
-1
lines changed

sound/soc/intel/avs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
snd-soc-avs-objs := dsp.o ipc.o messages.o utils.o core.o loader.o \
44
topology.o path.o pcm.o board_selection.o control.o
55
snd-soc-avs-objs += cldma.o
6-
snd-soc-avs-objs += skl.o apl.o cnl.o icl.o
6+
snd-soc-avs-objs += skl.o apl.o cnl.o icl.o tgl.o
77

88
snd-soc-avs-objs += trace.o
99
# tell define_trace.h where to find the trace header

sound/soc/intel/avs/avs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ extern const struct avs_dsp_ops avs_skl_dsp_ops;
6868
extern const struct avs_dsp_ops avs_apl_dsp_ops;
6969
extern const struct avs_dsp_ops avs_cnl_dsp_ops;
7070
extern const struct avs_dsp_ops avs_icl_dsp_ops;
71+
extern const struct avs_dsp_ops avs_tgl_dsp_ops;
7172

7273
#define AVS_PLATATTR_CLDMA BIT_ULL(0)
7374
#define AVS_PLATATTR_IMR BIT_ULL(1)

sound/soc/intel/avs/core.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,23 @@ static const struct avs_spec jsl_desc = {
828828
.hipc = &cnl_hipc_spec,
829829
};
830830

831+
#define AVS_TGL_BASED_SPEC(sname) \
832+
static const struct avs_spec sname##_desc = { \
833+
.name = #sname, \
834+
.min_fw_version = { 10, 29, 0, 5646 }, \
835+
.dsp_ops = &avs_tgl_dsp_ops, \
836+
.core_init_mask = 1, \
837+
.attributes = AVS_PLATATTR_IMR, \
838+
.sram = &apl_sram_spec, \
839+
.hipc = &cnl_hipc_spec, \
840+
}
841+
842+
AVS_TGL_BASED_SPEC(lkf);
843+
AVS_TGL_BASED_SPEC(tgl);
844+
AVS_TGL_BASED_SPEC(ehl);
845+
AVS_TGL_BASED_SPEC(adl);
846+
AVS_TGL_BASED_SPEC(adl_n);
847+
831848
static const struct pci_device_id avs_ids[] = {
832849
{ PCI_DEVICE_DATA(INTEL, HDA_SKL_LP, &skl_desc) },
833850
{ PCI_DEVICE_DATA(INTEL, HDA_SKL, &skl_desc) },
@@ -846,6 +863,23 @@ static const struct pci_device_id avs_ids[] = {
846863
{ PCI_DEVICE_DATA(INTEL, HDA_ICL_N, &icl_desc) },
847864
{ PCI_DEVICE_DATA(INTEL, HDA_ICL_H, &icl_desc) },
848865
{ PCI_DEVICE_DATA(INTEL, HDA_JSL_N, &jsl_desc) },
866+
{ PCI_DEVICE_DATA(INTEL, HDA_LKF, &lkf_desc) },
867+
{ PCI_DEVICE_DATA(INTEL, HDA_TGL_LP, &tgl_desc) },
868+
{ PCI_DEVICE_DATA(INTEL, HDA_TGL_H, &tgl_desc) },
869+
{ PCI_DEVICE_DATA(INTEL, HDA_CML_R, &tgl_desc) },
870+
{ PCI_DEVICE_DATA(INTEL, HDA_EHL_0, &ehl_desc) },
871+
{ PCI_DEVICE_DATA(INTEL, HDA_EHL_3, &ehl_desc) },
872+
{ PCI_DEVICE_DATA(INTEL, HDA_ADL_S, &adl_desc) },
873+
{ PCI_DEVICE_DATA(INTEL, HDA_ADL_P, &adl_desc) },
874+
{ PCI_DEVICE_DATA(INTEL, HDA_ADL_PS, &adl_desc) },
875+
{ PCI_DEVICE_DATA(INTEL, HDA_ADL_M, &adl_desc) },
876+
{ PCI_DEVICE_DATA(INTEL, HDA_ADL_PX, &adl_desc) },
877+
{ PCI_DEVICE_DATA(INTEL, HDA_ADL_N, &adl_n_desc) },
878+
{ PCI_DEVICE_DATA(INTEL, HDA_RPL_S, &adl_desc) },
879+
{ PCI_DEVICE_DATA(INTEL, HDA_RPL_P_0, &adl_desc) },
880+
{ PCI_DEVICE_DATA(INTEL, HDA_RPL_P_1, &adl_desc) },
881+
{ PCI_DEVICE_DATA(INTEL, HDA_RPL_M, &adl_desc) },
882+
{ PCI_DEVICE_DATA(INTEL, HDA_RPL_PX, &adl_desc) },
849883
{ 0 }
850884
};
851885
MODULE_DEVICE_TABLE(pci, avs_ids);

sound/soc/intel/avs/tgl.c

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
//
3+
// Copyright(c) 2021-2024 Intel Corporation. All rights reserved.
4+
//
5+
// Authors: Cezary Rojewski <[email protected]>
6+
// Amadeusz Slawinski <[email protected]>
7+
//
8+
9+
#include "avs.h"
10+
11+
static int avs_tgl_dsp_core_power(struct avs_dev *adev, u32 core_mask, bool power)
12+
{
13+
core_mask &= AVS_MAIN_CORE_MASK;
14+
15+
if (!core_mask)
16+
return 0;
17+
return avs_dsp_core_power(adev, core_mask, power);
18+
}
19+
20+
static int avs_tgl_dsp_core_reset(struct avs_dev *adev, u32 core_mask, bool reset)
21+
{
22+
core_mask &= AVS_MAIN_CORE_MASK;
23+
24+
if (!core_mask)
25+
return 0;
26+
return avs_dsp_core_reset(adev, core_mask, reset);
27+
}
28+
29+
static int avs_tgl_dsp_core_stall(struct avs_dev *adev, u32 core_mask, bool stall)
30+
{
31+
core_mask &= AVS_MAIN_CORE_MASK;
32+
33+
if (!core_mask)
34+
return 0;
35+
return avs_dsp_core_stall(adev, core_mask, stall);
36+
}
37+
38+
const struct avs_dsp_ops avs_tgl_dsp_ops = {
39+
.power = avs_tgl_dsp_core_power,
40+
.reset = avs_tgl_dsp_core_reset,
41+
.stall = avs_tgl_dsp_core_stall,
42+
.irq_handler = avs_irq_handler,
43+
.irq_thread = avs_cnl_irq_thread,
44+
.int_control = avs_dsp_interrupt_control,
45+
.load_basefw = avs_hda_load_basefw,
46+
.load_lib = avs_hda_load_library,
47+
.transfer_mods = avs_hda_transfer_modules,
48+
.log_buffer_offset = avs_icl_log_buffer_offset,
49+
.log_buffer_status = avs_apl_log_buffer_status,
50+
.coredump = avs_apl_coredump,
51+
.d0ix_toggle = avs_icl_d0ix_toggle,
52+
.set_d0ix = avs_icl_set_d0ix,
53+
AVS_SET_ENABLE_LOGS_OP(icl)
54+
};

0 commit comments

Comments
 (0)