drivers/firmware/imx/sm-misc.c
Source file repositories/reference/linux-study-clean/drivers/firmware/imx/sm-misc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/imx/sm-misc.c- Extension
.c- Size
- 6784 bytes
- Lines
- 228
- 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/debugfs.hlinux/device/devres.hlinux/firmware/imx/sm.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/scmi_protocol.hlinux/scmi_imx_protocol.hlinux/seq_file.hlinux/sizes.h
Detected Declarations
function scmi_imx_misc_ctrl_setfunction scmi_imx_misc_ctrl_getfunction scmi_imx_misc_ctrl_notifierfunction syslog_showfunction scmi_imx_misc_putfunction scmi_imx_misc_get_reasonfunction scmi_imx_misc_ctrl_probeexport scmi_imx_misc_ctrl_setexport scmi_imx_misc_ctrl_get
Annotated Snippet
if (ret) {
dev_err(&sdev->dev, "Failed to read ctrl-id: %i\n", i);
continue;
}
ret = of_property_read_u32_index(np, "nxp,ctrl-ids", i + 1, &flags);
if (ret) {
dev_err(&sdev->dev, "Failed to read ctrl-id value: %d\n", i + 1);
continue;
}
ret = handle->notify_ops->devm_event_notifier_register(sdev, SCMI_PROTOCOL_IMX_MISC,
SCMI_EVENT_IMX_MISC_CONTROL,
&src_id,
&scmi_imx_misc_ctrl_nb);
if (ret) {
dev_err(&sdev->dev, "Failed to register scmi misc event: %d\n", src_id);
} else {
ret = imx_misc_ctrl_ops->misc_ctrl_req_notify(ph, src_id,
SCMI_EVENT_IMX_MISC_CONTROL,
flags);
if (ret)
dev_err(&sdev->dev, "Failed to req notify: %d\n", src_id);
}
}
scmi_imx_dentry = debugfs_create_dir("scmi_imx", NULL);
debugfs_create_file("syslog", 0444, scmi_imx_dentry, &sdev->dev, &syslog_fops);
scmi_imx_misc_get_reason(sdev);
return devm_add_action_or_reset(&sdev->dev, scmi_imx_misc_put, scmi_imx_dentry);
}
static const struct scmi_device_id scmi_id_table[] = {
{ SCMI_PROTOCOL_IMX_MISC, "imx-misc-ctrl" },
{ },
};
MODULE_DEVICE_TABLE(scmi, scmi_id_table);
static struct scmi_driver scmi_imx_misc_ctrl_driver = {
.name = "scmi-imx-misc-ctrl",
.probe = scmi_imx_misc_ctrl_probe,
.id_table = scmi_id_table,
};
module_scmi_driver(scmi_imx_misc_ctrl_driver);
MODULE_AUTHOR("Peng Fan <peng.fan@nxp.com>");
MODULE_DESCRIPTION("IMX SM MISC driver");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/device/devres.h`, `linux/firmware/imx/sm.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/scmi_protocol.h`, `linux/scmi_imx_protocol.h`.
- Detected declarations: `function scmi_imx_misc_ctrl_set`, `function scmi_imx_misc_ctrl_get`, `function scmi_imx_misc_ctrl_notifier`, `function syslog_show`, `function scmi_imx_misc_put`, `function scmi_imx_misc_get_reason`, `function scmi_imx_misc_ctrl_probe`, `export scmi_imx_misc_ctrl_set`, `export scmi_imx_misc_ctrl_get`.
- 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.