lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 4 Mar 2015 17:47:41 +1100
From:	NeilBrown <neilb@...e.de>
To:	Pavel Machek <pavel@....cz>
Cc:	Samuel Ortiz <sameo@...ux.intel.com>,
	Tony Lindgren <tony@...mide.com>,
	Lee Jones <lee.jones@...aro.org>,
	Sebastian Reichel <sre@...nel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	David Woodhouse <dwmw2@...radead.org>,
	GTA04 owners <gta04-owner@...delico.com>,
	linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org
Subject: Re: [PATCH 07/15] twl4030_charger: allow fine control of charger
 current.

On Mon, 2 Mar 2015 22:05:01 +0100 Pavel Machek <pavel@....cz> wrote:

> 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.

Maybe. 32bits allows for  4000A, which should be plenty...
I made it unsigned int.

> 
> [Plus, this is not kernel comment style, but...]

Fixed

> 
> > +	/* For ichg_eoc, reg value must be 100XXXX000, we only
> > +	 * set the XXXX in high nibble.
> > +	 */
> 
> Confused. High nibble is 0xf0, right?

does this help?

	/*
	 * For ichg_eoc, the hardware only supports reg values matching
	 * 100XXXX000, and requires the XXXX be stored in the high nibble
	 * of TWL4030_BCIMFTH8
	 */


> 
> > +	/* 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 <pavel@....cz>
> 

Thanks again!

NeilBrown

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