drivers/power/reset/rmobile-reset.c
Source file repositories/reference/linux-study-clean/drivers/power/reset/rmobile-reset.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/power/reset/rmobile-reset.c- Extension
.c- Size
- 1802 bytes
- Lines
- 74
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io.hlinux/module.hlinux/notifier.hlinux/of_address.hlinux/platform_device.hlinux/printk.hlinux/reboot.h
Detected Declarations
function Copyrightfunction rmobile_reset_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Renesas R-Mobile Reset Driver
*
* Copyright (C) 2014 Glider bvba
*/
#include <linux/io.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/printk.h>
#include <linux/reboot.h>
/* SYSC Register Bank 2 */
#define RESCNT2 0x20 /* Reset Control Register 2 */
/* Reset Control Register 2 */
#define RESCNT2_PRES 0x80000000 /* Soft power-on reset */
static int rmobile_reset_handler(struct sys_off_data *data)
{
void __iomem *sysc_base2 = (void __iomem *)data->cb_data;
/* Let's assume we have acquired the HPB semaphore */
writel(RESCNT2_PRES, sysc_base2 + RESCNT2);
return NOTIFY_DONE;
}
static int rmobile_reset_probe(struct platform_device *pdev)
{
void __iomem *sysc_base2;
int error;
sysc_base2 = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(sysc_base2))
return PTR_ERR(sysc_base2);
error = devm_register_sys_off_handler(&pdev->dev,
SYS_OFF_MODE_RESTART,
SYS_OFF_PRIO_HIGH,
rmobile_reset_handler,
(__force void *)sysc_base2);
if (error) {
dev_err(&pdev->dev,
"cannot register restart handler (err=%d)\n", error);
return error;
}
return 0;
}
static const struct of_device_id rmobile_reset_of_match[] = {
{ .compatible = "renesas,sysc-rmobile", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, rmobile_reset_of_match);
static struct platform_driver rmobile_reset_driver = {
.probe = rmobile_reset_probe,
.driver = {
.name = "rmobile_reset",
.of_match_table = rmobile_reset_of_match,
},
};
module_platform_driver(rmobile_reset_driver);
MODULE_DESCRIPTION("Renesas R-Mobile Reset Driver");
MODULE_AUTHOR("Geert Uytterhoeven <geert+renesas@glider.be>");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/io.h`, `linux/module.h`, `linux/notifier.h`, `linux/of_address.h`, `linux/platform_device.h`, `linux/printk.h`, `linux/reboot.h`.
- Detected declarations: `function Copyright`, `function rmobile_reset_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.