[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090624214510.27233eb1@hyperion.delvare>
Date: Wed, 24 Jun 2009 21:45:10 +0200
From: Jean Delvare <khali@...ux-fr.org>
To: avorontsov@...mvista.com
Cc: Ryan Mallon <ryan@...ewatersys.com>,
linux kernel <linux-kernel@...r.kernel.org>,
linux-i2c@...r.kernel.org, Anton Vorontsov <cbou@...l.ru>,
David Woodhouse <dwmw2@...radead.org>
Subject: Re: [PATCH] ds2782 battery gas gauge driver
On Wed, 24 Jun 2009 18:18:34 +0400, Anton Vorontsov wrote:
> On Wed, Jun 17, 2009 at 11:09:08AM +0200, Jean Delvare wrote:
> > Hi Ryan,
> >
> > On Tue, 16 Jun 2009 16:17:35 +1200, Ryan Mallon wrote:
> > > Add support for the the ds2782 standalone I2C gas-gauge.
> > >
> > > Signed-off-by: Ryan Mallon <ryan@...ewatersys.com>
> >
> > I suggest you send this patch to the maintainers of the power supply
> > subsystem for review: Anton Vorontsov and David Woodhouse (Cc'd.)
>
> Thanks for Cc'ing and for the review, Jean.
You're welcome.
> [...]
> > > +static int ds2782_get_temp(struct ds2782_info *info)
> > > +{
> > > + u16 raw;
> > > + s16 temp;
> > > +
> > > + /* Temperature is measured in units of 0.125 degrees celcius */
> > > + raw = ds2782_read_reg16(info, DS2782_REG_TEMP_MSB);
> > > + temp = (raw >> 5) & 0x7ff;
> > > + if (raw & (1 << 15))
> > > + temp |= 0xf800;
> > > + return (temp * 125) / 100;
> > > +}
> >
> > I don't know if the power supply class has a standard to reporting
> > temperature values, but the hwmon class does, and it says that
> > temperatures should be reported in millidegrees C. That's not what you
> > do here AFAICS. It might be convenient to register a hwmon class device
> > and export the temperature there, so that libsensors picks it.
>
> Hwmon feels like a good idea. But no, drivers should not bother
> with registering hwmon classes. Instead, some day we might want to
> create power_supply_hwmon.c interface (like _sysfs.c that we have
> already), the interface would register all needed stuff. And all
> drivers will benefit right away without any modifications.
Sounds like a very good plan indeed.
--
Jean Delvare
--
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