[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120127192247.GA19414@opensource.wolfsonmicro.com>
Date: Fri, 27 Jan 2012 19:22:47 +0000
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Pali Rohár <pali.rohar@...il.com>
Cc: 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>,
Felipe Contreras <felipe.contreras@...il.com>,
Anton Vorontsov <cbouatmailru@...il.com>,
Joerg Reisenweber <joerg@...nmoko.org>,
Sebastian Reichel <sre@...ian.org>,
???????????? ???????????????? <freemangordon@....bg>
Subject: Re: RFC 2: bq2415x_charger driver
On Fri, Jan 27, 2012 at 07:33:59PM +0100, Pali Rohár wrote:
> On Friday 27 January 2012 16:24:55 Mark Brown wrote:
> > On Fri, Jan 27, 2012 at 03:40:43AM +0100, Pali Roh?r wrote:
> > > + struct i2c_client *client = to_i2c_client(bq->dev);
> > You could save a bunch of code by moving all this I2C register I/O over
> > to regmap.
> regmap is not available in 2.6.28, so I cannot use it.
You're submitting to mainline here...
In any case, it's trivial to backport - just copy the directory and
header back.
> > > +static int bq2415x_set_weak_battery_voltage(struct bq2415x_device *bq,
> > > int mV) +{
> > > + int val = mV/100 + (mV%100 > 0 ? 1 : 0) - 34;
> > This could probably be written more clearly?
> How?
Without the ternery operator and with more spaces, probably.
> > > + case BQ2415X_MODE_BOOST: /* Boost mode */
> > > + dev_info(bq->dev, "mode: Boost\n");
> > Is dev_info() really appropriate for this stuff?
> How can driver write info that user (or other driver) changed chip mode?
> This should be reported in dmesg!
Why does the user care? There's an interface for querying if they want
to know and you can generate power supply events when the mode changes.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists