From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755543AbbCBVFH (ORCPT ); Mon, 2 Mar 2015 16:05:07 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:58250 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753540AbbCBVFE (ORCPT ); Mon, 2 Mar 2015 16:05:04 -0500 Date: Mon, 2 Mar 2015 22:05:01 +0100 From: Pavel Machek To: NeilBrown Cc: Samuel Ortiz , Tony Lindgren , Lee Jones , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , GTA04 owners , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 07/15] twl4030_charger: allow fine control of charger current. Message-ID: <20150302210501.GJ13270@amd> References: <20150224043341.4243.23291.stgit@notabene.brown> <20150224043351.4243.88962.stgit@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150224043351.4243.88962.stgit@notabene.brown> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > + /* ichg values in uA. If any are 'large', we set CGAIN to > + * '1' which doubles the range for half the precision. > + */ > + int ichg_eoc, ichg_lo, ichg_hi, cur; We should really get uA_t. [Plus, this is not kernel comment style, but...] > + /* For ichg_eoc, reg value must be 100XXXX000, we only > + * set the XXXX in high nibble. > + */ Confused. High nibble is 0xf0, right? > + /* And finally, set the current. This is stored in > + * two registers. */ > + reg = ua2regval(bci->cur, cgain); > + /* we have only 10 bit */ bits > @@ -562,6 +698,14 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) > if (!pdata) > pdata = twl4030_bci_parse_dt(&pdev->dev); > > + bci->ichg_eoc = 80100; /* Stop charging when current drops to here */ > + bci->ichg_lo = 241000; /* low threshold */ Low > + bci->ichg_hi = 500000; /* High threshold */ Acked-by: Pavel Machek -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html