Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336823
b: refs/heads/master
c: 8939ddc
h: refs/heads/master
i:
  336821: c567b04
  336819: eec1011
  336815: 77fb1bd
v: v3
  • Loading branch information
Laxman Dewangan authored and Linus Walleij committed Nov 8, 2012
1 parent a21e61b commit f9b02f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c868fc629b0e645a68aec3a6834d965e71531f4
refs/heads/master: 8939ddc76a2f3399be98a60246ae0b365442f008
18 changes: 13 additions & 5 deletions trunk/drivers/gpio/gpio-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/irqdomain.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm.h>

#include <asm/mach/irq.h>

Expand Down Expand Up @@ -64,7 +65,7 @@ struct tegra_gpio_bank {
int bank;
int irq;
spinlock_t lvl_lock[4];
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
u32 cnf[4];
u32 out[4];
u32 oe[4];
Expand Down Expand Up @@ -285,8 +286,8 @@ static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)

}

#ifdef CONFIG_PM
void tegra_gpio_resume(void)
#ifdef CONFIG_PM_SLEEP
static int tegra_gpio_resume(struct device *dev)
{
unsigned long flags;
int b;
Expand All @@ -308,9 +309,10 @@ void tegra_gpio_resume(void)
}

local_irq_restore(flags);
return 0;
}

void tegra_gpio_suspend(void)
static int tegra_gpio_suspend(struct device *dev)
{
unsigned long flags;
int b;
Expand All @@ -330,6 +332,7 @@ void tegra_gpio_suspend(void)
}
}
local_irq_restore(flags);
return 0;
}

static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable)
Expand All @@ -345,11 +348,15 @@ static struct irq_chip tegra_gpio_irq_chip = {
.irq_mask = tegra_gpio_irq_mask,
.irq_unmask = tegra_gpio_irq_unmask,
.irq_set_type = tegra_gpio_irq_set_type,
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
.irq_set_wake = tegra_gpio_wake_enable,
#endif
};

static const struct dev_pm_ops tegra_gpio_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume)
};

struct tegra_gpio_soc_config {
u32 bank_stride;
u32 upper_offset;
Expand Down Expand Up @@ -489,6 +496,7 @@ static struct platform_driver tegra_gpio_driver = {
.driver = {
.name = "tegra-gpio",
.owner = THIS_MODULE,
.pm = &tegra_gpio_pm_ops,
.of_match_table = tegra_gpio_of_match,
},
.probe = tegra_gpio_probe,
Expand Down

0 comments on commit f9b02f6

Please sign in to comment.