-
Notifications
You must be signed in to change notification settings - Fork 78
Add sm5708 battery/charger driver for a6plte #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 6.16.3/main
Are you sure you want to change the base?
Conversation
This is a Power Management IC which includes USBLDO, RGB(SVC led), Dual Flash, Charger.
squash! power: supply: add support for sm5708 charger switch to devm_extcon_register_notifier_all
|
By chance, I found out that the latest release v6.17.7-r0 includes another driver for the sm5708. First, I thought ok, at least I learned something about kernel drivers. But now I tested it and the battery percentage did not show up. If there is no quick fix, I would still stick to the version here. I do not know why I should spend time debugging the other driver, because this one works on my device. @vldly, you are the author of the other sm5708 driver, commit 92a0fab. Did it work properly on your device, including battery percentage? |
It has some dependencies for complex battery thermistor setup, which is needed for thermal mitigation. If those are missing or didn't probe it won't work.
Yes. Battery estimation isn't great but better than nothing. With old driver it might die at 20% or so. |
Thanks, I will try it again with these configurations tomorrow, I am currently travelling. I just used the config-postmarketos-qcom-msm8953.aarch64. Normally, all dependent kernel dependencies should be specified in the
Thanks, that could be an issue on the old implementation! Actually, my phone died. After restarting, it was at 4%. Then I disconnected it from battery, it died again, and after restarting, it was 15%. It seems to me that the phone dies too early... |
I checked it now. Because I was travelling, it took a bit longer (compiled it natively on the phone). Results:
|
This adds battery for a6plte, charging works now, battery percentage is displayed in phosh. The a6plte seems to work great with postmarketos (only broken call-audio and broken camera) thank you all to make that possible!
This is the first linux kernel patch I submitted anywhere, I know this is the wrong format. Perhaps someone can also point me to the documentation on how I can do it right...
Also, there are some quirks:
sm5708_request_mode()is exported as global function. Therefore, kernel log givesDriver 'sm5708-mfd' needs updating - please use bus_type methods. This should be fixed.of_get_named_gpio()is marked as deprecated, but I don't know how I could get the IRQ from the device tree. In general, I don't know much about the device tree kernel interface or how IRQs are initialized under the hood.