sh_mipi_dsi.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. /*
  2. * Renesas SH-mobile MIPI DSI support
  3. *
  4. * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  5. *
  6. * This is free software; you can redistribute it and/or modify
  7. * it under the terms of version 2 of the GNU General Public License as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/bitmap.h>
  11. #include <linux/clk.h>
  12. #include <linux/delay.h>
  13. #include <linux/init.h>
  14. #include <linux/io.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/pm_runtime.h>
  17. #include <linux/slab.h>
  18. #include <linux/string.h>
  19. #include <linux/types.h>
  20. #include <linux/module.h>
  21. #include <video/mipi_display.h>
  22. #include <video/sh_mipi_dsi.h>
  23. #include <video/sh_mobile_lcdc.h>
  24. #include "sh_mobile_lcdcfb.h"
  25. #define SYSCTRL 0x0000
  26. #define SYSCONF 0x0004
  27. #define TIMSET 0x0008
  28. #define RESREQSET0 0x0018
  29. #define RESREQSET1 0x001c
  30. #define HSTTOVSET 0x0020
  31. #define LPRTOVSET 0x0024
  32. #define TATOVSET 0x0028
  33. #define PRTOVSET 0x002c
  34. #define DSICTRL 0x0030
  35. #define DSIINTE 0x0060
  36. #define PHYCTRL 0x0070
  37. /* relative to linkbase */
  38. #define DTCTR 0x0000
  39. #define VMCTR1 0x0020
  40. #define VMCTR2 0x0024
  41. #define VMLEN1 0x0028
  42. #define VMLEN2 0x002c
  43. #define CMTSRTREQ 0x0070
  44. #define CMTSRTCTR 0x00d0
  45. /* E.g., sh7372 has 2 MIPI-DSIs - one for each LCDC */
  46. #define MAX_SH_MIPI_DSI 2
  47. struct sh_mipi {
  48. struct sh_mobile_lcdc_entity entity;
  49. void __iomem *base;
  50. void __iomem *linkbase;
  51. struct clk *dsit_clk;
  52. struct platform_device *pdev;
  53. };
  54. #define to_sh_mipi(e) container_of(e, struct sh_mipi, entity)
  55. static struct sh_mipi *mipi_dsi[MAX_SH_MIPI_DSI];
  56. /* Protect the above array */
  57. static DEFINE_MUTEX(array_lock);
  58. static struct sh_mipi *sh_mipi_by_handle(int handle)
  59. {
  60. if (handle >= ARRAY_SIZE(mipi_dsi) || handle < 0)
  61. return NULL;
  62. return mipi_dsi[handle];
  63. }
  64. static int sh_mipi_send_short(struct sh_mipi *mipi, u8 dsi_cmd,
  65. u8 cmd, u8 param)
  66. {
  67. u32 data = (dsi_cmd << 24) | (cmd << 16) | (param << 8);
  68. int cnt = 100;
  69. /* transmit a short packet to LCD panel */
  70. iowrite32(1 | data, mipi->linkbase + CMTSRTCTR);
  71. iowrite32(1, mipi->linkbase + CMTSRTREQ);
  72. while ((ioread32(mipi->linkbase + CMTSRTREQ) & 1) && --cnt)
  73. udelay(1);
  74. return cnt ? 0 : -ETIMEDOUT;
  75. }
  76. #define LCD_CHAN2MIPI(c) ((c) < LCDC_CHAN_MAINLCD || (c) > LCDC_CHAN_SUBLCD ? \
  77. -EINVAL : (c) - 1)
  78. static int sh_mipi_dcs(int handle, u8 cmd)
  79. {
  80. struct sh_mipi *mipi = sh_mipi_by_handle(LCD_CHAN2MIPI(handle));
  81. if (!mipi)
  82. return -ENODEV;
  83. return sh_mipi_send_short(mipi, MIPI_DSI_DCS_SHORT_WRITE, cmd, 0);
  84. }
  85. static int sh_mipi_dcs_param(int handle, u8 cmd, u8 param)
  86. {
  87. struct sh_mipi *mipi = sh_mipi_by_handle(LCD_CHAN2MIPI(handle));
  88. if (!mipi)
  89. return -ENODEV;
  90. return sh_mipi_send_short(mipi, MIPI_DSI_DCS_SHORT_WRITE_PARAM, cmd,
  91. param);
  92. }
  93. static void sh_mipi_dsi_enable(struct sh_mipi *mipi, bool enable)
  94. {
  95. /*
  96. * enable LCDC data tx, transition to LPS after completion of each HS
  97. * packet
  98. */
  99. iowrite32(0x00000002 | enable, mipi->linkbase + DTCTR);
  100. }
  101. static void sh_mipi_shutdown(struct platform_device *pdev)
  102. {
  103. struct sh_mipi *mipi = to_sh_mipi(platform_get_drvdata(pdev));
  104. sh_mipi_dsi_enable(mipi, false);
  105. }
  106. static int sh_mipi_setup(struct sh_mipi *mipi, const struct fb_videomode *mode)
  107. {
  108. void __iomem *base = mipi->base;
  109. struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
  110. u32 pctype, datatype, pixfmt, linelength, vmctr2;
  111. u32 tmp, top, bottom, delay, div;
  112. int bpp;
  113. /*
  114. * Select data format. MIPI DSI is not hot-pluggable, so, we just use
  115. * the default videomode. If this ever becomes a problem, We'll have to
  116. * move this to mipi_display_on() above and use info->var.xres
  117. */
  118. switch (pdata->data_format) {
  119. case MIPI_RGB888:
  120. pctype = 0;
  121. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24;
  122. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  123. linelength = mode->xres * 3;
  124. break;
  125. case MIPI_RGB565:
  126. pctype = 1;
  127. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16;
  128. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  129. linelength = mode->xres * 2;
  130. break;
  131. case MIPI_RGB666_LP:
  132. pctype = 2;
  133. datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
  134. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  135. linelength = mode->xres * 3;
  136. break;
  137. case MIPI_RGB666:
  138. pctype = 3;
  139. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18;
  140. pixfmt = MIPI_DCS_PIXEL_FMT_18BIT;
  141. linelength = (mode->xres * 18 + 7) / 8;
  142. break;
  143. case MIPI_BGR888:
  144. pctype = 8;
  145. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24;
  146. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  147. linelength = mode->xres * 3;
  148. break;
  149. case MIPI_BGR565:
  150. pctype = 9;
  151. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16;
  152. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  153. linelength = mode->xres * 2;
  154. break;
  155. case MIPI_BGR666_LP:
  156. pctype = 0xa;
  157. datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
  158. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  159. linelength = mode->xres * 3;
  160. break;
  161. case MIPI_BGR666:
  162. pctype = 0xb;
  163. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18;
  164. pixfmt = MIPI_DCS_PIXEL_FMT_18BIT;
  165. linelength = (mode->xres * 18 + 7) / 8;
  166. break;
  167. case MIPI_YUYV:
  168. pctype = 4;
  169. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16;
  170. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  171. linelength = mode->xres * 2;
  172. break;
  173. case MIPI_UYVY:
  174. pctype = 5;
  175. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16;
  176. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  177. linelength = mode->xres * 2;
  178. break;
  179. case MIPI_YUV420_L:
  180. pctype = 6;
  181. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12;
  182. pixfmt = MIPI_DCS_PIXEL_FMT_12BIT;
  183. linelength = (mode->xres * 12 + 7) / 8;
  184. break;
  185. case MIPI_YUV420:
  186. pctype = 7;
  187. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12;
  188. pixfmt = MIPI_DCS_PIXEL_FMT_12BIT;
  189. /* Length of U/V line */
  190. linelength = (mode->xres + 1) / 2;
  191. break;
  192. default:
  193. return -EINVAL;
  194. }
  195. if (!pdata->lane)
  196. return -EINVAL;
  197. /* reset DSI link */
  198. iowrite32(0x00000001, base + SYSCTRL);
  199. /* Hold reset for 100 cycles of the slowest of bus, HS byte and LP clock */
  200. udelay(50);
  201. iowrite32(0x00000000, base + SYSCTRL);
  202. /* setup DSI link */
  203. /*
  204. * T_wakeup = 0x7000
  205. * T_hs-trail = 3
  206. * T_hs-prepare = 3
  207. * T_clk-trail = 3
  208. * T_clk-prepare = 2
  209. */
  210. iowrite32(0x70003332, base + TIMSET);
  211. /* no responses requested */
  212. iowrite32(0x00000000, base + RESREQSET0);
  213. /* request response to packets of type 0x28 */
  214. iowrite32(0x00000100, base + RESREQSET1);
  215. /* High-speed transmission timeout, default 0xffffffff */
  216. iowrite32(0x0fffffff, base + HSTTOVSET);
  217. /* LP reception timeout, default 0xffffffff */
  218. iowrite32(0x0fffffff, base + LPRTOVSET);
  219. /* Turn-around timeout, default 0xffffffff */
  220. iowrite32(0x0fffffff, base + TATOVSET);
  221. /* Peripheral reset timeout, default 0xffffffff */
  222. iowrite32(0x0fffffff, base + PRTOVSET);
  223. /* Interrupts not used, disable all */
  224. iowrite32(0, base + DSIINTE);
  225. /* DSI-Tx bias on */
  226. iowrite32(0x00000001, base + PHYCTRL);
  227. udelay(200);
  228. /* Deassert resets, power on */
  229. iowrite32(0x03070001 | pdata->phyctrl, base + PHYCTRL);
  230. /*
  231. * Default = ULPS enable |
  232. * Contention detection enabled |
  233. * EoT packet transmission enable |
  234. * CRC check enable |
  235. * ECC check enable
  236. */
  237. bitmap_fill((unsigned long *)&tmp, pdata->lane);
  238. tmp |= 0x00003700;
  239. iowrite32(tmp, base + SYSCONF);
  240. /* setup l-bridge */
  241. /*
  242. * Enable transmission of all packets,
  243. * transmit LPS after each HS packet completion
  244. */
  245. iowrite32(0x00000006, mipi->linkbase + DTCTR);
  246. /* VSYNC width = 2 (<< 17) */
  247. iowrite32((mode->vsync_len << pdata->vsynw_offset) |
  248. (pdata->clksrc << 16) | (pctype << 12) | datatype,
  249. mipi->linkbase + VMCTR1);
  250. /*
  251. * Non-burst mode with sync pulses: VSE and HSE are output,
  252. * HSA period allowed, no commands in LP
  253. */
  254. vmctr2 = 0;
  255. if (pdata->flags & SH_MIPI_DSI_VSEE)
  256. vmctr2 |= 1 << 23;
  257. if (pdata->flags & SH_MIPI_DSI_HSEE)
  258. vmctr2 |= 1 << 22;
  259. if (pdata->flags & SH_MIPI_DSI_HSAE)
  260. vmctr2 |= 1 << 21;
  261. if (pdata->flags & SH_MIPI_DSI_BL2E)
  262. vmctr2 |= 1 << 17;
  263. if (pdata->flags & SH_MIPI_DSI_HSABM)
  264. vmctr2 |= 1 << 5;
  265. if (pdata->flags & SH_MIPI_DSI_HBPBM)
  266. vmctr2 |= 1 << 4;
  267. if (pdata->flags & SH_MIPI_DSI_HFPBM)
  268. vmctr2 |= 1 << 3;
  269. iowrite32(vmctr2, mipi->linkbase + VMCTR2);
  270. /*
  271. * VMLEN1 = RGBLEN | HSALEN
  272. *
  273. * see
  274. * Video mode - Blanking Packet setting
  275. */
  276. top = linelength << 16; /* RGBLEN */
  277. bottom = 0x00000001;
  278. if (pdata->flags & SH_MIPI_DSI_HSABM) /* HSALEN */
  279. bottom = (pdata->lane * mode->hsync_len) - 10;
  280. iowrite32(top | bottom , mipi->linkbase + VMLEN1);
  281. /*
  282. * VMLEN2 = HBPLEN | HFPLEN
  283. *
  284. * see
  285. * Video mode - Blanking Packet setting
  286. */
  287. top = 0x00010000;
  288. bottom = 0x00000001;
  289. delay = 0;
  290. div = 1; /* HSbyteCLK is calculation base
  291. * HS4divCLK = HSbyteCLK/2
  292. * HS6divCLK is not supported for now */
  293. if (pdata->flags & SH_MIPI_DSI_HS4divCLK)
  294. div = 2;
  295. if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */
  296. top = mode->hsync_len + mode->left_margin;
  297. top = ((pdata->lane * top / div) - 10) << 16;
  298. }
  299. if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */
  300. bottom = mode->right_margin;
  301. bottom = (pdata->lane * bottom / div) - 12;
  302. }
  303. bpp = linelength / mode->xres; /* byte / pixel */
  304. if ((pdata->lane / div) > bpp) {
  305. tmp = mode->xres / bpp; /* output cycle */
  306. tmp = mode->xres - tmp; /* (input - output) cycle */
  307. delay = (pdata->lane * tmp);
  308. }
  309. iowrite32(top | (bottom + delay) , mipi->linkbase + VMLEN2);
  310. msleep(5);
  311. /* setup LCD panel */
  312. /* cf. drivers/video/omap/lcd_mipid.c */
  313. sh_mipi_dcs(pdata->channel, MIPI_DCS_EXIT_SLEEP_MODE);
  314. msleep(120);
  315. /*
  316. * [7] - Page Address Mode
  317. * [6] - Column Address Mode
  318. * [5] - Page / Column Address Mode
  319. * [4] - Display Device Line Refresh Order
  320. * [3] - RGB/BGR Order
  321. * [2] - Display Data Latch Data Order
  322. * [1] - Flip Horizontal
  323. * [0] - Flip Vertical
  324. */
  325. sh_mipi_dcs_param(pdata->channel, MIPI_DCS_SET_ADDRESS_MODE, 0x00);
  326. /* cf. set_data_lines() */
  327. sh_mipi_dcs_param(pdata->channel, MIPI_DCS_SET_PIXEL_FORMAT,
  328. pixfmt << 4);
  329. sh_mipi_dcs(pdata->channel, MIPI_DCS_SET_DISPLAY_ON);
  330. /* Enable timeout counters */
  331. iowrite32(0x00000f00, base + DSICTRL);
  332. return 0;
  333. }
  334. static int mipi_display_on(struct sh_mobile_lcdc_entity *entity)
  335. {
  336. struct sh_mipi *mipi = to_sh_mipi(entity);
  337. struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
  338. int ret;
  339. pm_runtime_get_sync(&mipi->pdev->dev);
  340. ret = pdata->set_dot_clock(mipi->pdev, mipi->base, 1);
  341. if (ret < 0)
  342. goto mipi_display_on_fail1;
  343. ret = sh_mipi_setup(mipi, &entity->def_mode);
  344. if (ret < 0)
  345. goto mipi_display_on_fail2;
  346. sh_mipi_dsi_enable(mipi, true);
  347. return SH_MOBILE_LCDC_DISPLAY_CONNECTED;
  348. mipi_display_on_fail1:
  349. pm_runtime_put_sync(&mipi->pdev->dev);
  350. mipi_display_on_fail2:
  351. pdata->set_dot_clock(mipi->pdev, mipi->base, 0);
  352. return ret;
  353. }
  354. static void mipi_display_off(struct sh_mobile_lcdc_entity *entity)
  355. {
  356. struct sh_mipi *mipi = to_sh_mipi(entity);
  357. struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
  358. sh_mipi_dsi_enable(mipi, false);
  359. pdata->set_dot_clock(mipi->pdev, mipi->base, 0);
  360. pm_runtime_put_sync(&mipi->pdev->dev);
  361. }
  362. static const struct sh_mobile_lcdc_entity_ops mipi_ops = {
  363. .display_on = mipi_display_on,
  364. .display_off = mipi_display_off,
  365. };
  366. static int __init sh_mipi_probe(struct platform_device *pdev)
  367. {
  368. struct sh_mipi *mipi;
  369. struct sh_mipi_dsi_info *pdata = pdev->dev.platform_data;
  370. struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  371. struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  372. unsigned long rate, f_current;
  373. int idx = pdev->id, ret;
  374. if (!res || !res2 || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
  375. return -ENODEV;
  376. if (!pdata->set_dot_clock)
  377. return -EINVAL;
  378. mutex_lock(&array_lock);
  379. if (idx < 0)
  380. for (idx = 0; idx < ARRAY_SIZE(mipi_dsi) && mipi_dsi[idx]; idx++)
  381. ;
  382. if (idx == ARRAY_SIZE(mipi_dsi)) {
  383. ret = -EBUSY;
  384. goto efindslot;
  385. }
  386. mipi = kzalloc(sizeof(*mipi), GFP_KERNEL);
  387. if (!mipi) {
  388. ret = -ENOMEM;
  389. goto ealloc;
  390. }
  391. mipi->entity.owner = THIS_MODULE;
  392. mipi->entity.ops = &mipi_ops;
  393. if (!request_mem_region(res->start, resource_size(res), pdev->name)) {
  394. dev_err(&pdev->dev, "MIPI register region already claimed\n");
  395. ret = -EBUSY;
  396. goto ereqreg;
  397. }
  398. mipi->base = ioremap(res->start, resource_size(res));
  399. if (!mipi->base) {
  400. ret = -ENOMEM;
  401. goto emap;
  402. }
  403. if (!request_mem_region(res2->start, resource_size(res2), pdev->name)) {
  404. dev_err(&pdev->dev, "MIPI register region 2 already claimed\n");
  405. ret = -EBUSY;
  406. goto ereqreg2;
  407. }
  408. mipi->linkbase = ioremap(res2->start, resource_size(res2));
  409. if (!mipi->linkbase) {
  410. ret = -ENOMEM;
  411. goto emap2;
  412. }
  413. mipi->pdev = pdev;
  414. mipi->dsit_clk = clk_get(&pdev->dev, "dsit_clk");
  415. if (IS_ERR(mipi->dsit_clk)) {
  416. ret = PTR_ERR(mipi->dsit_clk);
  417. goto eclktget;
  418. }
  419. f_current = clk_get_rate(mipi->dsit_clk);
  420. /* 80MHz required by the datasheet */
  421. rate = clk_round_rate(mipi->dsit_clk, 80000000);
  422. if (rate > 0 && rate != f_current)
  423. ret = clk_set_rate(mipi->dsit_clk, rate);
  424. else
  425. ret = rate;
  426. if (ret < 0)
  427. goto esettrate;
  428. dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
  429. ret = clk_enable(mipi->dsit_clk);
  430. if (ret < 0)
  431. goto eclkton;
  432. mipi_dsi[idx] = mipi;
  433. pm_runtime_enable(&pdev->dev);
  434. pm_runtime_resume(&pdev->dev);
  435. mutex_unlock(&array_lock);
  436. platform_set_drvdata(pdev, &mipi->entity);
  437. return 0;
  438. eclkton:
  439. esettrate:
  440. clk_put(mipi->dsit_clk);
  441. eclktget:
  442. iounmap(mipi->linkbase);
  443. emap2:
  444. release_mem_region(res2->start, resource_size(res2));
  445. ereqreg2:
  446. iounmap(mipi->base);
  447. emap:
  448. release_mem_region(res->start, resource_size(res));
  449. ereqreg:
  450. kfree(mipi);
  451. ealloc:
  452. efindslot:
  453. mutex_unlock(&array_lock);
  454. return ret;
  455. }
  456. static int sh_mipi_remove(struct platform_device *pdev)
  457. {
  458. struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  459. struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  460. struct sh_mipi *mipi = to_sh_mipi(platform_get_drvdata(pdev));
  461. int i, ret;
  462. mutex_lock(&array_lock);
  463. for (i = 0; i < ARRAY_SIZE(mipi_dsi) && mipi_dsi[i] != mipi; i++)
  464. ;
  465. if (i == ARRAY_SIZE(mipi_dsi)) {
  466. ret = -EINVAL;
  467. } else {
  468. ret = 0;
  469. mipi_dsi[i] = NULL;
  470. }
  471. mutex_unlock(&array_lock);
  472. if (ret < 0)
  473. return ret;
  474. pm_runtime_disable(&pdev->dev);
  475. clk_disable(mipi->dsit_clk);
  476. clk_put(mipi->dsit_clk);
  477. iounmap(mipi->linkbase);
  478. if (res2)
  479. release_mem_region(res2->start, resource_size(res2));
  480. iounmap(mipi->base);
  481. if (res)
  482. release_mem_region(res->start, resource_size(res));
  483. kfree(mipi);
  484. return 0;
  485. }
  486. static struct platform_driver sh_mipi_driver = {
  487. .remove = sh_mipi_remove,
  488. .shutdown = sh_mipi_shutdown,
  489. .driver = {
  490. .name = "sh-mipi-dsi",
  491. },
  492. };
  493. module_platform_driver_probe(sh_mipi_driver, sh_mipi_probe);
  494. MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
  495. MODULE_DESCRIPTION("SuperH / ARM-shmobile MIPI DSI driver");
  496. MODULE_LICENSE("GPL v2");