Re: [PATCH] ds2782 battery gas gauge driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx>
> > 
> > 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-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux