linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] iio: xilinx-xadc: Fix ADC-B powerdown
@ 2020-04-03 13:27 Lars-Peter Clausen
  2020-04-03 13:27 ` [PATCH 2/5] iio: xilinx-xadc: Fix clearing interrupt when enabling trigger Lars-Peter Clausen
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Lars-Peter Clausen @ 2020-04-03 13:27 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Peter Meerwald-Stadler, linux-iio,
	Lars-Peter Clausen

The check for shutting down the second ADC is inverted. This causes it to
be powered down when it should be enabled. As a result channels that are
supposed to be handled by the second ADC return invalid conversion results.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/adc/xilinx-xadc-core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 2d6505a66511..4fcf1729341f 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -722,13 +722,14 @@ static int xadc_power_adc_b(struct xadc *xadc, unsigned int seq_mode)
 {
 	uint16_t val;
 
+	/* Powerdown the ADC-B when it is not needed. */
 	switch (seq_mode) {
 	case XADC_CONF1_SEQ_SIMULTANEOUS:
 	case XADC_CONF1_SEQ_INDEPENDENT:
-		val = XADC_CONF2_PD_ADC_B;
+		val = 0;
 		break;
 	default:
-		val = 0;
+		val = XADC_CONF2_PD_ADC_B;
 		break;
 	}
 
-- 
2.20.1


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

end of thread, other threads:[~2020-04-05 17:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-03 13:27 [PATCH 1/5] iio: xilinx-xadc: Fix ADC-B powerdown Lars-Peter Clausen
2020-04-03 13:27 ` [PATCH 2/5] iio: xilinx-xadc: Fix clearing interrupt when enabling trigger Lars-Peter Clausen
2020-04-05 12:11   ` Jonathan Cameron
2020-04-03 13:27 ` [PATCH 3/5] iio: xilinx-xadc: Fix sequencer configuration for aux channels in simultaneous mode Lars-Peter Clausen
2020-04-05 12:13   ` Jonathan Cameron
2020-04-03 13:27 ` [PATCH 4/5] iio: xilinx-xadc: Make sure not exceed maximum samplerate Lars-Peter Clausen
2020-04-05 12:15   ` Jonathan Cameron
2020-04-03 13:27 ` [PATCH 5/5] iio: xilinx-xadc: Fix typo Lars-Peter Clausen
2020-04-05 12:17   ` Jonathan Cameron
2020-04-05 12:10 ` [PATCH 1/5] iio: xilinx-xadc: Fix ADC-B powerdown Jonathan Cameron
2020-04-05 12:13   ` Lars-Peter Clausen
2020-04-05 12:26     ` Jonathan Cameron
2020-04-05 12:29       ` Lars-Peter Clausen
2020-04-05 17:20         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).