drivers/regulator/act8865-regulator.c

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

File Facts

System
Linux kernel
Corpus path
drivers/regulator/act8865-regulator.c
Extension
.c
Size
22020 bytes
Lines
801
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 act8865 {
	struct regmap *regmap;
	int off_reg;
	int off_mask;
};

static const struct regmap_range act8600_reg_ranges[] = {
	regmap_reg_range(0x00, 0x01),
	regmap_reg_range(0x10, 0x10),
	regmap_reg_range(0x12, 0x12),
	regmap_reg_range(0x20, 0x20),
	regmap_reg_range(0x22, 0x22),
	regmap_reg_range(0x30, 0x30),
	regmap_reg_range(0x32, 0x32),
	regmap_reg_range(0x40, 0x41),
	regmap_reg_range(0x50, 0x51),
	regmap_reg_range(0x60, 0x61),
	regmap_reg_range(0x70, 0x71),
	regmap_reg_range(0x80, 0x81),
	regmap_reg_range(0x91, 0x91),
	regmap_reg_range(0xA1, 0xA1),
	regmap_reg_range(0xA8, 0xAA),
	regmap_reg_range(0xB0, 0xB0),
	regmap_reg_range(0xB2, 0xB2),
	regmap_reg_range(0xC1, 0xC1),
};

static const struct regmap_range act8600_reg_ro_ranges[] = {
	regmap_reg_range(0xAA, 0xAA),
	regmap_reg_range(0xC1, 0xC1),
};

static const struct regmap_range act8600_reg_volatile_ranges[] = {
	regmap_reg_range(0x00, 0x01),
	regmap_reg_range(0x12, 0x12),
	regmap_reg_range(0x22, 0x22),
	regmap_reg_range(0x32, 0x32),
	regmap_reg_range(0x41, 0x41),
	regmap_reg_range(0x51, 0x51),
	regmap_reg_range(0x61, 0x61),
	regmap_reg_range(0x71, 0x71),
	regmap_reg_range(0x81, 0x81),
	regmap_reg_range(0xA8, 0xA8),
	regmap_reg_range(0xAA, 0xAA),
	regmap_reg_range(0xB0, 0xB0),
	regmap_reg_range(0xC1, 0xC1),
};

static const struct regmap_access_table act8600_write_ranges_table = {
	.yes_ranges	= act8600_reg_ranges,
	.n_yes_ranges	= ARRAY_SIZE(act8600_reg_ranges),
	.no_ranges	= act8600_reg_ro_ranges,
	.n_no_ranges	= ARRAY_SIZE(act8600_reg_ro_ranges),
};

static const struct regmap_access_table act8600_read_ranges_table = {
	.yes_ranges	= act8600_reg_ranges,
	.n_yes_ranges	= ARRAY_SIZE(act8600_reg_ranges),
};

static const struct regmap_access_table act8600_volatile_ranges_table = {
	.yes_ranges	= act8600_reg_volatile_ranges,
	.n_yes_ranges	= ARRAY_SIZE(act8600_reg_volatile_ranges),
};

static const struct regmap_config act8600_regmap_config = {
	.reg_bits = 8,
	.val_bits = 8,
	.max_register = 0xFF,
	.wr_table = &act8600_write_ranges_table,
	.rd_table = &act8600_read_ranges_table,
	.volatile_table = &act8600_volatile_ranges_table,
};

static const struct regmap_config act8865_regmap_config = {
	.reg_bits = 8,
	.val_bits = 8,
};

static const struct linear_range act8865_voltage_ranges[] = {
	REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000),
	REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000),
	REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000),
};

static const struct linear_range act8600_sudcdc_voltage_ranges[] = {
	REGULATOR_LINEAR_RANGE(3000000, 0, 63, 0),
	REGULATOR_LINEAR_RANGE(3000000, 64, 159, 100000),
	REGULATOR_LINEAR_RANGE(12600000, 160, 191, 200000),
	REGULATOR_LINEAR_RANGE(19000000, 192, 247, 400000),

Annotation

Implementation Notes