drivers/staging/media/ipu7/ipu7-syscom.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/ipu7/ipu7-syscom.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/ipu7/ipu7-syscom.c- Extension
.c- Size
- 2213 bytes
- Lines
- 79
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/io.habi/ipu7_fw_syscom_abi.hipu7.hipu7-syscom.h
Detected Declarations
function Copyrightfunction ipu7_syscom_put_tokenfunction ipu7_syscom_get_queue_config
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2013 - 2025 Intel Corporation
*/
#include <linux/export.h>
#include <linux/io.h>
#include "abi/ipu7_fw_syscom_abi.h"
#include "ipu7.h"
#include "ipu7-syscom.h"
static void __iomem *ipu7_syscom_get_indices(struct ipu7_syscom_context *ctx,
u32 q)
{
return ctx->queue_indices + (q * sizeof(struct syscom_queue_indices_s));
}
void *ipu7_syscom_get_token(struct ipu7_syscom_context *ctx, int q)
{
struct syscom_queue_config *queue_params = &ctx->queue_configs[q];
void __iomem *queue_indices = ipu7_syscom_get_indices(ctx, q);
u32 write_index = readl(queue_indices +
offsetof(struct syscom_queue_indices_s,
write_index));
u32 read_index = readl(queue_indices +
offsetof(struct syscom_queue_indices_s,
read_index));
void *token = NULL;
if (q < ctx->num_output_queues) {
/* Output queue */
bool empty = (write_index == read_index);
if (!empty)
token = queue_params->token_array_mem +
read_index *
queue_params->token_size_in_bytes;
} else {
/* Input queue */
bool full = (read_index == ((write_index + 1U) %
(u32)queue_params->max_capacity));
if (!full)
token = queue_params->token_array_mem +
write_index * queue_params->token_size_in_bytes;
}
return token;
}
EXPORT_SYMBOL_NS_GPL(ipu7_syscom_get_token, "INTEL_IPU7");
void ipu7_syscom_put_token(struct ipu7_syscom_context *ctx, int q)
{
struct syscom_queue_config *queue_params = &ctx->queue_configs[q];
void __iomem *queue_indices = ipu7_syscom_get_indices(ctx, q);
u32 offset, index;
if (q < ctx->num_output_queues)
/* Output queue */
offset = offsetof(struct syscom_queue_indices_s, read_index);
else
/* Input queue */
offset = offsetof(struct syscom_queue_indices_s, write_index);
index = readl(queue_indices + offset);
writel((index + 1U) % queue_params->max_capacity,
queue_indices + offset);
}
EXPORT_SYMBOL_NS_GPL(ipu7_syscom_put_token, "INTEL_IPU7");
struct syscom_queue_params_config *
ipu7_syscom_get_queue_config(struct syscom_config_s *config)
{
return (struct syscom_queue_params_config *)(&config[1]);
}
EXPORT_SYMBOL_NS_GPL(ipu7_syscom_get_queue_config, "INTEL_IPU7");
Annotation
- Immediate include surface: `linux/export.h`, `linux/io.h`, `abi/ipu7_fw_syscom_abi.h`, `ipu7.h`, `ipu7-syscom.h`.
- Detected declarations: `function Copyright`, `function ipu7_syscom_put_token`, `function ipu7_syscom_get_queue_config`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: integration implementation candidate.
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.