sound/soc/intel/catpt/trace.c

Source file repositories/reference/linux-study-clean/sound/soc/intel/catpt/trace.c

File Facts

System
Linux kernel
Corpus path
sound/soc/intel/catpt/trace.c
Extension
.c
Size
597 bytes
Lines
28
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.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0-only

#include <linux/types.h>

#define CREATE_TRACE_POINTS
#include "trace.h"

#define BYTES_PER_LINE 16
#define MAX_CHUNK_SIZE ((PAGE_SIZE - 150) /* Place for trace header */	\
			/ (2 * BYTES_PER_LINE + 4) /* chars per line */	\
			* BYTES_PER_LINE)

void trace_catpt_ipc_payload(const void *data, size_t size)
{
	size_t remaining = size;
	size_t offset = 0;

	while (remaining > 0) {
		u32 chunk;

		chunk = min_t(size_t, remaining, MAX_CHUNK_SIZE);
		trace_catpt_ipc_payload_chunk(data, chunk, offset, size);

		remaining -= chunk;
		offset += chunk;
	}
}

Annotation

Implementation Notes