mt_gpio_base.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /******************************************************************************
  2. * mt_gpio_base.c - MTKLinux GPIO Device Driver
  3. *
  4. * Copyright 2008-2009 MediaTek Co.,Ltd.
  5. *
  6. * DESCRIPTION:
  7. * This file provid the other drivers GPIO relative functions
  8. *
  9. ******************************************************************************/
  10. #include <6735_gpio.h>
  11. #include <linux/types.h>
  12. #include "mt-plat/sync_write.h"
  13. #include <mt-plat/mt_gpio.h>
  14. #include <mt-plat/mt_gpio_core.h>
  15. #include <mt_gpio_base.h>
  16. /* autogen */
  17. #include <gpio_cfg.h>
  18. #ifdef CONFIG_OF
  19. #include <linux/of_address.h>
  20. #endif
  21. /* unsigned long GPIO_COUNT=0; */
  22. /* unsigned long uart_base; */
  23. /* #define GPIO_BRINGUP 1 */
  24. long gpio_pull_select_unsupport[MAX_GPIO_PIN] = { 0 };
  25. long gpio_pullen_unsupport[MAX_GPIO_PIN] = { 0 };
  26. long gpio_smt_unsupport[MAX_GPIO_PIN] = { 0 };
  27. struct mt_gpio_vbase gpio_vbase;
  28. int mt6306_set_gpio_out(unsigned long pin, unsigned long output)
  29. {
  30. GPIOERR("denali not support\n");
  31. return 0;
  32. }
  33. int mt6306_set_gpio_dir(unsigned long pin, unsigned long dir)
  34. {
  35. GPIOERR("denali not support\n");
  36. return 0;
  37. }
  38. /*---------------------------------------------------------------------------*/
  39. int mt_set_gpio_dir_base(unsigned long pin, unsigned long dir)
  40. {
  41. unsigned long bit;
  42. if (pin >= MAX_GPIO_PIN)
  43. return -ERINVAL;
  44. if (dir >= GPIO_DIR_MAX)
  45. return -ERINVAL;
  46. /* GPIOERR("before pin:%ld, dir:%ld\n",pin,dir); */
  47. /* pos = pin / MAX_GPIO_REG_BITS; */
  48. bit = DIR_offset[pin].offset;
  49. #ifdef GPIO_BRINGUP
  50. reg = GPIO_RD32(DIR_addr[pin].addr);
  51. if (dir == GPIO_DIR_IN)
  52. reg &= (~(1 << bit));
  53. else
  54. reg |= (1 << bit);
  55. GPIO_WR32(DIR_addr[pin].addr, reg);
  56. #else
  57. if (dir == GPIO_DIR_IN)
  58. GPIO_SET_BITS((1L << bit), DIR_addr[pin].addr + 8);
  59. else
  60. GPIO_SET_BITS((1L << bit), DIR_addr[pin].addr + 4);
  61. #endif
  62. /* GPIOERR("%s:pin:%ld, dir:%ld, value:0x%x\n",__FUNCTION__, pin, dir, GPIO_RD32(DIR_addr[pin].addr)); */
  63. return RSUCCESS;
  64. }
  65. /*---------------------------------------------------------------------------*/
  66. int mt_get_gpio_dir_base(unsigned long pin)
  67. {
  68. unsigned long bit;
  69. unsigned long reg;
  70. if (pin >= MAX_GPIO_PIN)
  71. return -ERINVAL;
  72. bit = DIR_offset[pin].offset;
  73. reg = GPIO_RD32(DIR_addr[pin].addr);
  74. return ((reg & (1L << bit)) != 0) ? 1 : 0;
  75. }
  76. /*---------------------------------------------------------------------------*/
  77. int mt_set_gpio_pull_enable_base(unsigned long pin, unsigned long enable)
  78. {
  79. if (pin >= MAX_GPIO_PIN)
  80. return -ERINVAL;
  81. #ifdef GPIO_BRINGUP
  82. bit = PULLEN_offset[pin].offset;
  83. if (PULLEN_offset[pin].offset == -1)
  84. return GPIO_PULL_EN_UNSUPPORTED;
  85. reg = GPIO_RD32(PULLEN_addr[pin].addr);
  86. if (enable == GPIO_PULL_DISABLE)
  87. reg &= (~(1 << bit));
  88. else
  89. reg |= (1 << bit);
  90. GPIO_WR32(PULLEN_addr[pin].addr, reg);
  91. #else
  92. if (PULLEN_offset[pin].offset == -1) {
  93. gpio_pullen_unsupport[pin] = -1;
  94. return GPIO_PULL_EN_UNSUPPORTED;
  95. }
  96. if (enable == GPIO_PULL_DISABLE)
  97. GPIO_SET_BITS((1L << (PULLEN_offset[pin].offset)),
  98. PULLEN_addr[pin].addr + 8);
  99. else
  100. GPIO_SET_BITS((1L << (PULLEN_offset[pin].offset)),
  101. PULLEN_addr[pin].addr + 4);
  102. #endif
  103. return RSUCCESS;
  104. }
  105. /*---------------------------------------------------------------------------*/
  106. int mt_get_gpio_pull_enable_base(unsigned long pin)
  107. {
  108. unsigned long data;
  109. u32 bit = 0;
  110. if (pin >= MAX_GPIO_PIN)
  111. return -ERINVAL;
  112. if (PULLEN_offset[pin].offset == -1 && pupd_offset[pin].offset == -1)
  113. return GPIO_PULL_EN_UNSUPPORTED;
  114. if (PULLEN_offset[pin].offset != -1) {
  115. bit = PULLEN_offset[pin].offset;
  116. data = GPIO_RD32(PULLEN_addr[pin].addr);
  117. return ((data & (1L << bit)) != 0) ? 1 : 0;
  118. }
  119. bit = pupd_offset[pin].offset;
  120. data = GPIO_RD32(pupd_addr[pin].addr);
  121. return ((data & (0x7 << bit)) != 0) ? 1 : 0;
  122. }
  123. /*---------------------------------------------------------------------------*/
  124. int mt_set_gpio_smt_base(unsigned long pin, unsigned long enable)
  125. {
  126. /* unsigned long flags; */
  127. if (pin >= MAX_GPIO_PIN)
  128. return -ERINVAL;
  129. #ifdef GPIO_BRINGUP
  130. if (SMT_offset[pin].offset == -1) {
  131. return GPIO_SMT_UNSUPPORTED;
  132. } else {
  133. bit = SMT_offset[pin].offset;
  134. reg = GPIO_RD32(SMT_addr[pin].addr);
  135. if (enable == GPIO_SMT_DISABLE)
  136. reg &= (~(1 << bit));
  137. else
  138. reg |= (1 << bit);
  139. }
  140. /* printk("SMT addr(%x),value(%x)\n",SMT_addr[pin].addr,GPIO_RD32(SMT_addr[pin].addr)); */
  141. GPIO_WR32(SMT_addr[pin].addr, reg);
  142. #else
  143. if (SMT_offset[pin].offset == -1) {
  144. gpio_smt_unsupport[pin] = -1;
  145. return GPIO_SMT_UNSUPPORTED;
  146. }
  147. if (enable == GPIO_SMT_DISABLE)
  148. GPIO_SET_BITS((1L << (SMT_offset[pin].offset)), SMT_addr[pin].addr + 8);
  149. else
  150. GPIO_SET_BITS((1L << (SMT_offset[pin].offset)), SMT_addr[pin].addr + 4);
  151. #endif
  152. /* GPIOERR("%s:pin:%ld, enable:%ld, value:0x%x\n",__FUNCTION__, pin, enable, GPIO_RD32(SMT_addr[pin].addr)); */
  153. return RSUCCESS;
  154. }
  155. /*---------------------------------------------------------------------------*/
  156. int mt_get_gpio_smt_base(unsigned long pin)
  157. {
  158. unsigned long data;
  159. unsigned long bit = 0;
  160. bit = SMT_offset[pin].offset;
  161. if (pin >= MAX_GPIO_PIN)
  162. return -ERINVAL;
  163. if (SMT_offset[pin].offset == -1)
  164. return GPIO_SMT_UNSUPPORTED;
  165. data = GPIO_RD32(SMT_addr[pin].addr);
  166. return ((data & (1L << bit)) != 0) ? 1 : 0;
  167. }
  168. /*---------------------------------------------------------------------------*/
  169. int mt_set_gpio_ies_base(unsigned long pin, unsigned long enable)
  170. {
  171. /* unsigned long flags; */
  172. if (pin >= MAX_GPIO_PIN)
  173. return -ERINVAL;
  174. if (IES_offset[pin].offset == -1)
  175. return GPIO_IES_UNSUPPORTED;
  176. if (enable == GPIO_IES_DISABLE)
  177. GPIO_SET_BITS((1L << (IES_offset[pin].offset)), IES_addr[pin].addr + 8);
  178. else
  179. GPIO_SET_BITS((1L << (IES_offset[pin].offset)), IES_addr[pin].addr + 4);
  180. return RSUCCESS;
  181. }
  182. /*---------------------------------------------------------------------------*/
  183. int mt_get_gpio_ies_base(unsigned long pin)
  184. {
  185. unsigned long data;
  186. if (pin >= MAX_GPIO_PIN)
  187. return -ERINVAL;
  188. if (IES_offset[pin].offset == -1)
  189. return GPIO_IES_UNSUPPORTED;
  190. data = GPIO_RD32(IES_addr[pin].addr);
  191. return ((data & (1L << (IES_offset[pin].offset))) != 0) ? 1 : 0;
  192. }
  193. /*---------------------------------------------------------------------------*/
  194. int mt_set_gpio_pull_select_base(unsigned long pin, unsigned long select)
  195. {
  196. /* unsigned long flags; */
  197. unsigned long bit = 0;
  198. /*u32 mask = (1L << 4) - 1;*/
  199. if (pin >= MAX_GPIO_PIN)
  200. return -ERINVAL;
  201. if (pin == 5) {
  202. pr_err("XXX MSDC SD CD PIN be touched!\n");
  203. dump_stack();
  204. }
  205. #ifdef GPIO_BRINGUP
  206. if (PULL_offset[pin].offset == -1 && pupd_offset[pin].offset == -1)
  207. return GPIO_PULL_UNSUPPORTED;
  208. if (pin >= 160 && pin <= 165) {
  209. bit = pupd_offset[pin].offset;
  210. reg = GPIO_RD32(pupd_addr[pin].addr);
  211. if (select == GPIO_PULL_UP) { /* 0x2 pull up */
  212. reg &= (~(mask << bit));
  213. reg |= (0x2 << bit);
  214. } else { /* 0x6 pull down */
  215. reg &= (~(mask << bit));
  216. reg |= (0x6 << bit);
  217. }
  218. /* printk("fwq pullset pin=%d,3.............\n",pin); */
  219. GPIO_WR32(pupd_addr[pin].addr, reg);
  220. return RSUCCESS;
  221. }
  222. /* printk("fwq pullset pin=%d,select(%d)\n",pin,select); */
  223. if (PULL_offset[pin].offset != -1) {
  224. bit = PULL_offset[pin].offset;
  225. reg = GPIO_RD32(PULL_addr[pin].addr);
  226. if (select == GPIO_PULL_DOWN)
  227. reg &= (~(1 << bit));
  228. else
  229. reg |= (1 << bit);
  230. /* printk("fwq pullset pin=%d,2.............\n",pin); */
  231. GPIO_WR32(PULL_addr[pin].addr, reg);
  232. } else {
  233. bit = pupd_offset[pin].offset + 2;
  234. reg = GPIO_RD32(pupd_addr[pin].addr);
  235. if (select == GPIO_PULL_UP)
  236. reg &= (~(1 << bit));
  237. else
  238. reg |= (1 << bit);
  239. /* printk("fwq pullset pin=%d,3.............\n",pin); */
  240. GPIO_WR32(pupd_addr[pin].addr, reg);
  241. }
  242. #else
  243. if ((PULL_offset[pin].offset == -1) && (pupd_offset[pin].offset == -1)) {
  244. gpio_pull_select_unsupport[pin] = -1;
  245. return GPIO_PULL_UNSUPPORTED;
  246. }
  247. /* printk("fwq pullset pin=%ld,1.............\n",pin); */
  248. if (pin >= 160 && pin <= 165) {
  249. if (select == GPIO_PULL_UP) { /* 0x2 pull up */
  250. /* reg &= (~(mask << bit)); */
  251. /* reg |= (0x2 << bit); */
  252. GPIO_SET_BITS((2L << (pupd_offset[pin].offset)), pupd_addr[pin].addr + 4);
  253. } else { /* 0x6 pull down */
  254. /* reg &= (~(mask << bit)); */
  255. /* reg |= (0x6 << bit); */
  256. GPIO_SET_BITS((6L << (pupd_offset[pin].offset)), pupd_addr[pin].addr + 4);
  257. }
  258. return RSUCCESS;
  259. }
  260. /* printk("fwq pullset pin=%ld,2.............\n",pin); */
  261. /* printk("fwq pullset pin=%d,select(%d)\n",pin,select); */
  262. if (PULL_offset[pin].offset != -1) {
  263. bit = PULL_offset[pin].offset;
  264. /* reg = GPIO_RD32(PULL_addr[pin].addr); */
  265. if (select == GPIO_PULL_DOWN)
  266. GPIO_SET_BITS((1L << bit), PULL_addr[pin].addr + 8);
  267. else
  268. GPIO_SET_BITS((1L << bit), PULL_addr[pin].addr + 4);
  269. /* printk("fwq pullset pin=%d,2.............\n",pin); */
  270. } else {
  271. bit = pupd_offset[pin].offset + 2;
  272. /* reg = GPIO_RD32(pupd_addr[pin].addr); */
  273. if (select == GPIO_PULL_UP)
  274. GPIO_SET_BITS((1L << (bit)), pupd_addr[pin].addr + 8);
  275. else
  276. GPIO_SET_BITS((1L << (bit)), pupd_addr[pin].addr + 4);
  277. }
  278. #endif
  279. /* GPIOERR("%s:pin:%ld, select:%ld, value:0x%x\n",__FUNCTION__, pin, select, GPIO_RD32(PULL_addr[pin].addr)); */
  280. return RSUCCESS;
  281. }
  282. /*---------------------------------------------------------------------------*/
  283. int mt_get_gpio_pull_select_base(unsigned long pin)
  284. {
  285. unsigned long data;
  286. unsigned long bit = 0;
  287. u32 mask = (1L << 4) - 1;
  288. if (pin >= 160 && pin <= 165) {
  289. bit = pupd_offset[pin].offset;
  290. data = GPIO_RD32(pupd_addr[pin].addr);
  291. return ((((data >> bit) & mask) == 0x2)) ? 1 : 0;
  292. }
  293. if ((PULL_offset[pin].offset == -1) && (pupd_offset[pin].offset == -1))
  294. return GPIO_PULL_UNSUPPORTED;
  295. if (PULL_offset[pin].offset == -1) {
  296. data = GPIO_RD32(pupd_addr[pin].addr);
  297. return ((data & (1L << (pupd_offset[pin].offset + 2))) != 0) ? 0 : 1;
  298. }
  299. data = GPIO_RD32(PULL_addr[pin].addr);
  300. return ((data & (1L << (PULL_offset[pin].offset))) != 0) ? 1 : 0;
  301. }
  302. /*---------------------------------------------------------------------------*/
  303. int mt_set_gpio_inversion_base(unsigned long pin, unsigned long enable)
  304. { /*FIX-ME
  305. */
  306. return RSUCCESS;
  307. }
  308. /*---------------------------------------------------------------------------*/
  309. int mt_get_gpio_inversion_base(unsigned long pin)
  310. { /*FIX-ME */
  311. return 0; /* FIX-ME */
  312. }
  313. /*---------------------------------------------------------------------------*/
  314. int mt_set_gpio_out_base(unsigned long pin, unsigned long output)
  315. {
  316. unsigned long bit;
  317. if (pin >= MAX_GPIO_PIN)
  318. return -ERINVAL;
  319. if (output >= GPIO_OUT_MAX)
  320. return -ERINVAL;
  321. /* GPIOERR("before pin:%ld, output:%ld\n",pin,output); */
  322. bit = DATAOUT_offset[pin].offset;
  323. #ifdef GPIO_BRINGUP
  324. reg = GPIO_RD32(DATAOUT_addr[pin].addr);
  325. GPIOERR("before2 pin[%ld],addr=%lx\n", pin, DATAOUT_addr[pin].addr);
  326. if (output == GPIO_OUT_ZERO)
  327. reg &= (~(1 << bit));
  328. else
  329. reg |= (1 << bit);
  330. GPIO_WR32(DATAOUT_addr[pin].addr, reg);
  331. #else
  332. if (output == GPIO_OUT_ZERO)
  333. GPIO_SET_BITS((1L << bit), DATAOUT_addr[pin].addr + 8);
  334. else
  335. GPIO_SET_BITS((1L << bit), DATAOUT_addr[pin].addr + 4);
  336. #endif
  337. return RSUCCESS;
  338. }
  339. /*---------------------------------------------------------------------------*/
  340. int mt_get_gpio_out_base(unsigned long pin)
  341. {
  342. unsigned long bit;
  343. unsigned long reg;
  344. if (pin >= MAX_GPIO_PIN)
  345. return -ERINVAL;
  346. bit = DATAOUT_offset[pin].offset;
  347. reg = GPIO_RD32(DATAOUT_addr[pin].addr);
  348. return ((reg & (1L << bit)) != 0) ? 1 : 0;
  349. }
  350. /*---------------------------------------------------------------------------*/
  351. int mt_get_gpio_in_base(unsigned long pin)
  352. {
  353. unsigned long bit;
  354. unsigned long reg;
  355. if (pin >= MAX_GPIO_PIN)
  356. return -ERINVAL;
  357. bit = DIN_offset[pin].offset;
  358. reg = GPIO_RD32(DIN_addr[pin].addr);
  359. return ((reg & (1L << bit)) != 0) ? 1 : 0;
  360. }
  361. /*---------------------------------------------------------------------------*/
  362. int mt_set_gpio_mode_base(unsigned long pin, unsigned long mode)
  363. {
  364. unsigned long bit;
  365. unsigned long reg;
  366. unsigned long mask = (1L << GPIO_MODE_BITS) - 1;
  367. if (pin >= MAX_GPIO_PIN)
  368. return -ERINVAL;
  369. if (mode >= GPIO_MODE_MAX)
  370. return -ERINVAL;
  371. /* pos = pin / MAX_GPIO_MODE_PER_REG; */
  372. bit = MODE_offset[pin].offset;
  373. /* GPIOERR("modebefore1 set pin[%ld],addr=%lx,(%p,%p)\n", pin, MODE_addr[pin].addr, GPIO_BASE,
  374. (GPIO_BASE + MODE_addr[pin].addr)); */
  375. /* #ifdef GPIO_BRINGUP */
  376. #if 1
  377. mode = mode & mask;
  378. /* printk("fwq pin=%d,mode=%d, offset=%d\n",pin,mode,bit); */
  379. reg = GPIO_RD32(MODE_addr[pin].addr);
  380. /* printk("fwq pin=%d,beforereg[%x]=%x\n",pin,MODE_addr[pin].addr,reg); */
  381. reg &= (~(mask << bit));
  382. /* printk("fwq pin=%d,clr=%x\n",pin,~(mask << (GPIO_MODE_BITS*bit))); */
  383. reg |= (mode << bit);
  384. /* printk("fwq pin=%d,reg[%x]=%x\n",pin,MODE_addr[pin].addr,reg); */
  385. GPIO_WR32(MODE_addr[pin].addr, reg);
  386. /* printk("fwq pin=%d,moderead=%x\n",pin,GPIO_RD32(MODE_addr[pin].addr)); */
  387. #else
  388. if (0 == mode)
  389. GPIO_SET_BITS((mask << bit), MODE_addr[pin].addr + 8);
  390. else {
  391. /* GPIO_SET_BITS((mask << bit), MODE_addr[pin].addr+8); */
  392. GPIO_SET_BITS((mode << bit), MODE_addr[pin].addr + 4);
  393. }
  394. #endif
  395. /* GPIOERR("%s:pin:%ld, mode:%ld, value:0x%x\n", __func__, pin, mode,
  396. GPIO_RD32(MODE_addr[pin].addr)); */
  397. return RSUCCESS;
  398. }
  399. /*---------------------------------------------------------------------------*/
  400. int mt_get_gpio_mode_base(unsigned long pin)
  401. {
  402. unsigned long bit;
  403. unsigned long reg;
  404. unsigned long mask = (1L << GPIO_MODE_BITS) - 1;
  405. /* struct mt_gpio_obj *obj = gpio_obj; */
  406. if (pin >= MAX_GPIO_PIN)
  407. return -ERINVAL;
  408. bit = MODE_offset[pin].offset;
  409. /* printf("fwqread bit=%d,offset=%d",bit,MODE_offset[pin].offset); */
  410. /* reg = GPIO_RD32(&obj->reg->mode[pos].val); */
  411. reg = GPIO_RD32(MODE_addr[pin].addr);
  412. /* printf("fwqread pin=%d,moderead=%x, bit=%d\n",pin,GPIO_RD32(MODE_addr[pin].addr),bit); */
  413. return (reg >> bit) & mask;
  414. }
  415. /*---------------------------------------------------------------------------*/
  416. void get_gpio_vbase(struct device_node *node)
  417. {
  418. /* compatible with HAL */
  419. if (!(gpio_vbase.gpio_regs)) {
  420. gpio_vbase.gpio_regs = of_iomap(node, 0);
  421. if (!gpio_vbase.gpio_regs) {
  422. GPIOERR("GPIO base addr is NULL\n");
  423. return;
  424. }
  425. /* gpio_reg = (GPIO_REGS*)(GPIO_BASE); */
  426. GPIOERR("GPIO base add is 0x%p\n", gpio_vbase.gpio_regs);
  427. }
  428. GPIOERR("GPIO base addr is 0x%p, %s\n", gpio_vbase.gpio_regs, __func__);
  429. }
  430. /*-----------------------User need GPIO APIs before GPIO probe------------------*/
  431. static int __init get_gpio_vbase_early(void)
  432. {
  433. /* void __iomem *gpio_base = NULL; */
  434. struct device_node *np_gpio = NULL;
  435. gpio_vbase.gpio_regs = NULL;
  436. np_gpio = get_gpio_np();
  437. /* Setup IO addresses */
  438. gpio_vbase.gpio_regs = of_iomap(np_gpio, 0);
  439. if (!gpio_vbase.gpio_regs) {
  440. GPIOERR("GPIO base addr is NULL\n");
  441. return 0;
  442. }
  443. /* gpio_reg = (GPIO_REGS*)(GPIO_BASE); */
  444. GPIOERR("GPIO base addr is 0x%p, %s\n", gpio_vbase.gpio_regs, __func__);
  445. return 0;
  446. }
  447. postcore_initcall(get_gpio_vbase_early);
  448. /*---------------------------------------------------------------------------*/
  449. void get_io_cfg_vbase(void)
  450. {
  451. /* compatible with HAL */
  452. }
  453. /*---------------------------------------------------------------------------*/
  454. /*---------------------------------------------------------------------------*/
  455. #ifdef CONFIG_PM
  456. /*---------------------------------------------------------------------------*/
  457. void mt_gpio_suspend(void)
  458. {
  459. /* compatible with HAL */
  460. }
  461. /*---------------------------------------------------------------------------*/
  462. void mt_gpio_resume(void)
  463. {
  464. /* compatible with HAL */
  465. }
  466. /*---------------------------------------------------------------------------*/
  467. #endif /*CONFIG_PM */
  468. /*---------------------------------------------------------------------------*/