irq.c 15 KB

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