drivers/hwmon/pmbus/xdpe1a2g7b.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/pmbus/xdpe1a2g7b.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/pmbus/xdpe1a2g7b.c- Extension
.c- Size
- 3265 bytes
- Lines
- 120
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- 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/i2c.hlinux/init.hlinux/kernel.hlinux/module.hpmbus.h
Detected Declarations
function Copyrightfunction xdpe1a2g7b_probe
Annotated Snippet
switch (vout_params) {
case XDPE1A2G7B_NVIDIA_195MV:
/* VID vrm_version for PAGE0 and PAGE1 */
info->vrm_version[0] = nvidia195mv;
info->vrm_version[1] = nvidia195mv;
break;
default:
return -EINVAL;
}
break;
default:
return -ENODEV;
}
return 0;
}
static struct pmbus_driver_info xdpe1a2g7b_info = {
.pages = XDPE1A2G7B_PAGE_NUM,
.identify = xdpe1a2g7b_identify,
.format[PSC_VOLTAGE_IN] = linear,
.format[PSC_TEMPERATURE] = linear,
.format[PSC_CURRENT_IN] = linear,
.format[PSC_CURRENT_OUT] = linear,
.format[PSC_POWER] = linear,
.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP |
PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT,
.func[1] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
PMBUS_HAVE_PIN | PMBUS_HAVE_POUT | PMBUS_HAVE_STATUS_INPUT,
};
static int xdpe1a2g7b_probe(struct i2c_client *client)
{
struct pmbus_driver_info *info;
info = devm_kmemdup(&client->dev, &xdpe1a2g7b_info, sizeof(*info),
GFP_KERNEL);
if (!info)
return -ENOMEM;
return pmbus_do_probe(client, info);
}
static const struct i2c_device_id xdpe1a2g7b_id[] = {
{ .name = "xdpe1a2g5b" },
{ .name = "xdpe1a2g7b" },
{ }
};
MODULE_DEVICE_TABLE(i2c, xdpe1a2g7b_id);
static const struct of_device_id __maybe_unused xdpe1a2g7b_of_match[] = {
{ .compatible = "infineon,xdpe1a2g5b" },
{ .compatible = "infineon,xdpe1a2g7b" },
{}
};
MODULE_DEVICE_TABLE(of, xdpe1a2g7b_of_match);
static struct i2c_driver xdpe1a2g7b_driver = {
.driver = {
.name = "xdpe1a2g7b",
.of_match_table = of_match_ptr(xdpe1a2g7b_of_match),
},
.probe = xdpe1a2g7b_probe,
.id_table = xdpe1a2g7b_id,
};
module_i2c_driver(xdpe1a2g7b_driver);
MODULE_AUTHOR("Ashish Yadav <ashish.yadav@infineon.com>");
MODULE_DESCRIPTION("PMBus driver for Infineon XDPE1A2G5B/7B");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS("PMBUS");
Annotation
- Immediate include surface: `linux/err.h`, `linux/i2c.h`, `linux/init.h`, `linux/kernel.h`, `linux/module.h`, `pmbus.h`.
- Detected declarations: `function Copyright`, `function xdpe1a2g7b_probe`.
- Atlas domain: Driver Families / drivers/hwmon.
- 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.