irq.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. /* linux/arch/arm/mach-s3c2410/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. * Changelog:
  21. *
  22. * 22-Jul-2004 Ben Dooks <ben@simtec.co.uk>
  23. * Fixed compile warnings
  24. *
  25. * 22-Jul-2004 Roc Wu <cooloney@yahoo.com.cn>
  26. * Fixed s3c_extirq_type
  27. *
  28. * 21-Jul-2004 Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
  29. * Addition of ADC/TC demux
  30. *
  31. * 04-Oct-2004 Klaus Fetscher <k.fetscher@fetron.de>
  32. * Fix for set_irq_type() on low EINT numbers
  33. *
  34. * 05-Oct-2004 Ben Dooks <ben@simtec.co.uk>
  35. * Tidy up KF's patch and sort out new release
  36. *
  37. * 05-Oct-2004 Ben Dooks <ben@simtec.co.uk>
  38. * Add support for power management controls
  39. *
  40. * 04-Nov-2004 Ben Dooks
  41. * Fix standard IRQ wake for EINT0..4 and RTC
  42. *
  43. * 22-Feb-2005 Ben Dooks
  44. * Fixed edge-triggering on ADC IRQ
  45. *
  46. * 28-Jun-2005 Ben Dooks
  47. * Mark IRQ_LCD valid
  48. *
  49. * 25-Jul-2005 Ben Dooks
  50. * Split the S3C2440 IRQ code to seperate file
  51. */
  52. #include <linux/init.h>
  53. #include <linux/module.h>
  54. #include <linux/interrupt.h>
  55. #include <linux/ioport.h>
  56. #include <linux/ptrace.h>
  57. #include <linux/sysdev.h>
  58. #include <asm/hardware.h>
  59. #include <asm/irq.h>
  60. #include <asm/io.h>
  61. #include <asm/mach/irq.h>
  62. #include <asm/arch/regs-irq.h>
  63. #include <asm/arch/regs-gpio.h>
  64. #include "cpu.h"
  65. #include "pm.h"
  66. #include "irq.h"
  67. /* wakeup irq control */
  68. #ifdef CONFIG_PM
  69. /* state for IRQs over sleep */
  70. /* default is to allow for EINT0..EINT15, and IRQ_RTC as wakeup sources
  71. *
  72. * set bit to 1 in allow bitfield to enable the wakeup settings on it
  73. */
  74. unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
  75. unsigned long s3c_irqwake_intmask = 0xffffffffL;
  76. unsigned long s3c_irqwake_eintallow = 0x0000fff0L;
  77. unsigned long s3c_irqwake_eintmask = 0xffffffffL;
  78. static int
  79. s3c_irq_wake(unsigned int irqno, unsigned int state)
  80. {
  81. unsigned long irqbit = 1 << (irqno - IRQ_EINT0);
  82. if (!(s3c_irqwake_intallow & irqbit))
  83. return -ENOENT;
  84. printk(KERN_INFO "wake %s for irq %d\n",
  85. state ? "enabled" : "disabled", irqno);
  86. if (!state)
  87. s3c_irqwake_intmask |= irqbit;
  88. else
  89. s3c_irqwake_intmask &= ~irqbit;
  90. return 0;
  91. }
  92. static int
  93. s3c_irqext_wake(unsigned int irqno, unsigned int state)
  94. {
  95. unsigned long bit = 1L << (irqno - EXTINT_OFF);
  96. if (!(s3c_irqwake_eintallow & bit))
  97. return -ENOENT;
  98. printk(KERN_INFO "wake %s for irq %d\n",
  99. state ? "enabled" : "disabled", irqno);
  100. if (!state)
  101. s3c_irqwake_eintmask |= bit;
  102. else
  103. s3c_irqwake_eintmask &= ~bit;
  104. return 0;
  105. }
  106. #else
  107. #define s3c_irqext_wake NULL
  108. #define s3c_irq_wake NULL
  109. #endif
  110. static void
  111. s3c_irq_mask(unsigned int irqno)
  112. {
  113. unsigned long mask;
  114. irqno -= IRQ_EINT0;
  115. mask = __raw_readl(S3C2410_INTMSK);
  116. mask |= 1UL << irqno;
  117. __raw_writel(mask, S3C2410_INTMSK);
  118. }
  119. static inline void
  120. s3c_irq_ack(unsigned int irqno)
  121. {
  122. unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
  123. __raw_writel(bitval, S3C2410_SRCPND);
  124. __raw_writel(bitval, S3C2410_INTPND);
  125. }
  126. static inline void
  127. s3c_irq_maskack(unsigned int irqno)
  128. {
  129. unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
  130. unsigned long mask;
  131. mask = __raw_readl(S3C2410_INTMSK);
  132. __raw_writel(mask|bitval, S3C2410_INTMSK);
  133. __raw_writel(bitval, S3C2410_SRCPND);
  134. __raw_writel(bitval, S3C2410_INTPND);
  135. }
  136. static void
  137. s3c_irq_unmask(unsigned int irqno)
  138. {
  139. unsigned long mask;
  140. if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
  141. irqdbf2("s3c_irq_unmask %d\n", irqno);
  142. irqno -= IRQ_EINT0;
  143. mask = __raw_readl(S3C2410_INTMSK);
  144. mask &= ~(1UL << irqno);
  145. __raw_writel(mask, S3C2410_INTMSK);
  146. }
  147. struct irqchip s3c_irq_level_chip = {
  148. .ack = s3c_irq_maskack,
  149. .mask = s3c_irq_mask,
  150. .unmask = s3c_irq_unmask,
  151. .set_wake = s3c_irq_wake
  152. };
  153. static struct irqchip s3c_irq_chip = {
  154. .ack = s3c_irq_ack,
  155. .mask = s3c_irq_mask,
  156. .unmask = s3c_irq_unmask,
  157. .set_wake = s3c_irq_wake
  158. };
  159. /* S3C2410_EINTMASK
  160. * S3C2410_EINTPEND
  161. */
  162. static void
  163. s3c_irqext_mask(unsigned int irqno)
  164. {
  165. unsigned long mask;
  166. irqno -= EXTINT_OFF;
  167. mask = __raw_readl(S3C2410_EINTMASK);
  168. mask |= ( 1UL << irqno);
  169. __raw_writel(mask, S3C2410_EINTMASK);
  170. if (irqno <= (IRQ_EINT7 - EXTINT_OFF)) {
  171. /* check to see if all need masking */
  172. if ((mask & (0xf << 4)) == (0xf << 4)) {
  173. /* all masked, mask the parent */
  174. s3c_irq_mask(IRQ_EINT4t7);
  175. }
  176. } else {
  177. /* todo: the same check as above for the rest of the irq regs...*/
  178. }
  179. }
  180. static void
  181. s3c_irqext_ack(unsigned int irqno)
  182. {
  183. unsigned long req;
  184. unsigned long bit;
  185. unsigned long mask;
  186. bit = 1UL << (irqno - EXTINT_OFF);
  187. mask = __raw_readl(S3C2410_EINTMASK);
  188. __raw_writel(bit, S3C2410_EINTPEND);
  189. req = __raw_readl(S3C2410_EINTPEND);
  190. req &= ~mask;
  191. /* not sure if we should be acking the parent irq... */
  192. if (irqno <= IRQ_EINT7 ) {
  193. if ((req & 0xf0) == 0)
  194. s3c_irq_ack(IRQ_EINT4t7);
  195. } else {
  196. if ((req >> 8) == 0)
  197. s3c_irq_ack(IRQ_EINT8t23);
  198. }
  199. }
  200. static void
  201. s3c_irqext_unmask(unsigned int irqno)
  202. {
  203. unsigned long mask;
  204. irqno -= EXTINT_OFF;
  205. mask = __raw_readl(S3C2410_EINTMASK);
  206. mask &= ~( 1UL << irqno);
  207. __raw_writel(mask, S3C2410_EINTMASK);
  208. s3c_irq_unmask((irqno <= (IRQ_EINT7 - EXTINT_OFF)) ? IRQ_EINT4t7 : IRQ_EINT8t23);
  209. }
  210. static int
  211. s3c_irqext_type(unsigned int irq, unsigned int type)
  212. {
  213. void __iomem *extint_reg;
  214. void __iomem *gpcon_reg;
  215. unsigned long gpcon_offset, extint_offset;
  216. unsigned long newvalue = 0, value;
  217. if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3))
  218. {
  219. gpcon_reg = S3C2410_GPFCON;
  220. extint_reg = S3C2410_EXTINT0;
  221. gpcon_offset = (irq - IRQ_EINT0) * 2;
  222. extint_offset = (irq - IRQ_EINT0) * 4;
  223. }
  224. else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7))
  225. {
  226. gpcon_reg = S3C2410_GPFCON;
  227. extint_reg = S3C2410_EXTINT0;
  228. gpcon_offset = (irq - (EXTINT_OFF)) * 2;
  229. extint_offset = (irq - (EXTINT_OFF)) * 4;
  230. }
  231. else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15))
  232. {
  233. gpcon_reg = S3C2410_GPGCON;
  234. extint_reg = S3C2410_EXTINT1;
  235. gpcon_offset = (irq - IRQ_EINT8) * 2;
  236. extint_offset = (irq - IRQ_EINT8) * 4;
  237. }
  238. else if ((irq >= IRQ_EINT16) && (irq <= IRQ_EINT23))
  239. {
  240. gpcon_reg = S3C2410_GPGCON;
  241. extint_reg = S3C2410_EXTINT2;
  242. gpcon_offset = (irq - IRQ_EINT8) * 2;
  243. extint_offset = (irq - IRQ_EINT16) * 4;
  244. } else
  245. return -1;
  246. /* Set the GPIO to external interrupt mode */
  247. value = __raw_readl(gpcon_reg);
  248. value = (value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
  249. __raw_writel(value, gpcon_reg);
  250. /* Set the external interrupt to pointed trigger type */
  251. switch (type)
  252. {
  253. case IRQT_NOEDGE:
  254. printk(KERN_WARNING "No edge setting!\n");
  255. break;
  256. case IRQT_RISING:
  257. newvalue = S3C2410_EXTINT_RISEEDGE;
  258. break;
  259. case IRQT_FALLING:
  260. newvalue = S3C2410_EXTINT_FALLEDGE;
  261. break;
  262. case IRQT_BOTHEDGE:
  263. newvalue = S3C2410_EXTINT_BOTHEDGE;
  264. break;
  265. case IRQT_LOW:
  266. newvalue = S3C2410_EXTINT_LOWLEV;
  267. break;
  268. case IRQT_HIGH:
  269. newvalue = S3C2410_EXTINT_HILEV;
  270. break;
  271. default:
  272. printk(KERN_ERR "No such irq type %d", type);
  273. return -1;
  274. }
  275. value = __raw_readl(extint_reg);
  276. value = (value & ~(7 << extint_offset)) | (newvalue << extint_offset);
  277. __raw_writel(value, extint_reg);
  278. return 0;
  279. }
  280. static struct irqchip s3c_irqext_chip = {
  281. .mask = s3c_irqext_mask,
  282. .unmask = s3c_irqext_unmask,
  283. .ack = s3c_irqext_ack,
  284. .set_type = s3c_irqext_type,
  285. .set_wake = s3c_irqext_wake
  286. };
  287. static struct irqchip s3c_irq_eint0t4 = {
  288. .ack = s3c_irq_ack,
  289. .mask = s3c_irq_mask,
  290. .unmask = s3c_irq_unmask,
  291. .set_wake = s3c_irq_wake,
  292. .set_type = s3c_irqext_type,
  293. };
  294. /* mask values for the parent registers for each of the interrupt types */
  295. #define INTMSK_UART0 (1UL << (IRQ_UART0 - IRQ_EINT0))
  296. #define INTMSK_UART1 (1UL << (IRQ_UART1 - IRQ_EINT0))
  297. #define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
  298. #define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
  299. /* UART0 */
  300. static void
  301. s3c_irq_uart0_mask(unsigned int irqno)
  302. {
  303. s3c_irqsub_mask(irqno, INTMSK_UART0, 7);
  304. }
  305. static void
  306. s3c_irq_uart0_unmask(unsigned int irqno)
  307. {
  308. s3c_irqsub_unmask(irqno, INTMSK_UART0);
  309. }
  310. static void
  311. s3c_irq_uart0_ack(unsigned int irqno)
  312. {
  313. s3c_irqsub_maskack(irqno, INTMSK_UART0, 7);
  314. }
  315. static struct irqchip s3c_irq_uart0 = {
  316. .mask = s3c_irq_uart0_mask,
  317. .unmask = s3c_irq_uart0_unmask,
  318. .ack = s3c_irq_uart0_ack,
  319. };
  320. /* UART1 */
  321. static void
  322. s3c_irq_uart1_mask(unsigned int irqno)
  323. {
  324. s3c_irqsub_mask(irqno, INTMSK_UART1, 7 << 3);
  325. }
  326. static void
  327. s3c_irq_uart1_unmask(unsigned int irqno)
  328. {
  329. s3c_irqsub_unmask(irqno, INTMSK_UART1);
  330. }
  331. static void
  332. s3c_irq_uart1_ack(unsigned int irqno)
  333. {
  334. s3c_irqsub_maskack(irqno, INTMSK_UART1, 7 << 3);
  335. }
  336. static struct irqchip s3c_irq_uart1 = {
  337. .mask = s3c_irq_uart1_mask,
  338. .unmask = s3c_irq_uart1_unmask,
  339. .ack = s3c_irq_uart1_ack,
  340. };
  341. /* UART2 */
  342. static void
  343. s3c_irq_uart2_mask(unsigned int irqno)
  344. {
  345. s3c_irqsub_mask(irqno, INTMSK_UART2, 7 << 6);
  346. }
  347. static void
  348. s3c_irq_uart2_unmask(unsigned int irqno)
  349. {
  350. s3c_irqsub_unmask(irqno, INTMSK_UART2);
  351. }
  352. static void
  353. s3c_irq_uart2_ack(unsigned int irqno)
  354. {
  355. s3c_irqsub_maskack(irqno, INTMSK_UART2, 7 << 6);
  356. }
  357. static struct irqchip s3c_irq_uart2 = {
  358. .mask = s3c_irq_uart2_mask,
  359. .unmask = s3c_irq_uart2_unmask,
  360. .ack = s3c_irq_uart2_ack,
  361. };
  362. /* ADC and Touchscreen */
  363. static void
  364. s3c_irq_adc_mask(unsigned int irqno)
  365. {
  366. s3c_irqsub_mask(irqno, INTMSK_ADCPARENT, 3 << 9);
  367. }
  368. static void
  369. s3c_irq_adc_unmask(unsigned int irqno)
  370. {
  371. s3c_irqsub_unmask(irqno, INTMSK_ADCPARENT);
  372. }
  373. static void
  374. s3c_irq_adc_ack(unsigned int irqno)
  375. {
  376. s3c_irqsub_ack(irqno, INTMSK_ADCPARENT, 3 << 9);
  377. }
  378. static struct irqchip s3c_irq_adc = {
  379. .mask = s3c_irq_adc_mask,
  380. .unmask = s3c_irq_adc_unmask,
  381. .ack = s3c_irq_adc_ack,
  382. };
  383. /* irq demux for adc */
  384. static void s3c_irq_demux_adc(unsigned int irq,
  385. struct irqdesc *desc,
  386. struct pt_regs *regs)
  387. {
  388. unsigned int subsrc, submsk;
  389. unsigned int offset = 9;
  390. struct irqdesc *mydesc;
  391. /* read the current pending interrupts, and the mask
  392. * for what it is available */
  393. subsrc = __raw_readl(S3C2410_SUBSRCPND);
  394. submsk = __raw_readl(S3C2410_INTSUBMSK);
  395. subsrc &= ~submsk;
  396. subsrc >>= offset;
  397. subsrc &= 3;
  398. if (subsrc != 0) {
  399. if (subsrc & 1) {
  400. mydesc = irq_desc + IRQ_TC;
  401. desc_handle_irq(IRQ_TC, mydesc, regs);
  402. }
  403. if (subsrc & 2) {
  404. mydesc = irq_desc + IRQ_ADC;
  405. desc_handle_irq(IRQ_ADC, mydesc, regs);
  406. }
  407. }
  408. }
  409. static void s3c_irq_demux_uart(unsigned int start,
  410. struct pt_regs *regs)
  411. {
  412. unsigned int subsrc, submsk;
  413. unsigned int offset = start - IRQ_S3CUART_RX0;
  414. struct irqdesc *desc;
  415. /* read the current pending interrupts, and the mask
  416. * for what it is available */
  417. subsrc = __raw_readl(S3C2410_SUBSRCPND);
  418. submsk = __raw_readl(S3C2410_INTSUBMSK);
  419. irqdbf2("s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
  420. start, offset, subsrc, submsk);
  421. subsrc &= ~submsk;
  422. subsrc >>= offset;
  423. subsrc &= 7;
  424. if (subsrc != 0) {
  425. desc = irq_desc + start;
  426. if (subsrc & 1)
  427. desc_handle_irq(start, desc, regs);
  428. desc++;
  429. if (subsrc & 2)
  430. desc_handle_irq(start+1, desc, regs);
  431. desc++;
  432. if (subsrc & 4)
  433. desc_handle_irq(start+2, desc, regs);
  434. }
  435. }
  436. /* uart demux entry points */
  437. static void
  438. s3c_irq_demux_uart0(unsigned int irq,
  439. struct irqdesc *desc,
  440. struct pt_regs *regs)
  441. {
  442. irq = irq;
  443. s3c_irq_demux_uart(IRQ_S3CUART_RX0, regs);
  444. }
  445. static void
  446. s3c_irq_demux_uart1(unsigned int irq,
  447. struct irqdesc *desc,
  448. struct pt_regs *regs)
  449. {
  450. irq = irq;
  451. s3c_irq_demux_uart(IRQ_S3CUART_RX1, regs);
  452. }
  453. static void
  454. s3c_irq_demux_uart2(unsigned int irq,
  455. struct irqdesc *desc,
  456. struct pt_regs *regs)
  457. {
  458. irq = irq;
  459. s3c_irq_demux_uart(IRQ_S3CUART_RX2, regs);
  460. }
  461. /* s3c24xx_init_irq
  462. *
  463. * Initialise S3C2410 IRQ system
  464. */
  465. void __init s3c24xx_init_irq(void)
  466. {
  467. unsigned long pend;
  468. unsigned long last;
  469. int irqno;
  470. int i;
  471. irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
  472. /* first, clear all interrupts pending... */
  473. last = 0;
  474. for (i = 0; i < 4; i++) {
  475. pend = __raw_readl(S3C2410_EINTPEND);
  476. if (pend == 0 || pend == last)
  477. break;
  478. __raw_writel(pend, S3C2410_EINTPEND);
  479. printk("irq: clearing pending ext status %08x\n", (int)pend);
  480. last = pend;
  481. }
  482. last = 0;
  483. for (i = 0; i < 4; i++) {
  484. pend = __raw_readl(S3C2410_INTPND);
  485. if (pend == 0 || pend == last)
  486. break;
  487. __raw_writel(pend, S3C2410_SRCPND);
  488. __raw_writel(pend, S3C2410_INTPND);
  489. printk("irq: clearing pending status %08x\n", (int)pend);
  490. last = pend;
  491. }
  492. last = 0;
  493. for (i = 0; i < 4; i++) {
  494. pend = __raw_readl(S3C2410_SUBSRCPND);
  495. if (pend == 0 || pend == last)
  496. break;
  497. printk("irq: clearing subpending status %08x\n", (int)pend);
  498. __raw_writel(pend, S3C2410_SUBSRCPND);
  499. last = pend;
  500. }
  501. /* register the main interrupts */
  502. irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n");
  503. for (irqno = IRQ_BATT_FLT; irqno <= IRQ_ADCPARENT; irqno++) {
  504. /* set all the s3c2410 internal irqs */
  505. switch (irqno) {
  506. /* deal with the special IRQs (cascaded) */
  507. case IRQ_UART0:
  508. case IRQ_UART1:
  509. case IRQ_UART2:
  510. case IRQ_ADCPARENT:
  511. set_irq_chip(irqno, &s3c_irq_level_chip);
  512. set_irq_handler(irqno, do_level_IRQ);
  513. break;
  514. case IRQ_RESERVED6:
  515. case IRQ_RESERVED24:
  516. /* no IRQ here */
  517. break;
  518. default:
  519. //irqdbf("registering irq %d (s3c irq)\n", irqno);
  520. set_irq_chip(irqno, &s3c_irq_chip);
  521. set_irq_handler(irqno, do_edge_IRQ);
  522. set_irq_flags(irqno, IRQF_VALID);
  523. }
  524. }
  525. /* setup the cascade irq handlers */
  526. set_irq_chained_handler(IRQ_UART0, s3c_irq_demux_uart0);
  527. set_irq_chained_handler(IRQ_UART1, s3c_irq_demux_uart1);
  528. set_irq_chained_handler(IRQ_UART2, s3c_irq_demux_uart2);
  529. set_irq_chained_handler(IRQ_ADCPARENT, s3c_irq_demux_adc);
  530. /* external interrupts */
  531. for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
  532. irqdbf("registering irq %d (ext int)\n", irqno);
  533. set_irq_chip(irqno, &s3c_irq_eint0t4);
  534. set_irq_handler(irqno, do_edge_IRQ);
  535. set_irq_flags(irqno, IRQF_VALID);
  536. }
  537. for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
  538. irqdbf("registering irq %d (extended s3c irq)\n", irqno);
  539. set_irq_chip(irqno, &s3c_irqext_chip);
  540. set_irq_handler(irqno, do_edge_IRQ);
  541. set_irq_flags(irqno, IRQF_VALID);
  542. }
  543. /* register the uart interrupts */
  544. irqdbf("s3c2410: registering external interrupts\n");
  545. for (irqno = IRQ_S3CUART_RX0; irqno <= IRQ_S3CUART_ERR0; irqno++) {
  546. irqdbf("registering irq %d (s3c uart0 irq)\n", irqno);
  547. set_irq_chip(irqno, &s3c_irq_uart0);
  548. set_irq_handler(irqno, do_level_IRQ);
  549. set_irq_flags(irqno, IRQF_VALID);
  550. }
  551. for (irqno = IRQ_S3CUART_RX1; irqno <= IRQ_S3CUART_ERR1; irqno++) {
  552. irqdbf("registering irq %d (s3c uart1 irq)\n", irqno);
  553. set_irq_chip(irqno, &s3c_irq_uart1);
  554. set_irq_handler(irqno, do_level_IRQ);
  555. set_irq_flags(irqno, IRQF_VALID);
  556. }
  557. for (irqno = IRQ_S3CUART_RX2; irqno <= IRQ_S3CUART_ERR2; irqno++) {
  558. irqdbf("registering irq %d (s3c uart2 irq)\n", irqno);
  559. set_irq_chip(irqno, &s3c_irq_uart2);
  560. set_irq_handler(irqno, do_level_IRQ);
  561. set_irq_flags(irqno, IRQF_VALID);
  562. }
  563. for (irqno = IRQ_TC; irqno <= IRQ_ADC; irqno++) {
  564. irqdbf("registering irq %d (s3c adc irq)\n", irqno);
  565. set_irq_chip(irqno, &s3c_irq_adc);
  566. set_irq_handler(irqno, do_edge_IRQ);
  567. set_irq_flags(irqno, IRQF_VALID);
  568. }
  569. irqdbf("s3c2410: registered interrupt handlers\n");
  570. }