Lines Matching full:charger
42 /* TUSB1210 charger detection work states */
68 struct power_supply *charger; member
181 dev_dbg(&tusb->ulpi->dev, "charger type: %d\n", type); in tusb1210_chg_det_set_type()
214 * Boards using a TUSB121x for charger-detection have 3 power_supply class devs:
216 * tusb1211-charger-detect(1) -> charger -> fuel-gauge
218 * To determine if an USB charger is connected to the board, the online prop of
219 * the charger psy needs to be read. Since the tusb1211-charger-detect psy is
224 * these boards and the charger psy is looked up by name from this list.
226 * (1) modelling the external USB charger
229 "bq24190-charger",
237 for (i = 0; i < ARRAY_SIZE(tusb1210_chargers) && !tusb->charger; i++) in tusb1210_get_online()
238 tusb->charger = power_supply_get_by_name(tusb1210_chargers[i]); in tusb1210_get_online()
240 if (!tusb->charger) in tusb1210_get_online()
243 if (power_supply_get_property(tusb->charger, POWER_SUPPLY_PROP_ONLINE, &val)) in tusb1210_get_online()
267 /* Should never happen, skip charger detection */ in tusb1210_chg_det_work()
275 * Use the builtin charger detection FSM to keep things simple. in tusb1210_chg_det_work()
277 * boards which actually rely on the phy for charger detection. in tusb1210_chg_det_work()
288 /* Wait 400 ms for the charger detection FSM to finish */ in tusb1210_chg_det_work()
310 /* Set SW_CONTROL to stop the charger-det FSM */ in tusb1210_chg_det_work()
314 /* Clear DP_VSRC_EN which may have been enabled by the charger-det FSM */ in tusb1210_chg_det_work()
318 /* Clear CHGD_IDP_SRC_EN (may have been enabled by the charger-det FSM) */ in tusb1210_chg_det_work()
344 * The phy seems to take approx. 600ms longer then the charger in tusb1210_chg_det_work()
418 .name = "tusb1211-charger-detect",
427 /* Setup charger detection if requested, on errors continue without chg-det */
438 dev_err(dev, "error charger detection is only supported on the TUSB1211\n"); in tusb1210_probe_charger_detect()
451 * Delay initial run by 2 seconds to allow the charger driver, in tusb1210_probe_charger_detect()
471 if (tusb->charger) in tusb1210_remove_charger_detect()
472 power_supply_put(tusb->charger); in tusb1210_remove_charger_detect()