Fix ds2408 P0 output not working after power-on

From: Jean-Francois Dagenais
Date: Tue May 07 2013 - 08:40:45 EST


This issue is described in the v2 datasheet of ds2408 (see commit message). On
our board (9 ds2408 and 2 ds2433 on a ds1wm mastered bus), the problem affects
only 2 out of 9 chips 2408 and only after a long power off.

Adding the magic sequence described in the datasheet fixes the issue as
promised.

I had to do a little trick with the w1 master mutex since "add_slave" may be
called during w1 search of the master, at which time, the search op locks the
mutex the whole time. Checking if the mutex owner is the current thread to
determine whether locking is required or not sounds safe to me, any thoughts on
that? The bus search on my heavy setup works perfectly and is very stable.

Another point I'd like others to (perhaps) comment on is about doing this
"non-search" interaction with a particular slave between two search branches. I
did my homework and I can't find anything wrong with that.

/jfd

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/