Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225606
b: refs/heads/master
c: 67eb6f9
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Corbet authored and Florian Tobias Schandinat committed Nov 9, 2010
1 parent 115d98d commit 2c9eee6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 751305d9b2fd3e03eaab7808e976241d85ca4353
refs/heads/master: 67eb6f9617a24dfb033b584d6b1b42b39cc9297a
29 changes: 29 additions & 0 deletions trunk/drivers/video/via/via-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,28 @@ static void viafb_gpio_disable(struct viafb_gpio *gpio)
via_write_reg_mask(VIASR, gpio->vg_port_index, 0, 0x02);
}

#ifdef CONFIG_PM

static int viafb_gpio_suspend(void *private)
{
return 0;
}

static int viafb_gpio_resume(void *private)
{
int i;

for (i = 0; i < gpio_config.gpio_chip.ngpio; i += 2)
viafb_gpio_enable(gpio_config.active_gpios[i]);
return 0;
}

static struct viafb_pm_hooks viafb_gpio_pm_hooks = {
.suspend = viafb_gpio_suspend,
.resume = viafb_gpio_resume
};
#endif /* CONFIG_PM */

/*
* Look up a specific gpio and return the number it was assigned.
*/
Expand Down Expand Up @@ -236,6 +258,9 @@ static __devinit int viafb_gpio_probe(struct platform_device *platdev)
printk(KERN_ERR "viafb: failed to add gpios (%d)\n", ret);
gpio_config.gpio_chip.ngpio = 0;
}
#ifdef CONFIG_PM
viafb_pm_register(&viafb_gpio_pm_hooks);
#endif
return ret;
}

Expand All @@ -245,6 +270,10 @@ static int viafb_gpio_remove(struct platform_device *platdev)
unsigned long flags;
int ret = 0, i;

#ifdef CONFIG_PM
viafb_pm_unregister(&viafb_gpio_pm_hooks);
#endif

/*
* Get unregistered.
*/
Expand Down

0 comments on commit 2c9eee6

Please sign in to comment.