Lines Matching refs:p
29 static int pmic_charger_state(struct pmic *p, int state, int current) in pmic_charger_state() argument
34 if (pmic_probe(p)) in pmic_charger_state()
39 pmic_reg_read(p, MAX8997_REG_MBCCTRL2, &val); in pmic_charger_state()
41 pmic_reg_write(p, MAX8997_REG_MBCCTRL2, val); in pmic_charger_state()
59 pmic_reg_write(p, MAX8997_REG_MBCCTRL4, val); in pmic_charger_state()
61 pmic_reg_read(p, MAX8997_REG_MBCCTRL2, &val); in pmic_charger_state()
63 pmic_reg_write(p, MAX8997_REG_MBCCTRL2, val); in pmic_charger_state()
68 static int pmic_charger_bat_present(struct pmic *p) in pmic_charger_bat_present() argument
72 if (pmic_probe(p)) in pmic_charger_bat_present()
75 pmic_reg_read(p, MAX8997_REG_STATUS4, &val); in pmic_charger_bat_present()
88 struct pmic *p = pmic_alloc(); in pmic_init() local
90 if (!p) { in pmic_init()
97 p->name = name; in pmic_init()
98 p->interface = PMIC_I2C; in pmic_init()
99 p->number_of_regs = PMIC_NUM_OF_REGS; in pmic_init()
100 p->hw.i2c.addr = MAX8997_I2C_ADDR; in pmic_init()
101 p->hw.i2c.tx_num = 1; in pmic_init()
102 p->bus = bus; in pmic_init()
104 p->chrg = &power_chrg_pmic_ops; in pmic_init()