From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] ad7414 driver
Date: Thu, 19 Jun 2008 17:45:47 +0000 [thread overview]
Message-ID: <20080619194547.0efb8d2f@hyperion.delvare> (raw)
In-Reply-To: <20080613221221.50c642ee@lappy.seanm.ca>
Hi Sean,
On Thu, 19 Jun 2008 12:37:04 -0400, Sean MacLennan wrote:
> On Thu, 19 Jun 2008 12:46:50 +0200, Jean Delvare wrote:
> > This is overwriting _all_ the bits of the configuration file,
> > including changes that could have been done by the the BIOS or
> > firmware or whatever. That's not OK! You must read the configuration
> > register value, check bit 2, and if it's set, write the value back
> > with just bit 2 cleared.
>
> I work with, what we call, "board drivers" too much. We always reset
> everything to a know state ;)
>
> We don't need to worry about bit 2. The chip always runs in continuous
> conversion mode unless it is powered down. The one shot just *forces*
> an immediate conversion rather than waiting 800ms.
>
> The one shot is really more useful in the powered down mode.
My bad, I really meant bit 7, not bit 2. I read the datasheet in a
hurry it seems.
> All we have to guarantee is that the chip is powered up. Below is the
> new code:
>
> /* Make sure the chip is powered up. */
> conf = i2c_smbus_read_byte_data(client, AD7414_REG_CONF);
> if (conf < 0)
> printk(KERN_WARNING
> "ad7414_probe unable to read config register.\n");
> else {
> conf &= ~(1 << 7);
> i2c_smbus_write_byte_data(client, AD7414_REG_CONF, conf);
> }
>
> I do not fail the driver if the config read fails. The ad7414 is very
> important for our board and will always come up with the reset
> value. So the above code is really a NOP for us. I would hate to fail
> the driver due to an i2c bus glitch.
>
> If we can agree on the above patch, I can submit a patch with the code
> changes.
Yes, that's totally fine with me. Except that you want to use dev_warn
instead of printk, of course.
> I also added the AD7414_REG_LIMIT array and the round off change.
Great, thanks.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2008-06-19 17:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-14 2:12 [lm-sensors] [PATCH] ad7414 driver Sean MacLennan
2008-06-15 8:09 ` Jean Delvare
2008-06-15 17:13 ` Sean MacLennan
2008-06-15 21:11 ` Jean Delvare
2008-06-15 22:07 ` Sean MacLennan
2008-06-16 6:36 ` Jean Delvare
2008-06-16 23:11 ` Sean MacLennan
2008-06-19 10:46 ` Jean Delvare
2008-06-19 16:37 ` Sean MacLennan
2008-06-19 17:45 ` Jean Delvare [this message]
2008-06-19 18:02 ` Sean MacLennan
2008-06-23 12:33 ` Jean Delvare
2008-08-02 3:52 ` Sean MacLennan
2008-08-08 9:06 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080619194547.0efb8d2f@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.