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
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.
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
Just sayin that I lost track of counting the number of bugs fixed in this driver. I belive the driver you sent was never tested with real hadware.
The most important ones are:
- There are logical errors which disable the watchdog completely (> instead of >=), therefore no IRQ will be received.
- The IBAT LSB ADC register is not declared volatile, therefore it's never re-read on change
I've fixed all the issues I could find. Also changed the mode of operation a bit, to be driven by the watchdog timeout, single shot ADC readings, etc.
https://github.com/EffectiveRange/drv-bq25622
Builds and works fine on Raspberry Pi brcm2835, bullseye os (6.1.21+) kernel version.
Oh, also removed the USB part of the driver, as if the charger is unplugged/plugged there will be an interrupt, and the the status will be queried. The USB notification seemed a bit superfluous to me so I removed it completely.