]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/panel: simple: Allow GPIO accesses to sleep
authorThierry Reding <treding@nvidia.com>
Fri, 14 Mar 2014 11:03:47 +0000 (12:03 +0100)
committerThierry Reding <treding@nvidia.com>
Fri, 4 Apr 2014 06:40:31 +0000 (08:40 +0200)
The enable GPIO for panels may be provided by GPIO expanders on slow
busses (such as I2C), and therefore toggling the GPIO may sleep. Since
these accesses don't happen in interrupt context, use the *_cansleep()
variants of the GPIO API.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/panel/panel-simple.c

index 9b1ae33346d47584e9f32b31ee3eebc1460c95a5..5cf0a26d180e5fb7b57c115b854e03f08caf913f 100644 (file)
@@ -106,7 +106,7 @@ static int panel_simple_disable(struct drm_panel *panel)
        }
 
        if (p->enable_gpio)
-               gpiod_set_value(p->enable_gpio, 0);
+               gpiod_set_value_cansleep(p->enable_gpio, 0);
 
        regulator_disable(p->supply);
        p->enabled = false;
@@ -129,7 +129,7 @@ static int panel_simple_enable(struct drm_panel *panel)
        }
 
        if (p->enable_gpio)
-               gpiod_set_value(p->enable_gpio, 1);
+               gpiod_set_value_cansleep(p->enable_gpio, 1);
 
        if (p->backlight) {
                p->backlight->props.power = FB_BLANK_UNBLANK;