All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] staging:iio:dac:ad5446: Do not exit powerdown when writing a sample
@ 2012-04-23 17:51 Lars-Peter Clausen
  2012-04-23 17:51 ` [PATCH 2/8] staging:iio:dac:ad5446: Remove unused struct field Lars-Peter Clausen
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Lars-Peter Clausen @ 2012-04-23 17:51 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, device-drivers-devel, drivers, Lars-Peter Clausen

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>
---
 drivers/staging/iio/dac/ad5446.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c
index ec6968b..0cfe445 100644
--- a/drivers/staging/iio/dac/ad5446.c
+++ b/drivers/staging/iio/dac/ad5446.c
@@ -282,7 +282,8 @@ static int ad5446_write_raw(struct iio_dev *indio_dev,
 		val <<= chan->scan_type.shift;
 		mutex_lock(&indio_dev->mlock);
 		st->cached_val = val;
-		st->chip_info->store_sample(st, val);
+		if (!st->pwr_down)
+			st->chip_info->store_sample(st, val);
 		ret = spi_sync(st->spi, &st->msg);
 		mutex_unlock(&indio_dev->mlock);
 		break;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-04-24  9:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-23 17:51 [PATCH 1/8] staging:iio:dac:ad5446: Do not exit powerdown when writing a sample Lars-Peter Clausen
2012-04-23 17:51 ` [PATCH 2/8] staging:iio:dac:ad5446: Remove unused struct field Lars-Peter Clausen
2012-04-23 20:41   ` Jonathan Cameron
2012-04-23 17:51 ` [PATCH 3/8] staging:iio:dac:ad5446: Do not check for individual chip ids in probe Lars-Peter Clausen
2012-04-23 20:43   ` Jonathan Cameron
2012-04-23 17:51 ` [PATCH 4/8] staging:iio:dac:ad5446: Remove duplicated chip_info entries Lars-Peter Clausen
2012-04-23 20:44   ` Jonathan Cameron
2012-04-23 17:51 ` [PATCH 5/8] staging:iio:dac:ad5446: Remove duplicated write sample functions Lars-Peter Clausen
2012-04-23 21:15   ` Jonathan Cameron
2012-04-23 17:51 ` [PATCH 6/8] staging:iio:dac:ad5446: Convert to extended channel attributes Lars-Peter Clausen
2012-04-23 21:25   ` Jonathan Cameron
2012-04-23 17:51 ` [PATCH 7/8] staging:iio:dac:ad5446: Consolidate store_sample and store_pwr_down functions Lars-Peter Clausen
2012-04-24  8:06   ` Jonathan Cameron
2012-04-24  9:11     ` Lars-Peter Clausen
2012-04-24  9:10       ` Jonathan Cameron
2012-04-23 17:51 ` [PATCH 8/8] staging:iio:dac:ad5446: Add support for the AD5662 Lars-Peter Clausen
2012-04-24  8:10   ` Jonathan Cameron
2012-04-23 20:40 ` [PATCH 1/8] staging:iio:dac:ad5446: Do not exit powerdown when writing a sample Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.