Пример #1
0
Файл: icu.c Проект: 274914765/C
static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
{
    struct irq_desc *desc = irq_desc + irq;
    uint16_t intassign0, intassign1;
    unsigned int pin;

    pin = SYSINT1_IRQ_TO_PIN(irq);

    spin_lock_irq(&desc->lock);

    intassign0 = icu1_read(INTASSIGN0);
    intassign1 = icu1_read(INTASSIGN1);

    switch (pin) {
    case 0:
        intassign0 &= ~INTASSIGN_MASK;
        intassign0 |= (uint16_t)assign;
        break;
    case 1:
        intassign0 &= ~(INTASSIGN_MASK << 3);
        intassign0 |= (uint16_t)assign << 3;
        break;
    case 2:
        intassign0 &= ~(INTASSIGN_MASK << 6);
        intassign0 |= (uint16_t)assign << 6;
        break;
    case 3:
        intassign0 &= ~(INTASSIGN_MASK << 9);
        intassign0 |= (uint16_t)assign << 9;
        break;
    case 8:
        intassign0 &= ~(INTASSIGN_MASK << 12);
        intassign0 |= (uint16_t)assign << 12;
        break;
    case 9:
        intassign1 &= ~INTASSIGN_MASK;
        intassign1 |= (uint16_t)assign;
        break;
    case 11:
        intassign1 &= ~(INTASSIGN_MASK << 6);
        intassign1 |= (uint16_t)assign << 6;
        break;
    case 12:
        intassign1 &= ~(INTASSIGN_MASK << 9);
        intassign1 |= (uint16_t)assign << 9;
        break;
    default:
        spin_unlock_irq(&desc->lock);
        return -EINVAL;
    }

    sysint1_assign[pin] = assign;
    icu1_write(INTASSIGN0, intassign0);
    icu1_write(INTASSIGN1, intassign1);

    spin_unlock_irq(&desc->lock);

    return 0;
}
Пример #2
0
static void end_sysint1_irq(unsigned int irq)
{
	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
		icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
}
Пример #3
0
static void enable_sysint1_irq(unsigned int irq)
{
	icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
}
Пример #4
0
static void shutdown_sysint1_irq(unsigned int irq)
{
	icu1_clear(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
}
Пример #5
0
static unsigned int startup_sysint1_irq(unsigned int irq)
{
	icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));

	return 0; /* never anything pending */
}
Пример #6
0
static void enable_sysint1_irq(unsigned int irq)
{
	set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
}
Пример #7
0
static void shutdown_sysint1_irq(unsigned int irq)
{
	clear_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
}
Пример #8
0
static unsigned int startup_sysint1_irq(unsigned int irq)
{
	set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));

	return 0; /* never anything pending */
}
Пример #9
0
static void enable_sysint1_irq(struct irq_data *d)
{
	icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(d->irq));
}
Пример #10
0
static void disable_sysint1_irq(struct irq_data *d)
{
	icu1_clear(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(d->irq));
}