/* * Serialize concurrent calls to ls_extirq_set_type() from multiple * IRQ descriptors, making sure the read-modify-write is atomic.
*/
raw_spin_lock(&priv->lock);
if (priv->big_endian)
intpcr = ioread32be(priv->intpcr); else
intpcr = ioread32(priv->intpcr);
intpcr &= ~mask;
intpcr |= value;
if (priv->big_endian)
iowrite32be(intpcr, priv->intpcr); else
iowrite32(intpcr, priv->intpcr);
switch (type) { case IRQ_TYPE_LEVEL_LOW:
type = IRQ_TYPE_LEVEL_HIGH;
value = mask; break; case IRQ_TYPE_EDGE_FALLING:
type = IRQ_TYPE_EDGE_RISING;
value = mask; break; case IRQ_TYPE_LEVEL_HIGH: case IRQ_TYPE_EDGE_RISING:
value = 0; break; default: return -EINVAL;
}
parent_domain = irq_find_host(parent); if (!parent_domain) {
pr_err("Cannot find parent domain\n");
ret = -ENODEV; goto err_irq_find_host;
}
priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) {
ret = -ENOMEM; goto err_alloc_priv;
}
/* * All extirq OF nodes are under a scfg/syscon node with * the 'ranges' property
*/
priv->intpcr = of_iomap(node, 0); if (!priv->intpcr) {
pr_err("Cannot ioremap OF node %pOF\n", node);
ret = -ENOMEM; goto err_iomap;
}
ret = ls_extirq_parse_map(priv, node); if (ret) goto err_parse_map;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.