Lines Matching +full:precharge +full:- +full:current +full:- +full:microamp

1 // SPDX-License-Identifier: GPL-2.0-only
19 #include <linux/extcon-provider.h>
32 #define BQ24190_REG_POC 0x01 /* Power-On Configuration */
56 #define BQ24190_REG_CCC 0x02 /* Charge Current Control */
63 #define BQ24190_REG_PCTCC 0x03 /* Pre-charge/Termination Current Cntl */
161 * The tables below provide a 2-way mapping for the value that goes in
162 * the register field and the real-world value that it represents.
164 * number at that index in the array is the real-world value that it
216 * reads return the current value. In order to return the fault status
269 * 'val'. The index range returned is 0 to 'tbl_size' - 1. Assumes that
281 return i - 1; in bq24190_find_idx()
290 ret = i2c_smbus_read_byte_data(bdi->client, reg); in bq24190_read()
300 return i2c_smbus_write_byte_data(bdi->client, reg, data); in bq24190_write()
348 v = (v >= tbl_size) ? (tbl_size - 1) : v; in bq24190_get_field_val()
402 /* On i386 ptrace-abi.h defines SS that breaks the macro calls below. */
490 info = bq24190_sysfs_field_lookup(attr->attr.name); in bq24190_sysfs_show()
492 return -EINVAL; in bq24190_sysfs_show()
494 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_sysfs_show()
498 ret = bq24190_read_mask(bdi, info->reg, info->mask, info->shift, &v); in bq24190_sysfs_show()
504 pm_runtime_mark_last_busy(bdi->dev); in bq24190_sysfs_show()
505 pm_runtime_put_autosuspend(bdi->dev); in bq24190_sysfs_show()
519 info = bq24190_sysfs_field_lookup(attr->attr.name); in bq24190_sysfs_store()
521 return -EINVAL; in bq24190_sysfs_store()
527 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_sysfs_store()
531 ret = bq24190_write_mask(bdi, info->reg, info->mask, info->shift, v); in bq24190_sysfs_store()
535 pm_runtime_mark_last_busy(bdi->dev); in bq24190_sysfs_store()
536 pm_runtime_put_autosuspend(bdi->dev); in bq24190_sysfs_store()
544 union power_supply_propval val = { .intval = bdi->charge_type }; in bq24190_set_otg_vbus()
547 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_set_otg_vbus()
549 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret); in bq24190_set_otg_vbus()
553 bdi->otg_vbus_enabled = enable; in bq24190_set_otg_vbus()
562 pm_runtime_mark_last_busy(bdi->dev); in bq24190_set_otg_vbus()
563 pm_runtime_put_autosuspend(bdi->dev); in bq24190_set_otg_vbus()
572 ret = pm_runtime_resume_and_get(bdi->dev); in bq24296_set_otg_vbus()
574 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret); in bq24296_set_otg_vbus()
578 bdi->otg_vbus_enabled = enable; in bq24296_set_otg_vbus()
599 pm_runtime_mark_last_busy(bdi->dev); in bq24296_set_otg_vbus()
600 pm_runtime_put_autosuspend(bdi->dev); in bq24296_set_otg_vbus()
622 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_vbus_is_enabled()
624 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret); in bq24190_vbus_is_enabled()
632 pm_runtime_mark_last_busy(bdi->dev); in bq24190_vbus_is_enabled()
633 pm_runtime_put_autosuspend(bdi->dev); in bq24190_vbus_is_enabled()
638 bdi->otg_vbus_enabled = (val == BQ24190_REG_POC_CHG_CONFIG_OTG || in bq24190_vbus_is_enabled()
640 return bdi->otg_vbus_enabled; in bq24190_vbus_is_enabled()
659 ret = pm_runtime_resume_and_get(bdi->dev); in bq24296_vbus_is_enabled()
661 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret); in bq24296_vbus_is_enabled()
669 pm_runtime_mark_last_busy(bdi->dev); in bq24296_vbus_is_enabled()
670 pm_runtime_put_autosuspend(bdi->dev); in bq24296_vbus_is_enabled()
675 bdi->otg_vbus_enabled = (val == BQ24296_REG_POC_OTG_CONFIG_OTG); in bq24296_vbus_is_enabled()
677 return bdi->otg_vbus_enabled; in bq24296_vbus_is_enabled()
688 .of_match = "usb-otg-vbus",
704 .of_match = "usb-otg-vbus",
720 struct bq24190_platform_data *pdata = bdi->dev->platform_data; in bq24190_register_vbus_regulator()
725 cfg.dev = bdi->dev; in bq24190_register_vbus_regulator()
726 if (pdata && pdata->regulator_init_data) in bq24190_register_vbus_regulator()
727 cfg.init_data = pdata->regulator_init_data; in bq24190_register_vbus_regulator()
731 reg = devm_regulator_register(bdi->dev, bdi->info->vbus_desc, &cfg); in bq24190_register_vbus_regulator()
734 dev_err(bdi->dev, "Can't register regulator: %d\n", ret); in bq24190_register_vbus_regulator()
755 bdi->watchdog = ((v & BQ24190_REG_CTTC_WATCHDOG_MASK) >> in bq24190_set_config()
772 if (bdi->sys_min) { in bq24190_set_config()
773 v = bdi->sys_min / 100 - 30; // manual section 9.5.1.2, table 9 in bq24190_set_config()
782 if (bdi->iprechg) { in bq24190_set_config()
783 v = bdi->iprechg / 128 - 1; // manual section 9.5.1.4, table 11 in bq24190_set_config()
792 if (bdi->iterm) { in bq24190_set_config()
793 v = bdi->iterm / 128 - 1; // manual section 9.5.1.4, table 11 in bq24190_set_config()
802 if (bdi->ichg) { in bq24190_set_config()
807 bdi->info->ichg_array_size, in bq24190_set_config()
808 bdi->ichg); in bq24190_set_config()
813 if (bdi->vreg) { in bq24190_set_config()
819 bdi->vreg); in bq24190_set_config()
835 * { PROPERTY_ENTRY_BOOL("disable-reset"), ... }; in bq24190_register_reset()
842 if (device_property_read_bool(bdi->dev, "disable-reset")) in bq24190_register_reset()
866 } while (--limit); in bq24190_register_reset()
868 return -EIO; in bq24190_register_reset()
901 val->intval = type; in bq24190_charger_get_charge_type()
933 * termination current so it recommends turning off the termination in bq24190_charger_set_charge_type()
940 switch (val->intval) { in bq24190_charger_set_charge_type()
955 return -EINVAL; in bq24190_charger_set_charge_type()
958 bdi->charge_type = val->intval; in bq24190_charger_set_charge_type()
961 * the charge-type until its gets disabled. in bq24190_charger_set_charge_type()
963 if (bdi->otg_vbus_enabled) in bq24190_charger_set_charge_type()
982 return bdi->info->set_chg_config(bdi, chg_config); in bq24190_charger_set_charge_type()
1034 mutex_lock(&bdi->f_reg_lock); in bq24190_charger_get_health()
1035 v = bdi->f_reg; in bq24190_charger_get_health()
1036 mutex_unlock(&bdi->f_reg_lock); in bq24190_charger_get_health()
1038 if (v & bdi->info->ntc_fault_mask) { in bq24190_charger_get_health()
1039 health = bdi->info->get_ntc_status(v); in bq24190_charger_get_health()
1046 * This could be over-voltage or under-voltage in bq24190_charger_get_health()
1049 * when its really under-voltage, just return in bq24190_charger_get_health()
1061 health = -1; in bq24190_charger_get_health()
1065 * This could be over-current or over-voltage but there's in bq24190_charger_get_health()
1068 * even if it was over-current. in bq24190_charger_get_health()
1075 val->intval = health; in bq24190_charger_get_health()
1098 val->intval = pg_stat && !batfet_disable; in bq24190_charger_get_online()
1156 /* If FORCE_20PCT is enabled, then current is 50% of IPRECHG value */ in bq24190_charger_get_precharge()
1160 val->intval = curr; in bq24190_charger_get_precharge()
1177 val->intval = ++v * 128 * 1000; in bq24190_charger_get_charge_term()
1190 bdi->info->ichg_array_size, &curr); in bq24190_charger_get_current()
1200 /* If FORCE_20PCT is enabled, then current is 20% of ICHG value */ in bq24190_charger_get_current()
1204 val->intval = curr; in bq24190_charger_get_current()
1212 int ret, curr = val->intval; in bq24190_charger_set_current()
1224 if (curr > bdi->ichg_max) in bq24190_charger_set_current()
1225 return -EINVAL; in bq24190_charger_set_current()
1230 bdi->info->ichg_array_size, curr); in bq24190_charger_set_current()
1234 bdi->ichg = curr; in bq24190_charger_set_current()
1251 val->intval = voltage; in bq24190_charger_get_voltage()
1260 if (val->intval > bdi->vreg_max) in bq24190_charger_set_voltage()
1261 return -EINVAL; in bq24190_charger_set_voltage()
1266 ARRAY_SIZE(bq24190_cvc_vreg_values), val->intval); in bq24190_charger_set_voltage()
1270 bdi->vreg = val->intval; in bq24190_charger_set_voltage()
1288 val->intval = iinlimit; in bq24190_charger_get_iinlimit()
1299 ARRAY_SIZE(bq24190_isc_iinlim_values), val->intval); in bq24190_charger_set_iinlimit()
1308 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_charger_get_property()
1310 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_charger_get_property()
1340 val->intval = bdi->ichg_max; in bq24190_charger_get_property()
1347 val->intval = bdi->vreg_max; in bq24190_charger_get_property()
1354 val->intval = POWER_SUPPLY_SCOPE_SYSTEM; in bq24190_charger_get_property()
1358 val->strval = bdi->model_name; in bq24190_charger_get_property()
1362 val->strval = BQ24190_MANUFACTURER; in bq24190_charger_get_property()
1366 ret = -ENODATA; in bq24190_charger_get_property()
1369 pm_runtime_mark_last_busy(bdi->dev); in bq24190_charger_get_property()
1370 pm_runtime_put_autosuspend(bdi->dev); in bq24190_charger_get_property()
1382 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_charger_set_property()
1384 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_charger_set_property()
1408 ret = -EINVAL; in bq24190_charger_set_property()
1411 pm_runtime_mark_last_busy(bdi->dev); in bq24190_charger_set_property()
1412 pm_runtime_put_autosuspend(bdi->dev); in bq24190_charger_set_property()
1441 ret = power_supply_get_property_from_supplier(bdi->charger, in bq24190_input_current_limit_work()
1447 bq24190_charger_set_property(bdi->charger, in bq24190_input_current_limit_work()
1450 power_supply_changed(bdi->charger); in bq24190_input_current_limit_work()
1453 /* Sync the input-current-limit with our parent supply (if we have one) */
1459 * The Power-Good detection may take up to 220ms, sometimes in bq24190_charger_external_power_changed()
1463 * too low default 500mA iinlim. Delay setting the input-current-limit in bq24190_charger_external_power_changed()
1466 queue_delayed_work(system_wq, &bdi->input_current_limit_work, in bq24190_charger_external_power_changed()
1489 "main-battery",
1493 .name = "bq24190-charger",
1511 mutex_lock(&bdi->f_reg_lock); in bq24190_battery_get_status()
1512 chrg_fault = bdi->f_reg; in bq24190_battery_get_status()
1513 mutex_unlock(&bdi->f_reg_lock); in bq24190_battery_get_status()
1524 * - there is no good power source; in bq24190_battery_get_status()
1525 * - there is a charge fault. in bq24190_battery_get_status()
1539 case 0x1: /* Pre-charge */ in bq24190_battery_get_status()
1547 ret = -EIO; in bq24190_battery_get_status()
1552 val->intval = status; in bq24190_battery_get_status()
1563 mutex_lock(&bdi->f_reg_lock); in bq24190_battery_get_health()
1564 v = bdi->f_reg; in bq24190_battery_get_health()
1565 mutex_unlock(&bdi->f_reg_lock); in bq24190_battery_get_health()
1570 v &= bdi->info->ntc_fault_mask; in bq24190_battery_get_health()
1572 health = v ? bdi->info->get_ntc_status(v) : POWER_SUPPLY_HEALTH_GOOD; in bq24190_battery_get_health()
1575 val->intval = health; in bq24190_battery_get_health()
1591 val->intval = !batfet_disable; in bq24190_battery_get_online()
1600 BQ24190_REG_MOC_BATFET_DISABLE_SHIFT, !val->intval); in bq24190_battery_set_online()
1616 val->intval = temp; in bq24190_battery_get_temp_alert_max()
1627 ARRAY_SIZE(bq24190_ictrc_treg_values), val->intval); in bq24190_battery_set_temp_alert_max()
1636 dev_warn(bdi->dev, "warning: /sys/class/power_supply/bq24190-battery is deprecated\n"); in bq24190_battery_get_property()
1637 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_battery_get_property()
1639 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_battery_get_property()
1654 /* Could be Li-on or Li-polymer but no way to tell which */ in bq24190_battery_get_property()
1655 val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN; in bq24190_battery_get_property()
1662 val->intval = POWER_SUPPLY_SCOPE_SYSTEM; in bq24190_battery_get_property()
1666 ret = -ENODATA; in bq24190_battery_get_property()
1669 pm_runtime_mark_last_busy(bdi->dev); in bq24190_battery_get_property()
1670 pm_runtime_put_autosuspend(bdi->dev); in bq24190_battery_get_property()
1682 dev_warn(bdi->dev, "warning: /sys/class/power_supply/bq24190-battery is deprecated\n"); in bq24190_battery_set_property()
1683 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_battery_set_property()
1685 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_battery_set_property()
1697 ret = -EINVAL; in bq24190_battery_set_property()
1700 pm_runtime_mark_last_busy(bdi->dev); in bq24190_battery_set_property()
1701 pm_runtime_put_autosuspend(bdi->dev); in bq24190_battery_set_property()
1733 .name = "bq24190-battery",
1748 ret = extcon_set_state_sync(bdi->edev, EXTCON_USB, otg_enabled); in bq24190_configure_usb_otg()
1750 dev_err(bdi->dev, "Can't set extcon state to %d: %d\n", in bq24190_configure_usb_otg()
1764 battery_mask_f |= bdi->info->ntc_fault_mask; in bq24190_check_status()
1768 dev_err(bdi->dev, "Can't read SS reg: %d\n", ret); in bq24190_check_status()
1776 dev_err(bdi->dev, "Can't read F reg: %d\n", ret); in bq24190_check_status()
1786 if (f_reg != bdi->f_reg) { in bq24190_check_status()
1787 dev_warn(bdi->dev, in bq24190_check_status()
1792 !!(f_reg & bdi->info->ntc_fault_mask)); in bq24190_check_status()
1794 mutex_lock(&bdi->f_reg_lock); in bq24190_check_status()
1795 if ((bdi->f_reg & battery_mask_f) != (f_reg & battery_mask_f)) in bq24190_check_status()
1797 if ((bdi->f_reg & ~battery_mask_f) != (f_reg & ~battery_mask_f)) in bq24190_check_status()
1799 bdi->f_reg = f_reg; in bq24190_check_status()
1800 mutex_unlock(&bdi->f_reg_lock); in bq24190_check_status()
1803 if (ss_reg != bdi->ss_reg) { in bq24190_check_status()
1805 * The device is in host mode so when PG_STAT goes from 1->0 in bq24190_check_status()
1808 if ((bdi->ss_reg & BQ24190_REG_SS_PG_STAT_MASK) && in bq24190_check_status()
1815 dev_err(bdi->dev, "Can't access ISC reg: %d\n", in bq24190_check_status()
1819 if ((bdi->ss_reg & battery_mask_ss) != (ss_reg & battery_mask_ss)) in bq24190_check_status()
1821 if ((bdi->ss_reg & ~battery_mask_ss) != (ss_reg & ~battery_mask_ss)) in bq24190_check_status()
1823 bdi->ss_reg = ss_reg; in bq24190_check_status()
1827 power_supply_changed(bdi->charger); in bq24190_check_status()
1830 if (alert_battery && bdi->battery) in bq24190_check_status()
1831 power_supply_changed(bdi->battery); in bq24190_check_status()
1833 dev_dbg(bdi->dev, "ss_reg: 0x%02x, f_reg: 0x%02x\n", ss_reg, f_reg); in bq24190_check_status()
1841 bdi->irq_event = true; in bq24190_irq_handler_thread()
1842 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_irq_handler_thread()
1844 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_irq_handler_thread()
1848 pm_runtime_mark_last_busy(bdi->dev); in bq24190_irq_handler_thread()
1849 pm_runtime_put_autosuspend(bdi->dev); in bq24190_irq_handler_thread()
1850 bdi->irq_event = false; in bq24190_irq_handler_thread()
1873 dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v); in bq24190_check_chip()
1874 return -ENODEV; in bq24190_check_chip()
1896 dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v); in bq24296_check_chip()
1897 return -ENODEV; in bq24296_check_chip()
1907 ret = bdi->info->check_chip(bdi); in bq24190_hw_init()
1919 return bq24190_read(bdi, BQ24190_REG_SS, &bdi->ss_reg); in bq24190_hw_init()
1924 const char * const s = "ti,system-minimum-microvolt"; in bq24190_get_config()
1928 idx = bdi->info->ichg_array_size - 1; in bq24190_get_config()
1930 bdi->ichg_max = bq24190_ccc_ichg_values[idx]; in bq24190_get_config()
1932 idx = ARRAY_SIZE(bq24190_cvc_vreg_values) - 1; in bq24190_get_config()
1933 bdi->vreg_max = bq24190_cvc_vreg_values[idx]; in bq24190_get_config()
1935 if (device_property_read_u32(bdi->dev, s, &v) == 0) { in bq24190_get_config()
1939 bdi->sys_min = v; in bq24190_get_config()
1941 dev_warn(bdi->dev, "invalid value for %s: %u\n", s, v); in bq24190_get_config()
1944 if (!power_supply_get_battery_info(bdi->charger, &info)) { in bq24190_get_config()
1945 v = info->precharge_current_ua / 1000; in bq24190_get_config()
1948 bdi->iprechg = v; in bq24190_get_config()
1950 dev_warn(bdi->dev, "invalid value for battery:precharge-current-microamp: %d\n", in bq24190_get_config()
1953 v = info->charge_term_current_ua / 1000; in bq24190_get_config()
1956 bdi->iterm = v; in bq24190_get_config()
1958 dev_warn(bdi->dev, "invalid value for battery:charge-term-current-microamp: %d\n", in bq24190_get_config()
1962 v = info->constant_charge_current_max_ua; in bq24190_get_config()
1963 if (v >= bq24190_ccc_ichg_values[0] && v <= bdi->ichg_max) in bq24190_get_config()
1964 bdi->ichg = bdi->ichg_max = v; in bq24190_get_config()
1966 v = info->constant_charge_voltage_max_uv; in bq24190_get_config()
1967 if (v >= bq24190_cvc_vreg_values[0] && v <= bdi->vreg_max) in bq24190_get_config()
1968 bdi->vreg = bdi->vreg_max = v; in bq24190_get_config()
2035 struct i2c_adapter *adapter = client->adapter; in bq24190_probe()
2036 struct device *dev = &client->dev; in bq24190_probe()
2043 return -ENODEV; in bq24190_probe()
2049 return -ENOMEM; in bq24190_probe()
2052 bdi->client = client; in bq24190_probe()
2053 bdi->dev = dev; in bq24190_probe()
2054 strscpy(bdi->model_name, id->name, sizeof(bdi->model_name)); in bq24190_probe()
2055 bdi->info = i2c_get_match_data(client); in bq24190_probe()
2056 mutex_init(&bdi->f_reg_lock); in bq24190_probe()
2057 bdi->charge_type = POWER_SUPPLY_CHARGE_TYPE_FAST; in bq24190_probe()
2058 bdi->f_reg = 0; in bq24190_probe()
2059 bdi->ss_reg = BQ24190_REG_SS_VBUS_STAT_MASK; /* impossible state */ in bq24190_probe()
2060 INIT_DELAYED_WORK(&bdi->input_current_limit_work, in bq24190_probe()
2065 if (client->irq <= 0) { in bq24190_probe()
2067 return -EINVAL; in bq24190_probe()
2070 bdi->edev = devm_extcon_dev_allocate(dev, bq24190_usb_extcon_cable); in bq24190_probe()
2071 if (IS_ERR(bdi->edev)) in bq24190_probe()
2072 return PTR_ERR(bdi->edev); in bq24190_probe()
2074 ret = devm_extcon_dev_register(dev, bdi->edev); in bq24190_probe()
2093 charger_cfg.of_node = dev->of_node; in bq24190_probe()
2096 bdi->charger = power_supply_register(dev, &bq24190_charger_desc, in bq24190_probe()
2098 if (IS_ERR(bdi->charger)) { in bq24190_probe()
2100 ret = PTR_ERR(bdi->charger); in bq24190_probe()
2106 if (!device_property_read_bool(dev, "omit-battery-class")) { in bq24190_probe()
2108 bdi->battery = power_supply_register(dev, &bq24190_battery_desc, in bq24190_probe()
2110 if (IS_ERR(bdi->battery)) { in bq24190_probe()
2112 ret = PTR_ERR(bdi->battery); in bq24190_probe()
2129 ret = bq24190_configure_usb_otg(bdi, bdi->ss_reg); in bq24190_probe()
2133 bdi->initialized = true; in bq24190_probe()
2135 ret = devm_request_threaded_irq(dev, client->irq, NULL, in bq24190_probe()
2138 "bq24190-charger", bdi); in bq24190_probe()
2148 enable_irq_wake(client->irq); in bq24190_probe()
2156 if (!IS_ERR_OR_NULL(bdi->battery)) in bq24190_probe()
2157 power_supply_unregister(bdi->battery); in bq24190_probe()
2158 power_supply_unregister(bdi->charger); in bq24190_probe()
2172 cancel_delayed_work_sync(&bdi->input_current_limit_work); in bq24190_remove()
2173 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_remove()
2175 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_remove()
2178 if (bdi->battery) in bq24190_remove()
2179 power_supply_unregister(bdi->battery); in bq24190_remove()
2180 power_supply_unregister(bdi->charger); in bq24190_remove()
2182 pm_runtime_put_sync(bdi->dev); in bq24190_remove()
2183 pm_runtime_dont_use_autosuspend(bdi->dev); in bq24190_remove()
2184 pm_runtime_disable(bdi->dev); in bq24190_remove()
2192 bdi->info->set_otg_vbus(bdi, false); in bq24190_shutdown()
2200 if (!bdi->initialized) in bq24190_runtime_suspend()
2203 dev_dbg(bdi->dev, "%s\n", __func__); in bq24190_runtime_suspend()
2213 if (!bdi->initialized) in bq24190_runtime_resume()
2216 if (!bdi->irq_event) { in bq24190_runtime_resume()
2217 dev_dbg(bdi->dev, "checking events on possible wakeirq\n"); in bq24190_runtime_resume()
2230 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_pm_suspend()
2232 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_pm_suspend()
2237 pm_runtime_mark_last_busy(bdi->dev); in bq24190_pm_suspend()
2238 pm_runtime_put_autosuspend(bdi->dev); in bq24190_pm_suspend()
2250 bdi->f_reg = 0; in bq24190_pm_resume()
2251 bdi->ss_reg = BQ24190_REG_SS_VBUS_STAT_MASK; /* impossible state */ in bq24190_pm_resume()
2253 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_pm_resume()
2255 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_pm_resume()
2259 bq24190_read(bdi, BQ24190_REG_SS, &bdi->ss_reg); in bq24190_pm_resume()
2262 pm_runtime_mark_last_busy(bdi->dev); in bq24190_pm_resume()
2263 pm_runtime_put_autosuspend(bdi->dev); in bq24190_pm_resume()
2267 power_supply_changed(bdi->charger); in bq24190_pm_resume()
2268 if (bdi->battery) in bq24190_pm_resume()
2269 power_supply_changed(bdi->battery); in bq24190_pm_resume()
2306 .name = "bq24190-charger",