Release 4.11 arch/arm/mach-s3c24xx/bast-irq.c
/* linux/arch/arm/mach-s3c2410/bast-irq.c
*
* Copyright 2003-2005 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* http://www.simtec.co.uk/products/EB2410ITX/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/device.h>
#include <linux/io.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
#include <asm/mach/irq.h>
#include <mach/hardware.h>
#include <mach/regs-irq.h>
#include "bast.h"
#define irqdbf(x...)
#define irqdbf2(x...)
/* handle PC104 ISA interrupts from the system CPLD */
/* table of ISA irq nos to the relevant mask... zero means
* the irq is not implemented
*/
static const unsigned char bast_pc104_irqmasks[] = {
0, /* 0 */
0, /* 1 */
0, /* 2 */
1, /* 3 */
0, /* 4 */
2, /* 5 */
0, /* 6 */
4, /* 7 */
0, /* 8 */
0, /* 9 */
8, /* 10 */
0, /* 11 */
0, /* 12 */
0, /* 13 */
0, /* 14 */
0, /* 15 */
};
static const unsigned char bast_pc104_irqs[] = { 3, 5, 7, 10 };
static void
bast_pc104_mask(struct irq_data *data)
{
unsigned long temp;
temp = __raw_readb(BAST_VA_PC104_IRQMASK);
temp &= ~bast_pc104_irqmasks[data->irq];
__raw_writeb(temp, BAST_VA_PC104_IRQMASK);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 32 | 82.05% | 1 | 50.00% |
Lennert Buytenhek | 7 | 17.95% | 1 | 50.00% |
Total | 39 | 100.00% | 2 | 100.00% |
static void
bast_pc104_maskack(struct irq_data *data)
{
struct irq_desc *desc = irq_desc + BAST_IRQ_ISA;
bast_pc104_mask(data);
desc->irq_data.chip->irq_ack(&desc->irq_data);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 25 | 64.10% | 2 | 40.00% |
Lennert Buytenhek | 12 | 30.77% | 1 | 20.00% |
Kukjin Kim | 1 | 2.56% | 1 | 20.00% |
Russell King | 1 | 2.56% | 1 | 20.00% |
Total | 39 | 100.00% | 5 | 100.00% |
static void
bast_pc104_unmask(struct irq_data *data)
{
unsigned long temp;
temp = __raw_readb(BAST_VA_PC104_IRQMASK);
temp |= bast_pc104_irqmasks[data->irq];
__raw_writeb(temp, BAST_VA_PC104_IRQMASK);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 31 | 81.58% | 1 | 50.00% |
Lennert Buytenhek | 7 | 18.42% | 1 | 50.00% |
Total | 38 | 100.00% | 2 | 100.00% |
static struct irq_chip bast_pc104_chip = {
.irq_mask = bast_pc104_mask,
.irq_unmask = bast_pc104_unmask,
.irq_ack = bast_pc104_maskack
};
static void bast_irq_pc104_demux(struct irq_desc *desc)
{
unsigned int stat;
unsigned int irqno;
int i;
stat = __raw_readb(BAST_VA_PC104_IRQREQ) & 0xf;
if (unlikely(stat == 0)) {
/* ack if we get an irq with nothing (ie, startup) */
desc = irq_desc + BAST_IRQ_ISA;
desc->irq_data.chip->irq_ack(&desc->irq_data);
} else {
/* handle the IRQ */
for (i = 0; stat != 0; i++, stat >>= 1) {
if (stat & 1) {
irqno = bast_pc104_irqs[i];
generic_handle_irq(irqno);
}
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 96 | 90.57% | 2 | 33.33% |
Lennert Buytenhek | 7 | 6.60% | 1 | 16.67% |
Dmitry Baryshkov | 1 | 0.94% | 1 | 16.67% |
Kukjin Kim | 1 | 0.94% | 1 | 16.67% |
Russell King | 1 | 0.94% | 1 | 16.67% |
Total | 106 | 100.00% | 6 | 100.00% |
static __init int bast_irq_init(void)
{
unsigned int i;
if (machine_is_bast()) {
printk(KERN_INFO "BAST PC104 IRQ routing, Copyright 2005 Simtec Electronics\n");
/* zap all the IRQs */
__raw_writeb(0x0, BAST_VA_PC104_IRQMASK);
irq_set_chained_handler(BAST_IRQ_ISA, bast_irq_pc104_demux);
/* register our IRQs */
for (i = 0; i < 4; i++) {
unsigned int irqno = bast_pc104_irqs[i];
irq_set_chip_and_handler(irqno, &bast_pc104_chip,
handle_level_irq);
irq_clear_status_flags(irqno, IRQ_NOREQUEST);
}
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 79 | 91.86% | 3 | 33.33% |
Thomas Gleixner | 3 | 3.49% | 3 | 33.33% |
Rob Herring | 2 | 2.33% | 1 | 11.11% |
Russell King | 1 | 1.16% | 1 | 11.11% |
Kukjin Kim | 1 | 1.16% | 1 | 11.11% |
Total | 86 | 100.00% | 9 | 100.00% |
arch_initcall(bast_irq_init);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 401 | 87.17% | 4 | 26.67% |
Lennert Buytenhek | 36 | 7.83% | 1 | 6.67% |
Kukjin Kim | 8 | 1.74% | 1 | 6.67% |
Russell King | 6 | 1.30% | 2 | 13.33% |
Thomas Gleixner | 3 | 0.65% | 3 | 20.00% |
Krzysztof Kozlowski | 2 | 0.43% | 1 | 6.67% |
Rob Herring | 2 | 0.43% | 1 | 6.67% |
Dmitry Baryshkov | 1 | 0.22% | 1 | 6.67% |
Kay Sievers | 1 | 0.22% | 1 | 6.67% |
Total | 460 | 100.00% | 15 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.