Lines Matching full:charger

22  * ACT8945A Charger Register Map
209 static int act8945a_get_capacity_level(struct act8945a_charger *charger, in act8945a_get_capacity_level() argument
214 int lbo_level = gpiod_get_value(charger->lbo_gpio); in act8945a_get_capacity_level()
276 static int act8945a_get_current_max(struct act8945a_charger *charger, in act8945a_get_current_max() argument
282 int chgin_level = gpiod_get_value(charger->chglev_gpio); in act8945a_get_current_max()
346 struct act8945a_charger *charger = power_supply_get_drvdata(psy); in act8945a_charger_get_property() local
347 struct regmap *regmap = charger->regmap; in act8945a_charger_get_property()
364 ret = act8945a_get_capacity_level(charger, in act8945a_charger_get_property()
368 ret = act8945a_get_current_max(charger, in act8945a_charger_get_property()
384 static int act8945a_enable_interrupt(struct act8945a_charger *charger) in act8945a_enable_interrupt() argument
386 struct regmap *regmap = charger->regmap; in act8945a_enable_interrupt()
407 static unsigned int act8945a_set_supply_type(struct act8945a_charger *charger, in act8945a_set_supply_type() argument
413 ret = regmap_read(charger->regmap, ACT8945A_APCH_STATUS, &status); in act8945a_set_supply_type()
417 ret = regmap_read(charger->regmap, ACT8945A_APCH_STATE, &state); in act8945a_set_supply_type()
435 struct act8945a_charger *charger = in act8945a_work() local
438 act8945a_set_supply_type(charger, &charger->desc.type); in act8945a_work()
440 power_supply_changed(charger->psy); in act8945a_work()
445 struct act8945a_charger *charger = dev_id; in act8945a_status_changed() local
447 if (charger->init_done) in act8945a_status_changed()
448 schedule_work(&charger->work); in act8945a_status_changed()
458 struct act8945a_charger *charger) in act8945a_charger_config() argument
461 struct regmap *regmap = charger->regmap; in act8945a_charger_config()
472 dev_err(dev, "no charger of node\n"); in act8945a_charger_config()
485 charger->lbo_gpio = devm_gpiod_get_optional(dev, "active-semi,lbo", in act8945a_charger_config()
487 if (IS_ERR(charger->lbo_gpio)) { in act8945a_charger_config()
488 err = PTR_ERR(charger->lbo_gpio); in act8945a_charger_config()
493 ret = devm_request_irq(dev, gpiod_to_irq(charger->lbo_gpio), in act8945a_charger_config()
496 "act8945a_lbo_detect", charger); in act8945a_charger_config()
500 charger->chglev_gpio = devm_gpiod_get_optional(dev, in act8945a_charger_config()
503 if (IS_ERR(charger->chglev_gpio)) { in act8945a_charger_config()
504 err = PTR_ERR(charger->chglev_gpio); in act8945a_charger_config()
576 struct act8945a_charger *charger; in act8945a_charger_probe() local
580 charger = devm_kzalloc(&pdev->dev, sizeof(*charger), GFP_KERNEL); in act8945a_charger_probe()
581 if (!charger) in act8945a_charger_probe()
584 charger->regmap = dev_get_regmap(pdev->dev.parent, NULL); in act8945a_charger_probe()
585 if (!charger->regmap) { in act8945a_charger_probe()
590 ret = act8945a_charger_config(&pdev->dev, charger); in act8945a_charger_probe()
602 charger); in act8945a_charger_probe()
608 charger->desc.name = "act8945a-charger"; in act8945a_charger_probe()
609 charger->desc.get_property = act8945a_charger_get_property; in act8945a_charger_probe()
610 charger->desc.properties = act8945a_charger_props; in act8945a_charger_probe()
611 charger->desc.num_properties = ARRAY_SIZE(act8945a_charger_props); in act8945a_charger_probe()
613 ret = act8945a_set_supply_type(charger, &charger->desc.type); in act8945a_charger_probe()
618 psy_cfg.drv_data = charger; in act8945a_charger_probe()
620 charger->psy = devm_power_supply_register(&pdev->dev, in act8945a_charger_probe()
621 &charger->desc, in act8945a_charger_probe()
623 if (IS_ERR(charger->psy)) { in act8945a_charger_probe()
625 return PTR_ERR(charger->psy); in act8945a_charger_probe()
628 platform_set_drvdata(pdev, charger); in act8945a_charger_probe()
630 INIT_WORK(&charger->work, act8945a_work); in act8945a_charger_probe()
632 ret = act8945a_enable_interrupt(charger); in act8945a_charger_probe()
636 charger->init_done = true; in act8945a_charger_probe()
643 struct act8945a_charger *charger = platform_get_drvdata(pdev); in act8945a_charger_remove() local
645 charger->init_done = false; in act8945a_charger_remove()
646 cancel_work_sync(&charger->work); in act8945a_charger_remove()
653 .name = "act8945a-charger",
660 MODULE_DESCRIPTION("Active-semi ACT8945A ActivePath charger driver");