Release 4.14 arch/sh/cchips/hd6446x/hd64461.c
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2000 YAEGASHI Takeshi
* Hitachi HD64461 companion chip support
*/
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <asm/irq.h>
#include <asm/hd64461.h>
/* This belongs in cpu specific */
#define INTC_ICR1 0xA4140010UL
static void hd64461_mask_irq(struct irq_data *data)
{
unsigned int irq = data->irq;
unsigned short nimr;
unsigned short mask = 1 << (irq - HD64461_IRQBASE);
nimr = __raw_readw(HD64461_NIMR);
nimr |= mask;
__raw_writew(nimr, HD64461_NIMR);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 39 | 73.58% | 1 | 33.33% |
Paul Mundt | 11 | 20.75% | 1 | 33.33% |
Matt Fleming | 3 | 5.66% | 1 | 33.33% |
Total | 53 | 100.00% | 3 | 100.00% |
static void hd64461_unmask_irq(struct irq_data *data)
{
unsigned int irq = data->irq;
unsigned short nimr;
unsigned short mask = 1 << (irq - HD64461_IRQBASE);
nimr = __raw_readw(HD64461_NIMR);
nimr &= ~mask;
__raw_writew(nimr, HD64461_NIMR);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 40 | 74.07% | 1 | 33.33% |
Paul Mundt | 11 | 20.37% | 1 | 33.33% |
Matt Fleming | 3 | 5.56% | 1 | 33.33% |
Total | 54 | 100.00% | 3 | 100.00% |
static void hd64461_mask_and_ack_irq(struct irq_data *data)
{
hd64461_mask_irq(data);
#ifdef CONFIG_HD64461_ENABLER
if (data->irq == HD64461_IRQBASE + 13)
__raw_writeb(0x00, HD64461_PCC1CSCR);
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 28 | 73.68% | 1 | 33.33% |
Paul Mundt | 7 | 18.42% | 1 | 33.33% |
Matt Fleming | 3 | 7.89% | 1 | 33.33% |
Total | 38 | 100.00% | 3 | 100.00% |
static struct irq_chip hd64461_irq_chip = {
.name = "HD64461-IRQ",
.irq_mask = hd64461_mask_irq,
.irq_mask_ack = hd64461_mask_and_ack_irq,
.irq_unmask = hd64461_unmask_irq,
};
static void hd64461_irq_demux(struct irq_desc *desc)
{
unsigned short intv = __raw_readw(HD64461_NIRR);
unsigned int ext_irq = HD64461_IRQBASE;
intv &= (1 << HD64461_IRQ_NUM) - 1;
for (; intv; intv >>= 1, ext_irq++) {
if (!(intv & 1))
continue;
generic_handle_irq(ext_irq);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael Ignacio Zurita | 27 | 41.54% | 1 | 20.00% |
Linus Torvalds (pre-git) | 19 | 29.23% | 1 | 20.00% |
Paul Mundt | 17 | 26.15% | 2 | 40.00% |
Andrew Morton | 2 | 3.08% | 1 | 20.00% |
Total | 65 | 100.00% | 5 | 100.00% |
int __init setup_hd64461(void)
{
int irq_base, i;
printk(KERN_INFO
"HD64461 configured at 0x%x on irq %d(mapped into %d to %d)\n",
HD64461_IOBASE, CONFIG_HD64461_IRQ, HD64461_IRQBASE,
HD64461_IRQBASE + 15);
/* Should be at processor specific part.. */
#if defined(CONFIG_CPU_SUBTYPE_SH7709)
__raw_writew(0x2240, INTC_ICR1);
#endif
__raw_writew(0xffff, HD64461_NIMR);
irq_base = irq_alloc_descs(HD64461_IRQBASE, HD64461_IRQBASE, 16, -1);
if (IS_ERR_VALUE(irq_base)) {
pr_err("%s: failed hooking irqs for HD64461\n", __func__);
return irq_base;
}
for (i = 0; i < 16; i++)
irq_set_chip_and_handler(irq_base + i, &hd64461_irq_chip,
handle_level_irq);
irq_set_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux);
irq_set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW);
#ifdef CONFIG_HD64461_ENABLER
printk(KERN_INFO "HD64461: enabling PCMCIA devices\n");
__raw_writeb(0x4c, HD64461_PCC1CSCIER);
__raw_writeb(0x00, HD64461_PCC1CSCR);
#endif
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 73 | 48.03% | 2 | 22.22% |
Paul Mundt | 48 | 31.58% | 3 | 33.33% |
Rafael Ignacio Zurita | 12 | 7.89% | 1 | 11.11% |
Matt Fleming | 9 | 5.92% | 1 | 11.11% |
Linus Torvalds | 7 | 4.61% | 1 | 11.11% |
Thomas Gleixner | 3 | 1.97% | 1 | 11.11% |
Total | 152 | 100.00% | 9 | 100.00% |
module_init(setup_hd64461);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 238 | 55.22% | 2 | 11.11% |
Paul Mundt | 98 | 22.74% | 7 | 38.89% |
Rafael Ignacio Zurita | 39 | 9.05% | 1 | 5.56% |
Matt Fleming | 25 | 5.80% | 1 | 5.56% |
Andrew Morton | 14 | 3.25% | 2 | 11.11% |
Linus Torvalds | 7 | 1.62% | 1 | 5.56% |
Kristoffer Ericson | 6 | 1.39% | 2 | 11.11% |
Thomas Gleixner | 3 | 0.70% | 1 | 5.56% |
Greg Kroah-Hartman | 1 | 0.23% | 1 | 5.56% |
Total | 431 | 100.00% | 18 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.