drivers/acpi/pmic/tps68470_pmic.c

Source file repositories/reference/linux-study-clean/drivers/acpi/pmic/tps68470_pmic.c

File Facts

System
Linux kernel
Corpus path
drivers/acpi/pmic/tps68470_pmic.c
Extension
.c
Size
10271 bytes
Lines
446
Domain
Driver Families
Bucket
drivers/acpi
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 tps68470_pmic_table {
	u32 address;		/* operation region address */
	u32 reg;		/* corresponding register */
	u32 bitmask;		/* bit mask for power, clock */
};

#define TI_PMIC_POWER_OPREGION_ID		0xB0
#define TI_PMIC_VR_VAL_OPREGION_ID		0xB1
#define TI_PMIC_CLOCK_OPREGION_ID		0xB2
#define TI_PMIC_CLKFREQ_OPREGION_ID		0xB3

struct tps68470_pmic_opregion {
	struct mutex lock;
	struct regmap *regmap;
};

#define S_IO_I2C_EN	(BIT(0) | BIT(1))

static const struct tps68470_pmic_table power_table[] = {
	{
		.address = 0x00,
		.reg = TPS68470_REG_S_I2C_CTL,
		.bitmask = S_IO_I2C_EN,
		/* S_I2C_CTL */
	},
	{
		.address = 0x04,
		.reg = TPS68470_REG_VCMCTL,
		.bitmask = BIT(0),
		/* VCMCTL */
	},
	{
		.address = 0x08,
		.reg = TPS68470_REG_VAUX1CTL,
		.bitmask = BIT(0),
		/* VAUX1_CTL */
	},
	{
		.address = 0x0C,
		.reg = TPS68470_REG_VAUX2CTL,
		.bitmask = BIT(0),
		/* VAUX2CTL */
	},
	{
		.address = 0x10,
		.reg = TPS68470_REG_VACTL,
		.bitmask = BIT(0),
		/* VACTL */
	},
	{
		.address = 0x14,
		.reg = TPS68470_REG_VDCTL,
		.bitmask = BIT(0),
		/* VDCTL */
	},
};

/* Table to set voltage regulator value */
static const struct tps68470_pmic_table vr_val_table[] = {
	{
		.address = 0x00,
		.reg = TPS68470_REG_VSIOVAL,
		.bitmask = TPS68470_VSIOVAL_IOVOLT_MASK,
		/* TPS68470_REG_VSIOVAL */
	},
	{
		.address = 0x04,
		.reg = TPS68470_REG_VIOVAL,
		.bitmask = TPS68470_VIOVAL_IOVOLT_MASK,
		/* TPS68470_REG_VIOVAL */
	},
	{
		.address = 0x08,
		.reg = TPS68470_REG_VCMVAL,
		.bitmask = TPS68470_VCMVAL_VCVOLT_MASK,
		/* TPS68470_REG_VCMVAL */
	},
	{
		.address = 0x0C,
		.reg = TPS68470_REG_VAUX1VAL,
		.bitmask = TPS68470_VAUX1VAL_AUX1VOLT_MASK,
		/* TPS68470_REG_VAUX1VAL */
	},
	{
		.address = 0x10,
		.reg = TPS68470_REG_VAUX2VAL,
		.bitmask = TPS68470_VAUX2VAL_AUX2VOLT_MASK,
		/* TPS68470_REG_VAUX2VAL */
	},
	{

Annotation

Implementation Notes