diff options
author | Dave Stevenson <dave.stevenson@raspberrypi.org> | 2018-09-18 11:08:51 +0100 |
---|---|---|
committer | Phil Elwell <pelwell@users.noreply.github.com> | 2018-09-18 15:36:13 +0100 |
commit | 675e29ff7124059cb3b8b56fd7ae0ea131196982 (patch) | |
tree | 313bf5333be5214460cf3022fe3746e70ff61d10 | |
parent | 71538ec053e0cdeddabbc84f30c6c53d6d6e4e9b (diff) |
media: ov5647: Use gpiod_set_value_cansleepraspberrypi-kernel_1.20180919-1
All calls to the gpio library are in contexts that can sleep,
therefore there is no issue with having those GPIOs controlled
by controllers which require sleeping (eg I2C GPIO expanders).
Switch to using gpiod_set_value_cansleep instead of gpiod_set_value
to avoid triggering the warning in gpiolib should the GPIO
controller need to sleep.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
-rw-r--r-- | drivers/media/i2c/ov5647.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c index b7bacaa24303..5b5845f6b9ec 100644 --- a/drivers/media/i2c/ov5647.c +++ b/drivers/media/i2c/ov5647.c @@ -348,7 +348,7 @@ static int ov5647_sensor_power(struct v4l2_subdev *sd, int on) dev_dbg(&client->dev, "OV5647 power on\n"); if (ov5647->pwdn) { - gpiod_set_value(ov5647->pwdn, 0); + gpiod_set_value_cansleep(ov5647->pwdn, 0); msleep(PWDN_ACTIVE_DELAY_MS); } @@ -390,7 +390,7 @@ static int ov5647_sensor_power(struct v4l2_subdev *sd, int on) clk_disable_unprepare(ov5647->xclk); - gpiod_set_value(ov5647->pwdn, 1); + gpiod_set_value_cansleep(ov5647->pwdn, 1); } /* Update the power count. */ @@ -624,13 +624,13 @@ static int ov5647_probe(struct i2c_client *client, goto mutex_remove; if (sensor->pwdn) { - gpiod_set_value(sensor->pwdn, 0); + gpiod_set_value_cansleep(sensor->pwdn, 0); msleep(PWDN_ACTIVE_DELAY_MS); } ret = ov5647_detect(sd); - gpiod_set_value(sensor->pwdn, 1); + gpiod_set_value_cansleep(sensor->pwdn, 1); if (ret < 0) goto error; |