Advertisement
Guest User

Untitled

a guest
Jan 8th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. From 016527d3f47e8ca96edee80b2bb00497d5535379 Mon Sep 17 00:00:00 2001
  2. From: Florian Vaussard <[hidden email]>
  3. Date: Wed, 14 Mar 2012 16:08:00 +0100
  4. Subject: [PATCH] Adding missing ioctl's
  5.  
  6. ---
  7. drivers/media/video/omap3isp/ispvideo.c | 46
  8. +++++++++++++++++++++++++++++++
  9. 1 files changed, 46 insertions(+), 0 deletions(-)
  10.  
  11. diff --git a/drivers/media/video/omap3isp/ispvideo.c
  12. b/drivers/media/video/omap3isp/ispvideo.c
  13. index 1452b3a..a15e396 100644
  14. --- a/drivers/media/video/omap3isp/ispvideo.c
  15. +++ b/drivers/media/video/omap3isp/ispvideo.c
  16. @@ -733,6 +733,36 @@ isp_video_get_format(struct file *file, void *fh,
  17. struct
  18. v4l2_format *format)
  19. }
  20.  
  21. static int
  22. +isp_video_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc
  23. *fmtdesc)
  24. +{
  25. + struct isp_video_fh *vfh = to_isp_video_fh(fh);
  26. + struct isp_video *video = video_drvdata(file);
  27. +
  28. + if (fmtdesc->index)
  29. + {
  30. +// printk(KERN_ERR "%s: invalid index (%d)\n",__func__,
  31. fmtdesc->index);
  32. + return -EINVAL;
  33. + }
  34. +
  35. + if (fmtdesc->type != video->type)
  36. + {
  37. +// printk(KERN_ERR "%s: invalid type (%d). Current type:
  38. %d\n",__func__, fmtdesc->type, video->type);
  39. + return -EINVAL;
  40. + }
  41. +
  42. + // ***Ugly hack***
  43. + fmtdesc->flags = 0;
  44. + fmtdesc->description[0] = 'U';
  45. + fmtdesc->description[1] = 'Y';
  46. + fmtdesc->description[2] = 'V';
  47. + fmtdesc->description[3] = 'Y';
  48. + fmtdesc->description[4] = '0';
  49. + fmtdesc->pixelformat = V4L2_PIX_FMT_UYVY;
  50. +
  51. + return 0;
  52. +}
  53. +
  54. +static int
  55. isp_video_set_format(struct file *file, void *fh, struct v4l2_format
  56. *format)
  57. {
  58. struct isp_video_fh *vfh = to_isp_video_fh(fh);
  59. @@ -765,6 +795,8 @@ isp_video_try_format(struct file *file, void *fh, struct
  60. v4l2_format *format)
  61. u32 pad;
  62. int ret;
  63.  
  64. +// printk(KERN_ERR "%s: Trying format %d\n",__func__,
  65. format->fmt.pix.pixelformat);
  66. +
  67. if (format->type != video->type)
  68. return -EINVAL;
  69.  
  70. @@ -1158,8 +1190,21 @@ isp_video_s_input(struct file *file, void *fh,
  71. unsigned
  72. int input)
  73. return input == 0 ? 0 : -EINVAL;
  74. }
  75.  
  76. +static int
  77. +isp_video_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl
  78. *queryctrl)
  79. +{
  80. +// printk(KERN_ERR "%s: querry id (%d)\n",__func__, queryctrl->id);
  81. +// printk(KERN_ERR "%s: querry type (%d)\n",__func__, queryctrl->type);
  82. +
  83. + if (queryctrl->id < V4L2_CID_BASE)
  84. + return -EDOM;
  85. +
  86. + return -EINVAL;
  87. +}
  88. +
  89. static const struct v4l2_ioctl_ops isp_video_ioctl_ops = {
  90. .vidioc_querycap = isp_video_querycap,
  91. + .vidioc_enum_fmt_vid_cap = isp_video_enum_format,
  92. .vidioc_g_fmt_vid_cap = isp_video_get_format,
  93. .vidioc_s_fmt_vid_cap = isp_video_set_format,
  94. .vidioc_try_fmt_vid_cap = isp_video_try_format,
  95. @@ -1180,6 +1225,7 @@ static const struct v4l2_ioctl_ops
  96. isp_video_ioctl_ops = {
  97. .vidioc_enum_input = isp_video_enum_input,
  98. .vidioc_g_input = isp_video_g_input,
  99. .vidioc_s_input = isp_video_s_input,
  100. + .vidioc_queryctrl = isp_video_queryctrl,
  101. };
  102.  
  103. /*
  104. -----------------------------------------------------------------------------
  105. --
  106. 1.7.5.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement