drivers/power/supply/ip5xxx_power.c

Source file repositories/reference/linux-study-clean/drivers/power/supply/ip5xxx_power.c

File Facts

System
Linux kernel
Corpus path
drivers/power/supply/ip5xxx_power.c
Extension
.c
Size
25303 bytes
Lines
884
Domain
Driver Families
Bucket
drivers/power
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 ip5xxx {
	struct regmap *regmap;
	bool initialized;
	struct {
		struct {
			/* Charger enable */
			struct regmap_field *enable;
			/* Constant voltage value */
			struct regmap_field *const_volt_sel;
			/* Constant current value */
			struct regmap_field *const_curr_sel;
			/* Charger status */
			struct regmap_field *status;
			/* Charging ended flag */
			struct regmap_field *chg_end;
			/* Timeout flags (CV, charge, trickle) */
			struct regmap_field *timeout;
			/* Overvoltage limit */
			struct regmap_field *vin_overvolt;
		} charger;
		struct {
			/* Boost converter enable */
			struct regmap_field *enable;
			struct {
				/* Light load shutdown enable */
				struct regmap_field *enable;
				/* Light load shutdown current limit */
				struct regmap_field *i_limit;
			} light_load_shutdown;
			/* Automatic powerup on increased load */
			struct regmap_field *load_powerup_en;
			/* Automatic powerup on VIN pull-out */
			struct regmap_field *vin_pullout_en;
			/* Undervoltage limit */
			struct regmap_field *undervolt_limit;
			/* Light load status flag */
			struct regmap_field *light_load_status;
		} boost;
		struct {
			/* NTC disable */
			struct regmap_field *ntc_dis;
			/* Battery voltage type */
			struct regmap_field *type;
			/* Battery voltage autoset from Vset pin */
			struct regmap_field *vset_en;
			struct {
				/* Battery measurement registers */
				struct ip5xxx_battery_adc_regs {
					struct regmap_field *low;
					struct regmap_field *high;
				} volt, curr, open_volt;
			} adc;
		} battery;
		struct {
			/* Double/long press shutdown enable */
			struct regmap_field *shdn_enable;
			/* WLED activation: double press or long press */
			struct regmap_field *wled_mode;
			/* Shutdown activation: double press or long press */
			struct regmap_field *shdn_mode;
			/* Long press time */
			struct regmap_field *long_press_time;
			/* Button pressed */
			struct regmap_field *pressed;
			/* Button long-pressed */
			struct regmap_field *long_pressed;
			/* Button short-pressed */
			struct regmap_field *short_pressed;
		} btn;
		struct {
			/* WLED enable */
			struct regmap_field *enable;
			/* WLED detect */
			struct regmap_field *detect_en;
			/* WLED present */
			struct regmap_field *present;
		} wled;
	} regs;

	/* Maximum supported battery voltage (via regs.battery.type) */
	int vbat_max;
	/* Scaling constants for regs.boost.undervolt_limit */
	struct {
		int setpoint;
		int microvolts_per_bit;
	} boost_undervolt;
	/* Scaling constants for regs.charger.const_curr_sel */
	struct {
		int setpoint;
	} const_curr;

Annotation

Implementation Notes