Skip to contentSkip to conversation

patch "iio: ad5504: Fix setting power-down state" added to staging-linus

PATCH [email protected] 1 participant 1 message Jan 15, 2021

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: ad5504: Fix setting power-down state

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From efd597b2839a9895e8a98fcb0b76d2f545802cd4 Mon Sep 17 00:00:00 2001
From: Lars-Peter Clausen <[email protected]>
Date: Wed, 9 Dec 2020 11:46:49 +0100
Subject: iio: ad5504: Fix setting power-down state

The power-down mask of the ad5504 is actually a power-up mask. Meaning if a bit is set the corresponding channel is powered up and if it is not set the channel is powered down.

The driver currently has this the wrong way around, resulting in the channel being powered up when requested to be powered down and vice versa.

Fixes 3bbbf150ffde ("staging:iio:dac:ad5504: Use strtobool for boolean values")
---
 drivers/iio/dac/ad5504.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5504.c +2 -2
index 28921b62e642..e9297c25d4ef 100644
@@ -187,9 +187,9 @@ static ssize_t ad5504_write_dac_powerdown(struct iio_dev *indio_dev,
 		return ret;
 
 	if (pwr_down)
-		st->pwr_down_mask |= (1 << chan->channel);
-	else
 		st->pwr_down_mask &= ~(1 << chan->channel);
+	else
+		st->pwr_down_mask |= (1 << chan->channel);
 
 	ret = ad5504_spi_write(st, AD5504_ADDR_CTRL,
 				AD5504_DAC_PWRDWN_MODE(st->pwr_down_mode) |
Signature · 1 line
2.30.0