91bce3e07bb68f3db24dfab574a74abc21504bab
[openwrt/staging/ynezz.git] /
1 From ec29b05b2da1d82d03730e0ac317efd3a7e97759 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 15 Apr 2021 17:30:35 +0100
4 Subject: [PATCH] drm/panel: jdi-lt070me05000: Use
5 gpiod_set_value_cansleep
6
7 There is no reason why the control GPIOs for the panel can not
8 be connected to I2C or similar GPIO interfaces that may need to
9 sleep, therefore switch from gpiod_set_value to
10 gpiod_set_value_cansleep calls to configure them.
11 Without that you get complaints from gpiolib every time the state
12 is changed.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 18 +++++++++---------
17 1 file changed, 9 insertions(+), 9 deletions(-)
18
19 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
20 +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
21 @@ -205,11 +205,11 @@ static int jdi_panel_unprepare(struct dr
22 if (ret < 0)
23 dev_err(dev, "regulator disable failed, %d\n", ret);
24
25 - gpiod_set_value(jdi->enable_gpio, 0);
26 + gpiod_set_value_cansleep(jdi->enable_gpio, 0);
27
28 - gpiod_set_value(jdi->reset_gpio, 1);
29 + gpiod_set_value_cansleep(jdi->reset_gpio, 1);
30
31 - gpiod_set_value(jdi->dcdc_en_gpio, 0);
32 + gpiod_set_value_cansleep(jdi->dcdc_en_gpio, 0);
33
34 jdi->prepared = false;
35
36 @@ -233,13 +233,13 @@ static int jdi_panel_prepare(struct drm_
37
38 msleep(20);
39
40 - gpiod_set_value(jdi->dcdc_en_gpio, 1);
41 + gpiod_set_value_cansleep(jdi->dcdc_en_gpio, 1);
42 usleep_range(10, 20);
43
44 - gpiod_set_value(jdi->reset_gpio, 0);
45 + gpiod_set_value_cansleep(jdi->reset_gpio, 0);
46 usleep_range(10, 20);
47
48 - gpiod_set_value(jdi->enable_gpio, 1);
49 + gpiod_set_value_cansleep(jdi->enable_gpio, 1);
50 usleep_range(10, 20);
51
52 ret = jdi_panel_init(jdi);
53 @@ -263,11 +263,11 @@ poweroff:
54 if (ret < 0)
55 dev_err(dev, "regulator disable failed, %d\n", ret);
56
57 - gpiod_set_value(jdi->enable_gpio, 0);
58 + gpiod_set_value_cansleep(jdi->enable_gpio, 0);
59
60 - gpiod_set_value(jdi->reset_gpio, 1);
61 + gpiod_set_value_cansleep(jdi->reset_gpio, 1);
62
63 - gpiod_set_value(jdi->dcdc_en_gpio, 0);
64 + gpiod_set_value_cansleep(jdi->dcdc_en_gpio, 0);
65
66 return ret;
67 }