irq.c 15.1 KB
Newer Older
1 2
/* linux/arch/arm/plat-s3c24xx/irq.c
 *
3
 * Copyright (c) 2003-2004 Simtec Electronics
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *	Ben Dooks <ben@simtec.co.uk>
 *
 * 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/interrupt.h>
#include <linux/ioport.h>
#include <linux/sysdev.h>

#include <asm/irq.h>
#include <asm/mach/irq.h>

30
#include <plat/regs-irqtype.h>
31

32 33 34
#include <plat/cpu.h>
#include <plat/pm.h>
#include <plat/irq.h>
35 36

static void
37
s3c_irq_mask(struct irq_data *data)
38
{
39
	unsigned int irqno = data->irq - IRQ_EINT0;
40 41 42 43 44 45 46 47
	unsigned long mask;

	mask = __raw_readl(S3C2410_INTMSK);
	mask |= 1UL << irqno;
	__raw_writel(mask, S3C2410_INTMSK);
}

static inline void
48
s3c_irq_ack(struct irq_data *data)
49
{
50
	unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
51 52 53 54 55 56

	__raw_writel(bitval, S3C2410_SRCPND);
	__raw_writel(bitval, S3C2410_INTPND);
}

static inline void
57
s3c_irq_maskack(struct irq_data *data)
58
{
59
	unsigned long bitval = 1UL << (data->irq - IRQ_EINT0);
60 61 62 63 64 65 66 67 68 69 70
	unsigned long mask;

	mask = __raw_readl(S3C2410_INTMSK);
	__raw_writel(mask|bitval, S3C2410_INTMSK);

	__raw_writel(bitval, S3C2410_SRCPND);
	__raw_writel(bitval, S3C2410_INTPND);
}


static void
71
s3c_irq_unmask(struct irq_data *data)
72
{
73
	unsigned int irqno = data->irq;
74 75 76 77 78 79 80 81 82 83 84 85 86 87
	unsigned long mask;

	if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
		irqdbf2("s3c_irq_unmask %d\n", irqno);

	irqno -= IRQ_EINT0;

	mask = __raw_readl(S3C2410_INTMSK);
	mask &= ~(1UL << irqno);
	__raw_writel(mask, S3C2410_INTMSK);
}

struct irq_chip s3c_irq_level_chip = {
	.name		= "s3c-level",
88 89 90 91
	.irq_ack	= s3c_irq_maskack,
	.irq_mask	= s3c_irq_mask,
	.irq_unmask	= s3c_irq_unmask,
	.irq_set_wake	= s3c_irq_wake
92 93
};

94
struct irq_chip s3c_irq_chip = {
95
	.name		= "s3c",
96 97 98 99
	.irq_ack	= s3c_irq_ack,
	.irq_mask	= s3c_irq_mask,
	.irq_unmask	= s3c_irq_unmask,
	.irq_set_wake	= s3c_irq_wake
100 101 102
};

static void
103
s3c_irqext_mask(struct irq_data *data)
104
{
105
	unsigned int irqno = data->irq - EXTINT_OFF;
106 107 108 109 110 111 112 113
	unsigned long mask;

	mask = __raw_readl(S3C24XX_EINTMASK);
	mask |= ( 1UL << irqno);
	__raw_writel(mask, S3C24XX_EINTMASK);
}

static void
114
s3c_irqext_ack(struct irq_data *data)
115 116 117 118 119
{
	unsigned long req;
	unsigned long bit;
	unsigned long mask;

120
	bit = 1UL << (data->irq - EXTINT_OFF);
121 122 123 124 125 126 127 128 129 130

	mask = __raw_readl(S3C24XX_EINTMASK);

	__raw_writel(bit, S3C24XX_EINTPEND);

	req = __raw_readl(S3C24XX_EINTPEND);
	req &= ~mask;

	/* not sure if we should be acking the parent irq... */

131
	if (data->irq <= IRQ_EINT7) {
132
		if ((req & 0xf0) == 0)
133
			s3c_irq_ack(irq_get_irq_data(IRQ_EINT4t7));
134 135
	} else {
		if ((req >> 8) == 0)
136
			s3c_irq_ack(irq_get_irq_data(IRQ_EINT8t23));
137 138 139 140
	}
}

static void
141
s3c_irqext_unmask(struct irq_data *data)
142
{
143
	unsigned int irqno = data->irq - EXTINT_OFF;
144 145 146
	unsigned long mask;

	mask = __raw_readl(S3C24XX_EINTMASK);
147
	mask &= ~(1UL << irqno);
148 149 150 151
	__raw_writel(mask, S3C24XX_EINTMASK);
}

