summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGregory Bean <gbean@codeaurora.org>2010-09-10 03:38:02 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-09-10 05:57:24 +0400
commit5affb607720d734ca572b8a77c5c7d62d3042b6f (patch)
tree5c3a675bef03570958fc4e9baffb318ec7f64e31 /include/linux
parent0dcc48c15f63ee86c2fcd33968b08d651f0360a5 (diff)
downloadlinux-5affb607720d734ca572b8a77c5c7d62d3042b6f.tar.xz
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/i2c/sx150x.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/i2c/sx150x.h b/include/linux/i2c/sx150x.h
index ee3049cb9ba5..52baa79d69a7 100644
--- a/include/linux/i2c/sx150x.h
+++ b/include/linux/i2c/sx150x.h
@@ -63,6 +63,9 @@
* IRQ lines will appear. Similarly to gpio_base, the expander
* will create a block of irqs beginning at this number.
* This value is ignored if irq_summary is < 0.
+ * @reset_during_probe: If set to true, the driver will trigger a full
+ * reset of the chip at the beginning of the probe
+ * in order to place it in a known state.
*/
struct sx150x_platform_data {
unsigned gpio_base;
@@ -73,6 +76,7 @@ struct sx150x_platform_data {
u16 io_polarity;
int irq_summary;
unsigned irq_base;
+ bool reset_during_probe;
};
#endif /* __LINUX_I2C_SX150X_H */