5 Apr 2026
I sent a patch series to add the MAX17048 fuel gauge for the Samsung Galaxy Express. Now I should be able to read the battery percentage!
How it evolved (v1 → v3)
- v1: a single patch to add fuel gauge on the board DTS. Turns out it wasn’t able to apply to my other patches I sent upstream because I applied it on top of an older patch series. Whoops.
- v2: got a lot of good feedback here. Used GSBI5 instead of bit banging (which downstream used). Rebased onto correct dependencies this time and made b4 happy. And finally sorted expressatt DTS to be in line with the formatting standard used in qcom (tho I wish there was an auto formatter)
- v3: no more comments in this patch series so it seems good to go! Just some further formatting changes and to use interrupts-extended
Konrad and Dmitry really seemed to like how I tested this patch series, which was nice to hear :). What I did was I booted using the mainline kernel with the battery, got the capacity, put the battery into another expressatt that ran downstream Android, and see if the battery % matched. It seems to be really close!
One thing I have yet to do is see how it lasts over a long period of time. Upstream seems to drain a lot more battery than downstream, and I wonder how I can further optimize this. But that’s for after I get all the peripherals working in mainline first. I also wonder if the drift in reading will diverge further over a charge cycle. I mainly tested it about every 5%, but I wonder if upstream going to 100% to 0% would actually read as 0% in downstream.
It was nice that the fuel gauge driver was already upstreamed! The only required part was to convert the board file to a DTS, and AI is really good at doing just that. It cut down on my work significantly.
AI
AI again was super helpful in generating this patch series. Was able to quickly iterate and send this upstream :)
On the other hand, I tried to get it to generate this article, but it was so bad. It came up with a decent template, which I filled it out with my voice. I don’t think AI is there for writing articles to be honest. However, it’s really good at rephrasing things, so it might be useful for that.
Overall
Super excited with the progress I’m making! :) It actually feels like I’m getting somewhere with the few sparse minutes I have each day. A few minutes are all I need to test, get logs, and prompt the AI to continue iteration. Very excited to see what the future holds!
Pending Upstream Submissions I’ve slightly neglected
What’s Working
- UART
- USB
- eMMC/SD card
- vol up, vol down, home, and power button
- touchscreen
- weird initrd error has been conquered!
- lk2nd
- tsens
- nfc
- accelerometer
- light sensor
- touchkeys
- vibrator
- camera flash
- battery fuel guage
What’s Left
This list will potentially grow later as I find more things
- magnetometer (added but potentially wrong mount matrix)
- proximity (added but for some reason it is a floating value)
- vibrator (added but I need to figure out if I can vary the frequency. Currently works at either 0% or 100%)
- display
- gpu
- speakers/microphone/headphone jack
- cameras
- wifi/bluetooth
- modem/gps(from modem?)
- charging
- cpufreq