serial.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. /*
  2. * arch/arm/mach-omap2/serial.c
  3. *
  4. * OMAP2 serial support.
  5. *
  6. * Copyright (C) 2005-2008 Nokia Corporation
  7. * Author: Paul Mundt <paul.mundt@nokia.com>
  8. *
  9. * Major rework for PM support by Kevin Hilman
  10. *
  11. * Based off of arch/arm/mach-omap/omap1/serial.c
  12. *
  13. * Copyright (C) 2009 Texas Instruments
  14. * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com
  15. *
  16. * This file is subject to the terms and conditions of the GNU General Public
  17. * License. See the file "COPYING" in the main directory of this archive
  18. * for more details.
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/serial_8250.h>
  23. #include <linux/serial_reg.h>
  24. #include <linux/clk.h>
  25. #include <linux/io.h>
  26. #include <mach/common.h>
  27. #include <mach/board.h>
  28. #include <mach/clock.h>
  29. #include <mach/control.h>
  30. #include "prm.h"
  31. #include "pm.h"
  32. #include "prm-regbits-34xx.h"
  33. #define UART_OMAP_WER 0x17 /* Wake-up enable register */
  34. #define DEFAULT_TIMEOUT (5 * HZ)
  35. struct omap_uart_state {
  36. int num;
  37. int can_sleep;
  38. struct timer_list timer;
  39. u32 timeout;
  40. void __iomem *wk_st;
  41. void __iomem *wk_en;
  42. u32 wk_mask;
  43. u32 padconf;
  44. struct clk *ick;
  45. struct clk *fck;
  46. int clocked;
  47. struct plat_serial8250_port *p;
  48. struct list_head node;
  49. struct platform_device pdev;
  50. #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
  51. int context_valid;
  52. /* Registers to be saved/restored for OFF-mode */
  53. u16 dll;
  54. u16 dlh;
  55. u16 ier;
  56. u16 sysc;
  57. u16 scr;
  58. u16 wer;
  59. #endif
  60. };
  61. static LIST_HEAD(uart_list);
  62. static struct plat_serial8250_port serial_platform_data0[] = {
  63. {
  64. .membase = OMAP2_IO_ADDRESS(OMAP_UART1_BASE),
  65. .mapbase = OMAP_UART1_BASE,
  66. .irq = 72,
  67. .flags = UPF_BOOT_AUTOCONF,
  68. .iotype = UPIO_MEM,
  69. .regshift = 2,
  70. .uartclk = OMAP24XX_BASE_BAUD * 16,
  71. }, {
  72. .flags = 0
  73. }
  74. };
  75. static struct plat_serial8250_port serial_platform_data1[] = {
  76. {
  77. .membase = OMAP2_IO_ADDRESS(OMAP_UART2_BASE),
  78. .mapbase = OMAP_UART2_BASE,
  79. .irq = 73,
  80. .flags = UPF_BOOT_AUTOCONF,
  81. .iotype = UPIO_MEM,
  82. .regshift = 2,
  83. .uartclk = OMAP24XX_BASE_BAUD * 16,
  84. }, {
  85. .flags = 0
  86. }
  87. };
  88. static struct plat_serial8250_port serial_platform_data2[] = {
  89. {
  90. .membase = OMAP2_IO_ADDRESS(OMAP_UART3_BASE),
  91. .mapbase = OMAP_UART3_BASE,
  92. .irq = 74,
  93. .flags = UPF_BOOT_AUTOCONF,
  94. .iotype = UPIO_MEM,
  95. .regshift = 2,
  96. .uartclk = OMAP24XX_BASE_BAUD * 16,
  97. }, {
  98. #ifdef CONFIG_ARCH_OMAP4
  99. .membase = IO_ADDRESS(OMAP_UART4_BASE),
  100. .mapbase = OMAP_UART4_BASE,
  101. .irq = 70,
  102. .flags = UPF_BOOT_AUTOCONF,
  103. .iotype = UPIO_MEM,
  104. .regshift = 2,
  105. .uartclk = OMAP24XX_BASE_BAUD * 16,
  106. }, {
  107. #endif
  108. .flags = 0
  109. }
  110. };
  111. #ifdef CONFIG_ARCH_OMAP4
  112. static struct plat_serial8250_port serial_platform_data3[] = {
  113. {
  114. .membase = IO_ADDRESS(OMAP_UART4_BASE),
  115. .mapbase = OMAP_UART4_BASE,
  116. .irq = 70,
  117. .flags = UPF_BOOT_AUTOCONF,
  118. .iotype = UPIO_MEM,
  119. .regshift = 2,
  120. .uartclk = OMAP24XX_BASE_BAUD * 16,
  121. }, {
  122. .flags = 0
  123. }
  124. };
  125. #endif
  126. static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
  127. int offset)
  128. {
  129. offset <<= up->regshift;
  130. return (unsigned int)__raw_readb(up->membase + offset);
  131. }
  132. static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
  133. int value)
  134. {
  135. offset <<= p->regshift;
  136. __raw_writeb(value, p->membase + offset);
  137. }
  138. /*
  139. * Internal UARTs need to be initialized for the 8250 autoconfig to work
  140. * properly. Note that the TX watermark initialization may not be needed
  141. * once the 8250.c watermark handling code is merged.
  142. */
  143. static inline void __init omap_uart_reset(struct omap_uart_state *uart)
  144. {
  145. struct plat_serial8250_port *p = uart->p;
  146. serial_write_reg(p, UART_OMAP_MDR1, 0x07);
  147. serial_write_reg(p, UART_OMAP_SCR, 0x08);
  148. serial_write_reg(p, UART_OMAP_MDR1, 0x00);
  149. serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
  150. }
  151. #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
  152. static int enable_off_mode; /* to be removed by full off-mode patches */
  153. static void omap_uart_save_context(struct omap_uart_state *uart)
  154. {
  155. u16 lcr = 0;
  156. struct plat_serial8250_port *p = uart->p;
  157. if (!enable_off_mode)
  158. return;
  159. lcr = serial_read_reg(p, UART_LCR);
  160. serial_write_reg(p, UART_LCR, 0xBF);
  161. uart->dll = serial_read_reg(p, UART_DLL);
  162. uart->dlh = serial_read_reg(p, UART_DLM);
  163. serial_write_reg(p, UART_LCR, lcr);
  164. uart->ier = serial_read_reg(p, UART_IER);
  165. uart->sysc = serial_read_reg(p, UART_OMAP_SYSC);
  166. uart->scr = serial_read_reg(p, UART_OMAP_SCR);
  167. uart->wer = serial_read_reg(p, UART_OMAP_WER);
  168. uart->context_valid = 1;
  169. }
  170. static void omap_uart_restore_context(struct omap_uart_state *uart)
  171. {
  172. u16 efr = 0;
  173. struct plat_serial8250_port *p = uart->p;
  174. if (!enable_off_mode)
  175. return;
  176. if (!uart->context_valid)
  177. return;
  178. uart->context_valid = 0;
  179. serial_write_reg(p, UART_OMAP_MDR1, 0x7);
  180. serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */
  181. efr = serial_read_reg(p, UART_EFR);
  182. serial_write_reg(p, UART_EFR, UART_EFR_ECB);
  183. serial_write_reg(p, UART_LCR, 0x0); /* Operational mode */
  184. serial_write_reg(p, UART_IER, 0x0);
  185. serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */
  186. serial_write_reg(p, UART_DLL, uart->dll);
  187. serial_write_reg(p, UART_DLM, uart->dlh);
  188. serial_write_reg(p, UART_LCR, 0x0); /* Operational mode */
  189. serial_write_reg(p, UART_IER, uart->ier);
  190. serial_write_reg(p, UART_FCR, 0xA1);
  191. serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */
  192. serial_write_reg(p, UART_EFR, efr);
  193. serial_write_reg(p, UART_LCR, UART_LCR_WLEN8);
  194. serial_write_reg(p, UART_OMAP_SCR, uart->scr);
  195. serial_write_reg(p, UART_OMAP_WER, uart->wer);
  196. serial_write_reg(p, UART_OMAP_SYSC, uart->sysc);
  197. serial_write_reg(p, UART_OMAP_MDR1, 0x00); /* UART 16x mode */
  198. }
  199. #else
  200. static inline void omap_uart_save_context(struct omap_uart_state *uart) {}
  201. static inline void omap_uart_restore_context(struct omap_uart_state *uart) {}
  202. #endif /* CONFIG_PM && CONFIG_ARCH_OMAP3 */
  203. static inline void omap_uart_enable_clocks(struct omap_uart_state *uart)
  204. {
  205. if (uart->clocked)
  206. return;
  207. clk_enable(uart->ick);
  208. clk_enable(uart->fck);
  209. uart->clocked = 1;
  210. omap_uart_restore_context(uart);
  211. }
  212. #ifdef CONFIG_PM
  213. static inline void omap_uart_disable_clocks(struct omap_uart_state *uart)
  214. {
  215. if (!uart->clocked)
  216. return;
  217. omap_uart_save_context(uart);
  218. uart->clocked = 0;
  219. clk_disable(uart->ick);
  220. clk_disable(uart->fck);
  221. }
  222. static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
  223. {
  224. /* Set wake-enable bit */
  225. if (uart->wk_en && uart->wk_mask) {
  226. u32 v = __raw_readl(uart->wk_en);
  227. v |= uart->wk_mask;
  228. __raw_writel(v, uart->wk_en);
  229. }
  230. /* Ensure IOPAD wake-enables are set */
  231. if (cpu_is_omap34xx() && uart->padconf) {
  232. u16 v = omap_ctrl_readw(uart->padconf);
  233. v |= OMAP3_PADCONF_WAKEUPENABLE0;
  234. omap_ctrl_writew(v, uart->padconf);
  235. }
  236. }
  237. static void omap_uart_disable_wakeup(struct omap_uart_state *uart)
  238. {
  239. /* Clear wake-enable bit */
  240. if (uart->wk_en && uart->wk_mask) {
  241. u32 v = __raw_readl(uart->wk_en);
  242. v &= ~uart->wk_mask;
  243. __raw_writel(v, uart->wk_en);
  244. }
  245. /* Ensure IOPAD wake-enables are cleared */
  246. if (cpu_is_omap34xx() && uart->padconf) {
  247. u16 v = omap_ctrl_readw(uart->padconf);
  248. v &= ~OMAP3_PADCONF_WAKEUPENABLE0;
  249. omap_ctrl_writew(v, uart->padconf);
  250. }
  251. }
  252. static void omap_uart_smart_idle_enable(struct omap_uart_state *uart,
  253. int enable)
  254. {
  255. struct plat_serial8250_port *p = uart->p;
  256. u16 sysc;
  257. sysc = serial_read_reg(p, UART_OMAP_SYSC) & 0x7;
  258. if (enable)
  259. sysc |= 0x2 << 3;
  260. else
  261. sysc |= 0x1 << 3;
  262. serial_write_reg(p, UART_OMAP_SYSC, sysc);
  263. }
  264. static void omap_uart_block_sleep(struct omap_uart_state *uart)
  265. {
  266. omap_uart_enable_clocks(uart);
  267. omap_uart_smart_idle_enable(uart, 0);
  268. uart->can_sleep = 0;
  269. if (uart->timeout)
  270. mod_timer(&uart->timer, jiffies + uart->timeout);
  271. else
  272. del_timer(&uart->timer);
  273. }
  274. static void omap_uart_allow_sleep(struct omap_uart_state *uart)
  275. {
  276. if (device_may_wakeup(&uart->pdev.dev))
  277. omap_uart_enable_wakeup(uart);
  278. else
  279. omap_uart_disable_wakeup(uart);
  280. if (!uart->clocked)
  281. return;
  282. omap_uart_smart_idle_enable(uart, 1);
  283. uart->can_sleep = 1;
  284. del_timer(&uart->timer);
  285. }
  286. static void omap_uart_idle_timer(unsigned long data)
  287. {
  288. struct omap_uart_state *uart = (struct omap_uart_state *)data;
  289. omap_uart_allow_sleep(uart);
  290. }
  291. void omap_uart_prepare_idle(int num)
  292. {
  293. struct omap_uart_state *uart;
  294. list_for_each_entry(uart, &uart_list, node) {
  295. if (num == uart->num && uart->can_sleep) {
  296. omap_uart_disable_clocks(uart);
  297. return;
  298. }
  299. }
  300. }
  301. void omap_uart_resume_idle(int num)
  302. {
  303. struct omap_uart_state *uart;
  304. list_for_each_entry(uart, &uart_list, node) {
  305. if (num == uart->num) {
  306. omap_uart_enable_clocks(uart);
  307. /* Check for IO pad wakeup */
  308. if (cpu_is_omap34xx() && uart->padconf) {
  309. u16 p = omap_ctrl_readw(uart->padconf);
  310. if (p & OMAP3_PADCONF_WAKEUPEVENT0)
  311. omap_uart_block_sleep(uart);
  312. }
  313. /* Check for normal UART wakeup */
  314. if (__raw_readl(uart->wk_st) & uart->wk_mask)
  315. omap_uart_block_sleep(uart);
  316. return;
  317. }
  318. }
  319. }
  320. void omap_uart_prepare_suspend(void)
  321. {
  322. struct omap_uart_state *uart;
  323. list_for_each_entry(uart, &uart_list, node) {
  324. omap_uart_allow_sleep(uart);
  325. }
  326. }
  327. int omap_uart_can_sleep(void)
  328. {
  329. struct omap_uart_state *uart;
  330. int can_sleep = 1;
  331. list_for_each_entry(uart, &uart_list, node) {
  332. if (!uart->clocked)
  333. continue;
  334. if (!uart->can_sleep) {
  335. can_sleep = 0;
  336. continue;
  337. }
  338. /* This UART can now safely sleep. */
  339. omap_uart_allow_sleep(uart);
  340. }
  341. return can_sleep;
  342. }
  343. /**
  344. * omap_uart_interrupt()
  345. *
  346. * This handler is used only to detect that *any* UART interrupt has
  347. * occurred. It does _nothing_ to handle the interrupt. Rather,
  348. * any UART interrupt will trigger the inactivity timer so the
  349. * UART will not idle or sleep for its timeout period.
  350. *
  351. **/
  352. static irqreturn_t omap_uart_interrupt(int irq, void *dev_id)
  353. {
  354. struct omap_uart_state *uart = dev_id;
  355. omap_uart_block_sleep(uart);
  356. return IRQ_NONE;
  357. }
  358. static void omap_uart_idle_init(struct omap_uart_state *uart)
  359. {
  360. struct plat_serial8250_port *p = uart->p;
  361. int ret;
  362. uart->can_sleep = 0;
  363. uart->timeout = DEFAULT_TIMEOUT;
  364. setup_timer(&uart->timer, omap_uart_idle_timer,
  365. (unsigned long) uart);
  366. mod_timer(&uart->timer, jiffies + uart->timeout);
  367. omap_uart_smart_idle_enable(uart, 0);
  368. if (cpu_is_omap34xx()) {
  369. u32 mod = (uart->num == 2) ? OMAP3430_PER_MOD : CORE_MOD;
  370. u32 wk_mask = 0;
  371. u32 padconf = 0;
  372. uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1);
  373. uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1);
  374. switch (uart->num) {
  375. case 0:
  376. wk_mask = OMAP3430_ST_UART1_MASK;
  377. padconf = 0x182;
  378. break;
  379. case 1:
  380. wk_mask = OMAP3430_ST_UART2_MASK;
  381. padconf = 0x17a;
  382. break;
  383. case 2:
  384. wk_mask = OMAP3430_ST_UART3_MASK;
  385. padconf = 0x19e;
  386. break;
  387. }
  388. uart->wk_mask = wk_mask;
  389. uart->padconf = padconf;
  390. } else if (cpu_is_omap24xx()) {
  391. u32 wk_mask = 0;
  392. if (cpu_is_omap2430()) {
  393. uart->wk_en = OMAP2430_PRM_REGADDR(CORE_MOD, PM_WKEN1);
  394. uart->wk_st = OMAP2430_PRM_REGADDR(CORE_MOD, PM_WKST1);
  395. } else if (cpu_is_omap2420()) {
  396. uart->wk_en = OMAP2420_PRM_REGADDR(CORE_MOD, PM_WKEN1);
  397. uart->wk_st = OMAP2420_PRM_REGADDR(CORE_MOD, PM_WKST1);
  398. }
  399. switch (uart->num) {
  400. case 0:
  401. wk_mask = OMAP24XX_ST_UART1_MASK;
  402. break;
  403. case 1:
  404. wk_mask = OMAP24XX_ST_UART2_MASK;
  405. break;
  406. case 2:
  407. wk_mask = OMAP24XX_ST_UART3_MASK;
  408. break;
  409. }
  410. uart->wk_mask = wk_mask;
  411. } else {
  412. uart->wk_en = 0;
  413. uart->wk_st = 0;
  414. uart->wk_mask = 0;
  415. uart->padconf = 0;
  416. }
  417. p->irqflags |= IRQF_SHARED;
  418. ret = request_irq(p->irq, omap_uart_interrupt, IRQF_SHARED,
  419. "serial idle", (void *)uart);
  420. WARN_ON(ret);
  421. }
  422. void omap_uart_enable_irqs(int enable)
  423. {
  424. int ret;
  425. struct omap_uart_state *uart;
  426. list_for_each_entry(uart, &uart_list, node) {
  427. if (enable)
  428. ret = request_irq(uart->p->irq, omap_uart_interrupt,
  429. IRQF_SHARED, "serial idle", (void *)uart);
  430. else
  431. free_irq(uart->p->irq, (void *)uart);
  432. }
  433. }
  434. static ssize_t sleep_timeout_show(struct device *dev,
  435. struct device_attribute *attr,
  436. char *buf)
  437. {
  438. struct platform_device *pdev = container_of(dev,
  439. struct platform_device, dev);
  440. struct omap_uart_state *uart = container_of(pdev,
  441. struct omap_uart_state, pdev);
  442. return sprintf(buf, "%u\n", uart->timeout / HZ);
  443. }
  444. static ssize_t sleep_timeout_store(struct device *dev,
  445. struct device_attribute *attr,
  446. const char *buf, size_t n)
  447. {
  448. struct platform_device *pdev = container_of(dev,
  449. struct platform_device, dev);
  450. struct omap_uart_state *uart = container_of(pdev,
  451. struct omap_uart_state, pdev);
  452. unsigned int value;
  453. if (sscanf(buf, "%u", &value) != 1) {
  454. printk(KERN_ERR "sleep_timeout_store: Invalid value\n");
  455. return -EINVAL;
  456. }
  457. uart->timeout = value * HZ;
  458. if (uart->timeout)
  459. mod_timer(&uart->timer, jiffies + uart->timeout);
  460. else
  461. /* A zero value means disable timeout feature */
  462. omap_uart_block_sleep(uart);
  463. return n;
  464. }
  465. DEVICE_ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store);
  466. #define DEV_CREATE_FILE(dev, attr) WARN_ON(device_create_file(dev, attr))
  467. #else
  468. static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
  469. #define DEV_CREATE_FILE(dev, attr)
  470. #endif /* CONFIG_PM */
  471. static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = {
  472. {
  473. .pdev = {
  474. .name = "serial8250",
  475. .id = PLAT8250_DEV_PLATFORM,
  476. .dev = {
  477. .platform_data = serial_platform_data0,
  478. },
  479. },
  480. }, {
  481. .pdev = {
  482. .name = "serial8250",
  483. .id = PLAT8250_DEV_PLATFORM1,
  484. .dev = {
  485. .platform_data = serial_platform_data1,
  486. },
  487. },
  488. }, {
  489. .pdev = {
  490. .name = "serial8250",
  491. .id = PLAT8250_DEV_PLATFORM2,
  492. .dev = {
  493. .platform_data = serial_platform_data2,
  494. },
  495. },
  496. },
  497. #ifdef CONFIG_ARCH_OMAP4
  498. {
  499. .pdev = {
  500. .name = "serial8250",
  501. .id = 3
  502. .dev = {
  503. .platform_data = serial_platform_data3,
  504. },
  505. },
  506. },
  507. #endif
  508. };
  509. void __init omap_serial_early_init(void)
  510. {
  511. int i;
  512. char name[16];
  513. /*
  514. * Make sure the serial ports are muxed on at this point.
  515. * You have to mux them off in device drivers later on
  516. * if not needed.
  517. */
  518. for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
  519. struct omap_uart_state *uart = &omap_uart[i];
  520. struct platform_device *pdev = &uart->pdev;
  521. struct device *dev = &pdev->dev;
  522. struct plat_serial8250_port *p = dev->platform_data;
  523. sprintf(name, "uart%d_ick", i+1);
  524. uart->ick = clk_get(NULL, name);
  525. if (IS_ERR(uart->ick)) {
  526. printk(KERN_ERR "Could not get uart%d_ick\n", i+1);
  527. uart->ick = NULL;
  528. }
  529. sprintf(name, "uart%d_fck", i+1);
  530. uart->fck = clk_get(NULL, name);
  531. if (IS_ERR(uart->fck)) {
  532. printk(KERN_ERR "Could not get uart%d_fck\n", i+1);
  533. uart->fck = NULL;
  534. }
  535. /* FIXME: Remove this once the clkdev is ready */
  536. if (!cpu_is_omap44xx()) {
  537. if (!uart->ick || !uart->fck)
  538. continue;
  539. }
  540. uart->num = i;
  541. p->private_data = uart;
  542. uart->p = p;
  543. list_add_tail(&uart->node, &uart_list);
  544. if (cpu_is_omap44xx())
  545. p->irq += 32;
  546. omap_uart_enable_clocks(uart);
  547. }
  548. }
  549. void __init omap_serial_init(void)
  550. {
  551. int i;
  552. for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
  553. struct omap_uart_state *uart = &omap_uart[i];
  554. struct platform_device *pdev = &uart->pdev;
  555. struct device *dev = &pdev->dev;
  556. omap_uart_reset(uart);
  557. omap_uart_idle_init(uart);
  558. if (WARN_ON(platform_device_register(pdev)))
  559. continue;
  560. if ((cpu_is_omap34xx() && uart->padconf) ||
  561. (uart->wk_en && uart->wk_mask)) {
  562. device_init_wakeup(dev, true);
  563. DEV_CREATE_FILE(dev, &dev_attr_sleep_timeout);
  564. }
  565. }
  566. }