int
152
s3c_irqext_type(struct irq_data *data, unsigned int type)
153 154 155 156 157 158
{
	void __iomem *extint_reg;
	void __iomem *gpcon_reg;
	unsigned long gpcon_offset, extint_offset;
	unsigned long newvalue = 0, value;

159
	if ((data->irq >= IRQ_EINT0) && (data->irq <= IRQ_EINT3)) {
160 161
		gpcon_reg = S3C2410_GPFCON;
		extint_reg = S3C24XX_EXTINT0;
162 163 164
		gpcon_offset = (data->irq - IRQ_EINT0) * 2;
		extint_offset = (data->irq - IRQ_EINT0) * 4;
	} else if ((data->irq >= IRQ_EINT4) && (data->irq <= IRQ_EINT7)) {
165 166
		gpcon_reg = S3C2410_GPFCON;
		extint_reg = S3C24XX_EXTINT0;
167 168 169
		gpcon_offset = (data->irq - (EXTINT_OFF)) * 2;
		extint_offset = (data->irq - (EXTINT_OFF)) * 4;
	} else if ((data->irq >= IRQ_EINT8) && (data->irq <= IRQ_EINT15)) {
170 171
		gpcon_reg = S3C2410_GPGCON;
		extint_reg = S3C24XX_EXTINT1;
172 173 174
		gpcon_offset = (data->irq - IRQ_EINT8) * 2;
		extint_offset = (data->irq - IRQ_EINT8) * 4;
	} else if ((data->irq >= IRQ_EINT16) && (data->irq <= IRQ_EINT23)) {
175 176
		gpcon_reg = S3C2410_GPGCON;
		extint_reg = S3C24XX_EXTINT2;
177 178 179
		gpcon_offset = (data->irq - IRQ_EINT8) * 2;
		extint_offset = (data->irq - IRQ_EINT16) * 4;
	} else {
180
		return -1;
181
	}
182 183 184 185 186 187 188 189 190

	/* Set the GPIO to external interrupt mode */
	value = __raw_readl(gpcon_reg);
	value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
	__raw_writel(value, gpcon_reg);

	/* Set the external interrupt to pointed trigger type */
	switch (type)
	{
191
		case IRQ_TYPE_NONE:
192 193 194
			printk(KERN_WARNING "No edge setting!\n");
			break;

195
		case IRQ_TYPE_EDGE_RISING:
196 197 198
			newvalue = S3C2410_EXTINT_RISEEDGE;
			break;

199
		case IRQ_TYPE_EDGE_FALLING:
200 201 202
			newvalue = S3C2410_EXTINT_FALLEDGE;
			break;

203
		case IRQ_TYPE_EDGE_BOTH:
204 205 206
			newvalue = S3C2410_EXTINT_BOTHEDGE;
			break;

207
		case IRQ_TYPE_LEVEL_LOW:
208 209 210
			newvalue = S3C2410_EXTINT_LOWLEV;
			break;

211
		case IRQ_TYPE_LEVEL_HIGH:
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
			newvalue = S3C2410_EXTINT_HILEV;
			break;

		default:
			printk(KERN_ERR "No such irq type %d", type);
			return -1;
	}

	value = __raw_readl(extint_reg);
	value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
	__raw_writel(value, extint_reg);

	return 0;
}

static struct irq_chip s3c_irqext_chip = {
	.name		= "s3c-ext",
229 230 231 232
	.irq_mask	= s3c_irqext_mask,
	.irq_unmask	= s3c_irqext_unmask,
	.irq_ack	= s3c_irqext_ack,
	.irq_set_type	= s3c_irqext_type,
233
	.irq_set_wake	= s3c_irqext_wake
234 235 236 237
};

static struct irq_chip s3c_irq_eint0t4 = {
	.name		= "s3c-ext0",
238 239 240 241 242
	.irq_ack	= s3c_irq_ack,
	.irq_mask	= s3c_irq_mask,
	.irq_unmask	= s3c_irq_unmask,
	.irq_set_wake	= s3c_irq_wake,
	.irq_set_type	= s3c_irqext_type,
243 244 245 246 247 248 249 250 251 252 253 254 255
};

/* mask values for the parent registers for each of the interrupt types */

#define INTMSK_UART0	 (1UL << (IRQ_UART0 - IRQ_EINT0))
#define INTMSK_UART1	 (1UL << (IRQ_UART1 - IRQ_EINT0))
#define INTMSK_UART2	 (1UL << (IRQ_UART2 - IRQ_EINT0))
#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))


/* UART0 */

