Skip to contentSkip to conversation

w1: Add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support.

PATCH Simon INIZAN 1 participant 1 message Aug 11, 2011 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 6 lines · Clifton A.
Quoted 1 line · Simon INIZAN

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.

Quoted 4 lines
Quoted 1 line

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