drivers/misc/amd-sbi/rmi-hwmon.c
Source file repositories/reference/linux-study-clean/drivers/misc/amd-sbi/rmi-hwmon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/amd-sbi/rmi-hwmon.c- Extension
.c- Size
- 2646 bytes
- Lines
- 121
- Domain
- Driver Families
- Bucket
- drivers/misc
- 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/err.hlinux/hwmon.huapi/misc/amd-apml.hrmi-core.h
Detected Declarations
function Copyrightfunction sbrmi_writefunction sbrmi_is_visiblefunction create_hwmon_sensor_device
Annotated Snippet
switch (attr) {
case hwmon_power_input:
case hwmon_power_cap_max:
return 0444;
case hwmon_power_cap:
return 0644;
}
break;
default:
break;
}
return 0;
}
static const struct hwmon_channel_info * const sbrmi_info[] = {
HWMON_CHANNEL_INFO(power,
HWMON_P_INPUT | HWMON_P_CAP | HWMON_P_CAP_MAX),
NULL
};
static const struct hwmon_ops sbrmi_hwmon_ops = {
.is_visible = sbrmi_is_visible,
.read = sbrmi_read,
.write = sbrmi_write,
};
static const struct hwmon_chip_info sbrmi_chip_info = {
.ops = &sbrmi_hwmon_ops,
.info = sbrmi_info,
};
int create_hwmon_sensor_device(struct device *dev, struct sbrmi_data *data)
{
struct device *hwmon_dev;
hwmon_dev = devm_hwmon_device_register_with_info(dev, "sbrmi", data,
&sbrmi_chip_info, NULL);
return PTR_ERR_OR_ZERO(hwmon_dev);
}
Annotation
- Immediate include surface: `linux/err.h`, `linux/hwmon.h`, `uapi/misc/amd-apml.h`, `rmi-core.h`.
- Detected declarations: `function Copyright`, `function sbrmi_write`, `function sbrmi_is_visible`, `function create_hwmon_sensor_device`.
- Atlas domain: Driver Families / drivers/misc.
- 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.