~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/powerpc/sysdev/tsi108_pci.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
 * Linux descriptor level callbacks
344
344
 */
345
345
 
346
 
static void tsi108_pci_irq_enable(u_int irq)
347
 
{
348
 
        tsi108_pci_int_unmask(irq);
349
 
}
350
 
 
351
 
static void tsi108_pci_irq_disable(u_int irq)
352
 
{
353
 
        tsi108_pci_int_mask(irq);
354
 
}
355
 
 
356
 
static void tsi108_pci_irq_ack(u_int irq)
357
 
{
358
 
        tsi108_pci_int_mask(irq);
359
 
}
360
 
 
361
 
static void tsi108_pci_irq_end(u_int irq)
362
 
{
363
 
        tsi108_pci_int_unmask(irq);
 
346
static void tsi108_pci_irq_unmask(struct irq_data *d)
 
347
{
 
348
        tsi108_pci_int_unmask(d->irq);
364
349
 
365
350
        /* Enable interrupts from PCI block */
366
351
        tsi108_write_reg(TSI108_PCI_OFFSET + TSI108_PCI_IRP_ENABLE,
370
355
        mb();
371
356
}
372
357
 
 
358
static void tsi108_pci_irq_mask(struct irq_data *d)
 
359
{
 
360
        tsi108_pci_int_mask(d->irq);
 
361
}
 
362
 
 
363
static void tsi108_pci_irq_ack(struct irq_data *d)
 
364
{
 
365
        tsi108_pci_int_mask(d->irq);
 
366
}
 
367
 
373
368
/*
374
369
 * Interrupt controller descriptor for cascaded PCI interrupt controller.
375
370
 */
376
371
 
377
372
static struct irq_chip tsi108_pci_irq = {
378
373
        .name = "tsi108_PCI_int",
379
 
        .mask = tsi108_pci_irq_disable,
380
 
        .ack = tsi108_pci_irq_ack,
381
 
        .end = tsi108_pci_irq_end,
382
 
        .unmask = tsi108_pci_irq_enable,
 
374
        .irq_mask = tsi108_pci_irq_mask,
 
375
        .irq_ack = tsi108_pci_irq_ack,
 
376
        .irq_unmask = tsi108_pci_irq_unmask,
383
377
};
384
378
 
385
379
static int pci_irq_host_xlate(struct irq_host *h, struct device_node *ct,
397
391
        DBG("%s(%d, 0x%lx)\n", __func__, virq, hw);
398
392
        if ((virq >= 1) && (virq <= 4)){
399
393
                irq = virq + IRQ_PCI_INTAD_BASE - 1;
400
 
                irq_to_desc(irq)->status |= IRQ_LEVEL;
401
 
                set_irq_chip(irq, &tsi108_pci_irq);
 
394
                irq_set_status_flags(irq, IRQ_LEVEL);
 
395
                irq_set_chip(irq, &tsi108_pci_irq);
402
396
        }
403
397
        return 0;
404
398
}
437
431
 
438
432
void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc)
439
433
{
 
434
        struct irq_chip *chip = irq_desc_get_chip(desc);
440
435
        unsigned int cascade_irq = get_pci_source();
 
436
 
441
437
        if (cascade_irq != NO_IRQ)
442
438
                generic_handle_irq(cascade_irq);
443
 
        desc->chip->eoi(irq);
 
439
 
 
440
        chip->irq_eoi(&desc->irq_data);
444
441
}