static void vlynq_irq_mask(struct irq_data *d) { struct vlynq_device *dev = irq_data_get_irq_chip_data(d); int virq; u32 val; BUG_ON(!dev); virq = d->irq - dev->irq_start; val = readl(&dev->remote->int_device[virq >> 2]); val &= ~(VINT_ENABLE << VINT_OFFSET(virq)); writel(val, &dev->remote->int_device[virq >> 2]); }
static void vlynq_irq_mask(unsigned int irq) { u32 val; struct vlynq_device *dev = get_irq_chip_data(irq); int virq; BUG_ON(!dev); virq = irq - dev->irq_start; val = readl(&dev->remote->int_device[virq >> 2]); val &= ~(VINT_ENABLE << VINT_OFFSET(virq)); writel(val, &dev->remote->int_device[virq >> 2]); }
static int vlynq_irq_type(struct irq_data *d, unsigned int flow_type) { struct vlynq_device *dev = irq_data_get_irq_chip_data(d); int virq; u32 val; BUG_ON(!dev); virq = d->irq - dev->irq_start; val = readl(&dev->remote->int_device[virq >> 2]); switch (flow_type & IRQ_TYPE_SENSE_MASK) { case IRQ_TYPE_EDGE_RISING: case IRQ_TYPE_EDGE_FALLING: case IRQ_TYPE_EDGE_BOTH: val |= VINT_TYPE_EDGE << VINT_OFFSET(virq); val &= ~(VINT_LEVEL_LOW << VINT_OFFSET(virq)); break; case IRQ_TYPE_LEVEL_HIGH: val &= ~(VINT_TYPE_EDGE << VINT_OFFSET(virq)); val &= ~(VINT_LEVEL_LOW << VINT_OFFSET(virq)); break; case IRQ_TYPE_LEVEL_LOW: val &= ~(VINT_TYPE_EDGE << VINT_OFFSET(virq)); val |= VINT_LEVEL_LOW << VINT_OFFSET(virq); break; default: return -EINVAL; } writel(val, &dev->remote->int_device[virq >> 2]); return 0; }