summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2017-05-28 17:10:21 +0200
committerJonathan Cameron <jic23@kernel.org>2017-06-03 10:55:24 +0200
commite18788afebd12a53b3e173d5b1390a785346da2e (patch)
tree1d0f7f62f7beb85771e24f8d1eabc690faff212d /drivers/iio/adc
parentiio: adc: xilinx: Handle return value of clk_prepare_enable (diff)
downloadlinux-e18788afebd12a53b3e173d5b1390a785346da2e.tar.xz
linux-e18788afebd12a53b3e173d5b1390a785346da2e.zip
Revert "iio: hi8435: cleanup reset gpio"
This reverts commit 61305664a542f874283f74bf0b27ddb31f5045d7. This commit was applied prematurely and will break some existing situations where the signal is inverted as part of voltage level conversions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/hi8435.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c
index 1115913e3b13..adf7dc712937 100644
--- a/drivers/iio/adc/hi8435.c
+++ b/drivers/iio/adc/hi8435.c
@@ -476,15 +476,13 @@ static int hi8435_probe(struct spi_device *spi)
priv->spi = spi;
reset_gpio = devm_gpiod_get(&spi->dev, NULL, GPIOD_OUT_LOW);
- if (!IS_ERR(reset_gpio)) {
- /* need >=100ns low pulse to reset chip */
- gpiod_set_raw_value_cansleep(reset_gpio, 0);
- udelay(1);
- gpiod_set_raw_value_cansleep(reset_gpio, 1);
- } else {
- /* s/w reset chip if h/w reset is not available */
+ if (IS_ERR(reset_gpio)) {
+ /* chip s/w reset if h/w reset failed */
hi8435_writeb(priv, HI8435_CTRL_REG, HI8435_CTRL_SRST);
hi8435_writeb(priv, HI8435_CTRL_REG, 0);
+ } else {
+ udelay(5);
+ gpiod_set_value(reset_gpio, 1);
}
spi_set_drvdata(spi, idev);