[Gta04-owner] [PATCH] twl4030_charger: add software controlled linear charging mode.

Andreas Kemnade andreas at kemnade.info
Fri Sep 27 12:13:17 CEST 2013


Hi,

On Fri, 27 Sep 2013 07:39:09 +0200
"Dr. H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> Hi Andreas,
> 
> Am 26.09.2013 um 20:09 schrieb Andreas Kemnade:
> 
> > Hi,
> > 
> > 
> > On Thu, 26 Sep 2013 15:19:40 +0200
> > "Dr. H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> > 
> >> Hi Ben,
> >> thanks for the patch. I have applied it and now the /sys/.../lin file is back again.
> >> 
> >> One question (maybe to Andreas): "on" sets the variable do_lin=1 and "auto" resets it if it was on. But "off" does not set it to 0. Is this intended behaviour?
> >> 
> > yes, that is intended behaviour:
> > off= manual off (and no auto on, prevented by do_lin still =0 )

s/0/1/

> 
>  I think the code is missing something (as indicated). If you set it to "on" and then to "off" do_lin will still be =1! To reset this variableto 0 you have to set it to "on" and then to "auto". At least this is how I understand the code. So what I do not see is setting it to "off" prevents auto mode by setting do_lin = 0 if it was set before.

do_lin = 0 should not prevent auto mode therefore I leave it at 1 when lin is set to off.

There are several if (do_lin) in the code which prevent the autocharging from being enabled. But if power is reapplied, software-controlled charging is enabled again (by software). 

A hint for testing: vbus is not reported during hardware testing now, so the corresponding sysfs node does not give information. That has side effects on the usb module. For my use case it is better so. 

> 
> > auto=automatic charge mode
> > on = manual on 
> > 
> > btw: it is possible to keep the gta04 in suspend mode with do_lin=on when power supply goes on and off. Tested on my bike on the very hilly and windy roads around the North Cape.
> 
> That is a nice story we should push more to the public! Maybe we add it to the commit message "has been tested on a bike on the very hilly and windy roads around the North Cape" :)
> 
> Should we try to get this patch into mainline or would you do it yourself?
> 
I can try to do it myself. So it seems this patch is also interesting for other people and it is not only for thoses crazy people like me who do notice that cars are already invented and want to have crazy code everywhere ;-)

Maybe I should make it to Munich to go to the oshw to do some charging/usb hacking demonstrations...

Greetings
Andreas Kemnade
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20130927/2a868d1b/attachment.bin>


More information about the Gta04-owner mailing list