]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00269945: reset: handle cansleep case in gpio-reset
authorShawn Guo <shawn.guo@freescale.com>
Sun, 14 Jul 2013 12:28:05 +0000 (20:28 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:53:45 +0000 (09:53 +0800)
Some gpio reset may be backed by a gpio that can sleep, e.g. pca953x
gpio output.  For such gpio, gpio_set_value_cansleep() should be
called.  Otherwise, the WARN_ON(chip->can_sleep) in gpiod_set_value()
will be hit.  Add a gpio_cansleep() check to handle cansleep gpio.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
drivers/reset/gpio-reset.c

index 5d2515af6a5fbd5bcc79914a31b3d2706414897c..4f372f9e437b6f449aadb504684ae732e5ad4c98 100644 (file)
@@ -32,7 +32,10 @@ static void gpio_reset_set(struct reset_controller_dev *rcdev, int asserted)
        if (drvdata->active_low)
                value = !value;
 
-       gpio_set_value(drvdata->gpio, value);
+       if (gpio_cansleep(drvdata->gpio))
+               gpio_set_value_cansleep(drvdata->gpio, value);
+       else
+               gpio_set_value(drvdata->gpio, value);
 }
 
 static int gpio_reset(struct reset_controller_dev *rcdev, unsigned long id)