camif-core.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. /*
  2. * s3c24xx/s3c64xx SoC series Camera Interface (CAMIF) driver
  3. *
  4. * Copyright (C) 2012 Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
  5. * Copyright (C) 2012 Tomasz Figa <tomasz.figa@gmail.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published
  9. * by the Free Software Foundation, either version 2 of the License,
  10. * or (at your option) any later version.
  11. */
  12. #define pr_fmt(fmt) "%s:%d " fmt, __func__, __LINE__
  13. #include <linux/bug.h>
  14. #include <linux/clk.h>
  15. #include <linux/delay.h>
  16. #include <linux/device.h>
  17. #include <linux/errno.h>
  18. #include <linux/gpio.h>
  19. #include <linux/i2c.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/io.h>
  22. #include <linux/kernel.h>
  23. #include <linux/list.h>
  24. #include <linux/module.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/pm_runtime.h>
  27. #include <linux/slab.h>
  28. #include <linux/types.h>
  29. #include <media/media-device.h>
  30. #include <media/v4l2-ctrls.h>
  31. #include <media/v4l2-ioctl.h>
  32. #include <media/videobuf2-core.h>
  33. #include <media/videobuf2-dma-contig.h>
  34. #include "camif-core.h"
  35. static char *camif_clocks[CLK_MAX_NUM] = {
  36. /* HCLK CAMIF clock */
  37. [CLK_GATE] = "camif",
  38. /* CAMIF / external camera sensor master clock */
  39. [CLK_CAM] = "camera",
  40. };
  41. static const struct camif_fmt camif_formats[] = {
  42. {
  43. .name = "YUV 4:2:2 planar, Y/Cb/Cr",
  44. .fourcc = V4L2_PIX_FMT_YUV422P,
  45. .depth = 16,
  46. .ybpp = 1,
  47. .color = IMG_FMT_YCBCR422P,
  48. .colplanes = 3,
  49. .flags = FMT_FL_S3C24XX_CODEC |
  50. FMT_FL_S3C64XX,
  51. }, {
  52. .name = "YUV 4:2:0 planar, Y/Cb/Cr",
  53. .fourcc = V4L2_PIX_FMT_YUV420,
  54. .depth = 12,
  55. .ybpp = 1,
  56. .color = IMG_FMT_YCBCR420,
  57. .colplanes = 3,
  58. .flags = FMT_FL_S3C24XX_CODEC |
  59. FMT_FL_S3C64XX,
  60. }, {
  61. .name = "YVU 4:2:0 planar, Y/Cr/Cb",
  62. .fourcc = V4L2_PIX_FMT_YVU420,
  63. .depth = 12,
  64. .ybpp = 1,
  65. .color = IMG_FMT_YCRCB420,
  66. .colplanes = 3,
  67. .flags = FMT_FL_S3C24XX_CODEC |
  68. FMT_FL_S3C64XX,
  69. }, {
  70. .name = "RGB565, 16 bpp",
  71. .fourcc = V4L2_PIX_FMT_RGB565X,
  72. .depth = 16,
  73. .ybpp = 2,
  74. .color = IMG_FMT_RGB565,
  75. .colplanes = 1,
  76. .flags = FMT_FL_S3C24XX_PREVIEW |
  77. FMT_FL_S3C64XX,
  78. }, {
  79. .name = "XRGB8888, 32 bpp",
  80. .fourcc = V4L2_PIX_FMT_RGB32,
  81. .depth = 32,
  82. .ybpp = 4,
  83. .color = IMG_FMT_XRGB8888,
  84. .colplanes = 1,
  85. .flags = FMT_FL_S3C24XX_PREVIEW |
  86. FMT_FL_S3C64XX,
  87. }, {
  88. .name = "BGR666",
  89. .fourcc = V4L2_PIX_FMT_BGR666,
  90. .depth = 32,
  91. .ybpp = 4,
  92. .color = IMG_FMT_RGB666,
  93. .colplanes = 1,
  94. .flags = FMT_FL_S3C64XX,
  95. }
  96. };
  97. /**
  98. * s3c_camif_find_format() - lookup camif color format by fourcc or an index
  99. * @pixelformat: fourcc to match, ignored if null
  100. * @index: index to the camif_formats array, ignored if negative
  101. */
  102. const struct camif_fmt *s3c_camif_find_format(struct camif_vp *vp,
  103. const u32 *pixelformat,
  104. int index)
  105. {
  106. const struct camif_fmt *fmt, *def_fmt = NULL;
  107. unsigned int i;
  108. int id = 0;
  109. if (index >= (int)ARRAY_SIZE(camif_formats))
  110. return NULL;
  111. for (i = 0; i < ARRAY_SIZE(camif_formats); ++i) {
  112. fmt = &camif_formats[i];
  113. if (vp && !(vp->fmt_flags & fmt->flags))
  114. continue;
  115. if (pixelformat && fmt->fourcc == *pixelformat)
  116. return fmt;
  117. if (index == id)
  118. def_fmt = fmt;
  119. id++;
  120. }
  121. return def_fmt;
  122. }
  123. static int camif_get_scaler_factor(u32 src, u32 tar, u32 *ratio, u32 *shift)
  124. {
  125. unsigned int sh = 6;
  126. if (src >= 64 * tar)
  127. return -EINVAL;
  128. while (sh--) {
  129. unsigned int tmp = 1 << sh;
  130. if (src >= tar * tmp) {
  131. *shift = sh, *ratio = tmp;
  132. return 0;
  133. }
  134. }
  135. *shift = 0, *ratio = 1;
  136. return 0;
  137. }
  138. int s3c_camif_get_scaler_config(struct camif_vp *vp,
  139. struct camif_scaler *scaler)
  140. {
  141. struct v4l2_rect *camif_crop = &vp->camif->camif_crop;
  142. int source_x = camif_crop->width;
  143. int source_y = camif_crop->height;
  144. int target_x = vp->out_frame.rect.width;
  145. int target_y = vp->out_frame.rect.height;
  146. int ret;
  147. if (vp->rotation == 90 || vp->rotation == 270)
  148. swap(target_x, target_y);
  149. ret = camif_get_scaler_factor(source_x, target_x, &scaler->pre_h_ratio,
  150. &scaler->h_shift);
  151. if (ret < 0)
  152. return ret;
  153. ret = camif_get_scaler_factor(source_y, target_y, &scaler->pre_v_ratio,
  154. &scaler->v_shift);
  155. if (ret < 0)
  156. return ret;
  157. scaler->pre_dst_width = source_x / scaler->pre_h_ratio;
  158. scaler->pre_dst_height = source_y / scaler->pre_v_ratio;
  159. scaler->main_h_ratio = (source_x << 8) / (target_x << scaler->h_shift);
  160. scaler->main_v_ratio = (source_y << 8) / (target_y << scaler->v_shift);
  161. scaler->scaleup_h = (target_x >= source_x);
  162. scaler->scaleup_v = (target_y >= source_y);
  163. scaler->copy = 0;
  164. pr_debug("H: ratio: %u, shift: %u. V: ratio: %u, shift: %u.\n",
  165. scaler->pre_h_ratio, scaler->h_shift,
  166. scaler->pre_v_ratio, scaler->v_shift);
  167. pr_debug("Source: %dx%d, Target: %dx%d, scaleup_h/v: %d/%d\n",
  168. source_x, source_y, target_x, target_y,
  169. scaler->scaleup_h, scaler->scaleup_v);
  170. return 0;
  171. }
  172. static int camif_register_sensor(struct camif_dev *camif)
  173. {
  174. struct s3c_camif_sensor_info *sensor = &camif->pdata.sensor;
  175. struct v4l2_device *v4l2_dev = &camif->v4l2_dev;
  176. struct i2c_adapter *adapter;
  177. struct v4l2_subdev_format format;
  178. struct v4l2_subdev *sd;
  179. int ret;
  180. camif->sensor.sd = NULL;
  181. if (sensor->i2c_board_info.addr == 0)
  182. return -EINVAL;
  183. adapter = i2c_get_adapter(sensor->i2c_bus_num);
  184. if (adapter == NULL) {
  185. v4l2_warn(v4l2_dev, "failed to get I2C adapter %d\n",
  186. sensor->i2c_bus_num);
  187. return -EPROBE_DEFER;
  188. }
  189. sd = v4l2_i2c_new_subdev_board(v4l2_dev, adapter,
  190. &sensor->i2c_board_info, NULL);
  191. if (sd == NULL) {
  192. i2c_put_adapter(adapter);
  193. v4l2_warn(v4l2_dev, "failed to acquire subdev %s\n",
  194. sensor->i2c_board_info.type);
  195. return -EPROBE_DEFER;
  196. }
  197. camif->sensor.sd = sd;
  198. v4l2_info(v4l2_dev, "registered sensor subdevice %s\n", sd->name);
  199. /* Get initial pixel format and set it at the camif sink pad */
  200. format.pad = 0;
  201. format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
  202. ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &format);
  203. if (ret < 0)
  204. return 0;
  205. format.pad = CAMIF_SD_PAD_SINK;
  206. v4l2_subdev_call(&camif->subdev, pad, set_fmt, NULL, &format);
  207. v4l2_info(sd, "Initial format from sensor: %dx%d, %#x\n",
  208. format.format.width, format.format.height,
  209. format.format.code);
  210. return 0;
  211. }
  212. static void camif_unregister_sensor(struct camif_dev *camif)
  213. {
  214. struct v4l2_subdev *sd = camif->sensor.sd;
  215. struct i2c_client *client = sd ? v4l2_get_subdevdata(sd) : NULL;
  216. struct i2c_adapter *adapter;
  217. if (client == NULL)
  218. return;
  219. adapter = client->adapter;
  220. v4l2_device_unregister_subdev(sd);
  221. camif->sensor.sd = NULL;
  222. i2c_unregister_device(client);
  223. if (adapter)
  224. i2c_put_adapter(adapter);
  225. }
  226. static int camif_create_media_links(struct camif_dev *camif)
  227. {
  228. int i, ret;
  229. ret = media_entity_create_link(&camif->sensor.sd->entity, 0,
  230. &camif->subdev.entity, CAMIF_SD_PAD_SINK,
  231. MEDIA_LNK_FL_IMMUTABLE |
  232. MEDIA_LNK_FL_ENABLED);
  233. if (ret)
  234. return ret;
  235. for (i = 1; i < CAMIF_SD_PADS_NUM && !ret; i++) {
  236. ret = media_entity_create_link(&camif->subdev.entity, i,
  237. &camif->vp[i - 1].vdev.entity, 0,
  238. MEDIA_LNK_FL_IMMUTABLE |
  239. MEDIA_LNK_FL_ENABLED);
  240. }
  241. return ret;
  242. }
  243. static int camif_register_video_nodes(struct camif_dev *camif)
  244. {
  245. int ret = s3c_camif_register_video_node(camif, VP_CODEC);
  246. if (ret < 0)
  247. return ret;
  248. return s3c_camif_register_video_node(camif, VP_PREVIEW);
  249. }
  250. static void camif_unregister_video_nodes(struct camif_dev *camif)
  251. {
  252. s3c_camif_unregister_video_node(camif, VP_CODEC);
  253. s3c_camif_unregister_video_node(camif, VP_PREVIEW);
  254. }
  255. static void camif_unregister_media_entities(struct camif_dev *camif)
  256. {
  257. camif_unregister_video_nodes(camif);
  258. camif_unregister_sensor(camif);
  259. s3c_camif_unregister_subdev(camif);
  260. }
  261. /*
  262. * Media device
  263. */
  264. static int camif_media_dev_register(struct camif_dev *camif)
  265. {
  266. struct media_device *md = &camif->media_dev;
  267. struct v4l2_device *v4l2_dev = &camif->v4l2_dev;
  268. unsigned int ip_rev = camif->variant->ip_revision;
  269. int ret;
  270. memset(md, 0, sizeof(*md));
  271. snprintf(md->model, sizeof(md->model), "SAMSUNG S3C%s CAMIF",
  272. ip_rev == S3C6410_CAMIF_IP_REV ? "6410" : "244X");
  273. strlcpy(md->bus_info, "platform", sizeof(md->bus_info));
  274. md->hw_revision = ip_rev;
  275. md->driver_version = KERNEL_VERSION(1, 0, 0);
  276. md->dev = camif->dev;
  277. strlcpy(v4l2_dev->name, "s3c-camif", sizeof(v4l2_dev->name));
  278. v4l2_dev->mdev = md;
  279. ret = v4l2_device_register(camif->dev, v4l2_dev);
  280. if (ret < 0)
  281. return ret;
  282. ret = media_device_register(md);
  283. if (ret < 0)
  284. v4l2_device_unregister(v4l2_dev);
  285. return ret;
  286. }
  287. static void camif_clk_put(struct camif_dev *camif)
  288. {
  289. int i;
  290. for (i = 0; i < CLK_MAX_NUM; i++) {
  291. if (IS_ERR_OR_NULL(camif->clock[i]))
  292. continue;
  293. clk_unprepare(camif->clock[i]);
  294. clk_put(camif->clock[i]);
  295. }
  296. }
  297. static int camif_clk_get(struct camif_dev *camif)
  298. {
  299. int ret, i;
  300. for (i = 0; i < CLK_MAX_NUM; i++) {
  301. camif->clock[i] = clk_get(camif->dev, camif_clocks[i]);
  302. if (IS_ERR(camif->clock[i])) {
  303. ret = PTR_ERR(camif->clock[i]);
  304. goto err;
  305. }
  306. ret = clk_prepare(camif->clock[i]);
  307. if (ret < 0) {
  308. clk_put(camif->clock[i]);
  309. camif->clock[i] = NULL;
  310. goto err;
  311. }
  312. }
  313. return 0;
  314. err:
  315. camif_clk_put(camif);
  316. dev_err(camif->dev, "failed to get clock: %s\n",
  317. camif_clocks[i]);
  318. return ret;
  319. }
  320. /*
  321. * The CAMIF device has two relatively independent data processing paths
  322. * that can source data from memory or the common camera input frontend.
  323. * Register interrupts for each data processing path (camif_vp).
  324. */
  325. static int camif_request_irqs(struct platform_device *pdev,
  326. struct camif_dev *camif)
  327. {
  328. int irq, ret, i;
  329. for (i = 0; i < CAMIF_VP_NUM; i++) {
  330. struct camif_vp *vp = &camif->vp[i];
  331. init_waitqueue_head(&vp->irq_queue);
  332. irq = platform_get_irq(pdev, i);
  333. if (irq <= 0) {
  334. dev_err(&pdev->dev, "failed to get IRQ %d\n", i);
  335. return -ENXIO;
  336. }
  337. ret = devm_request_irq(&pdev->dev, irq, s3c_camif_irq_handler,
  338. 0, dev_name(&pdev->dev), vp);
  339. if (ret < 0) {
  340. dev_err(&pdev->dev, "failed to install IRQ: %d\n", ret);
  341. break;
  342. }
  343. }
  344. return ret;
  345. }
  346. static int s3c_camif_probe(struct platform_device *pdev)
  347. {
  348. struct device *dev = &pdev->dev;
  349. struct s3c_camif_plat_data *pdata = dev->platform_data;
  350. struct s3c_camif_drvdata *drvdata;
  351. struct camif_dev *camif;
  352. struct resource *mres;
  353. int ret = 0;
  354. camif = devm_kzalloc(dev, sizeof(*camif), GFP_KERNEL);
  355. if (!camif)
  356. return -ENOMEM;
  357. spin_lock_init(&camif->slock);
  358. mutex_init(&camif->lock);
  359. camif->dev = dev;
  360. if (!pdata || !pdata->gpio_get || !pdata->gpio_put) {
  361. dev_err(dev, "wrong platform data\n");
  362. return -EINVAL;
  363. }
  364. camif->pdata = *pdata;
  365. drvdata = (void *)platform_get_device_id(pdev)->driver_data;
  366. camif->variant = drvdata->variant;
  367. mres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  368. camif->io_base = devm_request_and_ioremap(dev, mres);
  369. if (!camif->io_base) {
  370. dev_err(dev, "failed to obtain I/O memory\n");
  371. return -ENOENT;
  372. }
  373. ret = camif_request_irqs(pdev, camif);
  374. if (ret < 0)
  375. return ret;
  376. ret = pdata->gpio_get();
  377. if (ret < 0)
  378. return ret;
  379. ret = s3c_camif_create_subdev(camif);
  380. if (ret < 0)
  381. goto err_sd;
  382. ret = camif_clk_get(camif);
  383. if (ret < 0)
  384. goto err_clk;
  385. platform_set_drvdata(pdev, camif);
  386. clk_set_rate(camif->clock[CLK_CAM],
  387. camif->pdata.sensor.clock_frequency);
  388. dev_info(dev, "sensor clock frequency: %lu\n",
  389. clk_get_rate(camif->clock[CLK_CAM]));
  390. /*
  391. * Set initial pixel format, resolution and crop rectangle.
  392. * Must be done before a sensor subdev is registered as some
  393. * settings are overrode with values from sensor subdev.
  394. */
  395. s3c_camif_set_defaults(camif);
  396. pm_runtime_enable(dev);
  397. ret = pm_runtime_get_sync(dev);
  398. if (ret < 0)
  399. goto err_pm;
  400. /* Initialize contiguous memory allocator */
  401. camif->alloc_ctx = vb2_dma_contig_init_ctx(dev);
  402. if (IS_ERR(camif->alloc_ctx)) {
  403. ret = PTR_ERR(camif->alloc_ctx);
  404. goto err_alloc;
  405. }
  406. ret = camif_media_dev_register(camif);
  407. if (ret < 0)
  408. goto err_mdev;
  409. ret = camif_register_sensor(camif);
  410. if (ret < 0)
  411. goto err_sens;
  412. ret = v4l2_device_register_subdev(&camif->v4l2_dev, &camif->subdev);
  413. if (ret < 0)
  414. goto err_sens;
  415. mutex_lock(&camif->media_dev.graph_mutex);
  416. ret = v4l2_device_register_subdev_nodes(&camif->v4l2_dev);
  417. if (ret < 0)
  418. goto err_unlock;
  419. ret = camif_register_video_nodes(camif);
  420. if (ret < 0)
  421. goto err_unlock;
  422. ret = camif_create_media_links(camif);
  423. if (ret < 0)
  424. goto err_unlock;
  425. mutex_unlock(&camif->media_dev.graph_mutex);
  426. pm_runtime_put(dev);
  427. return 0;
  428. err_unlock:
  429. mutex_unlock(&camif->media_dev.graph_mutex);
  430. err_sens:
  431. v4l2_device_unregister(&camif->v4l2_dev);
  432. media_device_unregister(&camif->media_dev);
  433. camif_unregister_media_entities(camif);
  434. err_mdev:
  435. vb2_dma_contig_cleanup_ctx(camif->alloc_ctx);
  436. err_alloc:
  437. pm_runtime_put(dev);
  438. pm_runtime_disable(dev);
  439. err_pm:
  440. camif_clk_put(camif);
  441. err_clk:
  442. s3c_camif_unregister_subdev(camif);
  443. err_sd:
  444. pdata->gpio_put();
  445. return ret;
  446. }
  447. static int s3c_camif_remove(struct platform_device *pdev)
  448. {
  449. struct camif_dev *camif = platform_get_drvdata(pdev);
  450. struct s3c_camif_plat_data *pdata = &camif->pdata;
  451. media_device_unregister(&camif->media_dev);
  452. camif_unregister_media_entities(camif);
  453. v4l2_device_unregister(&camif->v4l2_dev);
  454. pm_runtime_disable(&pdev->dev);
  455. camif_clk_put(camif);
  456. pdata->gpio_put();
  457. return 0;
  458. }
  459. static int s3c_camif_runtime_resume(struct device *dev)
  460. {
  461. struct camif_dev *camif = dev_get_drvdata(dev);
  462. clk_enable(camif->clock[CLK_GATE]);
  463. /* null op on s3c244x */
  464. clk_enable(camif->clock[CLK_CAM]);
  465. return 0;
  466. }
  467. static int s3c_camif_runtime_suspend(struct device *dev)
  468. {
  469. struct camif_dev *camif = dev_get_drvdata(dev);
  470. /* null op on s3c244x */
  471. clk_disable(camif->clock[CLK_CAM]);
  472. clk_disable(camif->clock[CLK_GATE]);
  473. return 0;
  474. }
  475. static const struct s3c_camif_variant s3c244x_camif_variant = {
  476. .vp_pix_limits = {
  477. [VP_CODEC] = {
  478. .max_out_width = 4096,
  479. .max_sc_out_width = 2048,
  480. .out_width_align = 16,
  481. .min_out_width = 16,
  482. .max_height = 4096,
  483. },
  484. [VP_PREVIEW] = {
  485. .max_out_width = 640,
  486. .max_sc_out_width = 640,
  487. .out_width_align = 16,
  488. .min_out_width = 16,
  489. .max_height = 480,
  490. }
  491. },
  492. .pix_limits = {
  493. .win_hor_offset_align = 8,
  494. },
  495. .ip_revision = S3C244X_CAMIF_IP_REV,
  496. };
  497. static struct s3c_camif_drvdata s3c244x_camif_drvdata = {
  498. .variant = &s3c244x_camif_variant,
  499. .bus_clk_freq = 24000000UL,
  500. };
  501. static const struct s3c_camif_variant s3c6410_camif_variant = {
  502. .vp_pix_limits = {
  503. [VP_CODEC] = {
  504. .max_out_width = 4096,
  505. .max_sc_out_width = 2048,
  506. .out_width_align = 16,
  507. .min_out_width = 16,
  508. .max_height = 4096,
  509. },
  510. [VP_PREVIEW] = {
  511. .max_out_width = 4096,
  512. .max_sc_out_width = 720,
  513. .out_width_align = 16,
  514. .min_out_width = 16,
  515. .max_height = 4096,
  516. }
  517. },
  518. .pix_limits = {
  519. .win_hor_offset_align = 8,
  520. },
  521. .ip_revision = S3C6410_CAMIF_IP_REV,
  522. .has_img_effect = 1,
  523. .vp_offset = 0x20,
  524. };
  525. static struct s3c_camif_drvdata s3c6410_camif_drvdata = {
  526. .variant = &s3c6410_camif_variant,
  527. .bus_clk_freq = 133000000UL,
  528. };
  529. static struct platform_device_id s3c_camif_driver_ids[] = {
  530. {
  531. .name = "s3c2440-camif",
  532. .driver_data = (unsigned long)&s3c244x_camif_drvdata,
  533. }, {
  534. .name = "s3c6410-camif",
  535. .driver_data = (unsigned long)&s3c6410_camif_drvdata,
  536. },
  537. { /* sentinel */ },
  538. };
  539. MODULE_DEVICE_TABLE(platform, s3c_camif_driver_ids);
  540. static const struct dev_pm_ops s3c_camif_pm_ops = {
  541. .runtime_suspend = s3c_camif_runtime_suspend,
  542. .runtime_resume = s3c_camif_runtime_resume,
  543. };
  544. static struct platform_driver s3c_camif_driver = {
  545. .probe = s3c_camif_probe,
  546. .remove = s3c_camif_remove,
  547. .id_table = s3c_camif_driver_ids,
  548. .driver = {
  549. .name = S3C_CAMIF_DRIVER_NAME,
  550. .owner = THIS_MODULE,
  551. .pm = &s3c_camif_pm_ops,
  552. }
  553. };
  554. module_platform_driver(s3c_camif_driver);
  555. MODULE_AUTHOR("Sylwester Nawrocki <sylvester.nawrocki@gmail.com>");
  556. MODULE_AUTHOR("Tomasz Figa <tomasz.figa@gmail.com>");
  557. MODULE_DESCRIPTION("S3C24XX/S3C64XX SoC camera interface driver");
  558. MODULE_LICENSE("GPL");