Skip to content

Commit 4237b2e

Browse files
committed
Merge tag 'gpio-v4.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull late GPIO fix from Linus Walleij: "Regressions never arrive when you want them to, so here is a late fix for the Renesas RCAR GPIO driver. It only affects that driver on the very specific Renesas platforms: - Fix a runtime PM suspend/resume bug in the RCAR driver" * tag 'gpio-v4.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: rcar: Add Runtime PM handling for interrupts
2 parents 19eab22 + b26a719 commit 4237b2e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

drivers/gpio/gpio-rcar.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,44 @@ static int gpio_rcar_irq_set_wake(struct irq_data *d, unsigned int on)
196196
return 0;
197197
}
198198

199+
static void gpio_rcar_irq_bus_lock(struct irq_data *d)
200+
{
201+
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
202+
struct gpio_rcar_priv *p = gpiochip_get_data(gc);
203+
204+
pm_runtime_get_sync(&p->pdev->dev);
205+
}
206+
207+
static void gpio_rcar_irq_bus_sync_unlock(struct irq_data *d)
208+
{
209+
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
210+
struct gpio_rcar_priv *p = gpiochip_get_data(gc);
211+
212+
pm_runtime_put(&p->pdev->dev);
213+
}
214+
215+
216+
static int gpio_rcar_irq_request_resources(struct irq_data *d)
217+
{
218+
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
219+
struct gpio_rcar_priv *p = gpiochip_get_data(gc);
220+
int error;
221+
222+
error = pm_runtime_get_sync(&p->pdev->dev);
223+
if (error < 0)
224+
return error;
225+
226+
return 0;
227+
}
228+
229+
static void gpio_rcar_irq_release_resources(struct irq_data *d)
230+
{
231+
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
232+
struct gpio_rcar_priv *p = gpiochip_get_data(gc);
233+
234+
pm_runtime_put(&p->pdev->dev);
235+
}
236+
199237
static irqreturn_t gpio_rcar_irq_handler(int irq, void *dev_id)
200238
{
201239
struct gpio_rcar_priv *p = dev_id;
@@ -450,6 +488,10 @@ static int gpio_rcar_probe(struct platform_device *pdev)
450488
irq_chip->irq_unmask = gpio_rcar_irq_enable;
451489
irq_chip->irq_set_type = gpio_rcar_irq_set_type;
452490
irq_chip->irq_set_wake = gpio_rcar_irq_set_wake;
491+
irq_chip->irq_bus_lock = gpio_rcar_irq_bus_lock;
492+
irq_chip->irq_bus_sync_unlock = gpio_rcar_irq_bus_sync_unlock;
493+
irq_chip->irq_request_resources = gpio_rcar_irq_request_resources;
494+
irq_chip->irq_release_resources = gpio_rcar_irq_release_resources;
453495
irq_chip->flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_MASK_ON_SUSPEND;
454496

455497
ret = gpiochip_add_data(gpio_chip, p);

0 commit comments

Comments
 (0)