drivers/regulator/bd96801-regulator.c

Source file repositories/reference/linux-study-clean/drivers/regulator/bd96801-regulator.c

File Facts

System
Linux kernel
Corpus path
drivers/regulator/bd96801-regulator.c
Extension
.c
Size
41176 bytes
Lines
1353
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct bd96801_irqinfo {
	int type;
	struct regulator_irq_desc irq_desc;
	int err_cfg;
	int wrn_cfg;
	const char *irq_name;
};

#define BD96801_IRQINFO(_type, _name, _irqoff_ms, _irqname)	\
{								\
	.type = (_type),					\
	.err_cfg = -1,						\
	.wrn_cfg = -1,						\
	.irq_name = (_irqname),					\
	.irq_desc = {						\
		.name = (_name),				\
		.irq_off_ms = (_irqoff_ms),			\
		.map_event = regulator_irq_map_event_simple,	\
	},							\
}

static const struct bd96801_irqinfo buck1_irqinfo[] = {
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck1-over-curr-h", 500,
			"buck1-overcurr-h"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck1-over-curr-l", 500,
			"buck1-overcurr-l"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck1-over-curr-n", 500,
			"buck1-overcurr-n"),
	BD96801_IRQINFO(BD96801_PROT_OVP, "buck1-over-voltage", 500,
			"buck1-overvolt"),
	BD96801_IRQINFO(BD96801_PROT_UVP, "buck1-under-voltage", 500,
			"buck1-undervolt"),
	BD96801_IRQINFO(BD96801_PROT_TEMP, "buck1-over-temp", 500,
			"buck1-thermal")
};

static const struct bd96801_irqinfo buck2_irqinfo[] = {
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck2-over-curr-h", 500,
			"buck2-overcurr-h"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck2-over-curr-l", 500,
			"buck2-overcurr-l"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck2-over-curr-n", 500,
			"buck2-overcurr-n"),
	BD96801_IRQINFO(BD96801_PROT_OVP, "buck2-over-voltage", 500,
			"buck2-overvolt"),
	BD96801_IRQINFO(BD96801_PROT_UVP, "buck2-under-voltage", 500,
			"buck2-undervolt"),
	BD96801_IRQINFO(BD96801_PROT_TEMP, "buck2-over-temp", 500,
			"buck2-thermal")
};

static const struct bd96801_irqinfo buck3_irqinfo[] = {
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck3-over-curr-h", 500,
			"buck3-overcurr-h"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck3-over-curr-l", 500,
			"buck3-overcurr-l"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck3-over-curr-n", 500,
			"buck3-overcurr-n"),
	BD96801_IRQINFO(BD96801_PROT_OVP, "buck3-over-voltage", 500,
			"buck3-overvolt"),
	BD96801_IRQINFO(BD96801_PROT_UVP, "buck3-under-voltage", 500,
			"buck3-undervolt"),
	BD96801_IRQINFO(BD96801_PROT_TEMP, "buck3-over-temp", 500,
			"buck3-thermal")
};

static const struct bd96801_irqinfo buck4_irqinfo[] = {
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck4-over-curr-h", 500,
			"buck4-overcurr-h"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck4-over-curr-l", 500,
			"buck4-overcurr-l"),
	BD96801_IRQINFO(BD96801_PROT_OCP, "buck4-over-curr-n", 500,
			"buck4-overcurr-n"),
	BD96801_IRQINFO(BD96801_PROT_OVP, "buck4-over-voltage", 500,
			"buck4-overvolt"),
	BD96801_IRQINFO(BD96801_PROT_UVP, "buck4-under-voltage", 500,
			"buck4-undervolt"),
	BD96801_IRQINFO(BD96801_PROT_TEMP, "buck4-over-temp", 500,
			"buck4-thermal")
};

static const struct bd96801_irqinfo ldo5_irqinfo[] = {
	BD96801_IRQINFO(BD96801_PROT_OCP, "ldo5-overcurr", 500,
			"ldo5-overcurr"),
	BD96801_IRQINFO(BD96801_PROT_OVP, "ldo5-over-voltage", 500,
			"ldo5-overvolt"),
	BD96801_IRQINFO(BD96801_PROT_UVP, "ldo5-under-voltage", 500,
			"ldo5-undervolt"),
};

Annotation

Implementation Notes