Lines Matching full:charger

3  * Battery charger driver for TI's tps65090
44 static int tps65090_low_chrg_current(struct tps65090_charger *charger) in tps65090_low_chrg_current() argument
48 if (charger->passive_mode) in tps65090_low_chrg_current()
51 ret = tps65090_write(charger->dev->parent, TPS65090_REG_CG_CTRL5, in tps65090_low_chrg_current()
54 dev_err(charger->dev, "%s(): error reading in register 0x%x\n", in tps65090_low_chrg_current()
61 static int tps65090_enable_charging(struct tps65090_charger *charger) in tps65090_enable_charging() argument
66 if (charger->passive_mode) in tps65090_enable_charging()
69 ret = tps65090_read(charger->dev->parent, TPS65090_REG_CG_CTRL0, in tps65090_enable_charging()
72 dev_err(charger->dev, "%s(): error reading in register 0x%x\n", in tps65090_enable_charging()
77 ret = tps65090_write(charger->dev->parent, TPS65090_REG_CG_CTRL0, in tps65090_enable_charging()
80 dev_err(charger->dev, "%s(): error writing in register 0x%x\n", in tps65090_enable_charging()
87 static int tps65090_config_charger(struct tps65090_charger *charger) in tps65090_config_charger() argument
92 if (charger->passive_mode) in tps65090_config_charger()
95 if (charger->pdata->enable_low_current_chrg) { in tps65090_config_charger()
96 ret = tps65090_low_chrg_current(charger); in tps65090_config_charger()
98 dev_err(charger->dev, in tps65090_config_charger()
105 ret = tps65090_read(charger->dev->parent, TPS65090_REG_INTR_MASK, in tps65090_config_charger()
108 dev_err(charger->dev, "%s(): error reading in register 0x%x\n", in tps65090_config_charger()
113 ret = tps65090_write(charger->dev->parent, TPS65090_REG_INTR_MASK, in tps65090_config_charger()
116 dev_err(charger->dev, "%s(): error writing in register 0x%x\n", in tps65090_config_charger()
128 struct tps65090_charger *charger = power_supply_get_drvdata(psy); in tps65090_ac_get_property() local
131 val->intval = charger->ac_online; in tps65090_ac_get_property()
132 charger->prev_ac_online = charger->ac_online; in tps65090_ac_get_property()
140 struct tps65090_charger *charger = dev_id; in tps65090_charger_isr() local
145 ret = tps65090_read(charger->dev->parent, TPS65090_REG_CG_STATUS1, in tps65090_charger_isr()
148 dev_err(charger->dev, "%s(): Error in reading reg 0x%x\n", in tps65090_charger_isr()
153 ret = tps65090_read(charger->dev->parent, TPS65090_REG_INTR_STS, in tps65090_charger_isr()
156 dev_err(charger->dev, "%s(): Error in reading reg 0x%x\n", in tps65090_charger_isr()
162 ret = tps65090_enable_charging(charger); in tps65090_charger_isr()
165 charger->ac_online = 1; in tps65090_charger_isr()
167 charger->ac_online = 0; in tps65090_charger_isr()
171 if (!charger->passive_mode) { in tps65090_charger_isr()
172 ret = tps65090_write(charger->dev->parent, in tps65090_charger_isr()
175 dev_err(charger->dev, in tps65090_charger_isr()
181 if (charger->prev_ac_online != charger->ac_online) in tps65090_charger_isr()
182 power_supply_changed(charger->ac); in tps65090_charger_isr()
279 dev_err(&pdev->dev, "charger config failed, err %d\n", ret); in tps65090_charger_probe()
283 /* Check for charger presence */ in tps65090_charger_probe()
295 dev_err(cdata->dev, "error enabling charger\n"); in tps65090_charger_probe()
304 tps65090_charger_isr, IRQF_ONESHOT, "tps65090-charger", cdata); in tps65090_charger_probe()
335 { .compatible = "ti,tps65090-charger", },
342 .name = "tps65090-charger",
352 MODULE_DESCRIPTION("tps65090 battery charger driver");