Lines Matching refs:bdpsy

147 			    struct bd70528_psy *bdpsy)  in bd70528_get_irqs()  argument
181 bdpsy->psy); in bd70528_get_irqs()
193 ret = regmap_update_bits(bdpsy->regmap, in bd70528_get_irqs()
201 static int bd70528_get_charger_status(struct bd70528_psy *bdpsy, int *val) in bd70528_get_charger_status() argument
206 ret = regmap_read(bdpsy->regmap, BD70528_REG_CHG_CURR_STAT, &v); in bd70528_get_charger_status()
208 dev_err(bdpsy->dev, "Charger state read failure %d\n", in bd70528_get_charger_status()
241 static int bd70528_get_charge_type(struct bd70528_psy *bdpsy, int *val) in bd70528_get_charge_type() argument
246 ret = regmap_read(bdpsy->regmap, BD70528_REG_CHG_CURR_STAT, &v); in bd70528_get_charge_type()
248 dev_err(bdpsy->dev, "Charger state read failure %d\n", in bd70528_get_charge_type()
281 static int bd70528_get_battery_health(struct bd70528_psy *bdpsy, int *val) in bd70528_get_battery_health() argument
286 ret = regmap_read(bdpsy->regmap, BD70528_REG_CHG_BAT_STAT, &v); in bd70528_get_battery_health()
288 dev_err(bdpsy->dev, "Battery state read failure %d\n", in bd70528_get_battery_health()
305 static int bd70528_get_online(struct bd70528_psy *bdpsy, int *val) in bd70528_get_online() argument
310 ret = regmap_read(bdpsy->regmap, BD70528_REG_CHG_IN_STAT, &v); in bd70528_get_online()
312 dev_err(bdpsy->dev, "DC1 IN state read failure %d\n", in bd70528_get_online()
322 static int bd70528_get_present(struct bd70528_psy *bdpsy, int *val) in bd70528_get_present() argument
327 ret = regmap_read(bdpsy->regmap, BD70528_REG_CHG_BAT_STAT, &v); in bd70528_get_present()
329 dev_err(bdpsy->dev, "Battery state read failure %d\n", in bd70528_get_present()
401 static int get_charge_current(struct bd70528_psy *bdpsy, int *ma) in get_charge_current() argument
406 ret = regmap_read(bdpsy->regmap, BD70528_REG_CHG_CHG_CURR_WARM, in get_charge_current()
409 dev_err(bdpsy->dev, in get_charge_current()
420 dev_err(bdpsy->dev, in get_charge_current()
428 static int get_current_limit(struct bd70528_psy *bdpsy, int *ma) in get_current_limit() argument
433 ret = regmap_read(bdpsy->regmap, BD70528_REG_CHG_DCIN_ILIM, in get_current_limit()
437 dev_err(bdpsy->dev, in get_current_limit()
470 struct bd70528_psy *bdpsy = power_supply_get_drvdata(psy); in bd70528_charger_get_property() local
475 return bd70528_get_charger_status(bdpsy, &val->intval); in bd70528_charger_get_property()
477 return bd70528_get_charge_type(bdpsy, &val->intval); in bd70528_charger_get_property()
479 return bd70528_get_battery_health(bdpsy, &val->intval); in bd70528_charger_get_property()
481 return bd70528_get_present(bdpsy, &val->intval); in bd70528_charger_get_property()
483 ret = get_current_limit(bdpsy, &val->intval); in bd70528_charger_get_property()
487 ret = get_charge_current(bdpsy, &val->intval); in bd70528_charger_get_property()
491 return bd70528_get_online(bdpsy, &val->intval); in bd70528_charger_get_property()
518 static int set_charge_current(struct bd70528_psy *bdpsy, int ma) in set_charge_current() argument
525 dev_warn(bdpsy->dev, in set_charge_current()
532 dev_err(bdpsy->dev, in set_charge_current()
552 dev_err(bdpsy->dev, in set_charge_current()
562 dev_warn(bdpsy->dev, in set_charge_current()
567 tmpret = regmap_update_bits(bdpsy->regmap, in set_charge_current()
571 dev_err(bdpsy->dev, in set_charge_current()
578 tmpret = regmap_update_bits(bdpsy->regmap, in set_charge_current()
591 static int set_current_limit(struct bd70528_psy *bdpsy, int ma) in set_current_limit() argument
598 dev_warn(bdpsy->dev, in set_current_limit()
605 dev_err(bdpsy->dev, in set_current_limit()
617 dev_err(bdpsy->dev, "Unsupported current limit %umA\n", ma); in set_current_limit()
627 dev_warn(bdpsy->dev, "Unsupported current limit %umA\n", ma); in set_current_limit()
631 tmpret = regmap_update_bits(bdpsy->regmap, in set_current_limit()
645 struct bd70528_psy *bdpsy = power_supply_get_drvdata(psy); in bd70528_charger_set_property() local
649 return set_current_limit(bdpsy, val->intval / 1000); in bd70528_charger_set_property()
651 return set_charge_current(bdpsy, val->intval / 1000); in bd70528_charger_set_property()
670 struct bd70528_psy *bdpsy; in bd70528_power_probe() local
673 bdpsy = devm_kzalloc(&pdev->dev, sizeof(*bdpsy), GFP_KERNEL); in bd70528_power_probe()
674 if (!bdpsy) in bd70528_power_probe()
677 bdpsy->regmap = dev_get_regmap(pdev->dev.parent, NULL); in bd70528_power_probe()
678 if (!bdpsy->regmap) { in bd70528_power_probe()
682 bdpsy->dev = &pdev->dev; in bd70528_power_probe()
684 platform_set_drvdata(pdev, bdpsy); in bd70528_power_probe()
685 cfg.drv_data = bdpsy; in bd70528_power_probe()
688 bdpsy->psy = devm_power_supply_register(&pdev->dev, in bd70528_power_probe()
690 if (IS_ERR(bdpsy->psy)) { in bd70528_power_probe()
692 return PTR_ERR(bdpsy->psy); in bd70528_power_probe()
695 return bd70528_get_irqs(pdev, bdpsy); in bd70528_power_probe()