Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip: s3c24xx: add irq_set_type callback for basic interrupt types

Enables post-init setting of the desired typehandler for the interrupt.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

authored by

Heiko Stuebner and committed by
Kukjin Kim
bd7c0da2 1ebc7e83

+24
+24
drivers/irqchip/irq-s3c24xx.c
··· 123 123 __raw_writel(bitval, intc->reg_intpnd); 124 124 } 125 125 126 + static int s3c_irq_type(struct irq_data *data, unsigned int type) 127 + { 128 + switch (type) { 129 + case IRQ_TYPE_NONE: 130 + break; 131 + case IRQ_TYPE_EDGE_RISING: 132 + case IRQ_TYPE_EDGE_FALLING: 133 + case IRQ_TYPE_EDGE_BOTH: 134 + irq_set_handler(data->irq, handle_edge_irq); 135 + break; 136 + case IRQ_TYPE_LEVEL_LOW: 137 + case IRQ_TYPE_LEVEL_HIGH: 138 + irq_set_handler(data->irq, handle_level_irq); 139 + break; 140 + default: 141 + pr_err("No such irq type %d", type); 142 + return -EINVAL; 143 + } 144 + 145 + return 0; 146 + } 147 + 126 148 static int s3c_irqext_type_set(void __iomem *gpcon_reg, 127 149 void __iomem *extint_reg, 128 150 unsigned long gpcon_offset, ··· 250 228 .irq_ack = s3c_irq_ack, 251 229 .irq_mask = s3c_irq_mask, 252 230 .irq_unmask = s3c_irq_unmask, 231 + .irq_set_type = s3c_irq_type, 253 232 .irq_set_wake = s3c_irq_wake 254 233 }; 255 234 ··· 259 236 .irq_mask = s3c_irq_mask, 260 237 .irq_unmask = s3c_irq_unmask, 261 238 .irq_ack = s3c_irq_ack, 239 + .irq_set_type = s3c_irq_type, 262 240 }; 263 241 264 242 static struct irq_chip s3c_irqext_chip = {