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:	Tue, 06 Dec 2011 14:34:59 +0100
From:	Pali Rohár <pali.rohar@...il.com>
To:	Felipe Contreras <felipe.contreras@...il.com>
Cc:	Sebastian Reichel <sre@...ian.org>,
	Felipe Contreras <felipe.contreras@...ia.com>,
	linux-main <linux-kernel@...r.kernel.org>,
	linux-omap <linux-omap@...r.kernel.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Aliaksei Katovich <aliaksei.katovich@...ia.com>,
	Vladimir Zapolskiy <vz@...ia.com>
Subject: Re: [PATCH] mfd: add bq2415x charger driver

Hi,

On Tuesday 06 December 2011 04:49:37 you wrote:
> Hi,
> 
> 2011/12/6 Sebastian Reichel <sre@...ian.org>:
> > Good to hear somebody is working on this :) I planned to do this
> > myself, but didn't find any time for it. Here are some comments
> :
> > from me:
> :)
> :
> > [...]
> > 
> >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > 
> > I would expect the driver in drivers/power. But maybe MFD is
> > better, since the chip can also be used to power USB host?

Yes, chip support usb host mode and is working on rx51.

> 
> Perhaps, at least I haven't tried that.
> 
> > [...]
> > 
> >> +#define BQ2415X_VOLTAGE_SCALE 20000
> > 
> > If I remember correctly (I read the specs some time ago), this can
> > be configured via external resistor. So this is board specific?
> 
> Not really. There are 6 bits: 640, 320, 160, 80, 40, 20. So values
> from 0 to 1260mV can be represented, at steps of 20mV. A value of 0
> means 3.5V.
> 
> > [...]
> > 
> >> +     bq2415x_i2c_write(cli, BQ2415X_CHG_CTL, 0x42);
> >> +     bq2415x_set_voltage(cli, 0, 4200000);
> >> +     bq2415x_set_current_limit(cli, 1800000, 1800000);
> > 
> > So it always charges with 1.8A? Shouldn't this be dependent on the
> > input source (e.g. 500mA from USB)? Also what's if no charger is
> > connected at all?
> 
> No. I'm hard-coding those values, but I wrote the functions
> (set_voltate, set_current_limit) so all values are supported.

These hardcoded values should go to board specified section.

> 
> What is missing is the code to connect this driver to the charger
> detector driver (isp1704), so those values are determined dynamically.
> 
> > Apart from this I think those values should be exposed to sysfs
> > via /sys/class/power_supply.
> 
> Perhaps. Although I don't see much of the power supply interface that
> could be useful here, but if so, I guess this should be indeed in
> 'drivers/power'.

Power supply interface has pending patches for chargers. Patches will add 
interface for periodic calling functions - which is usefull for watchdog reset 
and charging (+ errors handling).

> 
> Cheers.

-- 
Pali Rohár
pali.rohar@...il.com
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists