All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 3/3] Print the status of fault register at
Date: Thu, 18 Nov 2010 19:17:55 +0000	[thread overview]
Message-ID: <20101118191755.GB18194@ericsson.com> (raw)
In-Reply-To: <4CE5595B.60300@RuggedCom.com>

On Thu, Nov 18, 2010 at 02:05:07PM -0500, Ira W. Snyder wrote:
[ .. ]
> 
> I just booted a board and checked: I only saw the "Undervoltage fault
> occurred" bit set (the register value was 0x02).
> 
Sounds similar to what I see on ltc4261.

> The LTC4215_FAULT register isn't used by the Linux driver at all. How
> about doing this instead:
> 
> Change the ltc4215_probe() routine to do a read-modify-write of the
> LTC4215_FAULT register, like this:
> 
> s32 val;
> val = i2c_smbus_read_byte_data(client, LTC4215_FAULT);
> val &= 0xf0; /* clear spurious power-on faults */
> i2c_smbus_write_byte_data(client, LTC4215_FAULT, val);
> 
You still don't know what other boards do with the EN bit, though.

> Since the ltc4215 driver doesn't use the LTC4215_FAULT register at all,
> you can use userspace to read the value. Like this:
> $ i2cget -f -y 0x0 0x44 3 b
> 0x00
> 
I don't think that will work if the ltc4215 driver is loaded, since loading the driver
blocks the i2c address. You can do that, though, prior to loading the ltc4215 driver.
But then you don't need to touch the driver either, because that code would execute
before the driver is loaded.

Something like
	modprobe i2c-dev
	status=$(i2cget -f -y 0x0 0x44 3 b)
	echo ltc4215 0x44 >/sys/class/i2c-adapter/i2c-0/new_device
should do it.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

      parent reply	other threads:[~2010-11-18 19:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 16:50 [lm-sensors] [PATCH 3/3] Print the status of fault register at Richard Retanubun
2010-11-18 17:32 ` Guenter Roeck
2010-11-18 17:45 ` Richard Retanubun
2010-11-18 18:23 ` Guenter Roeck
2010-11-18 18:45 ` Ira W. Snyder
2010-11-18 19:05 ` Ira W. Snyder
2010-11-18 19:09 ` Guenter Roeck
2010-11-18 19:17 ` Guenter Roeck [this message]

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=20101118191755.GB18194@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --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.