提交 57863301 编写于 作者: D Dave Stevenson 提交者: Zheng Zengkai

media: ov5647: Use gpiod_set_value_cansleep

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

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: NDave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 073f3ca1
......@@ -373,7 +373,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);
}
......@@ -415,7 +415,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. */
......@@ -648,13 +648,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册