Commit 72ccc1f5 authored by Thierry Reding's avatar Thierry Reding

soc/tegra: pmc: Add support for simple wake events

Simple wake events are neither mapped to GIC interrupts nor have an
associated GPIO line. They are close to GPIO-backed wake events in that
the IRQ hierarchy processing needs to stop at the PMC level, but since
there is no dedicated GPIO line for them, let's turn them into a
separate type.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 1623566f
...@@ -296,6 +296,17 @@ struct tegra_wake_event { ...@@ -296,6 +296,17 @@ struct tegra_wake_event {
} gpio; } gpio;
}; };
#define TEGRA_WAKE_SIMPLE(_name, _id) \
{ \
.name = _name, \
.id = _id, \
.irq = 0, \
.gpio = { \
.instance = UINT_MAX, \
.pin = UINT_MAX, \
}, \
}
#define TEGRA_WAKE_IRQ(_name, _id, _irq) \ #define TEGRA_WAKE_IRQ(_name, _id, _irq) \
{ \ { \
.name = _name, \ .name = _name, \
...@@ -2239,6 +2250,7 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq, ...@@ -2239,6 +2250,7 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq,
for (i = 0; i < soc->num_wake_events; i++) { for (i = 0; i < soc->num_wake_events; i++) {
const struct tegra_wake_event *event = &soc->wake_events[i]; const struct tegra_wake_event *event = &soc->wake_events[i];
/* IRQ and simple wake events */
if (fwspec->param_count == 2) { if (fwspec->param_count == 2) {
struct irq_fwspec spec; struct irq_fwspec spec;
...@@ -2251,6 +2263,12 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq, ...@@ -2251,6 +2263,12 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq,
if (err < 0) if (err < 0)
break; break;
/* simple hierarchies stop at the PMC level */
if (event->irq == 0) {
err = irq_domain_disconnect_hierarchy(domain->parent, virq);
break;
}
spec.fwnode = &pmc->dev->of_node->fwnode; spec.fwnode = &pmc->dev->of_node->fwnode;
spec.param_count = 3; spec.param_count = 3;
spec.param[0] = GIC_SPI; spec.param[0] = GIC_SPI;
...@@ -2263,6 +2281,7 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq, ...@@ -2263,6 +2281,7 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq,
break; break;
} }
/* GPIO wake events */
if (fwspec->param_count == 3) { if (fwspec->param_count == 3) {
if (event->gpio.instance != fwspec->param[0] || if (event->gpio.instance != fwspec->param[0] ||
event->gpio.pin != fwspec->param[1]) event->gpio.pin != fwspec->param[1])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment