irq.c 15 KB

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