diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-04-12 04:05:22 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-04-12 04:05:22 -0400 |
commit | ce0e2c60e69e5f87ab4ac10c935d8bd85d4d11f7 (patch) | |
tree | 34c50a492bb83543342fa316a2250d76d7a43835 | |
parent | 42c25013ca95ce79b4ed192188ca843ae48f8c71 (diff) |
Revert "gpio: rcar: Fine-grained Runtime PM support"
This reverts commit 65194cb174b873448b208eb6e04ecb72237af76e.
-rw-r--r-- | drivers/gpio/gpio-rcar.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index cf41440aff91..4d9a315cfd43 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -242,32 +242,18 @@ static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip, | |||
242 | 242 | ||
243 | static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) | 243 | static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) |
244 | { | 244 | { |
245 | struct gpio_rcar_priv *p = gpiochip_get_data(chip); | 245 | return pinctrl_request_gpio(chip->base + offset); |
246 | int error; | ||
247 | |||
248 | error = pm_runtime_get_sync(&p->pdev->dev); | ||
249 | if (error < 0) | ||
250 | return error; | ||
251 | |||
252 | error = pinctrl_request_gpio(chip->base + offset); | ||
253 | if (error) | ||
254 | pm_runtime_put(&p->pdev->dev); | ||
255 | |||
256 | return error; | ||
257 | } | 246 | } |
258 | 247 | ||
259 | static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset) | 248 | static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset) |
260 | { | 249 | { |
261 | struct gpio_rcar_priv *p = gpiochip_get_data(chip); | ||
262 | |||
263 | pinctrl_free_gpio(chip->base + offset); | 250 | pinctrl_free_gpio(chip->base + offset); |
264 | 251 | ||
265 | /* Set the GPIO as an input to ensure that the next GPIO request won't | 252 | /* |
253 | * Set the GPIO as an input to ensure that the next GPIO request won't | ||
266 | * drive the GPIO pin as an output. | 254 | * drive the GPIO pin as an output. |
267 | */ | 255 | */ |
268 | gpio_rcar_config_general_input_output_mode(chip, offset, false); | 256 | gpio_rcar_config_general_input_output_mode(chip, offset, false); |
269 | |||
270 | pm_runtime_put(&p->pdev->dev); | ||
271 | } | 257 | } |
272 | 258 | ||
273 | static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset) | 259 | static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset) |
@@ -414,6 +400,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) | |||
414 | } | 400 | } |
415 | 401 | ||
416 | pm_runtime_enable(dev); | 402 | pm_runtime_enable(dev); |
403 | pm_runtime_get_sync(dev); | ||
417 | 404 | ||
418 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 405 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
419 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 406 | irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
@@ -480,6 +467,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) | |||
480 | err1: | 467 | err1: |
481 | gpiochip_remove(gpio_chip); | 468 | gpiochip_remove(gpio_chip); |
482 | err0: | 469 | err0: |
470 | pm_runtime_put(dev); | ||
483 | pm_runtime_disable(dev); | 471 | pm_runtime_disable(dev); |
484 | return ret; | 472 | return ret; |
485 | } | 473 | } |
@@ -490,6 +478,7 @@ static int gpio_rcar_remove(struct platform_device *pdev) | |||
490 | 478 | ||
491 | gpiochip_remove(&p->gpio_chip); | 479 | gpiochip_remove(&p->gpio_chip); |
492 | 480 | ||
481 | pm_runtime_put(&pdev->dev); | ||
493 | pm_runtime_disable(&pdev->dev); | 482 | pm_runtime_disable(&pdev->dev); |
494 | return 0; | 483 | return 0; |
495 | } | 484 | } |