On Thu, Apr 21, 2016 at 12:58 AM, Hans de Goede <[email protected]> wrote:
> Hi, > > On 21-04-16 08:16, Juan Carlos Barrientos wrote: > >> Hello Hans, >> Is theres any news about support battery /charging support for apx221s ?? >> i have using 4.6-rc2 kernel but this limitation persist. There is nothing >> in the folder /sys/class/power_supply/. >> Thanks for your work :) >> > > I did not write the apx221 battery charging support, only reviewed the > initial > code submission. > > Lawrence, what is the status of this ? > > Regards, > > Hans > > The updated code for that patch is available in github at https://github.com/micile/linux-sunxi/tree/AXP_Battery It works with my A33 tablet so I believe should also work with A31s tablet. I am not the original author of the patch and whatever problems kept the original patch from getting into mainline in 2014 would still be present. I just updated the code to make it work with the newer kernels. If someone wants to try to fix up the code to submit the code into mainline, they are more than welcome. To make it work, add the following to your dts file &axp22x { backup = <3000000 200>; }; Then rebuild the kernel using the patch and the sunxi_defconfig. Oddly, the AXP20X_POWER is already enabled in the mainline sunxi_defconfig so at one point this must have been close to getting in. After booting the new kernel, you will see the following: /sys/class/power_supply/axp20x-ac /sys/class/power_supply/axp20x-backup /sys/class/power_supply/axp20x-battery /sys/class/power_supply/axp20x-usb and there will be AC power state and battery information in there. > > > Juan Carlos >> >> El viernes, 10 de julio de 2015, 10:47:20 (UTC+2), Hans de Goede escribió: >> >> Hi, >> >> On 12-06-15 05:35, Lawrence Yu wrote: >> > Hi, >> > >> > On Wed, Jun 10, 2015 at 8:09 AM, Hans de Goede <[email protected]> >> wrote: >> > >> >> Hi, >> >> >> >> On 08-06-15 05:22, Lawrence Y wrote: >> >> >> >>> Hi, >> >>> >> >>> I've managed to get AC charging information and battery charge >> information >> >>> on my A31s tablet. >> >>> >> >>> I've taken the AXP20x patch from here >> >>> >> >>> >> >>> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2014-October/295547.html >> < >> http://lists.infradead.org/pipermail/linux-arm-kernel/2014-October/295547.html >> > >> >> >>> >> >>> and done very minor code modifications to make it work with the >> AXP221 and >> >>> the 4.1 sunxi-next kernel. >> >>> >> >> >> >> Cool that is great news. Note that I've just posted a new version >> of parts >> >> of that patch. One thing which needs to be changed is to use a dts >> >> child-node and thus a mfd cell, platform device and platform >> driver >> >> per function, instead of using only one which then instantiates >> all >> >> 4 power-supplies. We need this to be per power-supply so that >> they can >> >> be enabled/disabled individually and we do not end up having e.g. >> an >> >> ac power-supply registered in sysfs on tablets which only have an >> otg >> >> plug for charging and do not have a separate power barrel plug >> for the >> >> ac power-supply. >> >> >> >> What is the best way to share the modifications needed? Is it >> ok to post >> >>> a >> >>> patch containing all of the changes here including the >> modifications even >> >>> though I am not original author of the patch? >> >>> >> >> >> >> Yes that is fine, as long as you credit the original author in >> the commit >> >> message and leave his copyright at the top of the copied files. >> >> >> >> It would be great if you could convert the work you've done to >> the 1 >> >> dts childnode / mfd-cell per power-supply model, and then post >> that. >> >> >> >> If that is too much work, please do post what you've as that will >> be >> >> very helpful for however works on this next. >> >> >> >> Regards, >> >> >> >> Hans >> >> >> > >> > I've posted the patch at the end of this email. >> >> Thanks, one thing which stands out is that you're modifying a lot of >> the >> axp20x structs / defines, etc. >> >> What you should do instead is create new structs like >> axp22x_volatile_ranges >> which start as a copy of the 20x structs and then have your >> modifcations, >> likewise just copy all the register name #defines doing s/20X/22X and >> then >> make any necessary changes/additions to the 22X defines. >> >> Note that the 4.2-rc1 kernel already has some 22x support, so most of >> this is already done. >> >> > I don't think I am at the >> > level yet where I would be able to do a good job of creating the >> new needed >> > drivers. I will probably try anyway and post what I end up with, >> but I >> > wouldn't expect anyone to wait on anything usable coming out of it, >> > especially if they felt they could do a more proper job at making >> the >> > needed drivers. >> >> Maybe you can start with rebasing your patch on to of 4.2-rc1, and >> making >> the changes I've suggested? That would already be a big help for >> anyone >> coming after you and trying to add 22x battery / charging support. >> >> Regards, >> >> Hans >> >> -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
