drivers/regulator/fp9931.c
Source file repositories/reference/linux-study-clean/drivers/regulator/fp9931.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/fp9931.c- Extension
.c- Size
- 12712 bytes
- Lines
- 557
- Domain
- Driver Families
- Bucket
- drivers/regulator
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/cleanup.hlinux/completion.hlinux/gpio/consumer.hlinux/i2c.hlinux/module.hlinux/mutex.hlinux/hwmon.hlinux/pm_runtime.hlinux/property.hlinux/regulator/consumer.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regmap.h
Detected Declarations
struct fp9931_datafunction setup_timingsfunction fp9931_hwmon_readfunction fp9931_hwmon_is_visiblefunction fp9931_runtime_suspendfunction fp9931_runtime_resumefunction fp9931_volatile_regfunction disable_nopmfunction fp9931_v3p3_enablefunction fp9931_v3p3_disablefunction fp9931_v3p3_is_enabledfunction fp9931_check_powergoodfunction fp9931_get_voltage_selfunction fp9931_set_voltage_selfunction pgood_handlerfunction fp9931_set_enablefunction fp9931_clear_enablefunction fp9931_probe
Annotated Snippet
struct fp9931_data {
struct device *dev;
struct regmap *regmap;
struct regulator *vin_reg;
struct gpio_desc *pgood_gpio;
struct gpio_desc *en_gpio;
struct gpio_desc *en_ts_gpio;
struct completion pgood_completion;
int pgood_irq;
};
static const unsigned int VPOSNEG_table[] = {
7040000,
7040000,
7040000,
7040000,
7040000,
7040000,
7260000,
7490000,
7710000,
7930000,
8150000,
8380000,
8600000,
8820000,
9040000,
9270000,
9490000,
9710000,
9940000,
10160000,
10380000,
10600000,
10830000,
11050000,
11270000,
11490000,
11720000,
11940000,
12160000,
12380000,
12610000,
12830000,
13050000,
13280000,
13500000,
13720000,
13940000,
14170000,
14390000,
14610000,
14830000,
15060000,
};
static const struct hwmon_channel_info *fp9931_info[] = {
HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
NULL
};
static int setup_timings(struct fp9931_data *data)
{
u32 tdly[4];
u8 tdlys = 0;
int i;
int ret;
ret = device_property_count_u32(data->dev, "fitipower,tdly-ms");
if (ret == -EINVAL) /* property is optional */
return 0;
if (ret < 0)
return ret;
if (ret != ARRAY_SIZE(tdly)) {
dev_err(data->dev, "invalid delay specification");
return -EINVAL;
}
ret = device_property_read_u32_array(data->dev, "fitipower,tdly-ms",
tdly, ARRAY_SIZE(tdly));
if (ret)
return ret;
for (i = ARRAY_SIZE(tdly) - 1; i >= 0; i--) {
if (tdly[i] > 4 || tdly[i] == 3)
return -EINVAL;
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/completion.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/module.h`, `linux/mutex.h`, `linux/hwmon.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct fp9931_data`, `function setup_timings`, `function fp9931_hwmon_read`, `function fp9931_hwmon_is_visible`, `function fp9931_runtime_suspend`, `function fp9931_runtime_resume`, `function fp9931_volatile_reg`, `function disable_nopm`, `function fp9931_v3p3_enable`, `function fp9931_v3p3_disable`.
- Atlas domain: Driver Families / drivers/regulator.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.