drivers/hwmon/pmbus/adp1050.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/pmbus/adp1050.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/pmbus/adp1050.c- Extension
.c- Size
- 3544 bytes
- Lines
- 123
- 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/bits.hlinux/i2c.hlinux/mod_devicetable.hlinux/module.hpmbus.h
Detected Declarations
function adp1050_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Hardware monitoring driver for Analog Devices ADP1050
*
* Copyright (C) 2024 Analog Devices, Inc.
*/
#include <linux/bits.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include "pmbus.h"
#if IS_ENABLED(CONFIG_SENSORS_ADP1050_REGULATOR)
static const struct regulator_desc adp1050_reg_desc[] = {
PMBUS_REGULATOR_ONE("vout"),
};
#endif /* CONFIG_SENSORS_ADP1050_REGULATOR */
static struct pmbus_driver_info adp1050_info = {
.pages = 1,
.format[PSC_VOLTAGE_IN] = linear,
.format[PSC_VOLTAGE_OUT] = linear,
.format[PSC_CURRENT_IN] = linear,
.format[PSC_TEMPERATURE] = linear,
.func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
| PMBUS_HAVE_IIN | PMBUS_HAVE_TEMP
| PMBUS_HAVE_STATUS_TEMP,
};
static struct pmbus_driver_info adp1051_info = {
.pages = 1,
.format[PSC_VOLTAGE_IN] = linear,
.format[PSC_VOLTAGE_OUT] = linear,
.format[PSC_CURRENT_IN] = linear,
.format[PSC_TEMPERATURE] = linear,
.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
| PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT
| PMBUS_HAVE_TEMP
| PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT
| PMBUS_HAVE_STATUS_INPUT
| PMBUS_HAVE_STATUS_TEMP,
};
static struct pmbus_driver_info adp1055_info = {
.pages = 1,
.format[PSC_VOLTAGE_IN] = linear,
.format[PSC_VOLTAGE_OUT] = linear,
.format[PSC_CURRENT_IN] = linear,
.format[PSC_TEMPERATURE] = linear,
.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
| PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT
| PMBUS_HAVE_TEMP2 | PMBUS_HAVE_TEMP3
| PMBUS_HAVE_POUT
| PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT
| PMBUS_HAVE_STATUS_INPUT
| PMBUS_HAVE_STATUS_TEMP,
};
static struct pmbus_driver_info ltp8800_info = {
.pages = 1,
.format[PSC_VOLTAGE_IN] = linear,
.format[PSC_VOLTAGE_OUT] = linear,
.format[PSC_CURRENT_IN] = linear,
.format[PSC_TEMPERATURE] = linear,
.func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
| PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT
| PMBUS_HAVE_TEMP
| PMBUS_HAVE_POUT
| PMBUS_HAVE_STATUS_VOUT
| PMBUS_HAVE_STATUS_INPUT
| PMBUS_HAVE_STATUS_TEMP,
#if IS_ENABLED(CONFIG_SENSORS_ADP1050_REGULATOR)
.num_regulators = 1,
.reg_desc = adp1050_reg_desc,
#endif
};
static int adp1050_probe(struct i2c_client *client)
{
struct pmbus_driver_info *info;
info = (struct pmbus_driver_info *)i2c_get_match_data(client);
if (!info)
return -ENODEV;
return pmbus_do_probe(client, info);
}
Annotation
- Immediate include surface: `linux/bits.h`, `linux/i2c.h`, `linux/mod_devicetable.h`, `linux/module.h`, `pmbus.h`.
- Detected declarations: `function adp1050_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.