static void
256
s3c_irq_uart0_mask(struct irq_data *data)
257
{
258
	s3c_irqsub_mask(data->irq, INTMSK_UART0, 7);
259 260 261
}

static void
262
s3c_irq_uart0_unmask(struct irq_data *data)
263
{
264
	s3c_irqsub_unmask(data->irq, INTMSK_UART0);
265 266 267
}

static void
268
s3c_irq_uart0_ack(struct irq_data *data)
269
{
270
	s3c_irqsub_maskack(data->irq, INTMSK_UART0, 7);
271 272 273 274
}

static struct irq_chip s3c_irq_uart0 = {
	.name		= "s3c-uart0",
275 276 277
	.irq_mask	= s3c_irq_uart0_mask,
	.irq_unmask	= s3c_irq_uart0_unmask,
	.irq_ack	= s3c_irq_uart0_ack,
278 279 280 281 282
};

/* UART1 */

static void
283
s3c_irq_uart1_mask(struct irq_data *data)
284
{
285
	s3c_irqsub_mask(data->irq, INTMSK_UART1, 7 << 3);
286 287 288
}

static void
289
s3c_irq_uart1_unmask(struct irq_data *data)
290
{
291
	s3c_irqsub_unmask(data->irq, INTMSK_UART1);
292 293 294
}

static void
295
s3c_irq_uart1_ack(struct irq_data *data)
296
{
297
	s3c_irqsub_maskack(data->irq, INTMSK_UART1, 7 << 3);
298 299 300 301
}

static struct irq_chip s3c_irq_uart1 = {
	.name		= "s3c-uart1",
302 303 304
	.irq_mask	= s3c_irq_uart1_mask,
	.irq_unmask	= s3c_irq_uart1_unmask,
	.irq_ack	= s3c_irq_uart1_ack,
305 306 307 308 309
};

/* UART2 */

static void
310
s3c_irq_uart2_mask(struct irq_data *data)
311
{
312
	s3c_irqsub_mask(data->irq, INTMSK_UART2, 7 << 6);
313 314 315
}

static void
316
s3c_irq_uart2_unmask(struct irq_data *data)
317
{
318
	s3c_irqsub_unmask(data->irq, INTMSK_UART2);
319 320 321
}

static void
322
s3c_irq_uart2_ack(struct irq_data *data)
323
{
324
	s3c_irqsub_maskack(data->irq, INTMSK_UART2, 7 << 6);
325 326 327 328
}

static struct irq_chip s3c_irq_uart2 = {
	.name		= "s3c-uart2",
329 330 331
	.irq_mask	= s3c_irq_uart2_mask,
	.irq_unmask	= s3c_irq_uart2_unmask,
	.irq_ack	= s3c_irq_uart2_ack,
332 333 334 335 336
};

/* ADC and Touchscreen */

static void
337
s3c_irq_adc_mask(struct irq_data *d)
338
{
339
	s3c_irqsub_mask(d->irq, INTMSK_ADCPARENT, 3 << 9);
340 341 342
}

static void
343
s3c_irq_adc_unmask(struct irq_data *d)
344
{
345
	s3c_irqsub_unmask(d->irq, INTMSK_ADCPARENT);
346 347 348
}

static void
349
s3c_irq_adc_ack(struct irq_data *d)
350
{
351
	s3c_irqsub_ack(d->irq, INTMSK_ADCPARENT, 3 << 9);
352 353 354 355
}

static struct irq_chip s3c_irq_adc = {
	.name		= "s3c-adc",
356 357 358
	.irq_mask	= s3c_irq_adc_mask,
	.irq_unmask	= s3c_irq_adc_unmask,
	.irq_ack	= s3c_irq_adc_ack,
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
};

/* irq demux for adc */
static void s3c_irq_demux_adc(unsigned int irq,
			      struct irq_desc *desc)
{
	unsigned int subsrc, submsk;
	unsigned int offset = 9;

	/* read the current pending interrupts, and the mask
	 * for what it is available */

	subsrc = __raw_readl(S3C2410_SUBSRCPND);
	submsk = __raw_readl(S3C2410_INTSUBMSK);

	subsrc &= ~submsk;
	subsrc >>= offset;
	subsrc &= 3;

	if (subsrc != 0) {
		if (subsrc & 1) {
380
			generic_handle_irq(IRQ_TC);
381 382
		}
		if (subsrc & 2) {
383
			generic_handle_irq(IRQ_ADC);
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
		}
	}
}

