camif-core.c 16 KB

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