kernel: bump 4.14 to 4.14.93
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0419-media-ov5647-Use-gpiod_set_value_cansleep.patch
1 From 185076ab6bc5dd83f2da62552fbb79a53d36314d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Tue, 18 Sep 2018 11:08:51 +0100
4 Subject: [PATCH 419/454] media: ov5647: Use gpiod_set_value_cansleep
5
6 All calls to the gpio library are in contexts that can sleep,
7 therefore there is no issue with having those GPIOs controlled
8 by controllers which require sleeping (eg I2C GPIO expanders).
9
10 Switch to using gpiod_set_value_cansleep instead of gpiod_set_value
11 to avoid triggering the warning in gpiolib should the GPIO
12 controller need to sleep.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
15 ---
16 drivers/media/i2c/ov5647.c | 8 ++++----
17 1 file changed, 4 insertions(+), 4 deletions(-)
18
19 --- a/drivers/media/i2c/ov5647.c
20 +++ b/drivers/media/i2c/ov5647.c
21 @@ -348,7 +348,7 @@ static int ov5647_sensor_power(struct v4
22 dev_dbg(&client->dev, "OV5647 power on\n");
23
24 if (ov5647->pwdn) {
25 - gpiod_set_value(ov5647->pwdn, 0);
26 + gpiod_set_value_cansleep(ov5647->pwdn, 0);
27 msleep(PWDN_ACTIVE_DELAY_MS);
28 }
29
30 @@ -390,7 +390,7 @@ static int ov5647_sensor_power(struct v4
31
32 clk_disable_unprepare(ov5647->xclk);
33
34 - gpiod_set_value(ov5647->pwdn, 1);
35 + gpiod_set_value_cansleep(ov5647->pwdn, 1);
36 }
37
38 /* Update the power count. */
39 @@ -624,13 +624,13 @@ static int ov5647_probe(struct i2c_clien
40 goto mutex_remove;
41
42 if (sensor->pwdn) {
43 - gpiod_set_value(sensor->pwdn, 0);
44 + gpiod_set_value_cansleep(sensor->pwdn, 0);
45 msleep(PWDN_ACTIVE_DELAY_MS);
46 }
47
48 ret = ov5647_detect(sd);
49
50 - gpiod_set_value(sensor->pwdn, 1);
51 + gpiod_set_value_cansleep(sensor->pwdn, 1);
52
53 if (ret < 0)
54 goto error;