diff options
author | Hugues Fruchet <hugues.fruchet@st.com> | 2018-01-03 04:57:28 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-01-05 12:51:55 -0500 |
commit | 1fddc5da9e255a55b3fd1dd5128d9ed9ccd80a9a (patch) | |
tree | 814d94fcf5de5572c88029378029849d859aa7c3 /drivers/media | |
parent | 74e08739c0f7400cf2c0e1ddf4c52e24aad1768a (diff) | |
download | linux-1fddc5da9e255a55b3fd1dd5128d9ed9ccd80a9a.tar.bz2 |
media: ov5640: switch to gpiod_set_value_cansleep()
Switch gpiod_set_value to gpiod_set_value_cansleep to avoid
warnings when powering sensor.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/ov5640.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index c89ed6609738..61071f52a881 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -1524,7 +1524,7 @@ static int ov5640_restore_mode(struct ov5640_dev *sensor) static void ov5640_power(struct ov5640_dev *sensor, bool enable) { - gpiod_set_value(sensor->pwdn_gpio, enable ? 0 : 1); + gpiod_set_value_cansleep(sensor->pwdn_gpio, enable ? 0 : 1); } static void ov5640_reset(struct ov5640_dev *sensor) @@ -1532,7 +1532,7 @@ static void ov5640_reset(struct ov5640_dev *sensor) if (!sensor->reset_gpio) return; - gpiod_set_value(sensor->reset_gpio, 0); + gpiod_set_value_cansleep(sensor->reset_gpio, 0); /* camera power cycle */ ov5640_power(sensor, false); @@ -1540,10 +1540,10 @@ static void ov5640_reset(struct ov5640_dev *sensor) ov5640_power(sensor, true); usleep_range(5000, 10000); - gpiod_set_value(sensor->reset_gpio, 1); + gpiod_set_value_cansleep(sensor->reset_gpio, 1); usleep_range(1000, 2000); - gpiod_set_value(sensor->reset_gpio, 0); + gpiod_set_value_cansleep(sensor->reset_gpio, 0); usleep_range(5000, 10000); } |