soc_mediabus.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. /*
  2. * soc-camera media bus helper routines
  3. *
  4. * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  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 version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/module.h>
  12. #include <media/v4l2-device.h>
  13. #include <media/v4l2-mediabus.h>
  14. #include <media/soc_mediabus.h>
  15. static const struct soc_mbus_lookup mbus_fmt[] = {
  16. {
  17. .code = MEDIA_BUS_FMT_YUYV8_2X8,
  18. .fmt = {
  19. .fourcc = V4L2_PIX_FMT_YUYV,
  20. .name = "YUYV",
  21. .bits_per_sample = 8,
  22. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  23. .order = SOC_MBUS_ORDER_LE,
  24. .layout = SOC_MBUS_LAYOUT_PACKED,
  25. },
  26. }, {
  27. .code = MEDIA_BUS_FMT_YVYU8_2X8,
  28. .fmt = {
  29. .fourcc = V4L2_PIX_FMT_YVYU,
  30. .name = "YVYU",
  31. .bits_per_sample = 8,
  32. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  33. .order = SOC_MBUS_ORDER_LE,
  34. .layout = SOC_MBUS_LAYOUT_PACKED,
  35. },
  36. }, {
  37. .code = MEDIA_BUS_FMT_UYVY8_2X8,
  38. .fmt = {
  39. .fourcc = V4L2_PIX_FMT_UYVY,
  40. .name = "UYVY",
  41. .bits_per_sample = 8,
  42. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  43. .order = SOC_MBUS_ORDER_LE,
  44. .layout = SOC_MBUS_LAYOUT_PACKED,
  45. },
  46. }, {
  47. .code = MEDIA_BUS_FMT_VYUY8_2X8,
  48. .fmt = {
  49. .fourcc = V4L2_PIX_FMT_VYUY,
  50. .name = "VYUY",
  51. .bits_per_sample = 8,
  52. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  53. .order = SOC_MBUS_ORDER_LE,
  54. .layout = SOC_MBUS_LAYOUT_PACKED,
  55. },
  56. }, {
  57. .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
  58. .fmt = {
  59. .fourcc = V4L2_PIX_FMT_RGB555,
  60. .name = "RGB555",
  61. .bits_per_sample = 8,
  62. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  63. .order = SOC_MBUS_ORDER_LE,
  64. .layout = SOC_MBUS_LAYOUT_PACKED,
  65. },
  66. }, {
  67. .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
  68. .fmt = {
  69. .fourcc = V4L2_PIX_FMT_RGB555X,
  70. .name = "RGB555X",
  71. .bits_per_sample = 8,
  72. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  73. .order = SOC_MBUS_ORDER_BE,
  74. .layout = SOC_MBUS_LAYOUT_PACKED,
  75. },
  76. }, {
  77. .code = MEDIA_BUS_FMT_RGB565_2X8_LE,
  78. .fmt = {
  79. .fourcc = V4L2_PIX_FMT_RGB565,
  80. .name = "RGB565",
  81. .bits_per_sample = 8,
  82. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  83. .order = SOC_MBUS_ORDER_LE,
  84. .layout = SOC_MBUS_LAYOUT_PACKED,
  85. },
  86. }, {
  87. .code = MEDIA_BUS_FMT_RGB565_2X8_BE,
  88. .fmt = {
  89. .fourcc = V4L2_PIX_FMT_RGB565X,
  90. .name = "RGB565X",
  91. .bits_per_sample = 8,
  92. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  93. .order = SOC_MBUS_ORDER_BE,
  94. .layout = SOC_MBUS_LAYOUT_PACKED,
  95. },
  96. }, {
  97. .code = MEDIA_BUS_FMT_RGB666_1X18,
  98. .fmt = {
  99. .fourcc = V4L2_PIX_FMT_RGB32,
  100. .name = "RGB666/32bpp",
  101. .bits_per_sample = 18,
  102. .packing = SOC_MBUS_PACKING_EXTEND32,
  103. .order = SOC_MBUS_ORDER_LE,
  104. },
  105. }, {
  106. .code = MEDIA_BUS_FMT_RGB888_1X24,
  107. .fmt = {
  108. .fourcc = V4L2_PIX_FMT_RGB32,
  109. .name = "RGB888/32bpp",
  110. .bits_per_sample = 24,
  111. .packing = SOC_MBUS_PACKING_EXTEND32,
  112. .order = SOC_MBUS_ORDER_LE,
  113. },
  114. }, {
  115. .code = MEDIA_BUS_FMT_RGB888_2X12_BE,
  116. .fmt = {
  117. .fourcc = V4L2_PIX_FMT_RGB32,
  118. .name = "RGB888/32bpp",
  119. .bits_per_sample = 12,
  120. .packing = SOC_MBUS_PACKING_EXTEND32,
  121. .order = SOC_MBUS_ORDER_BE,
  122. },
  123. }, {
  124. .code = MEDIA_BUS_FMT_RGB888_2X12_LE,
  125. .fmt = {
  126. .fourcc = V4L2_PIX_FMT_RGB32,
  127. .name = "RGB888/32bpp",
  128. .bits_per_sample = 12,
  129. .packing = SOC_MBUS_PACKING_EXTEND32,
  130. .order = SOC_MBUS_ORDER_LE,
  131. },
  132. }, {
  133. .code = MEDIA_BUS_FMT_SBGGR8_1X8,
  134. .fmt = {
  135. .fourcc = V4L2_PIX_FMT_SBGGR8,
  136. .name = "Bayer 8 BGGR",
  137. .bits_per_sample = 8,
  138. .packing = SOC_MBUS_PACKING_NONE,
  139. .order = SOC_MBUS_ORDER_LE,
  140. .layout = SOC_MBUS_LAYOUT_PACKED,
  141. },
  142. }, {
  143. .code = MEDIA_BUS_FMT_SBGGR10_1X10,
  144. .fmt = {
  145. .fourcc = V4L2_PIX_FMT_SBGGR10,
  146. .name = "Bayer 10 BGGR",
  147. .bits_per_sample = 10,
  148. .packing = SOC_MBUS_PACKING_EXTEND16,
  149. .order = SOC_MBUS_ORDER_LE,
  150. .layout = SOC_MBUS_LAYOUT_PACKED,
  151. },
  152. }, {
  153. .code = MEDIA_BUS_FMT_Y8_1X8,
  154. .fmt = {
  155. .fourcc = V4L2_PIX_FMT_GREY,
  156. .name = "Grey",
  157. .bits_per_sample = 8,
  158. .packing = SOC_MBUS_PACKING_NONE,
  159. .order = SOC_MBUS_ORDER_LE,
  160. .layout = SOC_MBUS_LAYOUT_PACKED,
  161. },
  162. }, {
  163. .code = MEDIA_BUS_FMT_Y10_1X10,
  164. .fmt = {
  165. .fourcc = V4L2_PIX_FMT_Y10,
  166. .name = "Grey 10bit",
  167. .bits_per_sample = 10,
  168. .packing = SOC_MBUS_PACKING_EXTEND16,
  169. .order = SOC_MBUS_ORDER_LE,
  170. .layout = SOC_MBUS_LAYOUT_PACKED,
  171. },
  172. }, {
  173. .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE,
  174. .fmt = {
  175. .fourcc = V4L2_PIX_FMT_SBGGR10,
  176. .name = "Bayer 10 BGGR",
  177. .bits_per_sample = 8,
  178. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  179. .order = SOC_MBUS_ORDER_LE,
  180. .layout = SOC_MBUS_LAYOUT_PACKED,
  181. },
  182. }, {
  183. .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE,
  184. .fmt = {
  185. .fourcc = V4L2_PIX_FMT_SBGGR10,
  186. .name = "Bayer 10 BGGR",
  187. .bits_per_sample = 8,
  188. .packing = SOC_MBUS_PACKING_2X8_PADLO,
  189. .order = SOC_MBUS_ORDER_LE,
  190. .layout = SOC_MBUS_LAYOUT_PACKED,
  191. },
  192. }, {
  193. .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE,
  194. .fmt = {
  195. .fourcc = V4L2_PIX_FMT_SBGGR10,
  196. .name = "Bayer 10 BGGR",
  197. .bits_per_sample = 8,
  198. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  199. .order = SOC_MBUS_ORDER_BE,
  200. .layout = SOC_MBUS_LAYOUT_PACKED,
  201. },
  202. }, {
  203. .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE,
  204. .fmt = {
  205. .fourcc = V4L2_PIX_FMT_SBGGR10,
  206. .name = "Bayer 10 BGGR",
  207. .bits_per_sample = 8,
  208. .packing = SOC_MBUS_PACKING_2X8_PADLO,
  209. .order = SOC_MBUS_ORDER_BE,
  210. .layout = SOC_MBUS_LAYOUT_PACKED,
  211. },
  212. }, {
  213. .code = MEDIA_BUS_FMT_JPEG_1X8,
  214. .fmt = {
  215. .fourcc = V4L2_PIX_FMT_JPEG,
  216. .name = "JPEG",
  217. .bits_per_sample = 8,
  218. .packing = SOC_MBUS_PACKING_VARIABLE,
  219. .order = SOC_MBUS_ORDER_LE,
  220. .layout = SOC_MBUS_LAYOUT_PACKED,
  221. },
  222. }, {
  223. .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE,
  224. .fmt = {
  225. .fourcc = V4L2_PIX_FMT_RGB444,
  226. .name = "RGB444",
  227. .bits_per_sample = 8,
  228. .packing = SOC_MBUS_PACKING_2X8_PADHI,
  229. .order = SOC_MBUS_ORDER_BE,
  230. .layout = SOC_MBUS_LAYOUT_PACKED,
  231. },
  232. }, {
  233. .code = MEDIA_BUS_FMT_YUYV8_1_5X8,
  234. .fmt = {
  235. .fourcc = V4L2_PIX_FMT_YUV420,
  236. .name = "YUYV 4:2:0",
  237. .bits_per_sample = 8,
  238. .packing = SOC_MBUS_PACKING_1_5X8,
  239. .order = SOC_MBUS_ORDER_LE,
  240. .layout = SOC_MBUS_LAYOUT_PACKED,
  241. },
  242. }, {
  243. .code = MEDIA_BUS_FMT_YVYU8_1_5X8,
  244. .fmt = {
  245. .fourcc = V4L2_PIX_FMT_YVU420,
  246. .name = "YVYU 4:2:0",
  247. .bits_per_sample = 8,
  248. .packing = SOC_MBUS_PACKING_1_5X8,
  249. .order = SOC_MBUS_ORDER_LE,
  250. .layout = SOC_MBUS_LAYOUT_PACKED,
  251. },
  252. }, {
  253. .code = MEDIA_BUS_FMT_UYVY8_1X16,
  254. .fmt = {
  255. .fourcc = V4L2_PIX_FMT_UYVY,
  256. .name = "UYVY 16bit",
  257. .bits_per_sample = 16,
  258. .packing = SOC_MBUS_PACKING_EXTEND16,
  259. .order = SOC_MBUS_ORDER_LE,
  260. .layout = SOC_MBUS_LAYOUT_PACKED,
  261. },
  262. }, {
  263. .code = MEDIA_BUS_FMT_VYUY8_1X16,
  264. .fmt = {
  265. .fourcc = V4L2_PIX_FMT_VYUY,
  266. .name = "VYUY 16bit",
  267. .bits_per_sample = 16,
  268. .packing = SOC_MBUS_PACKING_EXTEND16,
  269. .order = SOC_MBUS_ORDER_LE,
  270. .layout = SOC_MBUS_LAYOUT_PACKED,
  271. },
  272. }, {
  273. .code = MEDIA_BUS_FMT_YUYV8_1X16,
  274. .fmt = {
  275. .fourcc = V4L2_PIX_FMT_YUYV,
  276. .name = "YUYV 16bit",
  277. .bits_per_sample = 16,
  278. .packing = SOC_MBUS_PACKING_EXTEND16,
  279. .order = SOC_MBUS_ORDER_LE,
  280. .layout = SOC_MBUS_LAYOUT_PACKED,
  281. },
  282. }, {
  283. .code = MEDIA_BUS_FMT_YVYU8_1X16,
  284. .fmt = {
  285. .fourcc = V4L2_PIX_FMT_YVYU,
  286. .name = "YVYU 16bit",
  287. .bits_per_sample = 16,
  288. .packing = SOC_MBUS_PACKING_EXTEND16,
  289. .order = SOC_MBUS_ORDER_LE,
  290. .layout = SOC_MBUS_LAYOUT_PACKED,
  291. },
  292. }, {
  293. .code = MEDIA_BUS_FMT_SGRBG8_1X8,
  294. .fmt = {
  295. .fourcc = V4L2_PIX_FMT_SGRBG8,
  296. .name = "Bayer 8 GRBG",
  297. .bits_per_sample = 8,
  298. .packing = SOC_MBUS_PACKING_NONE,
  299. .order = SOC_MBUS_ORDER_LE,
  300. .layout = SOC_MBUS_LAYOUT_PACKED,
  301. },
  302. }, {
  303. .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8,
  304. .fmt = {
  305. .fourcc = V4L2_PIX_FMT_SGRBG10DPCM8,
  306. .name = "Bayer 10 BGGR DPCM 8",
  307. .bits_per_sample = 8,
  308. .packing = SOC_MBUS_PACKING_NONE,
  309. .order = SOC_MBUS_ORDER_LE,
  310. .layout = SOC_MBUS_LAYOUT_PACKED,
  311. },
  312. }, {
  313. .code = MEDIA_BUS_FMT_SGBRG10_1X10,
  314. .fmt = {
  315. .fourcc = V4L2_PIX_FMT_SGBRG10,
  316. .name = "Bayer 10 GBRG",
  317. .bits_per_sample = 10,
  318. .packing = SOC_MBUS_PACKING_EXTEND16,
  319. .order = SOC_MBUS_ORDER_LE,
  320. .layout = SOC_MBUS_LAYOUT_PACKED,
  321. },
  322. }, {
  323. .code = MEDIA_BUS_FMT_SGRBG10_1X10,
  324. .fmt = {
  325. .fourcc = V4L2_PIX_FMT_SGRBG10,
  326. .name = "Bayer 10 GRBG",
  327. .bits_per_sample = 10,
  328. .packing = SOC_MBUS_PACKING_EXTEND16,
  329. .order = SOC_MBUS_ORDER_LE,
  330. .layout = SOC_MBUS_LAYOUT_PACKED,
  331. },
  332. }, {
  333. .code = MEDIA_BUS_FMT_SRGGB10_1X10,
  334. .fmt = {
  335. .fourcc = V4L2_PIX_FMT_SRGGB10,
  336. .name = "Bayer 10 RGGB",
  337. .bits_per_sample = 10,
  338. .packing = SOC_MBUS_PACKING_EXTEND16,
  339. .order = SOC_MBUS_ORDER_LE,
  340. .layout = SOC_MBUS_LAYOUT_PACKED,
  341. },
  342. }, {
  343. .code = MEDIA_BUS_FMT_SBGGR12_1X12,
  344. .fmt = {
  345. .fourcc = V4L2_PIX_FMT_SBGGR12,
  346. .name = "Bayer 12 BGGR",
  347. .bits_per_sample = 12,
  348. .packing = SOC_MBUS_PACKING_EXTEND16,
  349. .order = SOC_MBUS_ORDER_LE,
  350. .layout = SOC_MBUS_LAYOUT_PACKED,
  351. },
  352. }, {
  353. .code = MEDIA_BUS_FMT_SGBRG12_1X12,
  354. .fmt = {
  355. .fourcc = V4L2_PIX_FMT_SGBRG12,
  356. .name = "Bayer 12 GBRG",
  357. .bits_per_sample = 12,
  358. .packing = SOC_MBUS_PACKING_EXTEND16,
  359. .order = SOC_MBUS_ORDER_LE,
  360. .layout = SOC_MBUS_LAYOUT_PACKED,
  361. },
  362. }, {
  363. .code = MEDIA_BUS_FMT_SGRBG12_1X12,
  364. .fmt = {
  365. .fourcc = V4L2_PIX_FMT_SGRBG12,
  366. .name = "Bayer 12 GRBG",
  367. .bits_per_sample = 12,
  368. .packing = SOC_MBUS_PACKING_EXTEND16,
  369. .order = SOC_MBUS_ORDER_LE,
  370. .layout = SOC_MBUS_LAYOUT_PACKED,
  371. },
  372. }, {
  373. .code = MEDIA_BUS_FMT_SRGGB12_1X12,
  374. .fmt = {
  375. .fourcc = V4L2_PIX_FMT_SRGGB12,
  376. .name = "Bayer 12 RGGB",
  377. .bits_per_sample = 12,
  378. .packing = SOC_MBUS_PACKING_EXTEND16,
  379. .order = SOC_MBUS_ORDER_LE,
  380. .layout = SOC_MBUS_LAYOUT_PACKED,
  381. },
  382. },
  383. };
  384. int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf,
  385. unsigned int *numerator, unsigned int *denominator)
  386. {
  387. switch (mf->packing) {
  388. case SOC_MBUS_PACKING_NONE:
  389. case SOC_MBUS_PACKING_EXTEND16:
  390. *numerator = 1;
  391. *denominator = 1;
  392. return 0;
  393. case SOC_MBUS_PACKING_EXTEND32:
  394. *numerator = 1;
  395. *denominator = 1;
  396. return 0;
  397. case SOC_MBUS_PACKING_2X8_PADHI:
  398. case SOC_MBUS_PACKING_2X8_PADLO:
  399. *numerator = 2;
  400. *denominator = 1;
  401. return 0;
  402. case SOC_MBUS_PACKING_1_5X8:
  403. *numerator = 3;
  404. *denominator = 2;
  405. return 0;
  406. case SOC_MBUS_PACKING_VARIABLE:
  407. *numerator = 0;
  408. *denominator = 1;
  409. return 0;
  410. }
  411. return -EINVAL;
  412. }
  413. EXPORT_SYMBOL(soc_mbus_samples_per_pixel);
  414. s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf)
  415. {
  416. if (mf->layout != SOC_MBUS_LAYOUT_PACKED)
  417. return width * mf->bits_per_sample / 8;
  418. switch (mf->packing) {
  419. case SOC_MBUS_PACKING_NONE:
  420. return width * mf->bits_per_sample / 8;
  421. case SOC_MBUS_PACKING_2X8_PADHI:
  422. case SOC_MBUS_PACKING_2X8_PADLO:
  423. case SOC_MBUS_PACKING_EXTEND16:
  424. return width * 2;
  425. case SOC_MBUS_PACKING_1_5X8:
  426. return width * 3 / 2;
  427. case SOC_MBUS_PACKING_VARIABLE:
  428. return 0;
  429. case SOC_MBUS_PACKING_EXTEND32:
  430. return width * 4;
  431. }
  432. return -EINVAL;
  433. }
  434. EXPORT_SYMBOL(soc_mbus_bytes_per_line);
  435. s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf,
  436. u32 bytes_per_line, u32 height)
  437. {
  438. if (mf->layout == SOC_MBUS_LAYOUT_PACKED)
  439. return bytes_per_line * height;
  440. switch (mf->packing) {
  441. case SOC_MBUS_PACKING_2X8_PADHI:
  442. case SOC_MBUS_PACKING_2X8_PADLO:
  443. return bytes_per_line * height * 2;
  444. case SOC_MBUS_PACKING_1_5X8:
  445. return bytes_per_line * height * 3 / 2;
  446. default:
  447. return -EINVAL;
  448. }
  449. }
  450. EXPORT_SYMBOL(soc_mbus_image_size);
  451. const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc(
  452. u32 code,
  453. const struct soc_mbus_lookup *lookup,
  454. int n)
  455. {
  456. int i;
  457. for (i = 0; i < n; i++)
  458. if (lookup[i].code == code)
  459. return &lookup[i].fmt;
  460. return NULL;
  461. }
  462. EXPORT_SYMBOL(soc_mbus_find_fmtdesc);
  463. const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
  464. u32 code)
  465. {
  466. return soc_mbus_find_fmtdesc(code, mbus_fmt, ARRAY_SIZE(mbus_fmt));
  467. }
  468. EXPORT_SYMBOL(soc_mbus_get_fmtdesc);
  469. unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
  470. unsigned int flags)
  471. {
  472. unsigned long common_flags;
  473. bool hsync = true, vsync = true, pclk, data, mode;
  474. bool mipi_lanes, mipi_clock;
  475. common_flags = cfg->flags & flags;
  476. switch (cfg->type) {
  477. case V4L2_MBUS_PARALLEL:
  478. hsync = common_flags & (V4L2_MBUS_HSYNC_ACTIVE_HIGH |
  479. V4L2_MBUS_HSYNC_ACTIVE_LOW);
  480. vsync = common_flags & (V4L2_MBUS_VSYNC_ACTIVE_HIGH |
  481. V4L2_MBUS_VSYNC_ACTIVE_LOW);
  482. case V4L2_MBUS_BT656:
  483. pclk = common_flags & (V4L2_MBUS_PCLK_SAMPLE_RISING |
  484. V4L2_MBUS_PCLK_SAMPLE_FALLING);
  485. data = common_flags & (V4L2_MBUS_DATA_ACTIVE_HIGH |
  486. V4L2_MBUS_DATA_ACTIVE_LOW);
  487. mode = common_flags & (V4L2_MBUS_MASTER | V4L2_MBUS_SLAVE);
  488. return (!hsync || !vsync || !pclk || !data || !mode) ?
  489. 0 : common_flags;
  490. case V4L2_MBUS_CSI2:
  491. mipi_lanes = common_flags & V4L2_MBUS_CSI2_LANES;
  492. mipi_clock = common_flags & (V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK |
  493. V4L2_MBUS_CSI2_CONTINUOUS_CLOCK);
  494. return (!mipi_lanes || !mipi_clock) ? 0 : common_flags;
  495. }
  496. return 0;
  497. }
  498. EXPORT_SYMBOL(soc_mbus_config_compatible);
  499. static int __init soc_mbus_init(void)
  500. {
  501. return 0;
  502. }
  503. static void __exit soc_mbus_exit(void)
  504. {
  505. }
  506. module_init(soc_mbus_init);
  507. module_exit(soc_mbus_exit);
  508. MODULE_DESCRIPTION("soc-camera media bus interface");
  509. MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
  510. MODULE_LICENSE("GPL v2");