static void s3c_irq_demux_uart(unsigned int start)
{
	unsigned int subsrc, submsk;
	unsigned int offset = start - IRQ_S3CUART_RX0;

	/* read the current pending interrupts, and the mask
	 * for what it is available */

	subsrc = __raw_readl(S3C2410_SUBSRCPND);
	submsk = __raw_readl(S3C2410_INTSUBMSK);

	irqdbf2("s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
		start, offset, subsrc, submsk);

	subsrc &= ~submsk;
	subsrc >>= offset;
	subsrc &= 7;

	if (subsrc != 0) {
		if (subsrc & 1)
408
			generic_handle_irq(start);
409 410

		if (subsrc & 2)
411
			generic_handle_irq(start+1);
412 413

		if (subsrc & 4)
414
			generic_handle_irq(start+2);
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460
	}
}

/* uart demux entry points */

static void
s3c_irq_demux_uart0(unsigned int irq,
		    struct irq_desc *desc)
{
	irq = irq;
	s3c_irq_demux_uart(IRQ_S3CUART_RX0);
}

static void
s3c_irq_demux_uart1(unsigned int irq,
		    struct irq_desc *desc)
{
	irq = irq;
	s3c_irq_demux_uart(IRQ_S3CUART_RX1);
}

static void
s3c_irq_demux_uart2(unsigned int irq,
		    struct irq_desc *desc)
{
	irq = irq;
	s3c_irq_demux_uart(IRQ_S3CUART_RX2);
}

static void
s3c_irq_demux_extint8(unsigned int irq,
		      struct irq_desc *desc)
{
	unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
	unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);

	eintpnd &= ~eintmsk;
	eintpnd &= ~0xff;	/* ignore lower irqs */

	/* we may as well handle all the pending IRQs here */

	while (eintpnd) {
		irq = __ffs(eintpnd);
		eintpnd &= ~(1<<irq);

		irq += (IRQ_EINT4 - 4);
461
		generic_handle_irq(irq);
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
	}

}

static void
s3c_irq_demux_extint4t7(unsigned int irq,
			struct irq_desc *desc)
{
	unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
	unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);

	eintpnd &= ~eintmsk;
	eintpnd &= 0xff;	/* only lower irqs */

	/* we may as well handle all the pending IRQs here */

	while (eintpnd) {
		irq = __ffs(eintpnd);
		eintpnd &= ~(1<<irq);

		irq += (IRQ_EINT4 - 4);

484
		generic_handle_irq(irq);
485 486 487
	}
}

488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
#ifdef CONFIG_FIQ
/**
 * s3c24xx_set_fiq - set the FIQ routing
 * @irq: IRQ number to route to FIQ on processor.
 * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing.
 *
 * Change the state of the IRQ to FIQ routing depending on @irq and @on. If
 * @on is true, the @irq is checked to see if it can be routed and the
 * interrupt controller updated to route the IRQ. If @on is false, the FIQ
 * routing is cleared, regardless of which @irq is specified.
 */
int s3c24xx_set_fiq(unsigned int irq, bool on)
{
	u32 intmod;
	unsigned offs;

	if (on) {
		offs = irq - FIQ_START;
		if (offs > 31)
			return -EINVAL;

		intmod = 1 << offs;
	} else {
		intmod = 0;
	}

	__raw_writel(intmod, S3C2410_INTMOD);
	return 0;
}
517 518

EXPORT_SYMBOL_GPL(s3c24xx_set_fiq);
519 520 521
#endif


522 523 524 525 526 527 528 529 530 531 532 533
/* s3c24xx_init_irq
 *
 * Initialise S3C2410 IRQ system
*/

