Skip to content

Commit

Permalink
iio: adc: ad9361: use gpiod_set_value_cansleep() when resetting chip
Browse files Browse the repository at this point in the history
The gpiod_set_value() invocation for the reset pin always happens in a
context where sleeping is possible. Use gpiod_set_value_cansleep() to
indicate this. This will make sure that GPIO drivers that will sleep can
be used to driver the reset GPIO.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
  • Loading branch information
commodo committed May 9, 2018
1 parent be03583 commit 5f79e44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/adc/ad9361.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,9 @@ static int ad9361_1rx1tx_channel_map(struct ad9361_rf_phy *phy, bool tx, int cha
static int ad9361_reset(struct ad9361_rf_phy *phy)
{
if (phy->pdata->reset_gpio) {
gpiod_set_value(phy->pdata->reset_gpio, 0);
gpiod_set_value_cansleep(phy->pdata->reset_gpio, 0);
mdelay(1);
gpiod_set_value(phy->pdata->reset_gpio, 1);
gpiod_set_value_cansleep(phy->pdata->reset_gpio, 1);
mdelay(1);
dev_dbg(&phy->spi->dev, "%s: by GPIO", __func__);
return 0;
Expand Down

0 comments on commit 5f79e44

Please sign in to comment.