static void trout_gpio_irq_ack(struct irq_data *d)
{
	int bank = TROUT_INT_TO_BANK(d->irq);
	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
	int reg = TROUT_BANK_TO_STAT_REG(bank);
	/*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", d->irq);*/
	writeb(mask, TROUT_CPLD_BASE + reg);
}
예제 #2
0
static void trout_gpio_irq_ack(struct irq_data *d)
{
	int bank = TROUT_INT_TO_BANK(d->irq);
	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
	int reg = TROUT_BANK_TO_STAT_REG(bank);
	
	writeb(mask, TROUT_CPLD_BASE + reg);
}
예제 #3
0
static void trout_gpio_irq_unmask(struct irq_data *d)
{
	unsigned long flags;
	uint8_t reg_val;
	int bank = TROUT_INT_TO_BANK(d->irq);
	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
	int reg = TROUT_BANK_TO_MASK_REG(bank);

	local_irq_save(flags);
	reg_val = trout_int_mask[bank] &= ~mask;
	writeb(reg_val, TROUT_CPLD_BASE + reg);
	local_irq_restore(flags);
}
int trout_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
{
	unsigned long flags;
	int bank = TROUT_INT_TO_BANK(d->irq);
	uint8_t mask = TROUT_INT_TO_MASK(d->irq);

	local_irq_save(flags);
	if(on)
		trout_sleep_int_mask[bank] &= ~mask;
	else
		trout_sleep_int_mask[bank] |= mask;
	local_irq_restore(flags);
	return 0;
}
static void trout_gpio_irq_unmask(struct irq_data *d)
{
	unsigned long flags;
	uint8_t reg_val;
	int bank = TROUT_INT_TO_BANK(d->irq);
	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
	int reg = TROUT_BANK_TO_MASK_REG(bank);

	local_irq_save(flags);
	reg_val = trout_int_mask[bank] &= ~mask;
	/*printk(KERN_INFO "trout_gpio_irq_unmask irq %d => %d:%02x\n",
	       d->irq, bank, reg_val);*/
	writeb(reg_val, TROUT_CPLD_BASE + reg);
	local_irq_restore(flags);
}