Loading drivers/power/supply/qcom/fg-core.h +4 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,8 @@ /* Battery missing irq votable reasons */ #define BATT_MISS_IRQ_VOTER "fg_batt_miss_irq" #define ESR_FCC_VOTER "fg_esr_fcc" #define DEBUG_PRINT_BUFFER_SIZE 64 /* 3 byte address + 1 space character */ #define ADDR_LEN 4 Loading Loading @@ -403,6 +405,7 @@ struct fg_chip { struct votable *awake_votable; struct votable *delta_bsoc_irq_en_votable; struct votable *batt_miss_irq_en_votable; struct votable *pl_disable_votable; struct fg_sram_param *sp; struct fg_dma_address *addr_map; struct fg_alg_flag *alg_flags; Loading Loading @@ -460,6 +463,7 @@ struct fg_chip { struct work_struct status_change_work; struct delayed_work ttf_work; struct delayed_work sram_dump_work; struct delayed_work pl_enable_work; }; /* Debugfs data structures are below */ Loading drivers/power/supply/qcom/qpnp-fg-gen3.c +21 −0 Original line number Diff line number Diff line Loading @@ -2790,6 +2790,16 @@ static int __fg_restart(struct fg_chip *chip) return rc; } static void pl_enable_work(struct work_struct *work) { struct fg_chip *chip = container_of(work, struct fg_chip, pl_enable_work.work); vote(chip->pl_disable_votable, ESR_FCC_VOTER, false, 0); vote(chip->awake_votable, ESR_FCC_VOTER, false, 0); } static void profile_load_work(struct work_struct *work) { struct fg_chip *chip = container_of(work, Loading Loading @@ -2883,6 +2893,8 @@ static void profile_load_work(struct work_struct *work) fg_dbg(chip, FG_STATUS, "profile loaded successfully"); out: chip->soc_reporting_ready = true; vote(chip->awake_votable, ESR_FCC_VOTER, true, 0); schedule_delayed_work(&chip->pl_enable_work, msecs_to_jiffies(5000)); vote(chip->awake_votable, PROFILE_LOAD, false, 0); } Loading Loading @@ -4250,6 +4262,8 @@ static irqreturn_t fg_batt_missing_irq_handler(int irq, void *data) chip->profile_loaded = false; chip->soc_reporting_ready = false; chip->batt_id_ohms = -EINVAL; cancel_delayed_work_sync(&chip->pl_enable_work); vote(chip->pl_disable_votable, ESR_FCC_VOTER, true, 0); return IRQ_HANDLED; } Loading Loading @@ -5105,6 +5119,12 @@ static int fg_gen3_probe(struct platform_device *pdev) } } chip->pl_disable_votable = find_votable("PL_DISABLE"); if (chip->pl_disable_votable == NULL) { rc = -EPROBE_DEFER; goto exit; } chip->awake_votable = create_votable("FG_WS", VOTE_SET_ANY, fg_awake_cb, chip); if (IS_ERR(chip->awake_votable)) { Loading Loading @@ -5149,6 +5169,7 @@ static int fg_gen3_probe(struct platform_device *pdev) init_completion(&chip->soc_ready); init_completion(&chip->mem_grant); INIT_DELAYED_WORK(&chip->profile_load_work, profile_load_work); INIT_DELAYED_WORK(&chip->pl_enable_work, pl_enable_work); INIT_WORK(&chip->status_change_work, status_change_work); INIT_DELAYED_WORK(&chip->ttf_work, ttf_work); INIT_DELAYED_WORK(&chip->sram_dump_work, sram_dump_work); Loading Loading
drivers/power/supply/qcom/fg-core.h +4 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,8 @@ /* Battery missing irq votable reasons */ #define BATT_MISS_IRQ_VOTER "fg_batt_miss_irq" #define ESR_FCC_VOTER "fg_esr_fcc" #define DEBUG_PRINT_BUFFER_SIZE 64 /* 3 byte address + 1 space character */ #define ADDR_LEN 4 Loading Loading @@ -403,6 +405,7 @@ struct fg_chip { struct votable *awake_votable; struct votable *delta_bsoc_irq_en_votable; struct votable *batt_miss_irq_en_votable; struct votable *pl_disable_votable; struct fg_sram_param *sp; struct fg_dma_address *addr_map; struct fg_alg_flag *alg_flags; Loading Loading @@ -460,6 +463,7 @@ struct fg_chip { struct work_struct status_change_work; struct delayed_work ttf_work; struct delayed_work sram_dump_work; struct delayed_work pl_enable_work; }; /* Debugfs data structures are below */ Loading
drivers/power/supply/qcom/qpnp-fg-gen3.c +21 −0 Original line number Diff line number Diff line Loading @@ -2790,6 +2790,16 @@ static int __fg_restart(struct fg_chip *chip) return rc; } static void pl_enable_work(struct work_struct *work) { struct fg_chip *chip = container_of(work, struct fg_chip, pl_enable_work.work); vote(chip->pl_disable_votable, ESR_FCC_VOTER, false, 0); vote(chip->awake_votable, ESR_FCC_VOTER, false, 0); } static void profile_load_work(struct work_struct *work) { struct fg_chip *chip = container_of(work, Loading Loading @@ -2883,6 +2893,8 @@ static void profile_load_work(struct work_struct *work) fg_dbg(chip, FG_STATUS, "profile loaded successfully"); out: chip->soc_reporting_ready = true; vote(chip->awake_votable, ESR_FCC_VOTER, true, 0); schedule_delayed_work(&chip->pl_enable_work, msecs_to_jiffies(5000)); vote(chip->awake_votable, PROFILE_LOAD, false, 0); } Loading Loading @@ -4250,6 +4262,8 @@ static irqreturn_t fg_batt_missing_irq_handler(int irq, void *data) chip->profile_loaded = false; chip->soc_reporting_ready = false; chip->batt_id_ohms = -EINVAL; cancel_delayed_work_sync(&chip->pl_enable_work); vote(chip->pl_disable_votable, ESR_FCC_VOTER, true, 0); return IRQ_HANDLED; } Loading Loading @@ -5105,6 +5119,12 @@ static int fg_gen3_probe(struct platform_device *pdev) } } chip->pl_disable_votable = find_votable("PL_DISABLE"); if (chip->pl_disable_votable == NULL) { rc = -EPROBE_DEFER; goto exit; } chip->awake_votable = create_votable("FG_WS", VOTE_SET_ANY, fg_awake_cb, chip); if (IS_ERR(chip->awake_votable)) { Loading Loading @@ -5149,6 +5169,7 @@ static int fg_gen3_probe(struct platform_device *pdev) init_completion(&chip->soc_ready); init_completion(&chip->mem_grant); INIT_DELAYED_WORK(&chip->profile_load_work, profile_load_work); INIT_DELAYED_WORK(&chip->pl_enable_work, pl_enable_work); INIT_WORK(&chip->status_change_work, status_change_work); INIT_DELAYED_WORK(&chip->ttf_work, ttf_work); INIT_DELAYED_WORK(&chip->sram_dump_work, sram_dump_work); Loading