Open PaddleStroke opened 5 years ago
deprecated?
Not maintained (because I don't use the only A20/AXP209 board anymore) but should still work, though may require adjusting for newer kernels.
Are you talking about this script?
This is a kernel patch, but yes, it lives in this repository.
If so can you please elt me know where is the source code of the AXP209 driver?
This patch applies to the MFD driver in drivers/mfd/axp20x.c in the mainline kernel tree.
Other (newer) drivers are in drivers/power/supply/axp20x_battery.c, drivers/power/supply/axp20x_ac_power.c, drivers/power/supply/axp20x_usb_power.c, drivers/input/misc/axp20x-pek.c and I think there are some other bits somewhere.
Thanks for the reply!
So this patch should add the sysfs interface right? The one in /sys/power/axp_pmu ?
This patch does not cover battery max voltage right? (reg33) Nor the ADC GPIO ?
My problem is that I can't find other sysfs files than the ones generated by this patch. I'm not sure but I think there should be others sysfs folder no? Quentin Schulz who worked on some of these axp drivers suggested to use /sys/class/power_supply/voltage_max_design to change battery max voltage. But this does not exist.
Do you know how to use those drivers axp20x.c axp20x_battery.c ..?
Btw I opened a thread on armbian forum to discuss the matter : https://forum.armbian.com/topic/10834-axp209-proper-driver/ Also I found an issue with u-boot axp209 driver that may have been causing you trouble in the past (battery detection reseting) see the topic.
So this patch should add the sysfs interface right? The one in /sys/power/axp_pmu ?
Yes.
This patch does not cover battery max voltage right? (reg33) Nor the ADC GPIO ?
Yes, those functions are not implemented. Though the kernel now has a pinctrl/GPIO driver for the PMIC here. And battery voltage should be settable via the "proper" driver looking at it here.
My problem is that I can't find other sysfs files than the ones generated by this patch. I'm not sure but I think there should be others sysfs folder no? Quentin Schulz who worked on some of these axp drivers suggested to use /sys/class/power_supply/voltage_max_design to change battery max voltage. But this does not exist.
First, those drivers need to be enabled in the kernel at the compilation time (i.e. CONFIG_BATTERY_AXP20X
for the battery driver), and second, they need to be enabled in the Device Tree file for your board, i.e. like here for Cubietruck.
Those drivers should add nodes to /sys/class/power_supply/
if activated correctly.
Also I found an issue with u-boot axp209 driver that may have been causing you trouble in the past (battery detection reseting) see the topic.
I didn't test shutdown from u-boot at the time (as why would you ever want to interact with u-boot shutdown outside of debugging?), the main problem with battery detection was(is) in the kernel here - it should use regmap_update_bits() instead of regmap_write()
Thanks for the tips about adding to dts. I had not added them, that's why I did not got the sysfs!
And yes indeed you are right, the same issue is in kernel driver, I just found it few minutes ago. I found the uboot driver first, so I thought the issue was coming from there.
Hi, On armbian forum you say there :
Are you talking about this script? If so can you please elt me know where is the source code of the AXP209 driver? Thanks!