drivers/firmware/samsung/exynos-acpm.c
Source file repositories/reference/linux-study-clean/drivers/firmware/samsung/exynos-acpm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/samsung/exynos-acpm.c- Extension
.c- Size
- 23966 bytes
- Lines
- 905
- Domain
- Driver Families
- Bucket
- drivers/firmware
- 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.
- 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/bitfield.hlinux/bitmap.hlinux/bitops.hlinux/cleanup.hlinux/container_of.hlinux/delay.hlinux/device.hlinux/find.hlinux/firmware/samsung/exynos-acpm-protocol.hlinux/io.hlinux/iopoll.hlinux/ktime.hlinux/mailbox/exynos-message.hlinux/mailbox_client.hlinux/module.hlinux/mutex.hlinux/math.hlinux/of.hlinux/of_address.hlinux/of_platform.hlinux/platform_device.hlinux/slab.hlinux/types.hexynos-acpm.hexynos-acpm-dvfs.hexynos-acpm-pmic.hexynos-acpm-tmu.h
Detected Declarations
struct acpm_shmemstruct acpm_chan_shmemstruct acpm_queuestruct acpm_rx_datastruct acpm_chanstruct acpm_infostruct acpm_match_datafunction acpm_get_saved_rxfunction acpm_get_rxfunction acpm_dequeue_by_pollingfunction acpm_wait_for_queue_slotsfunction acpm_prepare_xferfunction acpm_wait_for_message_responsefunction acpm_do_xferfunction scoped_guardfunction acpm_set_xferfunction acpm_chan_shmem_get_paramsfunction acpm_achan_alloc_cmdsfunction acpm_free_mbox_chansfunction acpm_channels_initfunction acpm_clk_pdev_unregisterfunction acpm_probefunction acpm_handle_putfunction devm_acpm_releasefunction acpm_get_by_nodefunction devm_acpm_get_by_nodeexport devm_acpm_get_by_nodeexport devm_acpm_get_by_phandle
Annotated Snippet
struct acpm_shmem {
u32 reserved[2];
u32 chans;
u32 reserved1[3];
u32 num_chans;
};
/**
* struct acpm_chan_shmem - descriptor of a shared memory channel.
*
* @id: channel ID.
* @reserved: unused fields.
* @rx_rear: rear pointer of APM RX queue (TX for AP).
* @rx_front: front pointer of APM RX queue (TX for AP).
* @rx_base: base address of APM RX queue (TX for AP).
* @reserved1: unused fields.
* @tx_rear: rear pointer of APM TX queue (RX for AP).
* @tx_front: front pointer of APM TX queue (RX for AP).
* @tx_base: base address of APM TX queue (RX for AP).
* @qlen: queue length. Applies to both TX/RX queues.
* @mlen: message length. Applies to both TX/RX queues.
* @reserved2: unused fields.
* @poll_completion: true when the channel works on polling.
*/
struct acpm_chan_shmem {
u32 id;
u32 reserved[3];
u32 rx_rear;
u32 rx_front;
u32 rx_base;
u32 reserved1[3];
u32 tx_rear;
u32 tx_front;
u32 tx_base;
u32 qlen;
u32 mlen;
u32 reserved2[2];
u32 poll_completion;
};
/**
* struct acpm_queue - exynos acpm queue.
*
* @rear: rear address of the queue.
* @front: front address of the queue.
* @base: base address of the queue.
*/
struct acpm_queue {
void __iomem *rear;
void __iomem *front;
void __iomem *base;
};
/**
* struct acpm_rx_data - RX queue data.
*
* @cmd: pointer to where the data shall be saved.
* @cmdcnt: allocated capacity of the @cmd buffer in 32-bit words.
* @rxcnt: expected length of the response in 32-bit words.
* @completed: flag indicating if the firmware response has been fully
* processed.
*/
struct acpm_rx_data {
u32 *cmd __counted_by_ptr(cmdcnt);
size_t cmdcnt;
size_t rxcnt;
bool completed;
};
#define ACPM_SEQNUM_MAX 64
/**
* struct acpm_chan - driver internal representation of a channel.
* @cl: mailbox client.
* @chan: mailbox channel.
* @acpm: pointer to driver private data.
* @tx: TX queue. The enqueue is done by the host.
* - front index is written by the host.
* - rear index is written by the firmware.
*
* @rx: RX queue. The enqueue is done by the firmware.
* - front index is written by the firmware.
* - rear index is written by the host.
* @tx_lock: protects TX queue.
* @rx_lock: protects RX queue.
* @qlen: queue length. Applies to both TX/RX queues.
* @mlen: message length. Applies to both TX/RX queues.
* @seqnum: sequence number of the last message enqueued on TX queue.
* @id: channel ID.
* @poll_completion: indicates if the transfer needs to be polled for
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bitmap.h`, `linux/bitops.h`, `linux/cleanup.h`, `linux/container_of.h`, `linux/delay.h`, `linux/device.h`, `linux/find.h`.
- Detected declarations: `struct acpm_shmem`, `struct acpm_chan_shmem`, `struct acpm_queue`, `struct acpm_rx_data`, `struct acpm_chan`, `struct acpm_info`, `struct acpm_match_data`, `function acpm_get_saved_rx`, `function acpm_get_rx`, `function acpm_dequeue_by_polling`.
- Atlas domain: Driver Families / drivers/firmware.
- 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.