All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon INIZAN <simon.inizan@goobie.fr>
To: "Barnes, Clifton A." <cabarnes@indesign-llc.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] w1: Add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support.
Date: Thu, 11 Aug 2011 10:19:29 +0200	[thread overview]
Message-ID: <4E439091.6090905@goobie.fr> (raw)
In-Reply-To: <A8DC7EA93EFCBD4498E3857AFE65E5F13A3DD762@IND07.indesign.net>

On 31/05/2011 14:42, Barnes, Clifton A. wrote:
> On Monday, May 30, 2011, Simon INIZAN wrote:
>
>> However from time to time I a getting stuck in the driver.
> Getting stuck meaning a deadlock?  Is it during a read on a
> sysfs file?  Are you using the driver compiled in or as a
> module?
I have tested the driver with the fix you provided me, I am not getting 
a deadlock anymore.

>> FYI, I am using the GPIO 1-wire driver, and from time to time the gauge is not responding to the w1 queries.
> Is this the same condition you're talking about above?  Does this mean that sometimes
> the sysfs file returns and sometimes it hangs?
>
It seems I am getting some flipped bits on the 1-wire bus (using the 
w1-gpio master),
this is not directly related to your driver but it makes the results not 
very reliable
on my platform (sometimes the rsgain is wrong, so are the currents).
I am getting a 1-wire bus analyzer to investigate the issue.



In the get_current function, you are returning:

sense_res = 1000 / sense_res_raw;
*current_uA = current_raw * (DS2780_CURRENT_UNITS / sense_res);


Which means that we are getting current (in µA) = current_raw (in 
µV/Ohms) * sense_res_raw (in Ohms).
I have replaced it with

sense_res = sense_res_raw;
*current_uA = current_raw * (DS2780_CURRENT_UNITS / sense_res);


Which gives me more consistent results with my measures.

Simon


       reply	other threads:[~2011-08-11  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4DE3C363.2030503@goobie.fr>
     [not found] ` <A8DC7EA93EFCBD4498E3857AFE65E5F13A3DD762@IND07.indesign.net>
2011-08-11  8:19   ` Simon INIZAN [this message]
2011-05-19 12:21 [PATCH v3] w1: Add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support Clifton Barnes
2011-05-19 19:03 ` Andrew Morton
2011-05-19 20:21 ` Ryan Mallon

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=4E439091.6090905@goobie.fr \
    --to=simon.inizan@goobie.fr \
    --cc=cabarnes@indesign-llc.com \
    --cc=linux-kernel@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.