mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-20 02:34:23 +08:00
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>
This commit is contained in:
parent
74e08739c0
commit
1fddc5da9e
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user