drivers/crypto/caam/ctrl.c
Source file repositories/reference/linux-study-clean/drivers/crypto/caam/ctrl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/caam/ctrl.c- Extension
.c- Size
- 32627 bytes
- Lines
- 1173
- Domain
- Driver Families
- Bucket
- drivers/crypto
- 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/device.hlinux/of_address.hlinux/of_irq.hlinux/platform_device.hlinux/sys_soc.hlinux/fsl/mc.hcompat.hdebugfs.hregs.hintern.hjr.hdesc_constr.hctrl.hqi.h
Detected Declarations
struct caam_imx_datafunction build_instantiation_descfunction build_deinstantiation_descfunction softwarefunction deinstantiate_rngfunction devm_deinstantiate_rngfunction instantiate_rngfunction kick_trngfunction caam_get_era_from_hwfunction caam_get_erafunction handle_imx6_err005766function disable_clocksfunction init_clocksfunction caam_remove_debugfsfunction check_versionfunction needs_entropy_delay_adjustmentfunction caam_ctrl_rng_initfunction caam_off_during_pmfunction caam_state_savefunction caam_state_restorefunction caam_ctrl_suspendfunction caam_ctrl_resumefunction caam_probefunction LS1028Aexport caam_dpaa2
Annotated Snippet
struct caam_imx_data {
bool page0_access;
const struct clk_bulk_data *clks;
int num_clks;
};
static const struct clk_bulk_data caam_imx6_clks[] = {
{ .id = "ipg" },
{ .id = "mem" },
{ .id = "aclk" },
{ .id = "emi_slow" },
};
static const struct caam_imx_data caam_imx6_data = {
.page0_access = true,
.clks = caam_imx6_clks,
.num_clks = ARRAY_SIZE(caam_imx6_clks),
};
static const struct clk_bulk_data caam_imx7_clks[] = {
{ .id = "ipg" },
{ .id = "aclk" },
};
static const struct caam_imx_data caam_imx7_data = {
.page0_access = true,
.clks = caam_imx7_clks,
.num_clks = ARRAY_SIZE(caam_imx7_clks),
};
static const struct clk_bulk_data caam_imx6ul_clks[] = {
{ .id = "ipg" },
{ .id = "mem" },
{ .id = "aclk" },
};
static const struct caam_imx_data caam_imx6ul_data = {
.page0_access = true,
.clks = caam_imx6ul_clks,
.num_clks = ARRAY_SIZE(caam_imx6ul_clks),
};
static const struct clk_bulk_data caam_vf610_clks[] = {
{ .id = "ipg" },
};
static const struct caam_imx_data caam_vf610_data = {
.page0_access = true,
.clks = caam_vf610_clks,
.num_clks = ARRAY_SIZE(caam_vf610_clks),
};
static const struct caam_imx_data caam_imx8ulp_data;
static const struct soc_device_attribute caam_imx_soc_table[] = {
{ .soc_id = "i.MX6UL", .data = &caam_imx6ul_data },
{ .soc_id = "i.MX6*", .data = &caam_imx6_data },
{ .soc_id = "i.MX7*", .data = &caam_imx7_data },
{ .soc_id = "i.MX8M*", .data = &caam_imx7_data },
{ .soc_id = "i.MX8ULP", .data = &caam_imx8ulp_data },
{ .soc_id = "i.MX8Q*", .data = &caam_imx8ulp_data },
{ .soc_id = "VF*", .data = &caam_vf610_data },
{ .family = "Freescale i.MX" },
{ /* sentinel */ }
};
static void disable_clocks(void *data)
{
struct caam_drv_private *ctrlpriv = data;
clk_bulk_disable_unprepare(ctrlpriv->num_clks, ctrlpriv->clks);
}
static int init_clocks(struct device *dev, const struct caam_imx_data *data)
{
struct caam_drv_private *ctrlpriv = dev_get_drvdata(dev);
int ret;
ctrlpriv->num_clks = data->num_clks;
ctrlpriv->clks = devm_kmemdup_array(dev, data->clks,
data->num_clks, sizeof(*data->clks),
GFP_KERNEL);
if (!ctrlpriv->clks)
return -ENOMEM;
ret = devm_clk_bulk_get(dev, ctrlpriv->num_clks, ctrlpriv->clks);
if (ret) {
dev_err(dev,
"Failed to request all necessary clocks\n");
return ret;
Annotation
- Immediate include surface: `linux/device.h`, `linux/of_address.h`, `linux/of_irq.h`, `linux/platform_device.h`, `linux/sys_soc.h`, `linux/fsl/mc.h`, `compat.h`, `debugfs.h`.
- Detected declarations: `struct caam_imx_data`, `function build_instantiation_desc`, `function build_deinstantiation_desc`, `function software`, `function deinstantiate_rng`, `function devm_deinstantiate_rng`, `function instantiate_rng`, `function kick_trng`, `function caam_get_era_from_hw`, `function caam_get_era`.
- Atlas domain: Driver Families / drivers/crypto.
- 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.