]> bbs.cooldavid.org Git - net-next-2.6.git/commit
gpio: sx150x: correct and refine reset-on-probe behavior
authorGregory Bean <gbean@codeaurora.org>
Thu, 9 Sep 2010 23:38:02 +0000 (16:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Sep 2010 01:57:24 +0000 (18:57 -0700)
commit5affb607720d734ca572b8a77c5c7d62d3042b6f
tree5c3a675bef03570958fc4e9baffb318ec7f64e31
parent0dcc48c15f63ee86c2fcd33968b08d651f0360a5
gpio: sx150x: correct and refine reset-on-probe behavior

Replace the arbitrary software-reset call from the device-probe
method, because:

- It is defective.  To work correctly, it should be two byte writes,
  not a single word write.  As it stands, it does nothing.

- Some devices with sx150x expanders installed have their NRESET pins
  ganged on the same line, so resetting one causes the others to reset -
  not a nice thing to do arbitrarily!

- The probe, usually taking place at boot, implies a recent hard-reset,
  so a software reset at this point is just a waste of energy anyway.

Therefore, make it optional, defaulting to off, as this will match the
common case of probing at powerup and also matches the current broken
no-op behavior.

Signed-off-by: Gregory Bean <gbean@codeaurora.org>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpio/sx150x.c
include/linux/i2c/sx150x.h