drivers/power/reset/ep93xx-restart.c
Source file repositories/reference/linux-study-clean/drivers/power/reset/ep93xx-restart.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/power/reset/ep93xx-restart.c- Extension
.c- Size
- 2167 bytes
- Lines
- 85
- Domain
- Driver Families
- Bucket
- drivers/power
- 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.
- 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.
- 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/bits.hlinux/container_of.hlinux/delay.hlinux/errno.hlinux/mfd/syscon.hlinux/module.hlinux/mod_devicetable.hlinux/notifier.hlinux/reboot.hlinux/slab.hlinux/soc/cirrus/ep93xx.h
Detected Declarations
struct ep93xx_restartfunction ep93xx_restart_handlefunction ep93xx_reboot_probe
Annotated Snippet
struct ep93xx_restart {
struct ep93xx_regmap_adev *aux_dev;
struct notifier_block restart_handler;
};
static int ep93xx_restart_handle(struct notifier_block *this,
unsigned long mode, void *cmd)
{
struct ep93xx_restart *priv =
container_of(this, struct ep93xx_restart, restart_handler);
struct ep93xx_regmap_adev *aux = priv->aux_dev;
/* Issue the reboot */
aux->update_bits(aux->map, aux->lock, EP93XX_SYSCON_DEVCFG,
EP93XX_SYSCON_DEVCFG_SWRST, EP93XX_SYSCON_DEVCFG_SWRST);
aux->update_bits(aux->map, aux->lock, EP93XX_SYSCON_DEVCFG,
EP93XX_SYSCON_DEVCFG_SWRST, 0);
return NOTIFY_DONE;
}
static int ep93xx_reboot_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{
struct ep93xx_regmap_adev *rdev = to_ep93xx_regmap_adev(adev);
struct device *dev = &adev->dev;
struct ep93xx_restart *priv;
int err;
if (!rdev->update_bits)
return -ENODEV;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
priv->aux_dev = rdev;
priv->restart_handler.notifier_call = ep93xx_restart_handle;
priv->restart_handler.priority = 128;
err = register_restart_handler(&priv->restart_handler);
if (err)
return dev_err_probe(dev, err, "can't register restart notifier\n");
return 0;
}
static const struct auxiliary_device_id ep93xx_reboot_ids[] = {
{
.name = "soc_ep93xx.reset-ep93xx",
},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(auxiliary, ep93xx_reboot_ids);
static struct auxiliary_driver ep93xx_reboot_driver = {
.probe = ep93xx_reboot_probe,
.id_table = ep93xx_reboot_ids,
};
module_auxiliary_driver(ep93xx_reboot_driver);
Annotation
- Immediate include surface: `linux/bits.h`, `linux/container_of.h`, `linux/delay.h`, `linux/errno.h`, `linux/mfd/syscon.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/notifier.h`.
- Detected declarations: `struct ep93xx_restart`, `function ep93xx_restart_handle`, `function ep93xx_reboot_probe`.
- Atlas domain: Driver Families / drivers/power.
- Implementation status: source 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.