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:	Thu, 20 Feb 2014 10:33:10 +0530
From:	Jenny Tc <jenny.tc@...el.com>
To:	Pavel Machek <pavel@....cz>
Cc:	linux-kernel@...r.kernel.org,
	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	Anton Vorontsov <cbouatmailru@...il.com>,
	Anton Vorontsov <anton.vorontsov@...aro.org>,
	Kim Milo <Milo.Kim@...com>, Lee Jones <lee.jones@...aro.org>,
	Jingoo Han <jg1.han@...sung.com>,
	Chanwoo Choi <cw00.choi@...sung.com>,
	Sachin Kamat <sachin.kamat@...aro.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Pali Rohár <pali.rohar@...il.com>,
	Rhyland Klein <rklein@...dia.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	David Woodhouse <dwmw2@...radead.org>,
	Tony Lindgren <tony@...mide.com>,
	Russell King <linux@....linux.org.uk>,
	Sebastian Reichel <sre@...g0.de>, aaro.koskinen@....fi,
	Pallala Ramakrishna <ramakrishna.pallala@...el.com>,
	freemangordon@....bg, linux-omap@...r.kernel.org
Subject: Re: [PATCH 4/4] power_supply: bq24261 charger driver

On Tue, Feb 04, 2014 at 12:36:21PM +0100, Pavel Machek wrote:
> > +#define BQ24261_MIN_CV 3500
> > +#define BQ24261_MAX_CV 4440
> 
> Other defines use uV as an unit :-(.

uV is used if the value is read from psy class. For register configurations
uses mV. Will change the name to reflect mV

> > +	/* If status is fault, wait for READY before enabling the charging */
> > +
> > +	if (!is_ready) {
> > +		ret = wait_event_timeout(chip->wait_ready,
> > +			(chip->chrgr_stat != BQ24261_CHRGR_STAT_READY),
> > +				HZ);
> > +		dev_info(&chip->client->dev,
> > +			"chrgr_stat=%x\n", chip->chrgr_stat);
> > +		if (ret == 0) {
> > +			dev_err(&chip->client->dev,
> > +				"Waiting for Charger Ready Failed.Enabling charging anyway\n");
> > +		}
> > +	}
> 
> So charger has a problem, and we force it on, anyway? Also put space
> after ".".

Yes, sometimes charger does not give ready, so we force.
> 
> > +static inline int bq24261_set_cv(struct bq24261_charger *chip, int cv)
> > +{
> > +	int bat_volt;
> > +	int ret;
> > +	u8 reg_val;
> > +	u8 vindpm_val = 0x0;
> > +
> > +	/*
> > +	* Setting VINDPM value as per the battery voltage
> > +	*  VBatt           Vindpm     Register Setting
> > +	*  < 3.7v           4.2v       0x0 (default)
> > +	*  3.71v - 3.96v    4.36v      0x2
> > +	*  > 3.96v          4.6v       0x5
> > +	*/
> > +	ret = get_battery_voltage(&bat_volt);
> > +	if (ret) {
> > +		dev_err(&chip->client->dev,
> > +			"Error getting battery voltage!!\n");
> > +	} else {
> 
> You forget the error value and continue anyway.

On error, throw the error and program default VINDPM value.

-Jenny
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