irq.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. /* linux/arch/arm/plat-s3c24xx/irq.c
  2. *
  3. * Copyright (c) 2003-2004 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #include <linux/init.h>
  21. #include <linux/module.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/ioport.h>
  24. #include <linux/sysdev.h>
  25. #include <asm/irq.h>
  26. #include <asm/mach/irq.h>
  27. #include <plat/regs-irqtype.h>
  28. #include <plat/cpu.h>
  29. #include <plat/pm.h>
  30. #include <plat/irq.h>
  31. static void
  32. s3c_irq_mask(unsigned int irqno)
  33. {
  34. unsigned long mask;
  35. irqno -= IRQ_EINT0;
  36. mask = __raw_readl(S3C2410_INTMSK);
  37. mask |= 1UL << irqno;
  38. __raw_writel(mask, S3C2410_INTMSK);
  39. }
  40. static inline void
  41. s3c_irq_ack(unsigned int irqno)
  42. {
  43. unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
  44. __raw_writel(bitval, S3C2410_SRCPND);
  45. __raw_writel(bitval, S3C2410_INTPND);
  46. }
  47. static inline void
  48. s3c_irq_maskack(unsigned int irqno)
  49. {
  50. unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
  51. unsigned long mask;
  52. mask = __raw_readl(S3C2410_INTMSK);
  53. __raw_writel(mask|bitval, S3C2410_INTMSK);
  54. __raw_writel(bitval, S3C2410_SRCPND);
  55. __raw_writel(bitval, S3C2410_INTPND);
  56. }
  57. static void
  58. s3c_irq_unmask(unsigned int irqno)
  59. {
  60. unsigned long mask;
  61. if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
  62. irqdbf2("s3c_irq_unmask %d\n", irqno);
  63. irqno -= IRQ_EINT0;
  64. mask = __raw_readl(S3C2410_INTMSK);
  65. mask &= ~(1UL << irqno);
  66. __raw_writel(mask, S3C2410_INTMSK);
  67. }
  68. struct irq_chip s3c_irq_level_chip = {
  69. .name = "s3c-level",
  70. .ack = s3c_irq_maskack,
  71. .mask = s3c_irq_mask,
  72. .unmask = s3c_irq_unmask,
  73. .set_wake = s3c_irq_wake
  74. };
  75. struct irq_chip s3c_irq_chip = {
  76. .name = "s3c",
  77. .ack = s3c_irq_ack,
  78. .mask = s3c_irq_mask,
  79. .unmask = s3c_irq_unmask,
  80. .set_wake = s3c_irq_wake
  81. };
  82. static void
  83. s3c_irqext_mask(unsigned int irqno)
  84. {
  85. unsigned long mask;
  86. irqno -= EXTINT_OFF;
  87. mask = __raw_readl(S3C24XX_EINTMASK);
  88. mask |= ( 1UL << irqno);
  89. __raw_writel(mask, S3C24XX_EINTMASK);
  90. }
  91. static void
  92. s3c_irqext_ack(unsigned int irqno)
  93. {
  94. unsigned long req;
  95. unsigned long bit;
  96. unsigned long mask;
  97. bit = 1UL << (irqno - EXTINT_OFF);
  98. mask = __raw_readl(S3C24XX_EINTMASK);
  99. __raw_writel(bit, S3C24XX_EINTPEND);
  100. req = __raw_readl(S3C24XX_EINTPEND);
  101. req &= ~mask;
  102. /* not sure if we should be acking the parent irq... */
  103. if (irqno <= IRQ_EINT7 ) {
  104. if ((req & 0xf0) == 0)
  105. s3c_irq_ack(IRQ_EINT4t7);
  106. } else {
  107. if ((req >> 8) == 0)
  108. s3c_irq_ack(IRQ_EINT8t23);
  109. }
  110. }
  111. static void
  112. s3c_irqext_unmask(unsigned int irqno)
  113. {
  114. unsigned long mask;
  115. irqno -= EXTINT_OFF;
  116. mask = __raw_readl(S3C24XX_EINTMASK);
  117. mask &= ~( 1UL << irqno);
  118. __raw_writel(mask, S3C24XX_EINTMASK);
  119. }
  120. int
  121. s3c_irqext_type(unsigned int irq, unsigned int type)
  122. {
  123. void __iomem *extint_reg;
  124. void __iomem *gpcon_reg;
  125. unsigned long gpcon_offset, extint_offset;
  126. unsigned long newvalue = 0, value;
  127. if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3))
  128. {
  129. gpcon_reg = S3C2410_GPFCON;
  130. extint_reg = S3C24XX_EXTINT0;
  131. gpcon_offset = (irq - IRQ_EINT0) * 2;
  132. extint_offset = (irq - IRQ_EINT0) * 4;
  133. }
  134. else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7))
  135. {
  136. gpcon_reg = S3C2410_GPFCON;
  137. extint_reg = S3C24XX_EXTINT0;
  138. gpcon_offset = (irq - (EXTINT_OFF)) * 2;
  139. extint_offset = (irq - (EXTINT_OFF)) * 4;
  140. }
  141. else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15))
  142. {
  143. gpcon_reg = S3C2410_GPGCON;
  144. extint_reg = S3C24XX_EXTINT1;
  145. gpcon_offset = (irq - IRQ_EINT8) * 2;
  146. extint_offset = (irq - IRQ_EINT8) * 4;
  147. }
  148. else if ((irq >= IRQ_EINT16) && (irq <= IRQ_EINT23))
  149. {
  150. gpcon_reg = S3C2410_GPGCON;
  151. extint_reg = S3C24XX_EXTINT2;
  152. gpcon_offset = (irq - IRQ_EINT8) * 2;
  153. extint_offset = (irq - IRQ_EINT16) * 4;
  154. } else
  155. return -1;
  156. /* Set the GPIO to external interrupt mode */
  157. value = __raw_readl(gpcon_reg);
  158. value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
  159. __raw_writel(value, gpcon_reg);
  160. /* Set the external interrupt to pointed trigger type */
  161. switch (type)
  162. {
  163. case IRQ_TYPE_NONE:
  164. printk(KERN_WARNING "No edge setting!\n");
  165. break;
  166. case IRQ_TYPE_EDGE_RISING:
  167. newvalue = S3C2410_EXTINT_RISEEDGE;
  168. break;
  169. case IRQ_TYPE_EDGE_FALLING:
  170. newvalue = S3C2410_EXTINT_FALLEDGE;
  171. break;
  172. case IRQ_TYPE_EDGE_BOTH:
  173. newvalue = S3C2410_EXTINT_BOTHEDGE;
  174. break;
  175. case IRQ_TYPE_LEVEL_LOW:
  176. newvalue = S3C2410_EXTINT_LOWLEV;
  177. break;
  178. case IRQ_TYPE_LEVEL_HIGH:
  179. newvalue = S3C2410_EXTINT_HILEV;
  180. break;
  181. default:
  182. printk(KERN_ERR "No such irq type %d", type);
  183. return -1;
  184. }
  185. value = __raw_readl(extint_reg);
  186. value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
  187. __raw_writel(value, extint_reg);
  188. return 0;
  189. }
  190. static struct irq_chip s3c_irqext_chip = {
  191. .name = "s3c-ext",
  192. .mask = s3c_irqext_mask,
  193. .unmask = s3c_irqext_unmask,
  194. .ack = s3c_irqext_ack,
  195. .set_type = s3c_irqext_type,
  196. .set_wake = s3c_irqext_wake
  197. };
  198. static struct irq_chip s3c_irq_eint0t4 = {
  199. .name = "s3c-ext0",
  200. .ack = s3c_irq_ack,
  201. .mask = s3c_irq_mask,
  202. .unmask = s3c_irq_unmask,
  203. .set_wake = s3c_irq_wake,
  204. .set_type = s3c_irqext_type,
  205. };
  206. /* mask values for the parent registers for each of the interrupt types */
  207. #define INTMSK_UART0 (1UL << (IRQ_UART0 - IRQ_EINT0))
  208. #define INTMSK_UART1 (1UL << (IRQ_UART1 - IRQ_EINT0))
  209. #define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
  210. #define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
  211. /* UART0 */
  212. static void
  213. s3c_irq_uart0_mask(unsigned int irqno)
  214. {
  215. s3c_irqsub_mask(irqno, INTMSK_UART0, 7);
  216. }
  217. static void
  218. s3c_irq_uart0_unmask(unsigned int irqno)
  219. {
  220. s3c_irqsub_unmask(irqno, INTMSK_UART0);
  221. }
  222. static void
  223. s3c_irq_uart0_ack(unsigned int irqno)
  224. {
  225. s3c_irqsub_maskack(irqno, INTMSK_UART0, 7);
  226. }
  227. static struct irq_chip s3c_irq_uart0 = {
  228. .name = "s3c-uart0",
  229. .mask = s3c_irq_uart0_mask,
  230. .unmask = s3c_irq_uart0_unmask,
  231. .ack = s3c_irq_uart0_ack,
  232. };
  233. /* UART1 */
  234. static void
  235. s3c_irq_uart1_mask(unsigned int irqno)
  236. {
  237. s3c_irqsub_mask(irqno, INTMSK_UART1, 7 << 3);
  238. }
  239. static void
  240. s3c_irq_uart1_unmask(unsigned int irqno)
  241. {
  242. s3c_irqsub_unmask(irqno, INTMSK_UART1);
  243. }
  244. static void
  245. s3c_irq_uart1_ack(unsigned int irqno)
  246. {
  247. s3c_irqsub_maskack(irqno, INTMSK_UART1, 7 << 3);
  248. }
  249. static struct irq_chip s3c_irq_uart1 = {
  250. .name = "s3c-uart1",
  251. .mask = s3c_irq_uart1_mask,
  252. .unmask = s3c_irq_uart1_unmask,
  253. .ack = s3c_irq_uart1_ack,
  254. };
  255. /* UART2 */
  256. static void
  257. s3c_irq_uart2_mask(unsigned int irqno)
  258. {
  259. s3c_irqsub_mask(irqno, INTMSK_UART2, 7 << 6);
  260. }
  261. static void
  262. s3c_irq_uart2_unmask(unsigned int irqno)
  263. {
  264. s3c_irqsub_unmask(irqno, INTMSK_UART2);
  265. }
  266. static void
  267. s3c_irq_uart2_ack(unsigned int irqno)
  268. {
  269. s3c_irqsub_maskack(irqno, INTMSK_UART2, 7 << 6);
  270. }
  271. static struct irq_chip s3c_irq_uart2 = {
  272. .name = "s3c-uart2",
  273. .mask = s3c_irq_uart2_mask,
  274. .unmask = s3c_irq_uart2_unmask,
  275. .ack = s3c_irq_uart2_ack,
  276. };
  277. /* ADC and Touchscreen */
  278. static void
  279. s3c_irq_adc_mask(unsigned int irqno)
  280. {
  281. s3c_irqsub_mask(irqno, INTMSK_ADCPARENT, 3 << 9);
  282. }
  283. static void
  284. s3c_irq_adc_unmask(unsigned int irqno)
  285. {
  286. s3c_irqsub_unmask(irqno, INTMSK_ADCPARENT);
  287. }
  288. static void
  289. s3c_irq_adc_ack(unsigned int irqno)
  290. {
  291. s3c_irqsub_ack(irqno, INTMSK_ADCPARENT, 3 << 9);
  292. }
  293. static struct irq_chip s3c_irq_adc = {
  294. .name = "s3c-adc",
  295. .mask = s3c_irq_adc_mask,
  296. .unmask = s3c_irq_adc_unmask,
  297. .ack = s3c_irq_adc_ack,
  298. };
  299. /* irq demux for adc */
  300. static void s3c_irq_demux_adc(unsigned int irq,
  301. struct irq_desc *desc)
  302. {
  303. unsigned int subsrc, submsk;
  304. unsigned int offset = 9;
  305. /* read the current pending interrupts, and the mask
  306. * for what it is available */
  307. subsrc = __raw_readl(S3C2410_SUBSRCPND);
  308. submsk = __raw_readl(S3C2410_INTSUBMSK);
  309. subsrc &= ~submsk;
  310. subsrc >>= offset;
  311. subsrc &= 3;
  312. if (subsrc != 0) {
  313. if (subsrc & 1) {
  314. generic_handle_irq(IRQ_TC);
  315. }
  316. if (subsrc & 2) {
  317. generic_handle_irq(IRQ_ADC);
  318. }
  319. }
  320. }
  321. static void s3c_irq_demux_uart(unsigned int start)
  322. {
  323. unsigned int subsrc, submsk;
  324. unsigned int offset = start - IRQ_S3CUART_RX0;
  325. /* read the current pending interrupts, and the mask
  326. * for what it is available */
  327. subsrc = __raw_readl(S3C2410_SUBSRCPND);
  328. submsk = __raw_readl(S3C2410_INTSUBMSK);
  329. irqdbf2("s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
  330. start, offset, subsrc, submsk);
  331. subsrc &= ~submsk;
  332. subsrc >>= offset;
  333. subsrc &= 7;
  334. if (subsrc != 0) {
  335. if (subsrc & 1)
  336. generic_handle_irq(start);
  337. if (subsrc & 2)
  338. generic_handle_irq(start+1);
  339. if (subsrc & 4)
  340. generic_handle_irq(start+2);
  341. }
  342. }
  343. /* uart demux entry points */
  344. static void
  345. s3c_irq_demux_uart0(unsigned int irq,
  346. struct irq_desc *desc)
  347. {
  348. irq = irq;
  349. s3c_irq_demux_uart(IRQ_S3CUART_RX0);
  350. }
  351. static void
  352. s3c_irq_demux_uart1(unsigned int irq,
  353. struct irq_desc *desc)
  354. {
  355. irq = irq;
  356. s3c_irq_demux_uart(IRQ_S3CUART_RX1);
  357. }
  358. static void
  359. s3c_irq_demux_uart2(unsigned int irq,
  360. struct irq_desc *desc)
  361. {
  362. irq = irq;
  363. s3c_irq_demux_uart(IRQ_S3CUART_RX2);
  364. }
  365. static void
  366. s3c_irq_demux_extint8(unsigned int irq,
  367. struct irq_desc *desc)
  368. {
  369. unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
  370. unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
  371. eintpnd &= ~eintmsk;
  372. eintpnd &= ~0xff; /* ignore lower irqs */
  373. /* we may as well handle all the pending IRQs here */
  374. while (eintpnd) {
  375. irq = __ffs(eintpnd);
  376. eintpnd &= ~(1<<irq);
  377. irq += (IRQ_EINT4 - 4);
  378. generic_handle_irq(irq);
  379. }
  380. }
  381. static void
  382. s3c_irq_demux_extint4t7(unsigned int irq,
  383. struct irq_desc *desc)
  384. {
  385. unsigned long eintpnd = __raw_readl(S3C24XX_EINTPEND);
  386. unsigned long eintmsk = __raw_readl(S3C24XX_EINTMASK);
  387. eintpnd &= ~eintmsk;
  388. eintpnd &= 0xff; /* only lower irqs */
  389. /* we may as well handle all the pending IRQs here */
  390. while (eintpnd) {
  391. irq = __ffs(eintpnd);
  392. eintpnd &= ~(1<<irq);
  393. irq += (IRQ_EINT4 - 4);
  394. generic_handle_irq(irq);
  395. }
  396. }
  397. #ifdef CONFIG_FIQ
  398. /**
  399. * s3c24xx_set_fiq - set the FIQ routing
  400. * @irq: IRQ number to route to FIQ on processor.
  401. * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing.
  402. *
  403. * Change the state of the IRQ to FIQ routing depending on @irq and @on. If
  404. * @on is true, the @irq is checked to see if it can be routed and the
  405. * interrupt controller updated to route the IRQ. If @on is false, the FIQ
  406. * routing is cleared, regardless of which @irq is specified.
  407. */
  408. int s3c24xx_set_fiq(unsigned int irq, bool on)
  409. {
  410. u32 intmod;
  411. unsigned offs;
  412. if (on) {
  413. offs = irq - FIQ_START;
  414. if (offs > 31)
  415. return -EINVAL;
  416. intmod = 1 << offs;
  417. } else {
  418. intmod = 0;
  419. }
  420. __raw_writel(intmod, S3C2410_INTMOD);
  421. return 0;
  422. }
  423. EXPORT_SYMBOL_GPL(s3c24xx_set_fiq);
  424. #endif
  425. /* s3c24xx_init_irq
  426. *
  427. * Initialise S3C2410 IRQ system
  428. */
  429. void __init s3c24xx_init_irq(void)
  430. {
  431. unsigned long pend;
  432. unsigned long last;
  433. int irqno;
  434. int i;
  435. #ifdef CONFIG_FIQ
  436. init_FIQ();
  437. #endif
  438. irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
  439. /* first, clear all interrupts pending... */
  440. last = 0;
  441. for (i = 0; i < 4; i++) {
  442. pend = __raw_readl(S3C24XX_EINTPEND);
  443. if (pend == 0 || pend == last)
  444. break;
  445. __raw_writel(pend, S3C24XX_EINTPEND);
  446. printk("irq: clearing pending ext status %08x\n", (int)pend);
  447. last = pend;
  448. }
  449. last = 0;
  450. for (i = 0; i < 4; i++) {
  451. pend = __raw_readl(S3C2410_INTPND);
  452. if (pend == 0 || pend == last)
  453. break;
  454. __raw_writel(pend, S3C2410_SRCPND);
  455. __raw_writel(pend, S3C2410_INTPND);
  456. printk("irq: clearing pending status %08x\n", (int)pend);
  457. last = pend;
  458. }
  459. last = 0;
  460. for (i = 0; i < 4; i++) {
  461. pend = __raw_readl(S3C2410_SUBSRCPND);
  462. if (pend == 0 || pend == last)
  463. break;
  464. printk("irq: clearing subpending status %08x\n", (int)pend);
  465. __raw_writel(pend, S3C2410_SUBSRCPND);
  466. last = pend;
  467. }
  468. /* register the main interrupts */
  469. irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n");
  470. for (irqno = IRQ_EINT4t7; irqno <= IRQ_ADCPARENT; irqno++) {
  471. /* set all the s3c2410 internal irqs */
  472. switch (irqno) {
  473. /* deal with the special IRQs (cascaded) */
  474. case IRQ_EINT4t7:
  475. case IRQ_EINT8t23:
  476. case IRQ_UART0:
  477. case IRQ_UART1:
  478. case IRQ_UART2:
  479. case IRQ_ADCPARENT:
  480. set_irq_chip(irqno, &s3c_irq_level_chip);
  481. set_irq_handler(irqno, handle_level_irq);
  482. break;
  483. case IRQ_RESERVED6:
  484. case IRQ_RESERVED24:
  485. /* no IRQ here */
  486. break;
  487. default:
  488. //irqdbf("registering irq %d (s3c irq)\n", irqno);
  489. set_irq_chip(irqno, &s3c_irq_chip);
  490. set_irq_handler(irqno, handle_edge_irq);
  491. set_irq_flags(irqno, IRQF_VALID);
  492. }
  493. }
  494. /* setup the cascade irq handlers */
  495. set_irq_chained_handler(IRQ_EINT4t7, s3c_irq_demux_extint4t7);
  496. set_irq_chained_handler(IRQ_EINT8t23, s3c_irq_demux_extint8);
  497. set_irq_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
  498. set_irq_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
  499. set_irq_chained_handler(IRQ_UART2, s3c_irq_demux_uart2);
  500. set_irq_chained_handler(IRQ_ADCPARENT, s3c_irq_demux_adc);
  501. /* external interrupts */
  502. for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
  503. irqdbf("registering irq %d (ext int)\n", irqno);
  504. set_irq_chip(irqno, &s3c_irq_eint0t4);
  505. set_irq_handler(irqno, handle_edge_irq);
  506. set_irq_flags(irqno, IRQF_VALID);
  507. }
  508. for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
  509. irqdbf("registering irq %d (extended s3c irq)\n", irqno);
  510. set_irq_chip(irqno, &s3c_irqext_chip);
  511. set_irq_handler(irqno, handle_edge_irq);
  512. set_irq_flags(irqno, IRQF_VALID);
  513. }
  514. /* register the uart interrupts */
  515. irqdbf("s3c2410: registering external interrupts\n");
  516. for (irqno = IRQ_S3CUART_RX0; irqno <= IRQ_S3CUART_ERR0; irqno++) {
  517. irqdbf("registering irq %d (s3c uart0 irq)\n", irqno);
  518. set_irq_chip(irqno, &s3c_irq_uart0);
  519. set_irq_handler(irqno, handle_level_irq);
  520. set_irq_flags(irqno, IRQF_VALID);
  521. }
  522. for (irqno = IRQ_S3CUART_RX1; irqno <= IRQ_S3CUART_ERR1; irqno++) {
  523. irqdbf("registering irq %d (s3c uart1 irq)\n", irqno);
  524. set_irq_chip(irqno, &s3c_irq_uart1);
  525. set_irq_handler(irqno, handle_level_irq);
  526. set_irq_flags(irqno, IRQF_VALID);
  527. }
  528. for (irqno = IRQ_S3CUART_RX2; irqno <= IRQ_S3CUART_ERR2; irqno++) {
  529. irqdbf("registering irq %d (s3c uart2 irq)\n", irqno);
  530. set_irq_chip(irqno, &s3c_irq_uart2);
  531. set_irq_handler(irqno, handle_level_irq);
  532. set_irq_flags(irqno, IRQF_VALID);
  533. }
  534. for (irqno = IRQ_TC; irqno <= IRQ_ADC; irqno++) {
  535. irqdbf("registering irq %d (s3c adc irq)\n", irqno);
  536. set_irq_chip(irqno, &s3c_irq_adc);
  537. set_irq_handler(irqno, handle_edge_irq);
  538. set_irq_flags(irqno, IRQF_VALID);
  539. }
  540. irqdbf("s3c2410: registered interrupt handlers\n");
  541. }