w1-gpio: add external pull-up enable callback
authorDaniel Mack <daniel@caiaq.de>
Wed, 17 Jun 2009 23:28:15 +0000 (16:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Jun 2009 20:03:58 +0000 (13:03 -0700)
commitc8a06c1ef0bc45915fc45a170c7c60426971304c
tree9e8f5d3890766bca481c15aac69ef96f52612874
parent9916219579d078c80377dd3988c2cc213536d868
w1-gpio: add external pull-up enable callback

On embedded devices, sleep mode conditions can be tricky to handle,
Especially when processors tend to pull-down the w1 bus during sleep.  Bus
slaves (such as the ds2760) may interpret this as a reason for power-down
conditions and entirely switch off the device.

This patch adds a callback function pointer to let users switch on and off
the external pull-up resistor.  This lets the outside world know whether
the processor is currently actively driving the bus or not.

When this callback is not provided, the code behaviour won't change.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Ville Syrjala <syrjala@sci.fi>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/w1/masters/w1-gpio.c
include/linux/w1-gpio.h