8 Aug 2012 08:28
Re: [PATCH v2] hwmon: Driver for ADT7410
Guenter Roeck <linux <at> roeck-us.net>
2012-08-08 06:28:20 GMT
2012-08-08 06:28:20 GMT
On Tue, Aug 07, 2012 at 10:53:53PM +0200, Hartmut Knaack wrote:
> Hi Guenter,
> I did most of the fixes you recommended, just a few issues bother me, see below.
> Guenter Roeck schrieb:
> > On Fri, Aug 03, 2012 at 12:31:24PM +0200, Hartmut Knaack wrote:
> > +static int adt7410_temp_ready(struct i2c_client *client)
> > +{
> > + int i, status;
> > +
> > + for (i = 0; i < 4; i++) {
> > + status = i2c_smbus_read_byte_data(client, ADT7410_STATUS);
> > + if (status < 0)
> > + return status;
> > + if (!(status & ADT7410_STAT_NOT_RDY))
> > + return 0;
> > + msleep(100);
> > That seems to be a very excessive delay, and a huge penalty.
> >
> > I still wonder why you think this is needed. Almost every temperature sensor
> > chip
> > has a "busy" status bit, and we pretty much always ignore it.
> >
> > I suspect that this might actually be counter-reductive; the datasheet suggests
> > that -RDY is set after the temperature is read, and cleared after the next
> > update cycle. But for our application we don't really care if the old
> > temperature is returned multiple times.
> >
> My interpretation of the datasheet is, this bit indicates that a new temperature sample has been
taken/stored since the last read. This indicates that the sensor is working properly (and not for some
reason fallen into powerdown mode or defective). Maybe that is a bit paranoid, but I think the trade-off
(Continue reading)
RSS Feed