void __init s3c24xx_init_irq(void)
{
	unsigned long pend;
	unsigned long last;
	int irqno;
	int i;

534 535 536 537
#ifdef CONFIG_FIQ
	init_FIQ();
#endif

538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594
	irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");

	/* first, clear all interrupts pending... */

	last = 0;
	for (i = 0; i < 4; i++) {
		pend = __raw_readl(S3C24XX_EINTPEND);

		if (pend == 0 || pend == last)
			break;

		__raw_writel(pend, S3C24XX_EINTPEND);
		printk("irq: clearing pending ext status %08x\n", (int)pend);
		last = pend;
	}

	last = 0;
	for (i = 0; i < 4; i++) {
		pend = __raw_readl(S3C2410_INTPND);

		if (pend == 0 || pend == last)
			break;

		__raw_writel(pend, S3C2410_SRCPND);
		__raw_writel(pend, S3C2410_INTPND);
		printk("irq: clearing pending status %08x\n", (int)pend);
		last = pend;
	}

	last = 0;
	for (i = 0; i < 4; i++) {
		pend = __raw_readl(S3C2410_SUBSRCPND);

		if (pend == 0 || pend == last)
			break;

		printk("irq: clearing subpending status %08x\n", (int)pend);
		__raw_writel(pend, S3C2410_SUBSRCPND);
		last = pend;
	}

	/* register the main interrupts */

	irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n");

	for (irqno = IRQ_EINT4t7; irqno <= IRQ_ADCPARENT; irqno++) {
		/* set all the s3c2410 internal irqs */

		switch (irqno) {
			/* deal with the special IRQs (cascaded) */

		case IRQ_EINT4t7:
		case IRQ_EINT8t23:
		case IRQ_UART0:
		case IRQ_UART1:
		case IRQ_UART2:
		case IRQ_ADCPARENT:
T
Thomas Gleixner 已提交
595 596
			irq_set_chip(irqno, &s3c_irq_level_chip);
			irq_set_handler(irqno, handle_level_irq);
597 598 599 600 601 602 603 604 605
			break;

		case IRQ_RESERVED6:
		case IRQ_RESERVED24:
			/* no IRQ here */
			break;

		default:
			//irqdbf("registering irq %d (s3c irq)\n", irqno);
T
Thomas Gleixner 已提交
606 607
			irq_set_chip(irqno, &s3c_irq_chip);
			irq_set_handler(irqno, handle_edge_irq);
608 609 610 611 612 613
			set_irq_flags(irqno, IRQF_VALID);
		}
	}

	/* setup the cascade irq handlers */

T
Thomas Gleixner 已提交
614 615
	irq_set_chained_handler(IRQ_EINT4t7, s3c_irq_demux_extint4t7);
	irq_set_chained_handler(IRQ_EINT8t23, s3c_irq_demux_extint8);
616

T
Thomas Gleixner 已提交
617 618 619 620
	irq_set_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
	irq_set_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
	irq_set_chained_handler(IRQ_UART2, s3c_irq_demux_uart2);
	irq_set_chained_handler(IRQ_ADCPARENT, s3c_irq_demux_adc);
621 622 623 624 625

	/* external interrupts */

	for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
		irqdbf("registering irq %d (ext int)\n", irqno);
T
Thomas Gleixner 已提交
626 627
		irq_set_chip(irqno, &s3c_irq_eint0t4);
		irq_set_handler(irqno, handle_edge_irq);
628 629 630 631 632
		set_irq_flags(irqno, IRQF_VALID);
	}

	for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
		irqdbf("registering irq %d (extended s3c irq)\n", irqno);
T
Thomas Gleixner 已提交
633 634
		irq_set_chip(irqno, &s3c_irqext_chip);
		irq_set_handler(irqno, handle_edge_irq);
635 636 637 638 639 640 641 642 643
		set_irq_flags(irqno, IRQF_VALID);
	}

	/* register the uart interrupts */

	irqdbf("s3c2410: registering external interrupts\n");

	for (irqno = IRQ_S3CUART_RX0; irqno <= IRQ_S3CUART_ERR0; irqno++) {
		irqdbf("registering irq %d (s3c uart0 irq)\n", irqno);
T
Thomas Gleixner 已提交
644 645
		irq_set_chip(irqno, &s3c_irq_uart0);
		irq_set_handler(irqno, handle_level_irq);
646 647 648 649 650
		set_irq_flags(irqno, IRQF_VALID);
	}

	for (irqno = IRQ_S3CUART_RX1; irqno <= IRQ_S3CUART_ERR1; irqno++) {
		irqdbf("registering irq %d (s3c uart1 irq)\n", irqno);
T
Thomas Gleixner 已提交
651 652
		irq_set_chip(irqno, &s3c_irq_uart1);
		irq_set_handler(irqno, handle_level_irq);
653 654 655 656 657
		set_irq_flags(irqno, IRQF_VALID);
	}

	for (irqno = IRQ_S3CUART_RX2; irqno <= IRQ_S3CUART_ERR2; irqno++) {
		irqdbf("registering irq %d (s3c uart2 irq)\n", irqno);
T
Thomas Gleixner 已提交
658 659
		irq_set_chip(irqno, &s3c_irq_uart2);
		irq_set_handler(irqno, handle_level_irq);
660 661 662 663 664
		set_irq_flags(irqno, IRQF_VALID);
	}

	for (irqno = IRQ_TC; irqno <= IRQ_ADC; irqno++) {
		irqdbf("registering irq %d (s3c adc irq)\n", irqno);
T
Thomas Gleixner 已提交
665 666
		irq_set_chip(irqno, &s3c_irq_adc);
		irq_set_handler(irqno, handle_edge_irq);
667 668 669 670 671
		set_irq_flags(irqno, IRQF_VALID);
	}

	irqdbf("s3c2410: registered interrupt handlers\n");
}