sound/soc/intel/avs/icl.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/avs/icl.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/avs/icl.c- Extension
.c- Size
- 5663 bytes
- Lines
- 204
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hsound/hdaudio.hsound/hdaudio_ext.havs.hdebug.hmessages.h
Detected Declarations
struct avs_icl_memwnd2_descstruct avs_icl_memwnd2function avs_icl_enable_logsfunction avs_icl_slot_offsetfunction avs_icl_log_buffer_offsetfunction avs_icl_d0ix_togglefunction avs_icl_set_d0ixfunction avs_icl_load_basefw
Annotated Snippet
struct avs_icl_memwnd2_desc {
u32 resource_id;
union avs_icl_memwnd2_slot_type slot_id;
u32 vma;
} __packed;
static_assert(sizeof(struct avs_icl_memwnd2_desc) == 12);
#define AVS_ICL_MEMWND2_SLOTS_COUNT 15
struct avs_icl_memwnd2 {
union {
struct avs_icl_memwnd2_desc slot_desc[AVS_ICL_MEMWND2_SLOTS_COUNT];
u8 rsvd[SZ_4K];
};
u8 slot_array[AVS_ICL_MEMWND2_SLOTS_COUNT][SZ_4K];
} __packed;
static_assert(sizeof(struct avs_icl_memwnd2) == 65536);
#define AVS_ICL_SLOT_UNUSED \
((union avs_icl_memwnd2_slot_type) { 0x00000000U })
#define AVS_ICL_SLOT_CRITICAL_LOG \
((union avs_icl_memwnd2_slot_type) { 0x54524300U })
#define AVS_ICL_SLOT_DEBUG_LOG \
((union avs_icl_memwnd2_slot_type) { 0x474f4c00U })
#define AVS_ICL_SLOT_GDB_STUB \
((union avs_icl_memwnd2_slot_type) { 0x42444700U })
#define AVS_ICL_SLOT_BROKEN \
((union avs_icl_memwnd2_slot_type) { 0x44414544U })
static int avs_icl_slot_offset(struct avs_dev *adev, union avs_icl_memwnd2_slot_type slot_type)
{
struct avs_icl_memwnd2_desc desc[AVS_ICL_MEMWND2_SLOTS_COUNT];
int i;
memcpy_fromio(&desc, avs_sram_addr(adev, AVS_DEBUG_WINDOW), sizeof(desc));
for (i = 0; i < AVS_ICL_MEMWND2_SLOTS_COUNT; i++)
if (desc[i].slot_id.val == slot_type.val)
return offsetof(struct avs_icl_memwnd2, slot_array) + i * SZ_4K;
return -ENXIO;
}
int avs_icl_log_buffer_offset(struct avs_dev *adev, u32 core)
{
union avs_icl_memwnd2_slot_type slot_type = AVS_ICL_SLOT_DEBUG_LOG;
int ret;
slot_type.resource_id = core;
ret = avs_icl_slot_offset(adev, slot_type);
if (ret < 0)
dev_dbg(adev->dev, "No slot offset found for: %x\n",
slot_type.val);
return ret;
}
bool avs_icl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
{
/* Full-power when starting DMA engines. */
if (tx->glb.set_ppl_state.state == AVS_PPL_STATE_RUNNING)
return true;
/* Payload-less IPCs do not take part in d0ix toggling. */
return tx->size;
}
int avs_icl_set_d0ix(struct avs_dev *adev, bool enable)
{
int ret;
ret = avs_ipc_set_d0ix(adev, enable, false);
return AVS_IPC_RET(ret);
}
int avs_icl_load_basefw(struct avs_dev *adev, struct firmware *fw)
{
struct hdac_bus *bus = &adev->base.core;
struct hdac_ext_stream *host_stream;
struct snd_pcm_substream substream;
struct snd_dma_buffer dmab;
unsigned int sd_fmt;
u8 ltrp_gb;
int ret;
/*
* ICCMAX:
*
* For ICL+ platforms, as per HW recommendation LTRP_GB is set to 95us
* during FW load. Its original value shall be restored once load completes.
*
Annotation
- Immediate include surface: `linux/slab.h`, `sound/hdaudio.h`, `sound/hdaudio_ext.h`, `avs.h`, `debug.h`, `messages.h`.
- Detected declarations: `struct avs_icl_memwnd2_desc`, `struct avs_icl_memwnd2`, `function avs_icl_enable_logs`, `function avs_icl_slot_offset`, `function avs_icl_log_buffer_offset`, `function avs_icl_d0ix_toggle`, `function avs_icl_set_d0ix`, `function avs_icl_load_basefw`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.