v4l2-subdev.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. /*
  2. * V4L2 sub-device
  3. *
  4. * Copyright (C) 2010 Nokia Corporation
  5. *
  6. * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  7. * Sakari Ailus <sakari.ailus@iki.fi>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #include <linux/ioctl.h>
  23. #include <linux/slab.h>
  24. #include <linux/types.h>
  25. #include <linux/videodev2.h>
  26. #include <linux/export.h>
  27. #include <media/v4l2-ctrls.h>
  28. #include <media/v4l2-device.h>
  29. #include <media/v4l2-ioctl.h>
  30. #include <media/v4l2-fh.h>
  31. #include <media/v4l2-event.h>
  32. static int subdev_fh_init(struct v4l2_subdev_fh *fh, struct v4l2_subdev *sd)
  33. {
  34. #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
  35. if (sd->entity.num_pads) {
  36. fh->pad = v4l2_subdev_alloc_pad_config(sd);
  37. if (fh->pad == NULL)
  38. return -ENOMEM;
  39. }
  40. #endif
  41. return 0;
  42. }
  43. static void subdev_fh_free(struct v4l2_subdev_fh *fh)
  44. {
  45. #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
  46. v4l2_subdev_free_pad_config(fh->pad);
  47. fh->pad = NULL;
  48. #endif
  49. }
  50. static int subdev_open(struct file *file)
  51. {
  52. struct video_device *vdev = video_devdata(file);
  53. struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
  54. struct v4l2_subdev_fh *subdev_fh;
  55. #if defined(CONFIG_MEDIA_CONTROLLER)
  56. struct media_entity *entity = NULL;
  57. #endif
  58. int ret;
  59. subdev_fh = kzalloc(sizeof(*subdev_fh), GFP_KERNEL);
  60. if (subdev_fh == NULL)
  61. return -ENOMEM;
  62. ret = subdev_fh_init(subdev_fh, sd);
  63. if (ret) {
  64. kfree(subdev_fh);
  65. return ret;
  66. }
  67. v4l2_fh_init(&subdev_fh->vfh, vdev);
  68. v4l2_fh_add(&subdev_fh->vfh);
  69. file->private_data = &subdev_fh->vfh;
  70. #if defined(CONFIG_MEDIA_CONTROLLER)
  71. if (sd->v4l2_dev->mdev) {
  72. entity = media_entity_get(&sd->entity);
  73. if (!entity) {
  74. ret = -EBUSY;
  75. goto err;
  76. }
  77. }
  78. #endif
  79. if (sd->internal_ops && sd->internal_ops->open) {
  80. ret = sd->internal_ops->open(sd, subdev_fh);
  81. if (ret < 0)
  82. goto err;
  83. }
  84. return 0;
  85. err:
  86. #if defined(CONFIG_MEDIA_CONTROLLER)
  87. media_entity_put(entity);
  88. #endif
  89. v4l2_fh_del(&subdev_fh->vfh);
  90. v4l2_fh_exit(&subdev_fh->vfh);
  91. subdev_fh_free(subdev_fh);
  92. kfree(subdev_fh);
  93. return ret;
  94. }
  95. static int subdev_close(struct file *file)
  96. {
  97. struct video_device *vdev = video_devdata(file);
  98. struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
  99. struct v4l2_fh *vfh = file->private_data;
  100. struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh);
  101. if (sd->internal_ops && sd->internal_ops->close)
  102. sd->internal_ops->close(sd, subdev_fh);
  103. #if defined(CONFIG_MEDIA_CONTROLLER)
  104. if (sd->v4l2_dev->mdev)
  105. media_entity_put(&sd->entity);
  106. #endif
  107. v4l2_fh_del(vfh);
  108. v4l2_fh_exit(vfh);
  109. subdev_fh_free(subdev_fh);
  110. kfree(subdev_fh);
  111. file->private_data = NULL;
  112. return 0;
  113. }
  114. #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
  115. static int check_format(struct v4l2_subdev *sd,
  116. struct v4l2_subdev_format *format)
  117. {
  118. if (format->which != V4L2_SUBDEV_FORMAT_TRY &&
  119. format->which != V4L2_SUBDEV_FORMAT_ACTIVE)
  120. return -EINVAL;
  121. if (format->pad >= sd->entity.num_pads)
  122. return -EINVAL;
  123. return 0;
  124. }
  125. static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop)
  126. {
  127. if (crop->which != V4L2_SUBDEV_FORMAT_TRY &&
  128. crop->which != V4L2_SUBDEV_FORMAT_ACTIVE)
  129. return -EINVAL;
  130. if (crop->pad >= sd->entity.num_pads)
  131. return -EINVAL;
  132. return 0;
  133. }
  134. static int check_selection(struct v4l2_subdev *sd,
  135. struct v4l2_subdev_selection *sel)
  136. {
  137. if (sel->which != V4L2_SUBDEV_FORMAT_TRY &&
  138. sel->which != V4L2_SUBDEV_FORMAT_ACTIVE)
  139. return -EINVAL;
  140. if (sel->pad >= sd->entity.num_pads)
  141. return -EINVAL;
  142. return 0;
  143. }
  144. static int check_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
  145. {
  146. if (edid->pad >= sd->entity.num_pads)
  147. return -EINVAL;
  148. if (edid->blocks && edid->edid == NULL)
  149. return -EINVAL;
  150. return 0;
  151. }
  152. #endif
  153. static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
  154. {
  155. struct video_device *vdev = video_devdata(file);
  156. struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
  157. struct v4l2_fh *vfh = file->private_data;
  158. #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
  159. struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh);
  160. int rval;
  161. #endif
  162. switch (cmd) {
  163. case VIDIOC_QUERYCTRL:
  164. return v4l2_queryctrl(vfh->ctrl_handler, arg);
  165. case VIDIOC_QUERY_EXT_CTRL:
  166. return v4l2_query_ext_ctrl(vfh->ctrl_handler, arg);
  167. case VIDIOC_QUERYMENU:
  168. return v4l2_querymenu(vfh->ctrl_handler, arg);
  169. case VIDIOC_G_CTRL:
  170. return v4l2_g_ctrl(vfh->ctrl_handler, arg);
  171. case VIDIOC_S_CTRL:
  172. return v4l2_s_ctrl(vfh, vfh->ctrl_handler, arg);
  173. case VIDIOC_G_EXT_CTRLS:
  174. return v4l2_g_ext_ctrls(vfh->ctrl_handler, arg);
  175. case VIDIOC_S_EXT_CTRLS:
  176. return v4l2_s_ext_ctrls(vfh, vfh->ctrl_handler, arg);
  177. case VIDIOC_TRY_EXT_CTRLS:
  178. return v4l2_try_ext_ctrls(vfh->ctrl_handler, arg);
  179. case VIDIOC_DQEVENT:
  180. if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
  181. return -ENOIOCTLCMD;
  182. return v4l2_event_dequeue(vfh, arg, file->f_flags & O_NONBLOCK);
  183. case VIDIOC_SUBSCRIBE_EVENT:
  184. return v4l2_subdev_call(sd, core, subscribe_event, vfh, arg);
  185. case VIDIOC_UNSUBSCRIBE_EVENT:
  186. return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg);
  187. #ifdef CONFIG_VIDEO_ADV_DEBUG
  188. case VIDIOC_DBG_G_REGISTER:
  189. {
  190. struct v4l2_dbg_register *p = arg;
  191. if (!capable(CAP_SYS_ADMIN))
  192. return -EPERM;
  193. return v4l2_subdev_call(sd, core, g_register, p);
  194. }
  195. case VIDIOC_DBG_S_REGISTER:
  196. {
  197. struct v4l2_dbg_register *p = arg;
  198. if (!capable(CAP_SYS_ADMIN))
  199. return -EPERM;
  200. return v4l2_subdev_call(sd, core, s_register, p);
  201. }
  202. #endif
  203. case VIDIOC_LOG_STATUS: {
  204. int ret;
  205. pr_info("%s: ================= START STATUS =================\n",
  206. sd->name);
  207. ret = v4l2_subdev_call(sd, core, log_status);
  208. pr_info("%s: ================== END STATUS ==================\n",
  209. sd->name);
  210. return ret;
  211. }
  212. #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
  213. case VIDIOC_SUBDEV_G_FMT: {
  214. struct v4l2_subdev_format *format = arg;
  215. rval = check_format(sd, format);
  216. if (rval)
  217. return rval;
  218. return v4l2_subdev_call(sd, pad, get_fmt, subdev_fh->pad, format);
  219. }
  220. case VIDIOC_SUBDEV_S_FMT: {
  221. struct v4l2_subdev_format *format = arg;
  222. rval = check_format(sd, format);
  223. if (rval)
  224. return rval;
  225. return v4l2_subdev_call(sd, pad, set_fmt, subdev_fh->pad, format);
  226. }
  227. case VIDIOC_SUBDEV_G_CROP: {
  228. struct v4l2_subdev_crop *crop = arg;
  229. struct v4l2_subdev_selection sel;
  230. rval = check_crop(sd, crop);
  231. if (rval)
  232. return rval;
  233. memset(&sel, 0, sizeof(sel));
  234. sel.which = crop->which;
  235. sel.pad = crop->pad;
  236. sel.target = V4L2_SEL_TGT_CROP;
  237. rval = v4l2_subdev_call(
  238. sd, pad, get_selection, subdev_fh->pad, &sel);
  239. crop->rect = sel.r;
  240. return rval;
  241. }
  242. case VIDIOC_SUBDEV_S_CROP: {
  243. struct v4l2_subdev_crop *crop = arg;
  244. struct v4l2_subdev_selection sel;
  245. rval = check_crop(sd, crop);
  246. if (rval)
  247. return rval;
  248. memset(&sel, 0, sizeof(sel));
  249. sel.which = crop->which;
  250. sel.pad = crop->pad;
  251. sel.target = V4L2_SEL_TGT_CROP;
  252. sel.r = crop->rect;
  253. rval = v4l2_subdev_call(
  254. sd, pad, set_selection, subdev_fh->pad, &sel);
  255. crop->rect = sel.r;
  256. return rval;
  257. }
  258. case VIDIOC_SUBDEV_ENUM_MBUS_CODE: {
  259. struct v4l2_subdev_mbus_code_enum *code = arg;
  260. if (code->which != V4L2_SUBDEV_FORMAT_TRY &&
  261. code->which != V4L2_SUBDEV_FORMAT_ACTIVE)
  262. return -EINVAL;
  263. if (code->pad >= sd->entity.num_pads)
  264. return -EINVAL;
  265. return v4l2_subdev_call(sd, pad, enum_mbus_code, subdev_fh->pad,
  266. code);
  267. }
  268. case VIDIOC_SUBDEV_ENUM_FRAME_SIZE: {
  269. struct v4l2_subdev_frame_size_enum *fse = arg;
  270. if (fse->which != V4L2_SUBDEV_FORMAT_TRY &&
  271. fse->which != V4L2_SUBDEV_FORMAT_ACTIVE)
  272. return -EINVAL;
  273. if (fse->pad >= sd->entity.num_pads)
  274. return -EINVAL;
  275. return v4l2_subdev_call(sd, pad, enum_frame_size, subdev_fh->pad,
  276. fse);
  277. }
  278. case VIDIOC_SUBDEV_G_FRAME_INTERVAL: {
  279. struct v4l2_subdev_frame_interval *fi = arg;
  280. if (fi->pad >= sd->entity.num_pads)
  281. return -EINVAL;
  282. return v4l2_subdev_call(sd, video, g_frame_interval, arg);
  283. }
  284. case VIDIOC_SUBDEV_S_FRAME_INTERVAL: {
  285. struct v4l2_subdev_frame_interval *fi = arg;
  286. if (fi->pad >= sd->entity.num_pads)
  287. return -EINVAL;
  288. return v4l2_subdev_call(sd, video, s_frame_interval, arg);
  289. }
  290. case VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL: {
  291. struct v4l2_subdev_frame_interval_enum *fie = arg;
  292. if (fie->which != V4L2_SUBDEV_FORMAT_TRY &&
  293. fie->which != V4L2_SUBDEV_FORMAT_ACTIVE)
  294. return -EINVAL;
  295. if (fie->pad >= sd->entity.num_pads)
  296. return -EINVAL;
  297. return v4l2_subdev_call(sd, pad, enum_frame_interval, subdev_fh->pad,
  298. fie);
  299. }
  300. case VIDIOC_SUBDEV_G_SELECTION: {
  301. struct v4l2_subdev_selection *sel = arg;
  302. rval = check_selection(sd, sel);
  303. if (rval)
  304. return rval;
  305. return v4l2_subdev_call(
  306. sd, pad, get_selection, subdev_fh->pad, sel);
  307. }
  308. case VIDIOC_SUBDEV_S_SELECTION: {
  309. struct v4l2_subdev_selection *sel = arg;
  310. rval = check_selection(sd, sel);
  311. if (rval)
  312. return rval;
  313. return v4l2_subdev_call(
  314. sd, pad, set_selection, subdev_fh->pad, sel);
  315. }
  316. case VIDIOC_G_EDID: {
  317. struct v4l2_subdev_edid *edid = arg;
  318. rval = check_edid(sd, edid);
  319. if (rval)
  320. return rval;
  321. return v4l2_subdev_call(sd, pad, get_edid, edid);
  322. }
  323. case VIDIOC_S_EDID: {
  324. struct v4l2_subdev_edid *edid = arg;
  325. rval = check_edid(sd, edid);
  326. if (rval)
  327. return rval;
  328. return v4l2_subdev_call(sd, pad, set_edid, edid);
  329. }
  330. case VIDIOC_SUBDEV_DV_TIMINGS_CAP: {
  331. struct v4l2_dv_timings_cap *cap = arg;
  332. if (cap->pad >= sd->entity.num_pads)
  333. return -EINVAL;
  334. return v4l2_subdev_call(sd, pad, dv_timings_cap, cap);
  335. }
  336. case VIDIOC_SUBDEV_ENUM_DV_TIMINGS: {
  337. struct v4l2_enum_dv_timings *dvt = arg;
  338. if (dvt->pad >= sd->entity.num_pads)
  339. return -EINVAL;
  340. return v4l2_subdev_call(sd, pad, enum_dv_timings, dvt);
  341. }
  342. case VIDIOC_SUBDEV_QUERY_DV_TIMINGS:
  343. return v4l2_subdev_call(sd, video, query_dv_timings, arg);
  344. case VIDIOC_SUBDEV_G_DV_TIMINGS:
  345. return v4l2_subdev_call(sd, video, g_dv_timings, arg);
  346. case VIDIOC_SUBDEV_S_DV_TIMINGS:
  347. return v4l2_subdev_call(sd, video, s_dv_timings, arg);
  348. #endif
  349. default:
  350. return v4l2_subdev_call(sd, core, ioctl, cmd, arg);
  351. }
  352. return 0;
  353. }
  354. static long subdev_ioctl(struct file *file, unsigned int cmd,
  355. unsigned long arg)
  356. {
  357. return video_usercopy(file, cmd, arg, subdev_do_ioctl);
  358. }
  359. #ifdef CONFIG_COMPAT
  360. static long subdev_compat_ioctl32(struct file *file, unsigned int cmd,
  361. unsigned long arg)
  362. {
  363. struct video_device *vdev = video_devdata(file);
  364. struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
  365. return v4l2_subdev_call(sd, core, compat_ioctl32, cmd, arg);
  366. }
  367. #endif
  368. static unsigned int subdev_poll(struct file *file, poll_table *wait)
  369. {
  370. struct video_device *vdev = video_devdata(file);
  371. struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
  372. struct v4l2_fh *fh = file->private_data;
  373. if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
  374. return POLLERR;
  375. poll_wait(file, &fh->wait, wait);
  376. if (v4l2_event_pending(fh))
  377. return POLLPRI;
  378. return 0;
  379. }
  380. const struct v4l2_file_operations v4l2_subdev_fops = {
  381. .owner = THIS_MODULE,
  382. .open = subdev_open,
  383. .unlocked_ioctl = subdev_ioctl,
  384. #ifdef CONFIG_COMPAT
  385. .compat_ioctl32 = subdev_compat_ioctl32,
  386. #endif
  387. .release = subdev_close,
  388. .poll = subdev_poll,
  389. };
  390. #ifdef CONFIG_MEDIA_CONTROLLER
  391. int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
  392. struct media_link *link,
  393. struct v4l2_subdev_format *source_fmt,
  394. struct v4l2_subdev_format *sink_fmt)
  395. {
  396. /* The width, height and code must match. */
  397. if (source_fmt->format.width != sink_fmt->format.width
  398. || source_fmt->format.height != sink_fmt->format.height
  399. || source_fmt->format.code != sink_fmt->format.code)
  400. return -EPIPE;
  401. /* The field order must match, or the sink field order must be NONE
  402. * to support interlaced hardware connected to bridges that support
  403. * progressive formats only.
  404. */
  405. if (source_fmt->format.field != sink_fmt->format.field &&
  406. sink_fmt->format.field != V4L2_FIELD_NONE)
  407. return -EPIPE;
  408. return 0;
  409. }
  410. EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate_default);
  411. static int
  412. v4l2_subdev_link_validate_get_format(struct media_pad *pad,
  413. struct v4l2_subdev_format *fmt)
  414. {
  415. if (is_media_entity_v4l2_subdev(pad->entity)) {
  416. struct v4l2_subdev *sd =
  417. media_entity_to_v4l2_subdev(pad->entity);
  418. fmt->which = V4L2_SUBDEV_FORMAT_ACTIVE;
  419. fmt->pad = pad->index;
  420. return v4l2_subdev_call(sd, pad, get_fmt, NULL, fmt);
  421. }
  422. WARN(pad->entity->function != MEDIA_ENT_F_IO_V4L,
  423. "Driver bug! Wrong media entity type 0x%08x, entity %s\n",
  424. pad->entity->function, pad->entity->name);
  425. return -EINVAL;
  426. }
  427. int v4l2_subdev_link_validate(struct media_link *link)
  428. {
  429. struct v4l2_subdev *sink;
  430. struct v4l2_subdev_format sink_fmt, source_fmt;
  431. int rval;
  432. rval = v4l2_subdev_link_validate_get_format(
  433. link->source, &source_fmt);
  434. if (rval < 0)
  435. return 0;
  436. rval = v4l2_subdev_link_validate_get_format(
  437. link->sink, &sink_fmt);
  438. if (rval < 0)
  439. return 0;
  440. sink = media_entity_to_v4l2_subdev(link->sink->entity);
  441. rval = v4l2_subdev_call(sink, pad, link_validate, link,
  442. &source_fmt, &sink_fmt);
  443. if (rval != -ENOIOCTLCMD)
  444. return rval;
  445. return v4l2_subdev_link_validate_default(
  446. sink, link, &source_fmt, &sink_fmt);
  447. }
  448. EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate);
  449. struct v4l2_subdev_pad_config *
  450. v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd)
  451. {
  452. struct v4l2_subdev_pad_config *cfg;
  453. int ret;
  454. if (!sd->entity.num_pads)
  455. return NULL;
  456. cfg = kcalloc(sd->entity.num_pads, sizeof(*cfg), GFP_KERNEL);
  457. if (!cfg)
  458. return NULL;
  459. ret = v4l2_subdev_call(sd, pad, init_cfg, cfg);
  460. if (ret < 0 && ret != -ENOIOCTLCMD) {
  461. kfree(cfg);
  462. return NULL;
  463. }
  464. return cfg;
  465. }
  466. EXPORT_SYMBOL_GPL(v4l2_subdev_alloc_pad_config);
  467. void v4l2_subdev_free_pad_config(struct v4l2_subdev_pad_config *cfg)
  468. {
  469. kfree(cfg);
  470. }
  471. EXPORT_SYMBOL_GPL(v4l2_subdev_free_pad_config);
  472. #endif /* CONFIG_MEDIA_CONTROLLER */
  473. void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops)
  474. {
  475. INIT_LIST_HEAD(&sd->list);
  476. BUG_ON(!ops);
  477. sd->ops = ops;
  478. sd->v4l2_dev = NULL;
  479. sd->flags = 0;
  480. sd->name[0] = '\0';
  481. sd->grp_id = 0;
  482. sd->dev_priv = NULL;
  483. sd->host_priv = NULL;
  484. #if defined(CONFIG_MEDIA_CONTROLLER)
  485. sd->entity.name = sd->name;
  486. sd->entity.obj_type = MEDIA_ENTITY_TYPE_V4L2_SUBDEV;
  487. sd->entity.function = MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN;
  488. #endif
  489. }
  490. EXPORT_SYMBOL(v4l2_subdev_init);
  491. void v4l2_subdev_notify_event(struct v4l2_subdev *sd,
  492. const struct v4l2_event *ev)
  493. {
  494. v4l2_event_queue(sd->devnode, ev);
  495. v4l2_subdev_notify(sd, V4L2_DEVICE_NOTIFY_EVENT, (void *)ev);
  496. }
  497. EXPORT_SYMBOL_GPL(v4l2_subdev_notify_event);