staging:iio:dac:ad5446: Do not exit powerdown when writing a sample
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 25 Apr 2012 07:44:52 +0000 (09:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2012 17:57:19 +0000 (10:57 -0700)
commit07ffd0d071153aa45205891e0e577aaba1d74d0f
tree54265606f7c3669cdadb62cf06909db4e885cd1d
parent0f3bcfe67f175d4edf0c6ab5487fbe23b6533d4a
staging:iio:dac:ad5446: Do not exit powerdown when writing a sample

Both the powerdown mode bits and the sample value are stored in the same
register, so writing a sample while the device is powered down will clear the
power down bits. To avoid this only update the cached value when the device is
powered down.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
----
v1 actually had a small bug in that it would still write to the device's
register when the sample was updated while the device was powered down. This was
not critical since it would send out the powerdown mode again.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/dac/ad5446.c