Revert "gpio: rcar: Fine-grained Runtime PM support"
This reverts commit 65194cb174
.
This commit is contained in:
parent
42c25013ca
commit
ce0e2c60e6
|
@ -242,32 +242,18 @@ static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip,
|
||||||
|
|
||||||
static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset)
|
static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset)
|
||||||
{
|
{
|
||||||
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
|
return pinctrl_request_gpio(chip->base + offset);
|
||||||
int error;
|
|
||||||
|
|
||||||
error = pm_runtime_get_sync(&p->pdev->dev);
|
|
||||||
if (error < 0)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
error = pinctrl_request_gpio(chip->base + offset);
|
|
||||||
if (error)
|
|
||||||
pm_runtime_put(&p->pdev->dev);
|
|
||||||
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset)
|
static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset)
|
||||||
{
|
{
|
||||||
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
|
|
||||||
|
|
||||||
pinctrl_free_gpio(chip->base + offset);
|
pinctrl_free_gpio(chip->base + offset);
|
||||||
|
|
||||||
/* Set the GPIO as an input to ensure that the next GPIO request won't
|
/*
|
||||||
|
* Set the GPIO as an input to ensure that the next GPIO request won't
|
||||||
* drive the GPIO pin as an output.
|
* drive the GPIO pin as an output.
|
||||||
*/
|
*/
|
||||||
gpio_rcar_config_general_input_output_mode(chip, offset, false);
|
gpio_rcar_config_general_input_output_mode(chip, offset, false);
|
||||||
|
|
||||||
pm_runtime_put(&p->pdev->dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset)
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_runtime_enable(dev);
|
pm_runtime_enable(dev);
|
||||||
|
pm_runtime_get_sync(dev);
|
||||||
|
|
||||||
io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||||
|
@ -480,6 +467,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
|
||||||
err1:
|
err1:
|
||||||
gpiochip_remove(gpio_chip);
|
gpiochip_remove(gpio_chip);
|
||||||
err0:
|
err0:
|
||||||
|
pm_runtime_put(dev);
|
||||||
pm_runtime_disable(dev);
|
pm_runtime_disable(dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -490,6 +478,7 @@ static int gpio_rcar_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
gpiochip_remove(&p->gpio_chip);
|
gpiochip_remove(&p->gpio_chip);
|
||||||
|
|
||||||
|
pm_runtime_put(&pdev->dev);
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue