Hi! > Let's allow reconfiguring the cpcap-charger max charge voltage and > default to 4.2V that should be safe for the known users. > > This allows the users to use 4.35V for the extra capacity if really > needed at a cost of probably shorter battery life. We check the > constant charge voltage limit set by the battery. > > Some pieces of the property setting code is based on an earlier patch > from Pavel Machek <pavel@xxxxxx> but limited to configuring the charge > voltage for now. > > Cc: Merlijn Wajer <merlijn@xxxxxxxxxx> > Cc: Pavel Machek <pavel@xxxxxx> > Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx> > @@ -259,6 +263,83 @@ static int cpcap_charger_get_property(struct power_supply *psy, > return 0; > } > > +static int cpcap_charger_match_voltage(int voltage) > +{ > + switch (voltage) { > + case 0 ... 4100000 - 1: return 3800000; Would it be better to return 0 for < 3.8V values? > + case 4100000 ... 4120000 - 1: return 4120000; I believe this should be 4100000. > + case 4120000 ... 4150000 - 1: return 4120000; > + case 4150000 ... 4170000 - 1: return 4150000; > + case 4170000 ... 4200000 - 1: return 4170000; > + case 4200000 ... 4230000 - 1: return 4200000; With that fixed, Acked-by: Pavel Machek <pavel@xxxxxx> Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Attachment:
signature.asc
Description: Digital signature