Commit 1fddc5da authored by Hugues Fruchet's avatar Hugues Fruchet Committed by Mauro Carvalho Chehab

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: default avatarHugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 74e08739
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment