Lines Matching +full:ocv +full:- +full:capacity

1 // SPDX-License-Identifier: GPL-2.0+
12 #include <linux/devm-helpers.h>
68 * soc - state of charge - like the BSP this is stored as a percentage,
78 * Capacity of battery when fully charged, equal or less than design
79 * capacity depending upon wear. BSP kernel saves to nvram in mAh,
118 #define CHARGE_TO_ADC(capacity, res_div) \ argument
119 (capacity * res_div * 3600 / 172 * 1000)
143 return -EINVAL; in rk817_chg_cur_to_reg()
166 return -EINVAL; in rk817_chg_cur_from_reg()
177 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_VCALIB0_H, in rk817_bat_calib_vol()
181 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_VCALIB1_H, in rk817_bat_calib_vol()
186 charger->voltage_k = (4025 - 2300) * 1000 / in rk817_bat_calib_vol()
187 ((vcalib1 - vcalib0) ? (vcalib1 - vcalib0) : 1); in rk817_bat_calib_vol()
188 charger->voltage_b = 4025 - (charger->voltage_k * vcalib1) / 1000; in rk817_bat_calib_vol()
196 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_IOFFSET_H, in rk817_bat_calib_cur()
198 regmap_bulk_write(charger->rk808->regmap, RK817_GAS_GAUGE_CAL_OFFSET_H, in rk817_bat_calib_cur()
215 put_unaligned_le24(charger->soc, bulk_reg); in rk817_record_battery_nvram_values()
216 ret = regmap_bulk_write(charger->rk808->regmap, RK817_GAS_GAUGE_BAT_R1, in rk817_record_battery_nvram_values()
221 * write the remaining capacity in mah to the nvram location used by in rk817_record_battery_nvram_values()
224 rsoc = (charger->soc * charger->fcc_mah) / 100000; in rk817_record_battery_nvram_values()
226 ret = regmap_bulk_write(charger->rk808->regmap, RK817_GAS_GAUGE_DATA0, in rk817_record_battery_nvram_values()
231 put_unaligned_le24(charger->fcc_mah, bulk_reg); in rk817_record_battery_nvram_values()
232 ret = regmap_bulk_write(charger->rk808->regmap, RK817_GAS_GAUGE_DATA3, in rk817_record_battery_nvram_values()
242 struct rk808 *rk808 = charger->rk808; in rk817_bat_calib_cap()
247 if (!charger->battery_present) in rk817_bat_calib_cap()
262 if ((charger->volt_avg_uv < 2700000) || (charger->volt_avg_uv > 4450000)) { in rk817_bat_calib_cap()
263 dev_dbg(charger->dev, in rk817_bat_calib_cap()
265 charger->volt_avg_uv); in rk817_bat_calib_cap()
266 return -EINVAL; in rk817_bat_calib_cap()
271 if (charger->charge_status == CHARGE_FINISH && (!charger->soc_cal)) { in rk817_bat_calib_cap()
274 * charge capacity. Note that if the device is unplugged for a in rk817_bat_calib_cap()
283 charger->soc = 100000; in rk817_bat_calib_cap()
284 charge_now_adc = CHARGE_TO_ADC(charger->fcc_mah, in rk817_bat_calib_cap()
285 charger->res_div); in rk817_bat_calib_cap()
287 regmap_bulk_write(rk808->regmap, RK817_GAS_GAUGE_Q_INIT_H3, in rk817_bat_calib_cap()
290 charger->soc_cal = 1; in rk817_bat_calib_cap()
291 dev_dbg(charger->dev, in rk817_bat_calib_cap()
292 "Fully charged. SOC is %d, full capacity is %d\n", in rk817_bat_calib_cap()
293 charger->soc, charger->fcc_mah * 1000); in rk817_bat_calib_cap()
300 if (charger->charge_status == CHARGE_FINISH && charger->soc_cal) { in rk817_bat_calib_cap()
301 regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_Q_PRES_H3, in rk817_bat_calib_cap()
307 charger->res_div); in rk817_bat_calib_cap()
310 * Re-init columb counter with updated values to correct drift. in rk817_bat_calib_cap()
312 if (charge_now / 1000 > charger->fcc_mah) { in rk817_bat_calib_cap()
313 dev_dbg(charger->dev, in rk817_bat_calib_cap()
321 charge_now_adc = CHARGE_TO_ADC(charger->fcc_mah, in rk817_bat_calib_cap()
322 charger->res_div); in rk817_bat_calib_cap()
324 regmap_bulk_write(rk808->regmap, in rk817_bat_calib_cap()
346 regmap_read(charger->rk808->regmap, RK817_GAS_GAUGE_ADC_CONFIG1, &reg); in rk817_read_props()
350 regmap_write_bits(charger->rk808->regmap, in rk817_read_props()
357 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_Q_PRES_H3, in rk817_read_props()
360 charger->charge_now_uah = ADC_TO_CHARGE_UAH(tmp, charger->res_div); in rk817_read_props()
361 if (charger->charge_now_uah < 0) in rk817_read_props()
362 charger->charge_now_uah = 0; in rk817_read_props()
363 if (charger->charge_now_uah > charger->fcc_mah * 1000) in rk817_read_props()
364 charger->charge_now_uah = charger->fcc_mah * 1000; in rk817_read_props()
367 charger->soc = charger->charge_now_uah * 100 / charger->fcc_mah; in rk817_read_props()
370 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_BAT_VOL_H, in rk817_read_props()
373 charger->volt_avg_uv = (charger->voltage_k * tmp) + 1000 * in rk817_read_props()
374 charger->voltage_b; in rk817_read_props()
380 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_BAT_CUR_H, in rk817_read_props()
383 charger->cur_avg_ua = ADC_TO_CURRENT(tmp, charger->res_div); in rk817_read_props()
390 regmap_read(charger->rk808->regmap, RK817_PMIC_CHRG_OUT, &reg); in rk817_read_props()
391 charger->max_chg_cur_ua = in rk817_read_props()
398 regmap_read(charger->rk808->regmap, RK817_PMIC_CHRG_OUT, &reg); in rk817_read_props()
399 charger->max_chg_volt_uv = ((((reg & RK817_CHRG_VOL_SEL) >> 4) * in rk817_read_props()
403 regmap_read(charger->rk808->regmap, RK817_PMIC_CHRG_STS, &reg); in rk817_read_props()
404 charger->battery_present = (reg & RK817_BAT_EXS); in rk817_read_props()
407 regmap_read(charger->rk808->regmap, RK817_PMIC_CHRG_STS, &reg); in rk817_read_props()
408 charger->charge_status = (reg >> 4) & 0x07; in rk817_read_props()
422 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_USB_VOL_H, in rk817_read_props()
426 tmp = ((charger->voltage_k * reg / 1000 + charger->voltage_b) * in rk817_read_props()
428 charger->charger_input_volt_avg_uv = tmp * 1000; in rk817_read_props()
430 charger->charger_input_volt_avg_uv = 0; in rk817_read_props()
433 /* Calibrate battery capacity and soc. */ in rk817_read_props()
445 val->intval = charger->battery_present; in rk817_bat_get_prop()
448 if (charger->cur_avg_ua < 0) { in rk817_bat_get_prop()
449 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in rk817_bat_get_prop()
452 switch (charger->charge_status) { in rk817_bat_get_prop()
454 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in rk817_bat_get_prop()
458 * observed it but assume it's a pre-charge for a dead in rk817_bat_get_prop()
464 val->intval = POWER_SUPPLY_STATUS_CHARGING; in rk817_bat_get_prop()
467 val->intval = POWER_SUPPLY_STATUS_FULL; in rk817_bat_get_prop()
470 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in rk817_bat_get_prop()
471 return -EINVAL; in rk817_bat_get_prop()
476 switch (charger->charge_status) { in rk817_bat_get_prop()
479 val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; in rk817_bat_get_prop()
482 val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE; in rk817_bat_get_prop()
486 val->intval = POWER_SUPPLY_CHARGE_TYPE_STANDARD; in rk817_bat_get_prop()
489 val->intval = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN; in rk817_bat_get_prop()
494 val->intval = charger->fcc_mah * 1000; in rk817_bat_get_prop()
497 val->intval = charger->bat_charge_full_design_uah; in rk817_bat_get_prop()
500 val->intval = 0; in rk817_bat_get_prop()
503 val->intval = charger->charge_now_uah; in rk817_bat_get_prop()
506 val->intval = charger->bat_voltage_min_design_uv; in rk817_bat_get_prop()
510 val->intval = (charger->soc + 500) / 1000; in rk817_bat_get_prop()
511 if (val->intval > 100) in rk817_bat_get_prop()
512 val->intval = 100; in rk817_bat_get_prop()
513 if (val->intval < 0) in rk817_bat_get_prop()
514 val->intval = 0; in rk817_bat_get_prop()
517 val->intval = charger->volt_avg_uv; in rk817_bat_get_prop()
520 val->intval = charger->cur_avg_ua; in rk817_bat_get_prop()
523 val->intval = charger->max_chg_cur_ua; in rk817_bat_get_prop()
526 val->intval = charger->max_chg_volt_uv; in rk817_bat_get_prop()
529 val->intval = charger->bat_voltage_max_design_uv; in rk817_bat_get_prop()
532 return -EINVAL; in rk817_bat_get_prop()
545 val->intval = charger->plugged_in; in rk817_chg_get_prop()
549 val->intval = 5500000; in rk817_chg_get_prop()
553 val->intval = 3800000; in rk817_chg_get_prop()
556 val->intval = charger->charger_input_volt_avg_uv; in rk817_chg_get_prop()
564 val->intval = POWER_SUPPLY_USB_TYPE_DCP; in rk817_chg_get_prop()
567 return -EINVAL; in rk817_chg_get_prop()
578 charger->plugged_in = 1; in rk817_plug_in_isr()
579 power_supply_changed(charger->chg_ps); in rk817_plug_in_isr()
580 power_supply_changed(charger->bat_ps); in rk817_plug_in_isr()
581 /* try to recalibrate capacity if we hit full charge. */ in rk817_plug_in_isr()
582 charger->soc_cal = 0; in rk817_plug_in_isr()
586 dev_dbg(charger->dev, "Power Cord Inserted\n"); in rk817_plug_in_isr()
597 rk808 = charger->rk808; in rk817_plug_out_isr()
598 charger->plugged_in = 0; in rk817_plug_out_isr()
599 power_supply_changed(charger->bat_ps); in rk817_plug_out_isr()
600 power_supply_changed(charger->chg_ps); in rk817_plug_out_isr()
608 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, in rk817_plug_out_isr()
610 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, RK817_USB_VLIM_EN, in rk817_plug_out_isr()
617 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, in rk817_plug_out_isr()
619 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, RK817_USB_ILIM_EN, in rk817_plug_out_isr()
624 dev_dbg(charger->dev, "Power Cord Removed\n"); in rk817_plug_out_isr()
637 if ((val->intval < 500000) || in rk817_bat_set_prop()
638 (val->intval > charger->bat_charge_full_design_uah)) in rk817_bat_set_prop()
639 return -EINVAL; in rk817_bat_set_prop()
640 charger->fcc_mah = val->intval / 1000; in rk817_bat_set_prop()
643 return -EINVAL; in rk817_bat_set_prop()
684 .name = "rk817-battery",
694 .name = "rk817-charger",
708 /* Read the nvram data for full charge capacity. */ in rk817_read_battery_nvram_values()
709 ret = regmap_bulk_read(charger->rk808->regmap, in rk817_read_battery_nvram_values()
713 charger->fcc_mah = get_unaligned_le24(bulk_reg); in rk817_read_battery_nvram_values()
721 if ((charger->fcc_mah < 500) || in rk817_read_battery_nvram_values()
722 ((charger->fcc_mah * 1000) > charger->bat_charge_full_design_uah)) { in rk817_read_battery_nvram_values()
723 dev_info(charger->dev, in rk817_read_battery_nvram_values()
725 charger->bat_charge_full_design_uah); in rk817_read_battery_nvram_values()
726 charger->fcc_mah = charger->bat_charge_full_design_uah / 1000; in rk817_read_battery_nvram_values()
732 * U-Boot, or even i2cset) can write to this register. If the value is in rk817_read_battery_nvram_values()
736 ret = regmap_bulk_read(charger->rk808->regmap, in rk817_read_battery_nvram_values()
740 charger->soc = get_unaligned_le24(bulk_reg); in rk817_read_battery_nvram_values()
741 if (charger->soc > 10000) in rk817_read_battery_nvram_values()
742 charger->soc = 10000; in rk817_read_battery_nvram_values()
743 if (charger->soc < 0) in rk817_read_battery_nvram_values()
744 charger->soc = 0; in rk817_read_battery_nvram_values()
753 struct rk808 *rk808 = charger->rk808; in rk817_read_or_set_full_charge_on_boot()
763 ret = regmap_read(rk808->regmap, RK817_GAS_GAUGE_GG_STS, &reg); in rk817_read_or_set_full_charge_on_boot()
768 * If the battery is uninitialized, use the poweron voltage and an ocv in rk817_read_or_set_full_charge_on_boot()
773 regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_PWRON_VOL_H, in rk817_read_or_set_full_charge_on_boot()
776 boot_voltage = (charger->voltage_k * tmp) + in rk817_read_or_set_full_charge_on_boot()
777 1000 * charger->voltage_b; in rk817_read_or_set_full_charge_on_boot()
780 * 20C for OCV lookup. If lookup fails, report error with OCV in rk817_read_or_set_full_charge_on_boot()
783 charger->soc = power_supply_batinfo_ocv2cap(bat_info, in rk817_read_or_set_full_charge_on_boot()
786 if (charger->soc < 0) in rk817_read_or_set_full_charge_on_boot()
787 charger->soc = 0; in rk817_read_or_set_full_charge_on_boot()
789 /* Guess that full charge capacity is the design capacity */ in rk817_read_or_set_full_charge_on_boot()
790 charger->fcc_mah = charger->bat_charge_full_design_uah / 1000; in rk817_read_or_set_full_charge_on_boot()
793 * though datasheet claims it's a read-only value. in rk817_read_or_set_full_charge_on_boot()
795 regmap_write_bits(rk808->regmap, RK817_GAS_GAUGE_GG_STS, in rk817_read_or_set_full_charge_on_boot()
806 regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_Q_PRES_H3, in rk817_read_or_set_full_charge_on_boot()
812 charger->res_div) / 1000; in rk817_read_or_set_full_charge_on_boot()
815 * minutes as it tends to drift downward. If so, re-init soc in rk817_read_or_set_full_charge_on_boot()
818 * counting at 2550 (0xFF) minutes. BSP kernel used OCV, but in rk817_read_or_set_full_charge_on_boot()
824 regmap_read(rk808->regmap, RK817_GAS_GAUGE_OFF_CNT, &off_time); in rk817_read_or_set_full_charge_on_boot()
826 regmap_bulk_read(rk808->regmap, in rk817_read_or_set_full_charge_on_boot()
830 boot_voltage = (charger->voltage_k * tmp) + in rk817_read_or_set_full_charge_on_boot()
831 1000 * charger->voltage_b; in rk817_read_or_set_full_charge_on_boot()
832 charger->soc = in rk817_read_or_set_full_charge_on_boot()
837 charger->soc = (boot_charge_mah * 1000 * 100 / in rk817_read_or_set_full_charge_on_boot()
838 charger->fcc_mah); in rk817_read_or_set_full_charge_on_boot()
843 * Now we have our full charge capacity and soc, init the columb in rk817_read_or_set_full_charge_on_boot()
846 boot_charge_mah = charger->soc * charger->fcc_mah / 100 / 1000; in rk817_read_or_set_full_charge_on_boot()
847 if (boot_charge_mah > charger->fcc_mah) in rk817_read_or_set_full_charge_on_boot()
848 boot_charge_mah = charger->fcc_mah; in rk817_read_or_set_full_charge_on_boot()
849 tmp = CHARGE_TO_ADC(boot_charge_mah, charger->res_div); in rk817_read_or_set_full_charge_on_boot()
851 ret = regmap_bulk_write(rk808->regmap, RK817_GAS_GAUGE_Q_INIT_H3, in rk817_read_or_set_full_charge_on_boot()
856 /* Set QMAX value to max design capacity. */ in rk817_read_or_set_full_charge_on_boot()
857 tmp = CHARGE_TO_ADC((charger->bat_charge_full_design_uah / 1000), in rk817_read_or_set_full_charge_on_boot()
858 charger->res_div); in rk817_read_or_set_full_charge_on_boot()
860 ret = regmap_bulk_write(rk808->regmap, RK817_GAS_GAUGE_Q_MAX_H3, in rk817_read_or_set_full_charge_on_boot()
871 struct rk808 *rk808 = charger->rk808; in rk817_battery_init()
878 regmap_read(rk808->regmap, RK817_SYS_STS, &tmp); in rk817_battery_init()
879 charger->plugged_in = (tmp & RK817_PLUG_IN_STS); in rk817_battery_init()
886 regmap_write(rk808->regmap, RK817_GAS_GAUGE_ADC_CONFIG0, 0xfc); in rk817_battery_init()
893 regmap_write(rk808->regmap, RK817_GAS_GAUGE_GG_CON, 0x04); in rk817_battery_init()
899 tmp = CURRENT_TO_ADC(charger->sleep_enter_current_ua, in rk817_battery_init()
900 charger->res_div); in rk817_battery_init()
902 regmap_bulk_write(rk808->regmap, RK817_GAS_GAUGE_RELAX_THRE_H, in rk817_battery_init()
906 tmp = CURRENT_TO_ADC(charger->sleep_filter_current_ua, in rk817_battery_init()
907 charger->res_div); in rk817_battery_init()
909 regmap_bulk_write(rk808->regmap, RK817_GAS_GAUGE_SLEEP_CON_SAMP_CUR_H, in rk817_battery_init()
913 regmap_write_bits(rk808->regmap, RK817_GAS_GAUGE_GG_STS, in rk817_battery_init()
917 * Set OCV Threshold Voltage to 127.5mV. This was hard coded like this in rk817_battery_init()
920 regmap_write(rk808->regmap, RK817_GAS_GAUGE_OCV_THRE_VOL, 0xff); in rk817_battery_init()
927 max_chg_vol_mv = bat_info->constant_charge_voltage_max_uv / 1000; in rk817_battery_init()
928 max_chg_cur_ma = bat_info->constant_charge_current_max_ua / 1000; in rk817_battery_init()
931 return dev_err_probe(charger->dev, -EINVAL, in rk817_battery_init()
936 dev_info(charger->dev, in rk817_battery_init()
942 return dev_err_probe(charger->dev, -EINVAL, in rk817_battery_init()
947 dev_info(charger->dev, in rk817_battery_init()
956 max_chg_vol_reg = (max_chg_vol_mv - 4100) / 50; in rk817_battery_init()
961 return dev_err_probe(charger->dev, -EINVAL, in rk817_battery_init()
966 return dev_err_probe(charger->dev, -EINVAL, in rk817_battery_init()
975 ret = regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_OUT, in rk817_battery_init()
978 dev_emerg(charger->dev, in rk817_battery_init()
983 ret = regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_OUT, in rk817_battery_init()
986 dev_emerg(charger->dev, in rk817_battery_init()
992 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_TERM, in rk817_battery_init()
999 chg_term_ma = bat_info->charge_term_current_ua / 1000; in rk817_battery_init()
1001 dev_warn(charger->dev, in rk817_battery_init()
1011 chg_term_i_reg = (chg_term_ma - 100) / 100; in rk817_battery_init()
1012 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_TERM, in rk817_battery_init()
1023 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, in rk817_battery_init()
1025 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, RK817_USB_VLIM_EN, in rk817_battery_init()
1032 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, in rk817_battery_init()
1034 regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, RK817_USB_ILIM_EN, in rk817_battery_init()
1049 queue_delayed_work(system_wq, &charger->work, msecs_to_jiffies(8000)); in rk817_charging_monitor()
1061 struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent); in rk817_charger_probe()
1065 struct device *dev = &pdev->dev; in rk817_charger_probe()
1071 node = of_get_child_by_name(dev->parent->of_node, "charger"); in rk817_charger_probe()
1073 return -ENODEV; in rk817_charger_probe()
1075 ret = devm_add_action_or_reset(&pdev->dev, rk817_cleanup_node, node); in rk817_charger_probe()
1079 charger = devm_kzalloc(&pdev->dev, sizeof(*charger), GFP_KERNEL); in rk817_charger_probe()
1081 return -ENOMEM; in rk817_charger_probe()
1083 charger->rk808 = rk808; in rk817_charger_probe()
1085 charger->dev = &pdev->dev; in rk817_charger_probe()
1098 ret = of_property_read_u32(node, "rockchip,resistor-sense-micro-ohms", in rk817_charger_probe()
1108 charger->res_div = (of_value == 20000) ? 2 : 1; in rk817_charger_probe()
1115 "rockchip,sleep-enter-current-microamp", in rk817_charger_probe()
1121 charger->sleep_enter_current_ua = of_value; in rk817_charger_probe()
1125 "rockchip,sleep-filter-current-microamp", in rk817_charger_probe()
1132 charger->sleep_filter_current_ua = of_value; in rk817_charger_probe()
1134 charger->bat_ps = devm_power_supply_register(&pdev->dev, in rk817_charger_probe()
1136 if (IS_ERR(charger->bat_ps)) in rk817_charger_probe()
1137 return dev_err_probe(dev, -EINVAL, in rk817_charger_probe()
1140 charger->chg_ps = devm_power_supply_register(&pdev->dev, in rk817_charger_probe()
1142 if (IS_ERR(charger->chg_ps)) in rk817_charger_probe()
1143 return dev_err_probe(dev, -EINVAL, in rk817_charger_probe()
1146 ret = power_supply_get_battery_info(charger->bat_ps, in rk817_charger_probe()
1153 if ((bat_info->charge_full_design_uah <= 0) || in rk817_charger_probe()
1154 (bat_info->voltage_min_design_uv <= 0) || in rk817_charger_probe()
1155 (bat_info->voltage_max_design_uv <= 0) || in rk817_charger_probe()
1156 (bat_info->constant_charge_voltage_max_uv <= 0) || in rk817_charger_probe()
1157 (bat_info->constant_charge_current_max_ua <= 0) || in rk817_charger_probe()
1158 (bat_info->charge_term_current_ua <= 0)) { in rk817_charger_probe()
1159 return dev_err_probe(dev, -EINVAL, in rk817_charger_probe()
1163 charger->bat_charge_full_design_uah = bat_info->charge_full_design_uah; in rk817_charger_probe()
1164 charger->bat_voltage_min_design_uv = bat_info->voltage_min_design_uv; in rk817_charger_probe()
1165 charger->bat_voltage_max_design_uv = bat_info->voltage_max_design_uv; in rk817_charger_probe()
1175 power_supply_put_battery_info(charger->bat_ps, bat_info); in rk817_charger_probe()
1185 ret = devm_request_threaded_irq(charger->dev, plugin_irq, NULL, in rk817_charger_probe()
1190 return dev_err_probe(&pdev->dev, ret, in rk817_charger_probe()
1194 ret = devm_request_threaded_irq(charger->dev, plugout_irq, NULL, in rk817_charger_probe()
1199 return dev_err_probe(&pdev->dev, ret, in rk817_charger_probe()
1203 ret = devm_delayed_work_autocancel(&pdev->dev, &charger->work, in rk817_charger_probe()
1209 mod_delayed_work(system_wq, &charger->work, 0); in rk817_charger_probe()
1218 cancel_delayed_work_sync(&charger->work); in rk817_suspend()
1229 mod_delayed_work(system_wq, &charger->work, 0); in rk817_resume()
1239 .name = "rk817-charger",
1249 MODULE_ALIAS("platform:rk817-charger");