drivers/regulator/pf9453-regulator.c

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

File Facts

System
Linux kernel
Corpus path
drivers/regulator/pf9453-regulator.c
Extension
.c
Size
23290 bytes
Lines
874
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 pf9453_dvs_config {
	unsigned int run_reg; /* dvs0 */
	unsigned int run_mask;
	unsigned int standby_reg; /* dvs1 */
	unsigned int standby_mask;
};

struct pf9453_regulator_desc {
	struct regulator_desc desc;
	const struct pf9453_dvs_config dvs;
};

struct pf9453 {
	struct device *dev;
	struct regmap *regmap;
	struct gpio_desc *sd_vsel_gpio;
	int irq;
};

enum {
	PF9453_BUCK1 = 0,
	PF9453_BUCK2,
	PF9453_BUCK3,
	PF9453_BUCK4,
	PF9453_LDO1,
	PF9453_LDO2,
	PF9453_LDOSNVS,
	PF9453_REGULATOR_CNT
};

enum {
	PF9453_DVS_LEVEL_RUN = 0,
	PF9453_DVS_LEVEL_STANDBY,
	PF9453_DVS_LEVEL_DPSTANDBY,
	PF9453_DVS_LEVEL_MAX
};

#define PF9453_BUCK1_VOLTAGE_NUM	0x80
#define PF9453_BUCK2_VOLTAGE_NUM	0x80
#define PF9453_BUCK3_VOLTAGE_NUM	0x80
#define PF9453_BUCK4_VOLTAGE_NUM	0x80

#define PF9453_LDO1_VOLTAGE_NUM		0x65
#define PF9453_LDO2_VOLTAGE_NUM		0x3b
#define PF9453_LDOSNVS_VOLTAGE_NUM	0x59

enum {
	PF9453_REG_DEV_ID		= 0x01,
	PF9453_REG_INT1			= 0x02,
	PF9453_REG_INT1_MASK		= 0x03,
	PF9453_REG_INT1_STATUS		= 0x04,
	PF9453_REG_VRFLT1_INT		= 0x05,
	PF9453_REG_VRFLT1_MASK		= 0x06,
	PF9453_REG_PWRON_STAT		= 0x07,
	PF9453_REG_RESET_CTRL		= 0x08,
	PF9453_REG_SW_RST		= 0x09,
	PF9453_REG_PWR_CTRL		= 0x0a,
	PF9453_REG_CONFIG1		= 0x0b,
	PF9453_REG_CONFIG2		= 0x0c,
	PF9453_REG_32K_CONFIG		= 0x0d,
	PF9453_REG_BUCK1CTRL		= 0x10,
	PF9453_REG_BUCK1OUT		= 0x11,
	PF9453_REG_BUCK2CTRL		= 0x14,
	PF9453_REG_BUCK2OUT		= 0x15,
	PF9453_REG_BUCK2OUT_STBY	= 0x1d,
	PF9453_REG_BUCK2OUT_MAX_LIMIT	= 0x1f,
	PF9453_REG_BUCK2OUT_MIN_LIMIT	= 0x20,
	PF9453_REG_BUCK3CTRL		= 0x21,
	PF9453_REG_BUCK3OUT		= 0x22,
	PF9453_REG_BUCK4CTRL		= 0x2e,
	PF9453_REG_BUCK4OUT		= 0x2f,
	PF9453_REG_LDO1OUT_L		= 0x36,
	PF9453_REG_LDO1CFG		= 0x37,
	PF9453_REG_LDO1OUT_H		= 0x38,
	PF9453_REG_LDOSNVS_CFG1		= 0x39,
	PF9453_REG_LDOSNVS_CFG2		= 0x3a,
	PF9453_REG_LDO2CFG		= 0x3b,
	PF9453_REG_LDO2OUT		= 0x3c,
	PF9453_REG_BUCK_POK		= 0x3d,
	PF9453_REG_LSW_CTRL1		= 0x40,
	PF9453_REG_LSW_CTRL2		= 0x41,
	PF9453_REG_LOCK			= 0x4e,
	PF9453_MAX_REG
};

#define PF9453_UNLOCK_KEY		0x5c
#define PF9453_LOCK_KEY			0x0

/* PF9453 BUCK ENMODE bits */
#define BUCK_ENMODE_OFF			0x00

Annotation

Implementation Notes