Lines Matching +full:cold +full:- +full:temp

1 // SPDX-License-Identifier: GPL-2.0-only
19 #include <linux/extcon-provider.h>
32 #define BQ24190_REG_POC 0x01 /* Power-On Configuration */
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
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()
570 union power_supply_propval val = { .intval = bdi->charge_type }; in bq24296_set_otg_vbus()
573 ret = pm_runtime_resume_and_get(bdi->dev); in bq24296_set_otg_vbus()
575 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret); in bq24296_set_otg_vbus()
579 bdi->otg_vbus_enabled = enable; in bq24296_set_otg_vbus()
605 pm_runtime_mark_last_busy(bdi->dev); in bq24296_set_otg_vbus()
606 pm_runtime_put_autosuspend(bdi->dev); in bq24296_set_otg_vbus()
628 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_vbus_is_enabled()
630 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret); in bq24190_vbus_is_enabled()
638 pm_runtime_mark_last_busy(bdi->dev); in bq24190_vbus_is_enabled()
639 pm_runtime_put_autosuspend(bdi->dev); in bq24190_vbus_is_enabled()
644 bdi->otg_vbus_enabled = (val == BQ24190_REG_POC_CHG_CONFIG_OTG || in bq24190_vbus_is_enabled()
646 return bdi->otg_vbus_enabled; in bq24190_vbus_is_enabled()
665 ret = pm_runtime_resume_and_get(bdi->dev); in bq24296_vbus_is_enabled()
667 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret); in bq24296_vbus_is_enabled()
675 pm_runtime_mark_last_busy(bdi->dev); in bq24296_vbus_is_enabled()
676 pm_runtime_put_autosuspend(bdi->dev); in bq24296_vbus_is_enabled()
681 bdi->otg_vbus_enabled = (val == BQ24296_REG_POC_OTG_CONFIG_OTG); in bq24296_vbus_is_enabled()
683 return bdi->otg_vbus_enabled; in bq24296_vbus_is_enabled()
694 .of_match = "usb-otg-vbus",
710 .of_match = "usb-otg-vbus",
726 struct bq24190_platform_data *pdata = bdi->dev->platform_data; in bq24190_register_vbus_regulator()
731 cfg.dev = bdi->dev; in bq24190_register_vbus_regulator()
732 if (pdata && pdata->regulator_init_data) in bq24190_register_vbus_regulator()
733 cfg.init_data = pdata->regulator_init_data; in bq24190_register_vbus_regulator()
737 reg = devm_regulator_register(bdi->dev, bdi->info->vbus_desc, &cfg); in bq24190_register_vbus_regulator()
740 dev_err(bdi->dev, "Can't register regulator: %d\n", ret); in bq24190_register_vbus_regulator()
761 bdi->watchdog = ((v & BQ24190_REG_CTTC_WATCHDOG_MASK) >> in bq24190_set_config()
778 if (bdi->sys_min) { in bq24190_set_config()
779 v = bdi->sys_min / 100 - 30; // manual section 9.5.1.2, table 9 in bq24190_set_config()
788 if (bdi->iprechg) { in bq24190_set_config()
789 v = bdi->iprechg / 128 - 1; // manual section 9.5.1.4, table 11 in bq24190_set_config()
798 if (bdi->iterm) { in bq24190_set_config()
799 v = bdi->iterm / 128 - 1; // manual section 9.5.1.4, table 11 in bq24190_set_config()
808 if (bdi->ichg) { in bq24190_set_config()
813 bdi->info->ichg_array_size, in bq24190_set_config()
814 bdi->ichg); in bq24190_set_config()
819 if (bdi->vreg) { in bq24190_set_config()
825 bdi->vreg); in bq24190_set_config()
841 * { PROPERTY_ENTRY_BOOL("disable-reset"), ... }; in bq24190_register_reset()
848 if (device_property_read_bool(bdi->dev, "disable-reset")) in bq24190_register_reset()
872 } while (--limit); in bq24190_register_reset()
874 return -EIO; in bq24190_register_reset()
907 val->intval = type; in bq24190_charger_get_charge_type()
946 switch (val->intval) { in bq24190_charger_set_charge_type()
961 return -EINVAL; in bq24190_charger_set_charge_type()
964 bdi->charge_type = val->intval; in bq24190_charger_set_charge_type()
967 * the charge-type until its gets disabled. in bq24190_charger_set_charge_type()
969 if (bdi->otg_vbus_enabled) in bq24190_charger_set_charge_type()
988 return bdi->info->set_chg_config(bdi, chg_config); in bq24190_charger_set_charge_type()
996 case 0x1: /* TS1 Cold */ in bq24190_charger_get_ntc_status()
997 case 0x3: /* TS2 Cold */ in bq24190_charger_get_ntc_status()
998 case 0x5: /* Both Cold */ in bq24190_charger_get_ntc_status()
1024 case 0x2: /* Cold */ in bq24296_charger_get_ntc_status()
1040 mutex_lock(&bdi->f_reg_lock); in bq24190_charger_get_health()
1041 v = bdi->f_reg; in bq24190_charger_get_health()
1042 mutex_unlock(&bdi->f_reg_lock); in bq24190_charger_get_health()
1044 if (v & bdi->info->ntc_fault_mask) { in bq24190_charger_get_health()
1045 health = bdi->info->get_ntc_status(v); in bq24190_charger_get_health()
1052 * This could be over-voltage or under-voltage in bq24190_charger_get_health()
1055 * when its really under-voltage, just return in bq24190_charger_get_health()
1067 health = -1; in bq24190_charger_get_health()
1071 * This could be over-current or over-voltage but there's in bq24190_charger_get_health()
1074 * even if it was over-current. in bq24190_charger_get_health()
1081 val->intval = health; in bq24190_charger_get_health()
1104 val->intval = pg_stat && !batfet_disable; in bq24190_charger_get_online()
1166 val->intval = curr; in bq24190_charger_get_precharge()
1183 val->intval = ++v * 128 * 1000; in bq24190_charger_get_charge_term()
1196 bdi->info->ichg_array_size, &curr); in bq24190_charger_get_current()
1210 val->intval = curr; in bq24190_charger_get_current()
1218 int ret, curr = val->intval; in bq24190_charger_set_current()
1230 if (curr > bdi->ichg_max) in bq24190_charger_set_current()
1231 return -EINVAL; in bq24190_charger_set_current()
1236 bdi->info->ichg_array_size, curr); in bq24190_charger_set_current()
1240 bdi->ichg = curr; in bq24190_charger_set_current()
1257 val->intval = voltage; in bq24190_charger_get_voltage()
1266 if (val->intval > bdi->vreg_max) in bq24190_charger_set_voltage()
1267 return -EINVAL; in bq24190_charger_set_voltage()
1272 ARRAY_SIZE(bq24190_cvc_vreg_values), val->intval); in bq24190_charger_set_voltage()
1276 bdi->vreg = val->intval; in bq24190_charger_set_voltage()
1294 val->intval = iinlimit; in bq24190_charger_get_iinlimit()
1305 ARRAY_SIZE(bq24190_isc_iinlim_values), val->intval); in bq24190_charger_set_iinlimit()
1314 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_charger_get_property()
1316 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_charger_get_property()
1346 val->intval = bdi->ichg_max; in bq24190_charger_get_property()
1353 val->intval = bdi->vreg_max; in bq24190_charger_get_property()
1360 val->intval = POWER_SUPPLY_SCOPE_SYSTEM; in bq24190_charger_get_property()
1364 val->strval = bdi->model_name; in bq24190_charger_get_property()
1368 val->strval = BQ24190_MANUFACTURER; in bq24190_charger_get_property()
1372 ret = -ENODATA; in bq24190_charger_get_property()
1375 pm_runtime_mark_last_busy(bdi->dev); in bq24190_charger_get_property()
1376 pm_runtime_put_autosuspend(bdi->dev); in bq24190_charger_get_property()
1388 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_charger_set_property()
1390 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_charger_set_property()
1414 ret = -EINVAL; in bq24190_charger_set_property()
1417 pm_runtime_mark_last_busy(bdi->dev); in bq24190_charger_set_property()
1418 pm_runtime_put_autosuspend(bdi->dev); in bq24190_charger_set_property()
1447 ret = power_supply_get_property_from_supplier(bdi->charger, in bq24190_input_current_limit_work()
1453 bq24190_charger_set_property(bdi->charger, in bq24190_input_current_limit_work()
1456 power_supply_changed(bdi->charger); in bq24190_input_current_limit_work()
1459 /* Sync the input-current-limit with our parent supply (if we have one) */
1465 * The Power-Good detection may take up to 220ms, sometimes in bq24190_charger_external_power_changed()
1469 * too low default 500mA iinlim. Delay setting the input-current-limit in bq24190_charger_external_power_changed()
1472 queue_delayed_work(system_wq, &bdi->input_current_limit_work, in bq24190_charger_external_power_changed()
1495 "main-battery",
1499 .name = "bq24190-charger",
1517 mutex_lock(&bdi->f_reg_lock); in bq24190_battery_get_status()
1518 chrg_fault = bdi->f_reg; in bq24190_battery_get_status()
1519 mutex_unlock(&bdi->f_reg_lock); in bq24190_battery_get_status()
1530 * - there is no good power source; in bq24190_battery_get_status()
1531 * - there is a charge fault. in bq24190_battery_get_status()
1545 case 0x1: /* Pre-charge */ in bq24190_battery_get_status()
1553 ret = -EIO; in bq24190_battery_get_status()
1558 val->intval = status; in bq24190_battery_get_status()
1569 mutex_lock(&bdi->f_reg_lock); in bq24190_battery_get_health()
1570 v = bdi->f_reg; in bq24190_battery_get_health()
1571 mutex_unlock(&bdi->f_reg_lock); in bq24190_battery_get_health()
1576 v &= bdi->info->ntc_fault_mask; in bq24190_battery_get_health()
1578 health = v ? bdi->info->get_ntc_status(v) : POWER_SUPPLY_HEALTH_GOOD; in bq24190_battery_get_health()
1581 val->intval = health; in bq24190_battery_get_health()
1597 val->intval = !batfet_disable; in bq24190_battery_get_online()
1606 BQ24190_REG_MOC_BATFET_DISABLE_SHIFT, !val->intval); in bq24190_battery_set_online()
1612 int temp, ret; in bq24190_battery_get_temp_alert_max() local
1618 ARRAY_SIZE(bq24190_ictrc_treg_values), &temp); in bq24190_battery_get_temp_alert_max()
1622 val->intval = temp; in bq24190_battery_get_temp_alert_max()
1633 ARRAY_SIZE(bq24190_ictrc_treg_values), val->intval); in bq24190_battery_set_temp_alert_max()
1642 dev_warn(bdi->dev, "warning: /sys/class/power_supply/bq24190-battery is deprecated\n"); in bq24190_battery_get_property()
1643 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_battery_get_property()
1645 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_battery_get_property()
1660 /* Could be Li-on or Li-polymer but no way to tell which */ in bq24190_battery_get_property()
1661 val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN; in bq24190_battery_get_property()
1668 val->intval = POWER_SUPPLY_SCOPE_SYSTEM; in bq24190_battery_get_property()
1672 ret = -ENODATA; in bq24190_battery_get_property()
1675 pm_runtime_mark_last_busy(bdi->dev); in bq24190_battery_get_property()
1676 pm_runtime_put_autosuspend(bdi->dev); in bq24190_battery_get_property()
1688 dev_warn(bdi->dev, "warning: /sys/class/power_supply/bq24190-battery is deprecated\n"); in bq24190_battery_set_property()
1689 dev_dbg(bdi->dev, "prop: %d\n", psp); in bq24190_battery_set_property()
1691 ret = pm_runtime_resume_and_get(bdi->dev); in bq24190_battery_set_property()
1703 ret = -EINVAL; in bq24190_battery_set_property()
1706 pm_runtime_mark_last_busy(bdi->dev); in bq24190_battery_set_property()
1707 pm_runtime_put_autosuspend(bdi->dev); in bq24190_battery_set_property()
1739 .name = "bq24190-battery",
1754 ret = extcon_set_state_sync(bdi->edev, EXTCON_USB, otg_enabled); in bq24190_configure_usb_otg()
1756 dev_err(bdi->dev, "Can't set extcon state to %d: %d\n", in bq24190_configure_usb_otg()
1770 battery_mask_f |= bdi->info->ntc_fault_mask; in bq24190_check_status()
1774 dev_err(bdi->dev, "Can't read SS reg: %d\n", ret); in bq24190_check_status()
1782 dev_err(bdi->dev, "Can't read F reg: %d\n", ret); in bq24190_check_status()
1792 if (f_reg != bdi->f_reg) { in bq24190_check_status()
1793 dev_warn(bdi->dev, in bq24190_check_status()
1798 !!(f_reg & bdi->info->ntc_fault_mask)); in bq24190_check_status()
1800 mutex_lock(&bdi->f_reg_lock); in bq24190_check_status()
1801 if ((bdi->f_reg & battery_mask_f) != (f_reg & battery_mask_f)) in bq24190_check_status()
1803 if ((bdi->f_reg & ~battery_mask_f) != (f_reg & ~battery_mask_f)) in bq24190_check_status()
1805 bdi->f_reg = f_reg; in bq24190_check_status()
1806 mutex_unlock(&bdi->f_reg_lock); in bq24190_check_status()
1809 if (ss_reg != bdi->ss_reg) { in bq24190_check_status()
1811 * The device is in host mode so when PG_STAT goes from 1->0 in bq24190_check_status()
1814 if ((bdi->ss_reg & BQ24190_REG_SS_PG_STAT_MASK) && in bq24190_check_status()
1821 dev_err(bdi->dev, "Can't access ISC reg: %d\n", in bq24190_check_status()
1825 if ((bdi->ss_reg & battery_mask_ss) != (ss_reg & battery_mask_ss)) in bq24190_check_status()
1827 if ((bdi->ss_reg & ~battery_mask_ss) != (ss_reg & ~battery_mask_ss)) in bq24190_check_status()
1829 bdi->ss_reg = ss_reg; in bq24190_check_status()
1833 power_supply_changed(bdi->charger); in bq24190_check_status()
1836 if (alert_battery && bdi->battery) in bq24190_check_status()
1837 power_supply_changed(bdi->battery); in bq24190_check_status()
1839 dev_dbg(bdi->dev, "ss_reg: 0x%02x, f_reg: 0x%02x\n", ss_reg, f_reg); in bq24190_check_status()
1847 bdi->irq_event = true; in bq24190_irq_handler_thread()
1848 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_irq_handler_thread()
1850 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_irq_handler_thread()
1854 pm_runtime_mark_last_busy(bdi->dev); in bq24190_irq_handler_thread()
1855 pm_runtime_put_autosuspend(bdi->dev); in bq24190_irq_handler_thread()
1856 bdi->irq_event = false; in bq24190_irq_handler_thread()
1879 dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v); in bq24190_check_chip()
1880 return -ENODEV; in bq24190_check_chip()
1902 dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v); in bq24296_check_chip()
1903 return -ENODEV; in bq24296_check_chip()
1913 ret = bdi->info->check_chip(bdi); in bq24190_hw_init()
1925 return bq24190_read(bdi, BQ24190_REG_SS, &bdi->ss_reg); in bq24190_hw_init()
1930 const char * const s = "ti,system-minimum-microvolt"; in bq24190_get_config()
1934 idx = bdi->info->ichg_array_size - 1; in bq24190_get_config()
1936 bdi->ichg_max = bq24190_ccc_ichg_values[idx]; in bq24190_get_config()
1938 idx = ARRAY_SIZE(bq24190_cvc_vreg_values) - 1; in bq24190_get_config()
1939 bdi->vreg_max = bq24190_cvc_vreg_values[idx]; in bq24190_get_config()
1941 if (device_property_read_u32(bdi->dev, s, &v) == 0) { in bq24190_get_config()
1945 bdi->sys_min = v; in bq24190_get_config()
1947 dev_warn(bdi->dev, "invalid value for %s: %u\n", s, v); in bq24190_get_config()
1950 if (!power_supply_get_battery_info(bdi->charger, &info)) { in bq24190_get_config()
1951 v = info->precharge_current_ua / 1000; in bq24190_get_config()
1954 bdi->iprechg = v; in bq24190_get_config()
1956 dev_warn(bdi->dev, "invalid value for battery:precharge-current-microamp: %d\n", in bq24190_get_config()
1959 v = info->charge_term_current_ua / 1000; in bq24190_get_config()
1962 bdi->iterm = v; in bq24190_get_config()
1964 dev_warn(bdi->dev, "invalid value for battery:charge-term-current-microamp: %d\n", in bq24190_get_config()
1968 v = info->constant_charge_current_max_ua; in bq24190_get_config()
1969 if (v >= bq24190_ccc_ichg_values[0] && v <= bdi->ichg_max) in bq24190_get_config()
1970 bdi->ichg = bdi->ichg_max = v; in bq24190_get_config()
1972 v = info->constant_charge_voltage_max_uv; in bq24190_get_config()
1973 if (v >= bq24190_cvc_vreg_values[0] && v <= bdi->vreg_max) in bq24190_get_config()
1974 bdi->vreg = bdi->vreg_max = v; in bq24190_get_config()
2041 struct i2c_adapter *adapter = client->adapter; in bq24190_probe()
2042 struct device *dev = &client->dev; in bq24190_probe()
2049 return -ENODEV; in bq24190_probe()
2055 return -ENOMEM; in bq24190_probe()
2058 bdi->client = client; in bq24190_probe()
2059 bdi->dev = dev; in bq24190_probe()
2060 strscpy(bdi->model_name, id->name, sizeof(bdi->model_name)); in bq24190_probe()
2061 bdi->info = i2c_get_match_data(client); in bq24190_probe()
2062 mutex_init(&bdi->f_reg_lock); in bq24190_probe()
2063 bdi->charge_type = POWER_SUPPLY_CHARGE_TYPE_FAST; in bq24190_probe()
2064 bdi->f_reg = 0; in bq24190_probe()
2065 bdi->ss_reg = BQ24190_REG_SS_VBUS_STAT_MASK; /* impossible state */ in bq24190_probe()
2066 INIT_DELAYED_WORK(&bdi->input_current_limit_work, in bq24190_probe()
2071 if (client->irq <= 0) { in bq24190_probe()
2073 return -EINVAL; in bq24190_probe()
2076 bdi->edev = devm_extcon_dev_allocate(dev, bq24190_usb_extcon_cable); in bq24190_probe()
2077 if (IS_ERR(bdi->edev)) in bq24190_probe()
2078 return PTR_ERR(bdi->edev); in bq24190_probe()
2080 ret = devm_extcon_dev_register(dev, bdi->edev); in bq24190_probe()
2099 charger_cfg.of_node = dev->of_node; in bq24190_probe()
2102 bdi->charger = power_supply_register(dev, &bq24190_charger_desc, in bq24190_probe()
2104 if (IS_ERR(bdi->charger)) { in bq24190_probe()
2106 ret = PTR_ERR(bdi->charger); in bq24190_probe()
2112 if (!device_property_read_bool(dev, "omit-battery-class")) { in bq24190_probe()
2114 bdi->battery = power_supply_register(dev, &bq24190_battery_desc, in bq24190_probe()
2116 if (IS_ERR(bdi->battery)) { in bq24190_probe()
2118 ret = PTR_ERR(bdi->battery); in bq24190_probe()
2135 ret = bq24190_configure_usb_otg(bdi, bdi->ss_reg); in bq24190_probe()
2139 bdi->initialized = true; in bq24190_probe()
2141 ret = devm_request_threaded_irq(dev, client->irq, NULL, in bq24190_probe()
2144 "bq24190-charger", bdi); in bq24190_probe()
2154 enable_irq_wake(client->irq); in bq24190_probe()
2162 if (!IS_ERR_OR_NULL(bdi->battery)) in bq24190_probe()
2163 power_supply_unregister(bdi->battery); in bq24190_probe()
2164 power_supply_unregister(bdi->charger); in bq24190_probe()
2178 cancel_delayed_work_sync(&bdi->input_current_limit_work); in bq24190_remove()
2179 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_remove()
2181 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_remove()
2184 if (bdi->battery) in bq24190_remove()
2185 power_supply_unregister(bdi->battery); in bq24190_remove()
2186 power_supply_unregister(bdi->charger); in bq24190_remove()
2188 pm_runtime_put_sync(bdi->dev); in bq24190_remove()
2189 pm_runtime_dont_use_autosuspend(bdi->dev); in bq24190_remove()
2190 pm_runtime_disable(bdi->dev); in bq24190_remove()
2198 bdi->info->set_otg_vbus(bdi, false); in bq24190_shutdown()
2206 if (!bdi->initialized) in bq24190_runtime_suspend()
2209 dev_dbg(bdi->dev, "%s\n", __func__); in bq24190_runtime_suspend()
2219 if (!bdi->initialized) in bq24190_runtime_resume()
2222 if (!bdi->irq_event) { in bq24190_runtime_resume()
2223 dev_dbg(bdi->dev, "checking events on possible wakeirq\n"); in bq24190_runtime_resume()
2236 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_pm_suspend()
2238 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_pm_suspend()
2243 pm_runtime_mark_last_busy(bdi->dev); in bq24190_pm_suspend()
2244 pm_runtime_put_autosuspend(bdi->dev); in bq24190_pm_suspend()
2256 bdi->f_reg = 0; in bq24190_pm_resume()
2257 bdi->ss_reg = BQ24190_REG_SS_VBUS_STAT_MASK; /* impossible state */ in bq24190_pm_resume()
2259 error = pm_runtime_resume_and_get(bdi->dev); in bq24190_pm_resume()
2261 dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error); in bq24190_pm_resume()
2265 bq24190_read(bdi, BQ24190_REG_SS, &bdi->ss_reg); in bq24190_pm_resume()
2268 pm_runtime_mark_last_busy(bdi->dev); in bq24190_pm_resume()
2269 pm_runtime_put_autosuspend(bdi->dev); in bq24190_pm_resume()
2273 power_supply_changed(bdi->charger); in bq24190_pm_resume()
2274 if (bdi->battery) in bq24190_pm_resume()
2275 power_supply_changed(bdi->battery); in bq24190_pm_resume()
2312 .name = "bq24190-charger",