This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ25622: Issues with Linux driver

Part Number: BQ25622

Tool/software:

Hey,

I've recently received a linux driver for the BQ2562x chips. I've noticed a couple of interesting things:

1.) bq2562x_charger.h

#define BQ2562X_WATCHDOG_MASK   0x01
According to the datasheet, the watchdog timer is two bits, shouldn't this be BQ2562X_WATCHDOG_MASK   0x03?  In the hw_init function the code sets it with
    ret = regmap_update_bits(bq->regmap, BQ2562X_CHRG_CTRL_0,
                 BQ2562X_WATCHDOG_MASK, wd_reg_val);
Which means with this mask, it's either gonna be disabled or 40s (as the last bit is propagated only).
2) IIUC the mode of operation of the driver then the watchdog timer is not punched at all WD_RST bit of 0x16 register, instead when it expires, an interrupt is generated then the 
bq2562x_irq_handler_thread interrupt handler will read the registers, and hopefully detect that the ICHG (charge current limit) has changed, as according to the datasheet, it is halved every time a watchdog timeout occurs. The I guess as a result of the  power_supply_changed() call, some higher level entity will reprogram the charge current limit again through the bq2562x_set_property? Isn't this suboptimal?
Thanks & BR,
Nandor