History

Merge branch 'patchwork' into v4l_for_linus

* patchwork: (204 commits) [media] rc: sunxi-cir: Initialize the spinlock properly [media] rtl2832: do not filter out slave TS null packets [media] rtl2832: print reg number on error case [media] rtl28xxu: return demod reg page from driver cache [media] coda: enable MPEG-2 ES decoding [media] coda: don't start streaming without queued buffers [media] coda: hook up vidioc_prepare_buf [media] coda: relax coda_jpeg_check_buffer for trailing bytes [media] coda: make to_coda_video_device static [media] s5p-mfc: remove volatile attribute from MFC register addresses [media] s5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_void [media] s5p-mfc: use spinlock to protect MFC context [media] s5p-mfc: remove unnecessary callbacks [media] s5p-mfc: make queue cleanup code common [media] s5p-mfc: use one implementation of s5p_mfc_get_new_ctx [media] s5p-mfc: constify s5p_mfc_codec_ops structures [media] au8522: Avoid memory leak for device config data [media] ir-lirc-codec.c: don't leak lirc->drv-rbuf [media] uvcvideo: small cleanup in uvc_video_clock_update() [media] uvcvideo: Fix reading the current exposure value of UVC ...

Mauro Carvalho Chehab committed 10 years ago

Commit c3152592 parents afd2ff9 768acf4528 files · +4540 −4096Browse files

Unified · Split

528 files
  1. Documentation/DocBook/device-drivers.tmpl +16 −68
  2. Documentation/DocBook/media/Makefile +4 −2
  3. Documentation/DocBook/media/dvb/dvbproperty.xml +1 −1
  4. Documentation/DocBook/media/dvb/examples.xml +1 −1
  5. Documentation/DocBook/media/dvb/intro.xml +1 −1
  6. Documentation/DocBook/media/v4l/capture.c.xml +1 −1
  7. Documentation/DocBook/media/v4l/compat.xml +1 −1
  8. Documentation/DocBook/media/v4l/io.xml +5 −5
  9. Documentation/DocBook/media/v4l/v4l2.xml +10 −0
  10. Documentation/DocBook/media/v4l/vidioc-create-bufs.xml +14 −16
  11. Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-info.xml +1 −1
  12. Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml +1 −1
  13. Documentation/DocBook/media/v4l/vidioc-enumstd.xml +1 −1
  14. Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml +25 −3
  15. Documentation/DocBook/media_api.tmpl +3 −3
  16. Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +10 −10
  17. Documentation/dvb/README.dvb-usb +2 −2
  18. Documentation/dvb/faq.txt +1 −1
  19. Documentation/dvb/get_dvb_firmware +11 −11
  20. Documentation/dvb/readme.txt +5 −5
  21. Documentation/video4linux/API.html +1 −1
  22. Documentation/video4linux/CARDLIST.em28xx +2 −2
  23. Documentation/video4linux/fimc.txt +3 −3
  24. Documentation/video4linux/omap4_camera.txt +1 −1
  25. Documentation/video4linux/si4713.txt +1 −1
  26. Documentation/video4linux/v4l2-pci-skeleton.c +6 −7
  27. MAINTAINERS +118 −108
  28. arch/arm/boot/dts/stihxxx-b2120.dtsi +44 −2
  29. arch/arm/mach-davinci/board-da850-evm.c +2 −2
  30. arch/arm/mach-davinci/board-dm355-evm.c +1 −1
  31. arch/arm/mach-davinci/board-dm365-evm.c +2 −2
  32. arch/arm/mach-davinci/board-dm644x-evm.c +1 −1
  33. arch/arm/mach-davinci/board-dm646x-evm.c +2 −2
  34. arch/arm/mach-imx/devices/devices-common.h +2 −2
  35. arch/arm/mach-omap1/include/mach/camera.h +1 −1
  36. arch/arm/mach-omap2/board-rx51-peripherals.c +2 −2
  37. arch/arm/mach-pxa/devices.c +1 −1
  38. arch/arm/mach-pxa/em-x270.c +1 −1
  39. arch/arm/mach-pxa/ezx.c +1 −1
  40. arch/arm/mach-pxa/mioa701.c +1 −1
  41. arch/arm/mach-pxa/palmtreo.c +1 −1
  42. arch/arm/mach-pxa/palmz72.c +1 −1
  43. arch/arm/mach-pxa/pcm990-baseboard.c +2 −2
  44. arch/arm/plat-samsung/devs.c +1 −1
  45. arch/blackfin/mach-bf561/boards/ezkit.c +1 −1
  46. arch/blackfin/mach-bf609/boards/ezkit.c +3 −3
  47. arch/sh/boards/mach-ap325rxa/setup.c +3 −3
  48. arch/sh/boards/mach-ecovec24/setup.c +5 −5
  49. arch/sh/boards/mach-kfr2r09/setup.c +2 −2
  50. arch/sh/boards/mach-migor/setup.c +3 −3
  51. arch/sh/boards/mach-se/7724/setup.c +3 −3
  52. drivers/gpu/ipu-v3/ipu-cpmem.c +1 −1
  53. drivers/input/touchscreen/sur40.c +6 −7
  54. drivers/media/Kconfig +2 −2
  55. drivers/media/common/cx2341x.c +1 −1
  56. drivers/media/common/saa7146/saa7146_core.c +1 −1
  57. drivers/media/common/saa7146/saa7146_fops.c +1 −1
  58. drivers/media/common/saa7146/saa7146_hlp.c +1 −1
  59. drivers/media/common/saa7146/saa7146_i2c.c +1 −1
  60. drivers/media/common/saa7146/saa7146_vbi.c +1 −1
  61. drivers/media/common/saa7146/saa7146_video.c +1 −1
  62. drivers/media/common/siano/smsir.h +0 −2
  63. drivers/media/dvb-core/demux.h +65 −2
  64. drivers/media/dvb-core/dvb-usb-ids.h +1 −0
  65. drivers/media/dvb-core/dvb_frontend.c +16 −11
  66. drivers/media/dvb-core/dvb_frontend.h +168 −53
  67. drivers/media/dvb-frontends/Kconfig +1 −1
  68. drivers/media/dvb-frontends/au8522_common.c +5 −5
  69. drivers/media/dvb-frontends/au8522_decoder.c +2 −12
  70. drivers/media/dvb-frontends/au8522_dig.c +8 −8
  71. drivers/media/dvb-frontends/au8522_priv.h +1 −1
  72. drivers/media/dvb-frontends/bsbe1-d01a.h +1 −1
  73. drivers/media/dvb-frontends/bsbe1.h +1 −1
  74. drivers/media/dvb-frontends/bsru6.h +1 −1
  75. drivers/media/dvb-frontends/isl6405.c +1 −1
  76. drivers/media/dvb-frontends/isl6405.h +1 −1
  77. drivers/media/dvb-frontends/isl6421.c +1 −1
  78. drivers/media/dvb-frontends/isl6421.h +1 −1
  79. drivers/media/dvb-frontends/lnbp21.c +1 −1
  80. drivers/media/dvb-frontends/lnbp21.h +1 −1
  81. drivers/media/dvb-frontends/lnbp22.c +1 −1
  82. drivers/media/dvb-frontends/lnbp22.h +1 −1
  83. drivers/media/dvb-frontends/rtl2832.c +6 −15
  84. drivers/media/dvb-frontends/rtl2832_sdr.c +2 −2
  85. drivers/media/dvb-frontends/si2165.c +229 −122
  86. drivers/media/dvb-frontends/stb6100.c +19 −57
  87. drivers/media/dvb-frontends/stb6100.h +0 −1
  88. drivers/media/dvb-frontends/stb6100_cfg.h +21 −16
  89. drivers/media/dvb-frontends/stb6100_proc.h +23 −20
  90. drivers/media/dvb-frontends/tda665x.c +88 −95
  91. drivers/media/dvb-frontends/tda8261.c +52 −73
  92. drivers/media/dvb-frontends/tda8261_cfg.h +11 −26
  93. drivers/media/dvb-frontends/tdhd1.h +1 −1
  94. drivers/media/i2c/Kconfig +10 −0
  95. drivers/media/i2c/Makefile +1 −0
  96. drivers/media/i2c/ad9389b.c +1 −1
  97. drivers/media/i2c/adp1653.c +1 −1
  98. drivers/media/i2c/adv7180.c +1 −1
  99. drivers/media/i2c/adv7183.c +1 −1
  100. drivers/media/i2c/adv7343.c +1 −1
  101. drivers/media/i2c/adv7393.c +1 −1
  102. drivers/media/i2c/adv7511.c +2 −2
  103. drivers/media/i2c/adv7604.c +4 −4
  104. drivers/media/i2c/adv7842.c +4 −4
  105. drivers/media/i2c/ak881x.c +1 −1
  106. drivers/media/i2c/as3645a.c +1 −1
  107. drivers/media/i2c/bt819.c +1 −1
  108. drivers/media/i2c/cs3308.c +138 −0
  109. drivers/media/i2c/cx25840/cx25840-audio.c +1 −1
  110. drivers/media/i2c/cx25840/cx25840-core.c +61 −56
  111. drivers/media/i2c/cx25840/cx25840-core.h +1 −0
  112. drivers/media/i2c/cx25840/cx25840-firmware.c +1 −1
  113. drivers/media/i2c/cx25840/cx25840-ir.c +1 −1
  114. drivers/media/i2c/cx25840/cx25840-vbi.c +24 −10
  115. drivers/media/i2c/ir-kbd-i2c.c +1 −1
  116. drivers/media/i2c/lm3560.c +1 −1
  117. drivers/media/i2c/lm3646.c +1 −1
  118. drivers/media/i2c/m52790.c +1 −1
  119. drivers/media/i2c/m5mols/m5mols_capture.c +2 −2
  120. drivers/media/i2c/m5mols/m5mols_core.c +1 −1
  121. drivers/media/i2c/msp3400-driver.c +2 −2
  122. drivers/media/i2c/msp3400-driver.h +1 −1
  123. drivers/media/i2c/msp3400-kthreads.c +1 −1
  124. drivers/media/i2c/mt9m032.c +2 −2
  125. drivers/media/i2c/mt9p031.c +2 −2
  126. drivers/media/i2c/mt9t001.c +2 −2
  127. drivers/media/i2c/mt9v011.c +2 −2
  128. drivers/media/i2c/mt9v032.c +2 −2
  129. drivers/media/i2c/noon010pc30.c +1 −1
  130. drivers/media/i2c/ov2659.c +2 −2
  131. drivers/media/i2c/ov7670.c +1 −1
  132. drivers/media/i2c/ov9650.c +1 −1
  133. drivers/media/i2c/s5c73m3/s5c73m3-core.c +1 −1
  134. drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c +1 −1
  135. drivers/media/i2c/s5c73m3/s5c73m3-spi.c +1 −0
  136. drivers/media/i2c/s5c73m3/s5c73m3.h +1 −1
  137. drivers/media/i2c/s5k4ecgx.c +1 −1
  138. drivers/media/i2c/s5k6aa.c +1 −1
  139. drivers/media/i2c/saa6588.c +1 −1
  140. drivers/media/i2c/saa7115.c +1 −1
  141. drivers/media/i2c/saa7127.c +1 −1
  142. drivers/media/i2c/smiapp/smiapp.h +1 −1
  143. drivers/media/i2c/soc_camera/mt9m001.c +1 −1
  144. drivers/media/i2c/soc_camera/mt9t112.c +1 −1
  145. drivers/media/i2c/soc_camera/mt9v022.c +2 −2
  146. drivers/media/i2c/soc_camera/ov772x.c +1 −1
  147. drivers/media/i2c/soc_camera/rj54n1cb0c.c +1 −1
  148. drivers/media/i2c/soc_camera/tw9910.c +1 −1
  149. drivers/media/i2c/sr030pc30.c +1 −1
  150. drivers/media/i2c/tc358743.c +3 −3
  151. drivers/media/i2c/ths7303.c +1 −1
  152. drivers/media/i2c/tvaudio.c +1 −1
  153. drivers/media/i2c/tvp514x.c +1 −1
  154. drivers/media/i2c/tvp5150.c +1 −1
  155. drivers/media/i2c/tvp7002.c +1 −1
  156. drivers/media/i2c/uda1342.c +1 −1
  157. drivers/media/i2c/upd64031a.c +1 −1
  158. drivers/media/i2c/upd64083.c +1 −1
  159. drivers/media/i2c/wm8775.c +1 −1
  160. drivers/media/pci/bt8xx/bttv-cards.c +2 −2
  161. drivers/media/pci/bt8xx/bttv-driver.c +3 −3
  162. drivers/media/pci/bt8xx/bttvp.h +2 −2
  163. drivers/media/pci/cobalt/cobalt-driver.c +3 −3
  164. drivers/media/pci/cobalt/cobalt-irq.c +2 −2
  165. drivers/media/pci/cobalt/cobalt-v4l2.c +7 −11
  166. drivers/media/pci/cx18/cx18-cards.c +1 −1
  167. drivers/media/pci/cx18/cx18-controls.c +1 −1
  168. drivers/media/pci/cx18/cx18-controls.h +1 −1
  169. drivers/media/pci/cx18/cx18-driver.h +1 −1
  170. drivers/media/pci/cx18/cx18-ioctl.c +2 −2
  171. drivers/media/pci/cx18/cx23418.h +1 −1
  172. drivers/media/pci/cx23885/Kconfig +1 −0
  173. drivers/media/pci/cx23885/cx23885-417.c +2 −2
  174. drivers/media/pci/cx23885/cx23885-cards.c +115 −1
  175. drivers/media/pci/cx23885/cx23885-core.c +11 −1
  176. drivers/media/pci/cx23885/cx23885-dvb.c +5 −3
  177. drivers/media/pci/cx23885/cx23885-i2c.c +2 −0
  178. drivers/media/pci/cx23885/cx23885-input.c +1 −1
  179. drivers/media/pci/cx23885/cx23885-vbi.c +2 −3
  180. drivers/media/pci/cx23885/cx23885-video.c +44 −5
  181. drivers/media/pci/cx23885/cx23885.h +3 −6
  182. drivers/media/pci/cx25821/cx25821-video.c +7 −7
  183. drivers/media/pci/cx88/cx88-alsa.c +1 −1
  184. drivers/media/pci/cx88/cx88-blackbird.c +2 −2
  185. drivers/media/pci/cx88/cx88-core.c +1 −1
  186. drivers/media/pci/cx88/cx88-dvb.c +1 −1
  187. drivers/media/pci/cx88/cx88-vbi.c +1 −1
  188. drivers/media/pci/cx88/cx88-video.c +2 −2
  189. drivers/media/pci/cx88/cx88.h +3 −3
  190. drivers/media/pci/ddbridge/ddbridge-core.c +2 −2
  191. drivers/media/pci/dm1105/dm1105.c +0 −1
  192. drivers/media/pci/dt3155/dt3155.c +6 −7
  193. drivers/media/pci/ivtv/ivtv-cards.c +6 −6
  194. drivers/media/pci/ivtv/ivtv-controls.c +1 −1
  195. drivers/media/pci/ivtv/ivtv-controls.h +1 −1
  196. drivers/media/pci/ivtv/ivtv-driver.c +2 −2
  197. drivers/media/pci/ivtv/ivtv-driver.h +2 −2
  198. drivers/media/pci/ivtv/ivtv-fileops.c +1 −1
  199. drivers/media/pci/ivtv/ivtv-firmware.c +1 −1
  200. drivers/media/pci/ivtv/ivtv-i2c.c +1 −1
  201. drivers/media/pci/ivtv/ivtv-ioctl.c +5 −5
  202. drivers/media/pci/ivtv/ivtv-routing.c +4 −4
  203. drivers/media/pci/netup_unidvb/netup_unidvb_core.c +1 −2
  204. drivers/media/pci/saa7134/saa7134-core.c +1 −1
  205. drivers/media/pci/saa7134/saa7134-ts.c +1 −1
  206. drivers/media/pci/saa7134/saa7134-vbi.c +1 −1
  207. drivers/media/pci/saa7134/saa7134-video.c +2 −2
  208. drivers/media/pci/saa7134/saa7134.h +2 −2
  209. drivers/media/pci/saa7146/hexium_gemini.c +1 −1
  210. drivers/media/pci/saa7146/hexium_orion.c +1 −1
  211. drivers/media/pci/saa7146/mxb.c +2 −2
  212. drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +1 −3
  213. drivers/media/pci/solo6x10/solo6x10-v4l2.c +2 −2
  214. drivers/media/pci/sta2x11/sta2x11_vip.c +2 −2
  215. drivers/media/pci/ttpci/av7110.c +3 −3
  216. drivers/media/pci/ttpci/av7110.h +1 −1
  217. drivers/media/pci/ttpci/av7110_av.c +8 −3
  218. drivers/media/pci/ttpci/av7110_av.h +2 −1
  219. drivers/media/pci/ttpci/av7110_ca.c +1 −1
  220. drivers/media/pci/ttpci/av7110_hw.c +1 −1
  221. drivers/media/pci/ttpci/av7110_v4l.c +1 −1
  222. drivers/media/pci/ttpci/budget-av.c +2 −2
  223. drivers/media/pci/ttpci/budget-ci.c +1 −1
  224. drivers/media/pci/ttpci/budget-core.c +1 −1
  225. drivers/media/pci/ttpci/budget-patch.c +1 −1
  226. drivers/media/pci/ttpci/budget.c +1 −1
  227. drivers/media/pci/ttpci/budget.h +1 −1
  228. drivers/media/pci/tw68/tw68-video.c +11 −11
  229. drivers/media/pci/zoran/zoran_card.c +1 −1
  230. drivers/media/platform/Kconfig +1 −1
  231. drivers/media/platform/am437x/am437x-vpfe.c +10 −9
  232. drivers/media/platform/blackfin/bfin_capture.c +6 −8
  233. drivers/media/platform/coda/coda-bit.c +4 −4
  234. drivers/media/platform/coda/coda-common.c +12 −13
  235. drivers/media/platform/coda/coda-jpeg.c +20 −6
  236. drivers/media/platform/coda/coda.h +2 −2
  237. drivers/media/platform/davinci/Kconfig +6 −0
  238. drivers/media/platform/davinci/vpbe_display.c +7 −8
  239. drivers/media/platform/davinci/vpif_capture.c +9 −10
  240. drivers/media/platform/davinci/vpif_display.c +10 −9
  241. drivers/media/platform/exynos-gsc/gsc-m2m.c +2 −3
  242. drivers/media/platform/exynos4-is/common.c +1 −1
  243. drivers/media/platform/exynos4-is/fimc-capture.c +16 −17
  244. drivers/media/platform/exynos4-is/fimc-core.h +1 −1
  245. drivers/media/platform/exynos4-is/fimc-isp-video.c +16 −19
  246. drivers/media/platform/exynos4-is/fimc-isp.h +1 −1
  247. drivers/media/platform/exynos4-is/fimc-lite-reg.c +1 −1
  248. drivers/media/platform/exynos4-is/fimc-lite.c +16 −19
  249. drivers/media/platform/exynos4-is/fimc-lite.h +1 −1
  250. drivers/media/platform/exynos4-is/fimc-m2m.c +2 −2
  251. drivers/media/platform/exynos4-is/fimc-reg.c +1 −1
  252. drivers/media/platform/exynos4-is/media-dev.c +1 −1
  253. drivers/media/platform/exynos4-is/media-dev.h +1 −1
  254. drivers/media/platform/exynos4-is/mipi-csis.c +1 −1
  255. drivers/media/platform/m2m-deinterlace.c +1 −2
  256. drivers/media/platform/marvell-ccic/mcam-core.c +9 −8
  257. drivers/media/platform/marvell-ccic/mmp-driver.c +1 −1
  258. drivers/media/platform/mx2_emmaprp.c +1 −2
  259. drivers/media/platform/omap/omap_vout_vrfb.c +6 −4
  260. drivers/media/platform/omap3isp/ispvideo.c +1 −2
  261. drivers/media/platform/rcar_jpu.c +21 −19
  262. drivers/media/platform/s3c-camif/camif-capture.c +12 −23
  263. drivers/media/platform/s3c-camif/camif-core.h +1 −1
  264. drivers/media/platform/s3c-camif/camif-regs.h +1 −1
  265. drivers/media/platform/s5p-g2d/g2d.c +2 −2
  266. drivers/media/platform/s5p-jpeg/jpeg-core.c +2 −3
  267. drivers/media/platform/s5p-mfc/s5p_mfc.c +62 −41
  268. drivers/media/platform/s5p-mfc/s5p_mfc_common.h +5 −9
  269. drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +8 −8
  270. drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +19 −20
  271. drivers/media/platform/s5p-mfc/s5p_mfc_dec.h +1 −1
  272. drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +15 −32
  273. drivers/media/platform/s5p-mfc/s5p_mfc_enc.h +1 −1
  274. drivers/media/platform/s5p-mfc/s5p_mfc_opr.h +244 −263
  275. drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c +0 −94
  276. drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +8 −113
  277. drivers/media/platform/s5p-tv/hdmi_drv.c +2 −2
  278. drivers/media/platform/s5p-tv/mixer_video.c +1 −1
  279. drivers/media/platform/s5p-tv/sii9234_drv.c +1 −1
  280. drivers/media/platform/sh_veu.c +10 −23
  281. drivers/media/platform/sh_vou.c +7 −8
  282. drivers/media/platform/soc_camera/atmel-isi.c +125 −43
  283. drivers/media/platform/soc_camera/atmel-isi.h +10 −0
  284. drivers/media/platform/soc_camera/mx2_camera.c +3 −9
  285. drivers/media/platform/soc_camera/mx3_camera.c +10 −34
  286. drivers/media/platform/soc_camera/omap1_camera.c +2 −2
  287. drivers/media/platform/soc_camera/pxa_camera.c +2 −2
  288. drivers/media/platform/soc_camera/rcar_vin.c +37 −82
  289. drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c +11 −34
  290. drivers/media/platform/soc_camera/sh_mobile_csi2.c +3 −3
  291. drivers/media/platform/soc_camera/soc_camera.c +13 −12
  292. drivers/media/platform/soc_camera/soc_camera_platform.c +1 −1
  293. drivers/media/platform/soc_camera/soc_mediabus.c +1 −1
  294. drivers/media/platform/sti/bdisp/bdisp-v4l2.c +6 −8
  295. drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c +8 −8
  296. drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +1 −1
  297. drivers/media/platform/ti-vpe/vpe.c +1 −2
  298. drivers/media/platform/timblogiw.c +1 −1
  299. drivers/media/platform/via-camera.c +1 −1
  300. drivers/media/platform/vim2m.c +5 −10
  301. drivers/media/platform/vivid/vivid-core.h +2 −1
  302. drivers/media/platform/vivid/vivid-ctrls.c +30 −5
  303. drivers/media/platform/vivid/vivid-kthread-cap.c +3 −3
  304. drivers/media/platform/vivid/vivid-kthread-out.c +4 −4
  305. drivers/media/platform/vivid/vivid-sdr-cap.c +3 −3
  306. drivers/media/platform/vivid/vivid-vbi-cap.c +3 −5
  307. drivers/media/platform/vivid/vivid-vbi-out.c +1 −1
  308. drivers/media/platform/vivid/vivid-vid-cap.c +15 −19
  309. drivers/media/platform/vivid/vivid-vid-out.c +13 −17
  310. drivers/media/platform/vsp1/vsp1_video.c +11 −42
  311. drivers/media/platform/xilinx/xilinx-dma.c +6 −8
  312. drivers/media/platform/xilinx/xilinx-tpg.c +2 −0
  313. drivers/media/platform/xilinx/xilinx-vipp.c +3 −1
  314. drivers/media/radio/radio-maxiradio.c +2 −2
  315. drivers/media/radio/radio-sf16fmr2.c +2 −2
  316. drivers/media/radio/radio-shark.c +2 −2
  317. drivers/media/radio/radio-shark2.c +1 −1
  318. drivers/media/radio/radio-si476x.c +1 −1
  319. drivers/media/radio/radio-tea5777.h +1 −1
  320. drivers/media/radio/radio-timb.c +1 −1
  321. drivers/media/radio/si4713/radio-usb-si4713.c +1 −1
  322. drivers/media/radio/si4713/si4713.h +1 −1
  323. drivers/media/radio/tea575x.c +1 −1
  324. drivers/media/rc/Kconfig +2 −1
  325. drivers/media/rc/gpio-ir-recv.c +23 −1
  326. drivers/media/rc/ir-jvc-decoder.c +0 −3
  327. drivers/media/rc/ir-lirc-codec.c +1 −0
  328. drivers/media/rc/ir-mce_kbd-decoder.c +0 −3
  329. drivers/media/rc/ir-nec-decoder.c +0 −3
  330. drivers/media/rc/ir-rc5-decoder.c +0 −3
  331. drivers/media/rc/ir-rc6-decoder.c +0 −5
  332. drivers/media/rc/ir-rx51.c +1 −1
  333. drivers/media/rc/ir-sanyo-decoder.c +0 −3
  334. drivers/media/rc/ir-sharp-decoder.c +3 −4
  335. drivers/media/rc/ir-sony-decoder.c +0 −4
  336. drivers/media/rc/ir-xmp-decoder.c +0 −3
  337. drivers/media/rc/nuvoton-cir.c +69 −87
  338. drivers/media/rc/nuvoton-cir.h +16 −12
  339. drivers/media/rc/rc-core-priv.h +0 −71
  340. drivers/media/rc/rc-ir-raw.c +17 −24
  341. drivers/media/rc/rc-main.c +65 −23
  342. drivers/media/rc/st_rc.c +9 −5
  343. drivers/media/rc/streamzap.c +9 −10
  344. drivers/media/rc/sunxi-cir.c +2 −0
  345. drivers/media/tuners/max2165.c +1 −1
  346. drivers/media/tuners/mt2063.c +0 −1
  347. drivers/media/tuners/si2157.c +1 −0
  348. drivers/media/usb/airspy/airspy.c +2 −2
  349. drivers/media/usb/as102/as102_fw.c +1 −0
  350. drivers/media/usb/au0828/au0828-vbi.c +4 −10
  351. drivers/media/usb/au0828/au0828-video.c +5 −9
  352. drivers/media/usb/cpia2/cpia2_usb.c +1 −2
  353. drivers/media/usb/cx231xx/cx231xx-417.c +24 −2
  354. drivers/media/usb/cx231xx/cx231xx-cards.c +5 −5
  355. drivers/media/usb/cx231xx/cx231xx-core.c +14 −1
  356. drivers/media/usb/cx231xx/cx231xx-dvb.c +4 −4
  357. drivers/media/usb/cx231xx/cx231xx-vbi.c +1 −1
  358. drivers/media/usb/cx231xx/cx231xx-video.c +4 −3
  359. drivers/media/usb/cx231xx/cx231xx.h +2 −2
  360. drivers/media/usb/dvb-usb-v2/Kconfig +1 −1
  361. drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c +2 −2
  362. drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h +2 −2
  363. drivers/media/usb/dvb-usb-v2/mxl111sf.c +3 −3
  364. drivers/media/usb/dvb-usb-v2/rtl28xxu.c +11 −5
  365. drivers/media/usb/dvb-usb/Kconfig +1 −1
  366. drivers/media/usb/em28xx/em28xx-camera.c +2 −2
  367. drivers/media/usb/em28xx/em28xx-cards.c +12 −6
  368. drivers/media/usb/em28xx/em28xx-dvb.c +15 −0
  369. drivers/media/usb/em28xx/em28xx-vbi.c +8 −12
  370. drivers/media/usb/em28xx/em28xx-video.c +6 −17
  371. drivers/media/usb/em28xx/em28xx.h +1 −1
  372. drivers/media/usb/go7007/go7007-driver.c +1 −1
  373. drivers/media/usb/go7007/go7007-usb.c +3 −3
  374. drivers/media/usb/go7007/go7007-v4l2.c +1 −2
  375. drivers/media/usb/gspca/ov534.c +7 −2
  376. drivers/media/usb/gspca/topro.c +5 −1
  377. drivers/media/usb/hackrf/hackrf.c +3 −3
  378. drivers/media/usb/hdpvr/hdpvr-video.c +1 −1
  379. drivers/media/usb/hdpvr/hdpvr.h +1 −1
  380. drivers/media/usb/msi2500/msi2500.c +0 −1
  381. drivers/media/usb/pvrusb2/pvrusb2-audio.c +1 −1
  382. drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c +1 −1
  383. drivers/media/usb/pvrusb2/pvrusb2-hdw-internal.h +2 −2
  384. drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c +1 −1
  385. drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +14 −2
  386. drivers/media/usb/pvrusb2/pvrusb2-video-v4l.c +1 −1
  387. drivers/media/usb/pwc/pwc-if.c +2 −3
  388. drivers/media/usb/s2255/s2255drv.c +2 −2
  389. drivers/media/usb/stk1160/stk1160-core.c +1 −1
  390. drivers/media/usb/stk1160/stk1160-v4l.c +2 −2
  391. drivers/media/usb/stk1160/stk1160-video.c +1 −1
  392. drivers/media/usb/tm6000/tm6000-cards.c +1 −1
  393. drivers/media/usb/ttusb-dec/ttusb_dec.c +1 −1
  394. drivers/media/usb/usbtv/usbtv-video.c +5 −6
  395. drivers/media/usb/usbvision/usbvision-core.c +1 −1
  396. drivers/media/usb/usbvision/usbvision-video.c +23 −2
  397. drivers/media/usb/uvc/uvc_ctrl.c +2 −1
  398. drivers/media/usb/uvc/uvc_driver.c +2 −1
  399. drivers/media/usb/uvc/uvc_queue.c +5 −9
  400. drivers/media/usb/uvc/uvc_v4l2.c +20 −0
  401. drivers/media/usb/uvc/uvc_video.c +6 −11
  402. drivers/media/v4l2-core/v4l2-clk.c +9 −0
  403. drivers/media/v4l2-core/v4l2-compat-ioctl32.c +3 −3
  404. drivers/media/v4l2-core/v4l2-ctrls.c +53 −24
  405. drivers/media/v4l2-core/v4l2-device.c +15 −6
  406. drivers/media/v4l2-core/v4l2-dv-timings.c +14 −2
  407. drivers/media/v4l2-core/v4l2-ioctl.c +7 −7
  408. drivers/media/v4l2-core/videobuf2-core.c +836 −90
  409. drivers/media/v4l2-core/videobuf2-internal.h +0 −161
  410. drivers/media/v4l2-core/videobuf2-v4l2.c +73 −630
  411. drivers/mfd/timberdale.c +2 −2
  412. drivers/staging/media/bcm2048/radio-bcm2048.c +2 −2
  413. drivers/staging/media/davinci_vpfe/Kconfig +2 −0
  414. drivers/staging/media/davinci_vpfe/dm365_ipipe.c +3 −2
  415. drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +1 −1
  416. drivers/staging/media/davinci_vpfe/dm365_resizer.c +1 −6
  417. drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c +1 −1
  418. drivers/staging/media/davinci_vpfe/vpfe_video.c +2 −2
  419. drivers/staging/media/lirc/lirc_imon.c +2 −0
  420. drivers/staging/media/lirc/lirc_parallel.c +15 −20
  421. drivers/staging/media/lirc/lirc_sasem.c +9 −11
  422. drivers/staging/media/lirc/lirc_serial.c +17 −33
  423. drivers/staging/media/omap4iss/Kconfig +1 −1
  424. drivers/staging/media/omap4iss/iss.c +2 −2
  425. drivers/staging/media/omap4iss/iss.h +1 −1
  426. drivers/staging/media/omap4iss/iss_csi2.c +3 −3
  427. drivers/staging/media/omap4iss/iss_csiphy.h +1 −1
  428. drivers/staging/media/omap4iss/iss_resizer.c +2 −2
  429. drivers/staging/media/omap4iss/iss_video.c +1 −2
  430. drivers/usb/gadget/function/uvc_queue.c +2 −2
  431. firmware/WHENCE +1 −1
  432. include/linux/platform_data/camera-rcar.h +0 −25
  433. include/linux/platform_data/media/camera-mx2.h +0 −0
  434. include/linux/platform_data/media/camera-mx3.h +0 −0
  435. include/linux/platform_data/media/camera-pxa.h +0 −0
  436. include/linux/platform_data/media/coda.h +0 −0
  437. include/linux/platform_data/media/gpio-ir-recv.h +0 −1
  438. include/linux/platform_data/media/ir-rx51.h +0 −0
  439. include/linux/platform_data/media/mmp-camera.h +0 −0
  440. include/linux/platform_data/media/omap1_camera.h +0 −0
  441. include/linux/platform_data/media/omap4iss.h +0 −0
  442. include/linux/platform_data/media/s5p_hdmi.h +0 −1
  443. include/linux/platform_data/media/si4713.h +1 −1
  444. include/linux/platform_data/media/sii9234.h +0 −0
  445. include/linux/platform_data/media/soc_camera_platform.h +0 −0
  446. include/linux/platform_data/media/timb_radio.h +0 −0
  447. include/linux/platform_data/media/timb_video.h +0 −0
  448. include/linux/videodev2.h +1 −1
  449. include/media/drv-intf/cx2341x.h +0 −0
  450. include/media/drv-intf/cx25840.h +0 −0
  451. include/media/drv-intf/exynos-fimc.h +0 −0
  452. include/media/drv-intf/msp3400.h +0 −1
  453. include/media/drv-intf/s3c_camif.h +0 −0
  454. include/media/drv-intf/saa7146.h +0 −0
  455. include/media/drv-intf/saa7146_vv.h +1 −1
  456. include/media/drv-intf/sh_mobile_ceu.h +0 −0
  457. include/media/drv-intf/sh_mobile_csi2.h +0 −0
  458. include/media/drv-intf/sh_vou.h +0 −0
  459. include/media/drv-intf/si476x.h +1 −1
  460. include/media/drv-intf/soc_mediabus.h +0 −0
  461. include/media/drv-intf/tea575x.h +1 −1
  462. include/media/i2c/ad9389b.h +0 −0
  463. include/media/i2c/adp1653.h +1 −1
  464. include/media/i2c/adv7183.h +0 −0
  465. include/media/i2c/adv7343.h +0 −0
  466. include/media/i2c/adv7393.h +0 −0
  467. include/media/i2c/adv7511.h +0 −0
  468. include/media/i2c/adv7604.h +0 −0
  469. include/media/i2c/adv7842.h +0 −0
  470. include/media/i2c/ak881x.h +0 −0
  471. include/media/i2c/as3645a.h +1 −1
  472. include/media/i2c/bt819.h +0 −0
  473. include/media/i2c/cs5345.h +0 −0
  474. include/media/i2c/cs53l32a.h +0 −0
  475. include/media/i2c/ir-kbd-i2c.h +0 −0
  476. include/media/i2c/lm3560.h +1 −1
  477. include/media/i2c/lm3646.h +1 −1
  478. include/media/i2c/m52790.h +0 −0
  479. include/media/i2c/m5mols.h +0 −0
  480. include/media/i2c/mt9m032.h +0 −0
  481. include/media/i2c/mt9p031.h +0 −0
  482. include/media/i2c/mt9t001.h +0 −0
  483. include/media/i2c/mt9t112.h +0 −0
  484. include/media/i2c/mt9v011.h +0 −0
  485. include/media/i2c/mt9v022.h +0 −0
  486. include/media/i2c/mt9v032.h +0 −0
  487. include/media/i2c/noon010pc30.h +0 −0
  488. include/media/i2c/ov2659.h +0 −0
  489. include/media/i2c/ov7670.h +0 −0
  490. include/media/i2c/ov772x.h +0 −0
  491. include/media/i2c/ov9650.h +0 −0
  492. include/media/i2c/rj54n1cb0c.h +0 −0
  493. include/media/i2c/s5c73m3.h +0 −0
  494. include/media/i2c/s5k4ecgx.h +0 −0
  495. include/media/i2c/s5k6aa.h +0 −0
  496. include/media/i2c/saa6588.h +0 −0
  497. include/media/i2c/saa7115.h +0 −1
  498. include/media/i2c/saa7127.h +0 −1
  499. include/media/i2c/smiapp.h +1 −1
  500. include/media/i2c/sr030pc30.h +0 −0
  501. include/media/i2c/tc358743.h +0 −0
  502. include/media/i2c/ths7303.h +0 −0
  503. include/media/i2c/tvaudio.h +0 −0
  504. include/media/i2c/tvp514x.h +0 −0
  505. include/media/i2c/tvp5150.h +0 −1
  506. include/media/i2c/tvp7002.h +0 −0
  507. include/media/i2c/tw9910.h +0 −0
  508. include/media/i2c/uda1342.h +0 −0
  509. include/media/i2c/upd64031a.h +0 −0
  510. include/media/i2c/upd64083.h +0 −0
  511. include/media/i2c/wm8775.h +0 −0
  512. include/media/lirc.h +1 −168
  513. include/media/rc-core.h +1 −0
  514. include/media/rc-map.h +20 −20
  515. include/media/v4l2-clk.h +5 −0
  516. include/media/v4l2-dv-timings.h +24 −1
  517. include/media/videobuf2-core.h +87 −21
  518. include/media/videobuf2-v4l2.h +2 −38
  519. include/trace/events/v4l2.h +2 −2
  520. include/trace/events/vb2.h +5 −2
  521. include/uapi/drm/drm_fourcc.h +1 −1
  522. include/uapi/linux/dvb/video.h +0 −1
  523. include/uapi/linux/lirc.h +168 −0
  524. include/uapi/linux/usb/video.h +1 −0
  525. include/uapi/linux/v4l2-controls.h +4 −2
  526. include/uapi/linux/videodev2.h +12 −2
  527. sound/pci/es1968.c +2 −2
  528. sound/pci/fm801.c +2 −2
Documentation/DocBook/device-drivers.tmpl+16−68
@@ -238,78 +238,26 @@ X!Isound/sound_firmware.c · 237 unmodified lines
238!Iinclude/media/videobuf2-memops.h238!Iinclude/media/videobuf2-memops.h
239 </sect1>239 </sect1>
240 <sect1><title>Digital TV (DVB) devices</title>240 <sect1><title>Digital TV (DVB) devices</title>
241!Idrivers/media/dvb-core/dvb_ca_en50221.h241 <sect1><title>Digital TV Common functions</title>
242!Idrivers/media/dvb-core/dvb_frontend.h
243!Idrivers/media/dvb-core/dvb_math.h242!Idrivers/media/dvb-core/dvb_math.h
244!Idrivers/media/dvb-core/dvb_ringbuffer.h243!Idrivers/media/dvb-core/dvb_ringbuffer.h
245!Idrivers/media/dvb-core/dvbdev.h244!Idrivers/media/dvb-core/dvbdev.h
246 <sect1><title>Digital TV Demux API</title>245 </sect1>
247 <para>The kernel demux API defines a driver-internal interface for246 <sect1><title>Digital TV Frontend kABI</title>
248 registering low-level, hardware specific driver to a hardware247!Pdrivers/media/dvb-core/dvb_frontend.h Digital TV Frontend
249 independent demux layer. It is only of interest for Digital TV248!Idrivers/media/dvb-core/dvb_frontend.h
250 device driver writers. The header file for this API is named249 </sect1>
251 <constant>demux.h</constant> and located in250 <sect1><title>Digital TV Demux kABI</title>
252 <constant>drivers/media/dvb-core</constant>.</para>251!Pdrivers/media/dvb-core/demux.h Digital TV Demux
253 252 <sect1><title>Demux Callback API</title>
254 <para>The demux API should be implemented for each demux in the253!Pdrivers/media/dvb-core/demux.h Demux Callback
255 system. It is used to select the TS source of a demux and to manage254 </sect1>
256 the demux resources. When the demux client allocates a resource via
257 the demux API, it receives a pointer to the API of that
258 resource.</para>
259 <para>Each demux receives its TS input from a DVB front-end or from
260 memory, as set via this demux API. In a system with more than one
261 front-end, the API can be used to select one of the DVB front-ends
262 as a TS source for a demux, unless this is fixed in the HW platform.
263 The demux API only controls front-ends regarding to their connections
264 with demuxes; the APIs used to set the other front-end parameters,
265 such as tuning, are not defined in this document.</para>
266 <para>The functions that implement the abstract interface demux should
267 be defined static or module private and registered to the Demux
268 core for external access. It is not necessary to implement every
269 function in the struct <constant>dmx_demux</constant>. For example,
270 a demux interface might support Section filtering, but not PES
271 filtering. The API client is expected to check the value of any
272 function pointer before calling the function: the value of NULL means
273 that the &#8220;function is not available&#8221;.</para>
274 <para>Whenever the functions of the demux API modify shared data,
275 the possibilities of lost update and race condition problems should
276 be addressed, e.g. by protecting parts of code with mutexes.</para>
277 <para>Note that functions called from a bottom half context must not
278 sleep. Even a simple memory allocation without using GFP_ATOMIC can
279 result in a kernel thread being put to sleep if swapping is needed.
280 For example, the Linux kernel calls the functions of a network device
281 interface from a bottom half context. Thus, if a demux API function
282 is called from network device code, the function must not sleep.
283 </para>
284 </sect1>
285
286 <section id="demux_callback_api">
287 <title>Demux Callback API</title>
288 <para>This kernel-space API comprises the callback functions that
289 deliver filtered data to the demux client. Unlike the other DVB
290 kABIs, these functions are provided by the client and called from
291 the demux code.</para>
292 <para>The function pointers of this abstract interface are not
293 packed into a structure as in the other demux APIs, because the
294 callback functions are registered and used independent of each
295 other. As an example, it is possible for the API client to provide
296 several callback functions for receiving TS packets and no
297 callbacks for PES packets or sections.</para>
298 <para>The functions that implement the callback API need not be
299 re-entrant: when a demux driver calls one of these functions,
300 the driver is not allowed to call the function again before
301 the original call returns. If a callback is triggered by a
302 hardware interrupt, it is recommended to use the Linux
303 &#8220;bottom half&#8221; mechanism or start a tasklet instead of
304 making the callback function call directly from a hardware
305 interrupt.</para>
306 <para>This mechanism is implemented by
307 <link linkend='API-dmx-ts-cb'>dmx_ts_cb()</link> and
308 <link linkend='API-dmx-section-cb'>dmx_section_cb()</link>.</para>
309 </section>
310
311!Idrivers/media/dvb-core/demux.h255!Idrivers/media/dvb-core/demux.h
312 </sect1>256 </sect1>
257 <sect1><title>Digital TV Conditional Access kABI</title>
258!Idrivers/media/dvb-core/dvb_ca_en50221.h
259 </sect1>
260 </sect1>
313 <sect1><title>Remote Controller devices</title>261 <sect1><title>Remote Controller devices</title>
314!Iinclude/media/rc-core.h262!Iinclude/media/rc-core.h
315!Iinclude/media/lirc_dev.h263!Iinclude/media/lirc_dev.h
Documentation/DocBook/media/Makefile+4−2
@@ -199,8 +199,10 @@ DVB_DOCUMENTED = \ · 198 unmodified lines
199#199#
200 200
201install_media_images = \201install_media_images = \
202 $(Q)-mkdir $(MEDIA_OBJ_DIR)/media_api; \202 $(Q)if [ "x$(findstring media_api.xml,$(DOCBOOKS))" != "x" ]; then \
203 cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api203 mkdir -p $(MEDIA_OBJ_DIR)/media_api; \
204 cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api; \
205 fi
204 206
205$(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64207$(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
206 $(Q)base64 -d $< >$@208 $(Q)base64 -d $< >$@
Documentation/DocBook/media/dvb/dvbproperty.xml+1−1
@@ -76,7 +76,7 @@ int main(void) · 75 unmodified lines
76 76
77<para>NOTE: While it is possible to directly call the Kernel code like the77<para>NOTE: While it is possible to directly call the Kernel code like the
78 above example, it is strongly recommended to use78 above example, it is strongly recommended to use
79 <ulink url="http://linuxtv.org/docs/libdvbv5/index.html">libdvbv5</ulink>,79 <ulink url="https://linuxtv.org/docs/libdvbv5/index.html">libdvbv5</ulink>,
80 as it provides abstraction to work with the supported digital TV standards80 as it provides abstraction to work with the supported digital TV standards
81 and provides methods for usual operations like program scanning and to81 and provides methods for usual operations like program scanning and to
82 read/write channel descriptor files.</para>82 read/write channel descriptor files.</para>
Documentation/DocBook/media/dvb/examples.xml+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
3</para>3</para>
4<para>NOTE: This section is out of date, and the code below won't even4<para>NOTE: This section is out of date, and the code below won't even
5 compile. Please refer to the5 compile. Please refer to the
6 <ulink url="http://linuxtv.org/docs/libdvbv5/index.html">libdvbv5</ulink>6 <ulink url="https://linuxtv.org/docs/libdvbv5/index.html">libdvbv5</ulink>
7 for updated/recommended examples.7 for updated/recommended examples.
8</para>8</para>
9 9
Documentation/DocBook/media/dvb/intro.xml+1−1
@@ -32,7 +32,7 @@ and filtering several section and PES data streams at the same time. · 31 unmodified lines
32new standard Linux DVB API. As a commitment to the development of32new standard Linux DVB API. As a commitment to the development of
33terminals based on open standards, Nokia and Convergence made it33terminals based on open standards, Nokia and Convergence made it
34available to all Linux developers and published it on34available to all Linux developers and published it on
35<ulink url="http://www.linuxtv.org/" /> in September 2000.35<ulink url="https://linuxtv.org" /> in September 2000.
36Convergence is the maintainer of the Linux DVB API. Together with the36Convergence is the maintainer of the Linux DVB API. Together with the
37LinuxTV community (i.e. you, the reader of this document), the Linux DVB37LinuxTV community (i.e. you, the reader of this document), the Linux DVB
38API will be constantly reviewed and improved. With the Linux driver for38API will be constantly reviewed and improved. With the Linux driver for
Documentation/DocBook/media/v4l/capture.c.xml+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
5 * This program can be used and distributed without restrictions.5 * This program can be used and distributed without restrictions.
6 *6 *
7 * This program is provided with the V4L2 API7 * This program is provided with the V4L2 API
8 * see http://linuxtv.org/docs.php for more information8 * see https://linuxtv.org/docs.php for more information
9 */9 */
10 10
11#include &lt;stdio.h&gt;11#include &lt;stdio.h&gt;
Documentation/DocBook/media/v4l/compat.xml+1−1
@@ -2666,7 +2666,7 @@ is useful to display images captured with V4L2 devices.</para> · 2665 unmodified lines
2666 <para>V4L2 does not support digital terrestrial, cable or2666 <para>V4L2 does not support digital terrestrial, cable or
2667satellite broadcast. A separate project aiming at digital receivers2667satellite broadcast. A separate project aiming at digital receivers
2668exists. You can find its homepage at <ulink2668exists. You can find its homepage at <ulink
2669url="http://linuxtv.org">http://linuxtv.org</ulink>. The Linux DVB API2669url="https://linuxtv.org">https://linuxtv.org</ulink>. The Linux DVB API
2670has no connection to the V4L2 API except that drivers for hybrid2670has no connection to the V4L2 API except that drivers for hybrid
2671hardware may support both.</para>2671hardware may support both.</para>
2672 </section>2672 </section>
Documentation/DocBook/media/v4l/io.xml+5−5
@@ -699,7 +699,7 @@ linkend="v4l2-buf-type" /></entry> · 698 unmodified lines
699buffer. It depends on the negotiated data format and may change with699buffer. It depends on the negotiated data format and may change with
700each buffer for compressed variable size data like JPEG images.700each buffer for compressed variable size data like JPEG images.
701Drivers must set this field when <structfield>type</structfield>701Drivers must set this field when <structfield>type</structfield>
702refers to an input stream, applications when it refers to an output stream.702refers to a capture stream, applications when it refers to an output stream.
703If the application sets this to 0 for an output stream, then703If the application sets this to 0 for an output stream, then
704<structfield>bytesused</structfield> will be set to the size of the704<structfield>bytesused</structfield> will be set to the size of the
705buffer (see the <structfield>length</structfield> field of this struct) by705buffer (see the <structfield>length</structfield> field of this struct) by
@@ -720,14 +720,14 @@ linkend="buffer-flags" />.</entry> · 14 unmodified lines
720 <entry>Indicates the field order of the image in the720 <entry>Indicates the field order of the image in the
721buffer, see <xref linkend="v4l2-field" />. This field is not used when721buffer, see <xref linkend="v4l2-field" />. This field is not used when
722the buffer contains VBI data. Drivers must set it when722the buffer contains VBI data. Drivers must set it when
723<structfield>type</structfield> refers to an input stream,723<structfield>type</structfield> refers to a capture stream,
724applications when it refers to an output stream.</entry>724applications when it refers to an output stream.</entry>
725 </row>725 </row>
726 <row>726 <row>
727 <entry>struct timeval</entry>727 <entry>struct timeval</entry>
728 <entry><structfield>timestamp</structfield></entry>728 <entry><structfield>timestamp</structfield></entry>
729 <entry></entry>729 <entry></entry>
730 <entry><para>For input streams this is time when the first data730 <entry><para>For capture streams this is time when the first data
731 byte was captured, as returned by the731 byte was captured, as returned by the
732 <function>clock_gettime()</function> function for the relevant732 <function>clock_gettime()</function> function for the relevant
733 clock id; see <constant>V4L2_BUF_FLAG_TIMESTAMP_*</constant> in733 clock id; see <constant>V4L2_BUF_FLAG_TIMESTAMP_*</constant> in
@@ -866,7 +866,7 @@ must set this to 0.</entry> · 132 unmodified lines
866 <entry></entry>866 <entry></entry>
867 <entry>The number of bytes occupied by data in the plane867 <entry>The number of bytes occupied by data in the plane
868 (its payload). Drivers must set this field when <structfield>type</structfield>868 (its payload). Drivers must set this field when <structfield>type</structfield>
869 refers to an input stream, applications when it refers to an output stream.869 refers to a capture stream, applications when it refers to an output stream.
870 If the application sets this to 0 for an output stream, then870 If the application sets this to 0 for an output stream, then
871 <structfield>bytesused</structfield> will be set to the size of the871 <structfield>bytesused</structfield> will be set to the size of the
872 plane (see the <structfield>length</structfield> field of this struct)872 plane (see the <structfield>length</structfield> field of this struct)
@@ -919,7 +919,7 @@ must set this to 0.</entry> · 46 unmodified lines
919 <entry></entry>919 <entry></entry>
920 <entry>Offset in bytes to video data in the plane.920 <entry>Offset in bytes to video data in the plane.
921 Drivers must set this field when <structfield>type</structfield>921 Drivers must set this field when <structfield>type</structfield>
922 refers to an input stream, applications when it refers to an output stream.922 refers to a capture stream, applications when it refers to an output stream.
923 Note that data_offset is included in <structfield>bytesused</structfield>.923 Note that data_offset is included in <structfield>bytesused</structfield>.
924 So the size of the image in the plane is924 So the size of the image in the plane is
925 <structfield>bytesused</structfield>-<structfield>data_offset</structfield> at925 <structfield>bytesused</structfield>-<structfield>data_offset</structfield> at
Documentation/DocBook/media/v4l/v4l2.xml+10−0
@@ -151,6 +151,16 @@ Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, · 150 unmodified lines
151structs, ioctls) must be noted in more detail in the history chapter151structs, ioctls) must be noted in more detail in the history chapter
152(compat.xml), along with the possible impact on existing drivers and152(compat.xml), along with the possible impact on existing drivers and
153applications. -->153applications. -->
154 <revision>
155 <revnumber>4.5</revnumber>
156 <date>2015-10-29</date>
157 <authorinitials>rr</authorinitials>
158 <revremark>Extend vidioc-g-ext-ctrls;. Replace ctrl_class with a new
159union with ctrl_class and which. Which is used to select the current value of
160the control or the default value.
161 </revremark>
162 </revision>
163
154 <revision>164 <revision>
155 <revnumber>4.4</revnumber>165 <revnumber>4.4</revnumber>
156 <date>2015-05-26</date>166 <date>2015-05-26</date>
Documentation/DocBook/media/v4l/vidioc-create-bufs.xml+14−16
@@ -58,7 +58,7 @@ · 57 unmodified lines
58 <para>This ioctl is used to create buffers for <link linkend="mmap">memory58 <para>This ioctl is used to create buffers for <link linkend="mmap">memory
59mapped</link> or <link linkend="userp">user pointer</link> or <link59mapped</link> or <link linkend="userp">user pointer</link> or <link
60linkend="dmabuf">DMA buffer</link> I/O. It can be used as an alternative or in60linkend="dmabuf">DMA buffer</link> I/O. It can be used as an alternative or in
61addition to the <constant>VIDIOC_REQBUFS</constant> ioctl, when a tighter61addition to the &VIDIOC-REQBUFS; ioctl, when a tighter
62control over buffers is required. This ioctl can be called multiple times to62control over buffers is required. This ioctl can be called multiple times to
63create buffers of different sizes.</para>63create buffers of different sizes.</para>
64 64
@@ -71,30 +71,28 @@ zeroed.</para> · 6 unmodified lines
71 71
72 <para>The <structfield>format</structfield> field specifies the image format72 <para>The <structfield>format</structfield> field specifies the image format
73that the buffers must be able to handle. The application has to fill in this73that the buffers must be able to handle. The application has to fill in this
74&v4l2-format;. Usually this will be done using the74&v4l2-format;. Usually this will be done using the &VIDIOC-TRY-FMT; or &VIDIOC-G-FMT; ioctls
75<constant>VIDIOC_TRY_FMT</constant> or <constant>VIDIOC_G_FMT</constant> ioctl()75to ensure that the requested format is supported by the driver.
76to ensure that the requested format is supported by the driver. Unsupported76Based on the format's <structfield>type</structfield> field the requested buffer
77formats will result in an error.</para>77size (for single-planar) or plane sizes (for multi-planar formats) will be
78used for the allocated buffers. The driver may return an error if the size(s)
79are not supported by the hardware (usually because they are too small).</para>
78 80
79 <para>The buffers created by this ioctl will have as minimum size the size81 <para>The buffers created by this ioctl will have as minimum size the size
80defined by the <structfield>format.pix.sizeimage</structfield> field. If the82defined by the <structfield>format.pix.sizeimage</structfield> field (or the
83corresponding fields for other format types). Usually if the
81<structfield>format.pix.sizeimage</structfield> field is less than the minimum84<structfield>format.pix.sizeimage</structfield> field is less than the minimum
82required for the given format, then <structfield>sizeimage</structfield> will be85required for the given format, then an error will be returned since drivers will
83increased by the driver to that minimum to allocate the buffers. If it is86typically not allow this. If it is larger, then the value will be used as-is.
84larger, then the value will be used as-is. The same applies to the87In other words, the driver may reject the requested size, but if it is accepted
85<structfield>sizeimage</structfield> field of the88the driver will use it unchanged.</para>
86<structname>v4l2_plane_pix_format</structname> structure in the case of
87multiplanar formats.</para>
88 89
89 <para>When the ioctl is called with a pointer to this structure the driver90 <para>When the ioctl is called with a pointer to this structure the driver
90will attempt to allocate up to the requested number of buffers and store the91will attempt to allocate up to the requested number of buffers and store the
91actual number allocated and the starting index in the92actual number allocated and the starting index in the
92<structfield>count</structfield> and the <structfield>index</structfield> fields93<structfield>count</structfield> and the <structfield>index</structfield> fields
93respectively. On return <structfield>count</structfield> can be smaller than94respectively. On return <structfield>count</structfield> can be smaller than
94the number requested. The driver may also increase buffer sizes if required,95the number requested.</para>
95however, it will not update <structfield>sizeimage</structfield> field values.
96The user has to use <constant>VIDIOC_QUERYBUF</constant> to retrieve that
97information.</para>
98 96
99 <table pgwide="1" frame="none" id="v4l2-create-buffers">97 <table pgwide="1" frame="none" id="v4l2-create-buffers">
100 <title>struct <structname>v4l2_create_buffers</structname></title>98 <title>struct <structname>v4l2_create_buffers</structname></title>
Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-info.xml+1−1
@@ -99,7 +99,7 @@ if the driver supports writing registers to the device.</para> · 98 unmodified lines
99 <para>We recommended the <application>v4l2-dbg</application>99 <para>We recommended the <application>v4l2-dbg</application>
100utility over calling this ioctl directly. It is available from the100utility over calling this ioctl directly. It is available from the
101LinuxTV v4l-dvb repository; see <ulink101LinuxTV v4l-dvb repository; see <ulink
102url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for102url="https://linuxtv.org/repo/">https://linuxtv.org/repo/</ulink> for
103access instructions.</para>103access instructions.</para>
104 104
105 <!-- Note for convenience vidioc-dbg-g-register.sgml105 <!-- Note for convenience vidioc-dbg-g-register.sgml
Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml+1−1
@@ -117,7 +117,7 @@ However when a driver supports these ioctls it must also support · 116 unmodified lines
117 <para>We recommended the <application>v4l2-dbg</application>117 <para>We recommended the <application>v4l2-dbg</application>
118utility over calling these ioctls directly. It is available from the118utility over calling these ioctls directly. It is available from the
119LinuxTV v4l-dvb repository; see <ulink119LinuxTV v4l-dvb repository; see <ulink
120url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for120url="https://linuxtv.org/repo/">https://linuxtv.org/repo/</ulink> for
121access instructions.</para>121access instructions.</para>
122 122
123 <!-- Note for convenience vidioc-dbg-g-chip-info.sgml123 <!-- Note for convenience vidioc-dbg-g-chip-info.sgml
Documentation/DocBook/media/v4l/vidioc-enumstd.xml+1−1
@@ -198,7 +198,7 @@ video4linux-list@redhat.com on 17 Oct 2002 · 197 unmodified lines
198<constant>V4L2_STD_ATSC_16_VSB</constant> are U.S. terrestrial digital198<constant>V4L2_STD_ATSC_16_VSB</constant> are U.S. terrestrial digital
199TV standards. Presently the V4L2 API does not support digital TV. See199TV standards. Presently the V4L2 API does not support digital TV. See
200also the Linux DVB API at <ulink200also the Linux DVB API at <ulink
201url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>201url="https://linuxtv.org">https://linuxtv.org</ulink>.</para>
202<para><programlisting>202<para><programlisting>
203#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\203#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
204 V4L2_STD_PAL_B1 |\204 V4L2_STD_PAL_B1 |\
Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml+25−3
@@ -61,7 +61,7 @@ must belong to the same control class.</para> · 60 unmodified lines
61 61
62 <para>Applications must always fill in the62 <para>Applications must always fill in the
63<structfield>count</structfield>,63<structfield>count</structfield>,
64<structfield>ctrl_class</structfield>,64<structfield>which</structfield>,
65<structfield>controls</structfield> and65<structfield>controls</structfield> and
66<structfield>reserved</structfield> fields of &v4l2-ext-controls;, and66<structfield>reserved</structfield> fields of &v4l2-ext-controls;, and
67initialize the &v4l2-ext-control; array pointed to by the67initialize the &v4l2-ext-control; array pointed to by the
@@ -109,7 +109,7 @@ the driver whether wrong values are automatically adjusted to a valid · 41 unmodified lines
109value or if an error is returned.</para>109value or if an error is returned.</para>
110 110
111 <para>When the <structfield>id</structfield> or111 <para>When the <structfield>id</structfield> or
112<structfield>ctrl_class</structfield> is invalid drivers return an112<structfield>which</structfield> is invalid drivers return an
113&EINVAL;. When the value is out of bounds drivers can choose to take113&EINVAL;. When the value is out of bounds drivers can choose to take
114the closest valid value or return an &ERANGE;, whatever seems more114the closest valid value or return an &ERANGE;, whatever seems more
115appropriate. In the first case the new value is set in115appropriate. In the first case the new value is set in
@@ -223,7 +223,12 @@ Valid if <constant>V4L2_CTRL_FLAG_HAS_PAYLOAD</constant> is set for this control · 107 unmodified lines
223 <tgroup cols="3">223 <tgroup cols="3">
224 &cs-str;224 &cs-str;
225 <tbody valign="top">225 <tbody valign="top">
226 <row>
227 <entry>union</entry>
228 <entry>(anonymous)</entry>
229 </row>
226 <row>230 <row>
231 <entry></entry>
227 <entry>__u32</entry>232 <entry>__u32</entry>
228 <entry><structfield>ctrl_class</structfield></entry>233 <entry><structfield>ctrl_class</structfield></entry>
229 <entry>The control class to which all controls belong, see234 <entry>The control class to which all controls belong, see
@@ -233,6 +238,23 @@ belong to any control class. Whether drivers support this can be tested by setti · 3 unmodified lines
233<structfield>ctrl_class</structfield> to 0 and calling <constant>VIDIOC_TRY_EXT_CTRLS</constant>238<structfield>ctrl_class</structfield> to 0 and calling <constant>VIDIOC_TRY_EXT_CTRLS</constant>
234with a <structfield>count</structfield> of 0. If that succeeds, then the driver239with a <structfield>count</structfield> of 0. If that succeeds, then the driver
235supports this feature.</entry>240supports this feature.</entry>
241 </row>
242 <row>
243 <entry></entry>
244 <entry>__u32</entry>
245 <entry><structfield>which</structfield></entry>
246 <entry><para>Which value of the control to get/set/try. <constant>V4L2_CTRL_WHICH_CUR_VAL</constant>
247will return the current value of the control and <constant>V4L2_CTRL_WHICH_DEF_VAL</constant> will
248return the default value of the control. Please note that you can only get the default value of the
249control, you cannot set or try it.</para>
250<para>For backwards compatibility you can also use a control class here (see
251<xref linkend="ctrl-class" />). In that case all controls have to belong to that
252control class. This usage is deprecated, instead just use <constant>V4L2_CTRL_WHICH_CUR_VAL</constant>.
253There are some very old drivers that do not yet support <constant>V4L2_CTRL_WHICH_CUR_VAL</constant>
254and that require a control class here. You can test for such drivers by setting ctrl_class to
255<constant>V4L2_CTRL_WHICH_CUR_VAL</constant> and calling VIDIOC_TRY_EXT_CTRLS with a count of 0.
256If that fails, then the driver does not support <constant>V4L2_CTRL_WHICH_CUR_VAL</constant>.</para>
257</entry>
236 </row>258 </row>
237 <row>259 <row>
238 <entry>__u32</entry>260 <entry>__u32</entry>
@@ -390,7 +412,7 @@ These controls are described in <xref linkend="rf-tuner-controls" />.</entry> · 151 unmodified lines
390 <listitem>412 <listitem>
391 <para>The &v4l2-ext-control; <structfield>id</structfield>413 <para>The &v4l2-ext-control; <structfield>id</structfield>
392is invalid, the &v4l2-ext-controls;414is invalid, the &v4l2-ext-controls;
393<structfield>ctrl_class</structfield> is invalid, or the &v4l2-ext-control;415<structfield>which</structfield> is invalid, or the &v4l2-ext-control;
394<structfield>value</structfield> was inappropriate (e.g. the given menu416<structfield>value</structfield> was inappropriate (e.g. the given menu
395index is not supported by the driver). This error code is417index is not supported by the driver). This error code is
396also returned by the <constant>VIDIOC_S_EXT_CTRLS</constant> and418also returned by the <constant>VIDIOC_S_EXT_CTRLS</constant> and
Documentation/DocBook/media_api.tmpl+3−3
@@ -19,10 +19,10 @@ · 18 unmodified lines
19<!ENTITY cs-def "<colspec colname='c1' colwidth='3*' /><colspec colname='c2' colwidth='1*' /><colspec colname='c3' colwidth='4*' /><spanspec spanname='hspan' namest='c1' nameend='c3' />">19<!ENTITY cs-def "<colspec colname='c1' colwidth='3*' /><colspec colname='c2' colwidth='1*' /><colspec colname='c3' colwidth='4*' /><spanspec spanname='hspan' namest='c1' nameend='c3' />">
20 20
21<!-- Video for Linux mailing list address. -->21<!-- Video for Linux mailing list address. -->
22<!ENTITY v4l-ml "<ulink url='http://www.linuxtv.org/lists.php'>http://www.linuxtv.org/lists.php</ulink>">22<!ENTITY v4l-ml "<ulink url='https://linuxtv.org/lists.php'>https://linuxtv.org/lists.php</ulink>">
23 23
24<!-- LinuxTV v4l-dvb repository. -->24<!-- LinuxTV v4l-dvb repository. -->
25<!ENTITY v4l-dvb "<ulink url='http://linuxtv.org/repo/'>http://linuxtv.org/repo/</ulink>">25<!ENTITY v4l-dvb "<ulink url='https://linuxtv.org/repo/'>https://linuxtv.org/repo/</ulink>">
26<!ENTITY dash-ent-8 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">26<!ENTITY dash-ent-8 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
27<!ENTITY dash-ent-10 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">27<!ENTITY dash-ent-10 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
28<!ENTITY dash-ent-12 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">28<!ENTITY dash-ent-12 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
@@ -91,7 +91,7 @@ · 62 unmodified lines
91 components, like mixers, PCM capture, PCM playback, etc, which91 components, like mixers, PCM capture, PCM playback, etc, which
92 are controlled via ALSA API.</para>92 are controlled via ALSA API.</para>
93 <para>For additional information and for the latest development code,93 <para>For additional information and for the latest development code,
94 see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>94 see: <ulink url="https://linuxtv.org">https://linuxtv.org</ulink>.</para>
95 <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para>95 <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para>
96</preface>96</preface>
97 97
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt+10−10
@@ -35,7 +35,7 @@ Required properties (tsin (child) node): · 34 unmodified lines
35 35
36- tsin-num : tsin id of the InputBlock (must be between 0 to 6)36- tsin-num : tsin id of the InputBlock (must be between 0 to 6)
37- i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.37- i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected.
38- rst-gpio : reset gpio for this tsin channel.38- reset-gpios : reset gpio for this tsin channel.
39 39
40Optional properties (tsin (child) node):40Optional properties (tsin (child) node):
41 41
@@ -55,27 +55,27 @@ Example: · 13 unmodified lines
55 status = "okay";55 status = "okay";
56 reg = <0x08a20000 0x10000>, <0x08a00000 0x4000>;56 reg = <0x08a20000 0x10000>, <0x08a00000 0x4000>;
57 reg-names = "stfe", "stfe-ram";57 reg-names = "stfe", "stfe-ram";
58 interrupts = <0 34 0>, <0 35 0>;58 interrupts = <GIC_SPI 34 IRQ_TYPE_NONE>, <GIC_SPI 35 IRQ_TYPE_NONE>;
59 interrupt-names = "stfe-error-irq", "stfe-idle-irq";59 interrupt-names = "stfe-error-irq", "stfe-idle-irq";
60
61 pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial",
62 "tsin4-serial", "tsin5-serial";
63
64 pinctrl-0 = <&pinctrl_tsin0_serial>;60 pinctrl-0 = <&pinctrl_tsin0_serial>;
65 pinctrl-1 = <&pinctrl_tsin0_parallel>;61 pinctrl-1 = <&pinctrl_tsin0_parallel>;
66 pinctrl-2 = <&pinctrl_tsin3_serial>;62 pinctrl-2 = <&pinctrl_tsin3_serial>;
67 pinctrl-3 = <&pinctrl_tsin4_serial_alt3>;63 pinctrl-3 = <&pinctrl_tsin4_serial_alt3>;
68 pinctrl-4 = <&pinctrl_tsin5_serial_alt1>;64 pinctrl-4 = <&pinctrl_tsin5_serial_alt1>;
69 65 pinctrl-names = "tsin0-serial",
66 "tsin0-parallel",
67 "tsin3-serial",
68 "tsin4-serial",
69 "tsin5-serial";
70 clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>;70 clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>;
71 clock-names = "stfe";71 clock-names = "c8sectpfe";
72 72
73 /* tsin0 is TSA on NIMA */73 /* tsin0 is TSA on NIMA */
74 tsin0: port@0 {74 tsin0: port@0 {
75 tsin-num = <0>;75 tsin-num = <0>;
76 serial-not-parallel;76 serial-not-parallel;
77 i2c-bus = <&ssc2>;77 i2c-bus = <&ssc2>;
78 rst-gpio = <&pio15 4 0>;78 reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>;
79 dvb-card = <STV0367_TDA18212_NIMA_1>;79 dvb-card = <STV0367_TDA18212_NIMA_1>;
80 };80 };
81 81
@@ -83,7 +83,7 @@ Example: · 1 unmodified line
83 tsin-num = <3>;83 tsin-num = <3>;
84 serial-not-parallel;84 serial-not-parallel;
85 i2c-bus = <&ssc3>;85 i2c-bus = <&ssc3>;
86 rst-gpio = <&pio15 7 0>;86 reset-gpios = <&pio15 7 GPIO_ACTIVE_HIGH>;
87 dvb-card = <STV0367_TDA18212_NIMB_1>;87 dvb-card = <STV0367_TDA18212_NIMB_1>;
88 };88 };
89 };89 };
Documentation/dvb/README.dvb-usb+2−2
@@ -45,7 +45,7 @@ Supported devices · 44 unmodified lines
45See the LinuxTV DVB Wiki at www.linuxtv.org for a complete list of45See the LinuxTV DVB Wiki at www.linuxtv.org for a complete list of
46cards/drivers/firmwares:46cards/drivers/firmwares:
47 47
48http://www.linuxtv.org/wiki/index.php/DVB_USB48https://linuxtv.org/wiki/index.php/DVB_USB
49 49
500. History & News:500. History & News:
51 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang)51 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang)
@@ -121,7 +121,7 @@ working. · 69 unmodified lines
121Have a look at the Wikipage for the DVB-USB-drivers to find out, which firmware121Have a look at the Wikipage for the DVB-USB-drivers to find out, which firmware
122you need for your device:122you need for your device:
123 123
124http://www.linuxtv.org/wiki/index.php/DVB_USB124https://linuxtv.org/wiki/index.php/DVB_USB
125 125
1261.2. Compiling1261.2. Compiling
127 127
Documentation/dvb/faq.txt+1−1
@@ -76,7 +76,7 @@ Some very frequently asked questions about linuxtv-dvb · 75 unmodified lines
76 the TuxBox CVS many interesting DVB applications and the dBox276 the TuxBox CVS many interesting DVB applications and the dBox2
77 DVB source77 DVB source
78 78
79 http://www.linuxtv.org/downloads/ 79 https://linuxtv.org/downloads
80 DVB Swiss Army Knife library and utilities80 DVB Swiss Army Knife library and utilities
81 81
82 http://www.nenie.org/misc/mpsys/82 http://www.nenie.org/misc/mpsys/
Documentation/dvb/get_dvb_firmware+11−11
@@ -152,7 +152,7 @@ sub tda10046lifeview { · 151 unmodified lines
152 152
153sub av7110 {153sub av7110 {
154 my $sourcefile = "dvb-ttpci-01.fw-261d";154 my $sourcefile = "dvb-ttpci-01.fw-261d";
155 my $url = "http://www.linuxtv.org/downloads/firmware/$sourcefile";155 my $url = "https://linuxtv.org/downloads/firmware/$sourcefile";
156 my $hash = "603431b6259715a8e88f376a53b64e2f";156 my $hash = "603431b6259715a8e88f376a53b64e2f";
157 my $outfile = "dvb-ttpci-01.fw";157 my $outfile = "dvb-ttpci-01.fw";
158 158
@@ -303,7 +303,7 @@ sub vp7049 { · 144 unmodified lines
303}303}
304 304
305sub dibusb {305sub dibusb {
306 my $url = "http://www.linuxtv.org/downloads/firmware/dvb-usb-dibusb-5.0.0.11.fw";306 my $url = "https://linuxtv.org/downloads/firmware/dvb-usb-dibusb-5.0.0.11.fw";
307 my $outfile = "dvb-dibusb-5.0.0.11.fw";307 my $outfile = "dvb-dibusb-5.0.0.11.fw";
308 my $hash = "fa490295a527360ca16dcdf3224ca243";308 my $hash = "fa490295a527360ca16dcdf3224ca243";
309 309
@@ -351,7 +351,7 @@ sub nxt2004 { · 41 unmodified lines
351 351
352sub or51211 {352sub or51211 {
353 my $fwfile = "dvb-fe-or51211.fw";353 my $fwfile = "dvb-fe-or51211.fw";
354 my $url = "http://linuxtv.org/downloads/firmware/$fwfile";354 my $url = "https://linuxtv.org/downloads/firmware/$fwfile";
355 my $hash = "d830949c771a289505bf9eafc225d491";355 my $hash = "d830949c771a289505bf9eafc225d491";
356 356
357 checkstandard();357 checkstandard();
@@ -364,7 +364,7 @@ sub or51211 { · 6 unmodified lines
364 364
365sub cx231xx {365sub cx231xx {
366 my $fwfile = "v4l-cx231xx-avcore-01.fw";366 my $fwfile = "v4l-cx231xx-avcore-01.fw";
367 my $url = "http://linuxtv.org/downloads/firmware/$fwfile";367 my $url = "https://linuxtv.org/downloads/firmware/$fwfile";
368 my $hash = "7d3bb956dc9df0eafded2b56ba57cc42";368 my $hash = "7d3bb956dc9df0eafded2b56ba57cc42";
369 369
370 checkstandard();370 checkstandard();
@@ -376,7 +376,7 @@ sub cx231xx { · 5 unmodified lines
376}376}
377 377
378sub cx18 {378sub cx18 {
379 my $url = "http://linuxtv.org/downloads/firmware/";379 my $url = "https://linuxtv.org/downloads/firmware/";
380 380
381 my %files = (381 my %files = (
382 'v4l-cx23418-apu.fw' => '588f081b562f5c653a3db1ad8f65939a',382 'v4l-cx23418-apu.fw' => '588f081b562f5c653a3db1ad8f65939a',
@@ -450,7 +450,7 @@ sub mpc718 { · 67 unmodified lines
450}450}
451 451
452sub cx23885 {452sub cx23885 {
453 my $url = "http://linuxtv.org/downloads/firmware/";453 my $url = "https://linuxtv.org/downloads/firmware/";
454 454
455 my %files = (455 my %files = (
456 'v4l-cx23885-avcore-01.fw' => 'a9f8f5d901a7fb42f552e1ee6384f3bb',456 'v4l-cx23885-avcore-01.fw' => 'a9f8f5d901a7fb42f552e1ee6384f3bb',
@@ -472,7 +472,7 @@ sub cx23885 { · 15 unmodified lines
472}472}
473 473
474sub pvrusb2 {474sub pvrusb2 {
475 my $url = "http://linuxtv.org/downloads/firmware/";475 my $url = "https://linuxtv.org/downloads/firmware/";
476 476
477 my %files = (477 my %files = (
478 'v4l-cx25840.fw' => 'dadb79e9904fc8af96e8111d9cb59320',478 'v4l-cx25840.fw' => 'dadb79e9904fc8af96e8111d9cb59320',
@@ -494,7 +494,7 @@ sub pvrusb2 { · 15 unmodified lines
494 494
495sub or51132_qam {495sub or51132_qam {
496 my $fwfile = "dvb-fe-or51132-qam.fw";496 my $fwfile = "dvb-fe-or51132-qam.fw";
497 my $url = "http://linuxtv.org/downloads/firmware/$fwfile";497 my $url = "https://linuxtv.org/downloads/firmware/$fwfile";
498 my $hash = "7702e8938612de46ccadfe9b413cb3b5";498 my $hash = "7702e8938612de46ccadfe9b413cb3b5";
499 499
500 checkstandard();500 checkstandard();
@@ -507,7 +507,7 @@ sub or51132_qam { · 6 unmodified lines
507 507
508sub or51132_vsb {508sub or51132_vsb {
509 my $fwfile = "dvb-fe-or51132-vsb.fw";509 my $fwfile = "dvb-fe-or51132-vsb.fw";
510 my $url = "http://linuxtv.org/downloads/firmware/$fwfile";510 my $url = "https://linuxtv.org/downloads/firmware/$fwfile";
511 my $hash = "c16208e02f36fc439a557ad4c613364a";511 my $hash = "c16208e02f36fc439a557ad4c613364a";
512 512
513 checkstandard();513 checkstandard();
@@ -519,7 +519,7 @@ sub or51132_vsb { · 5 unmodified lines
519}519}
520 520
521sub bluebird {521sub bluebird {
522 my $url = "http://www.linuxtv.org/download/dvb/firmware/dvb-usb-bluebird-01.fw";522 my $url = "https://linuxtv.org/download/dvb/firmware/dvb-usb-bluebird-01.fw";
523 my $outfile = "dvb-usb-bluebird-01.fw";523 my $outfile = "dvb-usb-bluebird-01.fw";
524 my $hash = "658397cb9eba9101af9031302671f49d";524 my $hash = "658397cb9eba9101af9031302671f49d";
525 525
@@ -677,7 +677,7 @@ sub drxk_hauppauge_hvr930c { · 151 unmodified lines
677}677}
678 678
679sub drxk_terratec_h5 {679sub drxk_terratec_h5 {
680 my $url = "http://www.linuxtv.org/downloads/firmware/";680 my $url = "https://linuxtv.org/downloads/firmware/";
681 my $hash = "19000dada8e2741162ccc50cc91fa7f1";681 my $hash = "19000dada8e2741162ccc50cc91fa7f1";
682 my $fwfile = "dvb-usb-terratec-h5-drxk.fw";682 my $fwfile = "dvb-usb-terratec-h5-drxk.fw";
683 683
Documentation/dvb/readme.txt+5−5
@@ -2,12 +2,12 @@ Linux Digital Video Broadcast (DVB) subsystem · 1 unmodified line
2=============================================2=============================================
3 3
4The main development site and CVS repository for these4The main development site and CVS repository for these
5drivers is http://linuxtv.org/.5drivers is https://linuxtv.org.
6 6
7The developer mailing list linux-dvb is also hosted there,7The developer mailing list linux-dvb is also hosted there,
8see http://linuxtv.org/lists.php. Please check8see https://linuxtv.org/lists.php. Please check
9the archive http://linuxtv.org/pipermail/linux-dvb/9the archive https://linuxtv.org/pipermail/linux-dvb/
10and the Wiki http://linuxtv.org/wiki/10and the Wiki https://linuxtv.org/wiki/
11before asking newbie questions on the list.11before asking newbie questions on the list.
12 12
13API documentation, utilities and test/example programs13API documentation, utilities and test/example programs
@@ -16,7 +16,7 @@ are available as part of the old driver package for Linux 2.4 · 2 unmodified lines
16We plan to split this into separate packages, but it's not16We plan to split this into separate packages, but it's not
17been done yet.17been done yet.
18 18
19http://linuxtv.org/downloads/19https://linuxtv.org/downloads/
20 20
21What's inside this directory:21What's inside this directory:
22 22
Documentation/video4linux/API.html+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
9 <table border="0">9 <table border="0">
10 <tr>10 <tr>
11 <td>11 <td>
12 <a href="http://linuxtv.org/downloads/legacy/video4linux/API/V4L1_API.html">V4L original API</a>12 <a href="https://linuxtv.org/downloads/legacy/video4linux/API/V4L1_API.html">V4L original API</a>
13 </td>13 </td>
14 <td>14 <td>
15 Obsoleted by V4L2 API15 Obsoleted by V4L2 API
Documentation/video4linux/CARDLIST.em28xx+2−2
@@ -41,8 +41,8 @@ · 40 unmodified lines
41 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005]41 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005]
42 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350]42 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350]
43 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357,eb1a:e359]43 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357,eb1a:e359]
44 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043]44 43 -> Terratec Cinergy T XS (em2870)
45 44 -> Terratec Cinergy T XS (MT2060) (em2870)45 44 -> Terratec Cinergy T XS (MT2060) (em2870) [0ccd:0043]
46 45 -> Pinnacle PCTV DVB-T (em2870)46 45 -> Pinnacle PCTV DVB-T (em2870)
47 46 -> Compro, VideoMate U3 (em2870) [185b:2870]47 46 -> Compro, VideoMate U3 (em2870) [185b:2870]
48 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]48 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]
Documentation/video4linux/fimc.txt+3−3
@@ -58,7 +58,7 @@ Not currently supported: · 57 unmodified lines
584.1. Media device interface584.1. Media device interface
59 59
60The driver supports Media Controller API as defined at60The driver supports Media Controller API as defined at
61http://linuxtv.org/downloads/v4l-dvb-apis/media_common.html61https://linuxtv.org/downloads/v4l-dvb-apis/media_common.html
62The media device driver name is "SAMSUNG S5P FIMC".62The media device driver name is "SAMSUNG S5P FIMC".
63 63
64The purpose of this interface is to allow changing assignment of FIMC instances64The purpose of this interface is to allow changing assignment of FIMC instances
@@ -83,11 +83,11 @@ undefined behaviour. · 18 unmodified lines
834.3. Capture video node834.3. Capture video node
84 84
85The driver supports V4L2 Video Capture Interface as defined at:85The driver supports V4L2 Video Capture Interface as defined at:
86http://linuxtv.org/downloads/v4l-dvb-apis/devices.html86https://linuxtv.org/downloads/v4l-dvb-apis/devices.html
87 87
88At the capture and mem-to-mem video nodes only the multi-planar API is88At the capture and mem-to-mem video nodes only the multi-planar API is
89supported. For more details see:89supported. For more details see:
90http://linuxtv.org/downloads/v4l-dvb-apis/planar-apis.html90https://linuxtv.org/downloads/v4l-dvb-apis/planar-apis.html
91 91
924.4. Camera capture subdevs924.4. Camera capture subdevs
93 93
Documentation/video4linux/omap4_camera.txt+1−1
@@ -47,7 +47,7 @@ Tested platforms · 46 unmodified lines
47File list47File list
48---------48---------
49drivers/staging/media/omap4iss/49drivers/staging/media/omap4iss/
50include/media/omap4iss.h50include/linux/platform_data/media/omap4iss.h
51 51
52References52References
53----------53----------
Documentation/video4linux/si4713.txt+1−1
@@ -157,7 +157,7 @@ int main (int argc, char *argv[]) · 156 unmodified lines
157}157}
158 158
159The struct si4713_rnl and SI4713_IOC_MEASURE_RNL are defined under159The struct si4713_rnl and SI4713_IOC_MEASURE_RNL are defined under
160include/media/si4713.h.160include/linux/platform_data/media/si4713.h.
161 161
162Stereo/Mono and RDS subchannels162Stereo/Mono and RDS subchannels
163===============================163===============================
Documentation/video4linux/v4l2-pci-skeleton.c+6−7
@@ -163,11 +163,10 @@ static irqreturn_t skeleton_irq(int irq, void *dev_id) · 162 unmodified lines
163 * minimum number: many DMA engines need a minimum of 2 buffers in the163 * minimum number: many DMA engines need a minimum of 2 buffers in the
164 * queue and you need to have another available for userspace processing.164 * queue and you need to have another available for userspace processing.
165 */165 */
166static int queue_setup(struct vb2_queue *vq, const void *parg,166static int queue_setup(struct vb2_queue *vq,
167 unsigned int *nbuffers, unsigned int *nplanes,167 unsigned int *nbuffers, unsigned int *nplanes,
168 unsigned int sizes[], void *alloc_ctxs[])168 unsigned int sizes[], void *alloc_ctxs[])
169{169{
170 const struct v4l2_format *fmt = parg;
171 struct skeleton *skel = vb2_get_drv_priv(vq);170 struct skeleton *skel = vb2_get_drv_priv(vq);
172 171
173 skel->field = skel->format.field;172 skel->field = skel->format.field;
@@ -183,12 +182,12 @@ static int queue_setup(struct vb2_queue *vq, const void *parg, · 9 unmodified lines
183 182
184 if (vq->num_buffers + *nbuffers < 3)183 if (vq->num_buffers + *nbuffers < 3)
185 *nbuffers = 3 - vq->num_buffers;184 *nbuffers = 3 - vq->num_buffers;
185 alloc_ctxs[0] = skel->alloc_ctx;
186 186
187 if (fmt && fmt->fmt.pix.sizeimage < skel->format.sizeimage)187 if (*nplanes)
188 return -EINVAL;188 return sizes[0] < skel->format.sizeimage ? -EINVAL : 0;
189 *nplanes = 1;189 *nplanes = 1;
190 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : skel->format.sizeimage;190 sizes[0] = skel->format.sizeimage;
191 alloc_ctxs[0] = skel->alloc_ctx;
192 return 0;191 return 0;
193}192}
194 193
@@ -509,7 +508,7 @@ static int skeleton_s_dv_timings(struct file *file, void *_fh, · 314 unmodified lines
509 return -EINVAL;508 return -EINVAL;
510 509
511 /* Return 0 if the new timings are the same as the current timings. */510 /* Return 0 if the new timings are the same as the current timings. */
512 if (v4l2_match_dv_timings(timings, &skel->timings, 0))511 if (v4l2_match_dv_timings(timings, &skel->timings, 0, false))
513 return 0;512 return 0;
514 513
515 /*514 /*
MAINTAINERS+118−108
@@ -206,7 +206,7 @@ F: include/trace/events/9p.h · 205 unmodified lines
206A8293 MEDIA DRIVER206A8293 MEDIA DRIVER
207M: Antti Palosaari <crope@iki.fi>207M: Antti Palosaari <crope@iki.fi>
208L: linux-media@vger.kernel.org208L: linux-media@vger.kernel.org
209W: http://linuxtv.org/209W: https://linuxtv.org
210W: http://palosaari.fi/linux/210W: http://palosaari.fi/linux/
211Q: http://patchwork.linuxtv.org/project/linux-media/list/211Q: http://patchwork.linuxtv.org/project/linux-media/list/
212T: git git://linuxtv.org/anttip/media_tree.git212T: git git://linuxtv.org/anttip/media_tree.git
@@ -395,7 +395,7 @@ M: Sakari Ailus <sakari.ailus@iki.fi> · 182 unmodified lines
395L: linux-media@vger.kernel.org395L: linux-media@vger.kernel.org
396S: Maintained396S: Maintained
397F: drivers/media/i2c/adp1653.c397F: drivers/media/i2c/adp1653.c
398F: include/media/adp1653.h398F: include/media/i2c/adp1653.h
399 399
400ADP5520 BACKLIGHT DRIVER WITH IO EXPANDER (ADP5520/ADP5501)400ADP5520 BACKLIGHT DRIVER WITH IO EXPANDER (ADP5520/ADP5501)
401M: Michael Hennerich <michael.hennerich@analog.com>401M: Michael Hennerich <michael.hennerich@analog.com>
@@ -466,7 +466,7 @@ F: sound/oss/aedsp16.c · 64 unmodified lines
466AF9013 MEDIA DRIVER466AF9013 MEDIA DRIVER
467M: Antti Palosaari <crope@iki.fi>467M: Antti Palosaari <crope@iki.fi>
468L: linux-media@vger.kernel.org468L: linux-media@vger.kernel.org
469W: http://linuxtv.org/469W: https://linuxtv.org
470W: http://palosaari.fi/linux/470W: http://palosaari.fi/linux/
471Q: http://patchwork.linuxtv.org/project/linux-media/list/471Q: http://patchwork.linuxtv.org/project/linux-media/list/
472T: git git://linuxtv.org/anttip/media_tree.git472T: git git://linuxtv.org/anttip/media_tree.git
@@ -476,7 +476,7 @@ F: drivers/media/dvb-frontends/af9013* · 3 unmodified lines
476AF9033 MEDIA DRIVER476AF9033 MEDIA DRIVER
477M: Antti Palosaari <crope@iki.fi>477M: Antti Palosaari <crope@iki.fi>
478L: linux-media@vger.kernel.org478L: linux-media@vger.kernel.org
479W: http://linuxtv.org/479W: https://linuxtv.org
480W: http://palosaari.fi/linux/480W: http://palosaari.fi/linux/
481Q: http://patchwork.linuxtv.org/project/linux-media/list/481Q: http://patchwork.linuxtv.org/project/linux-media/list/
482T: git git://linuxtv.org/anttip/media_tree.git482T: git git://linuxtv.org/anttip/media_tree.git
@@ -522,7 +522,7 @@ AIMSLAB FM RADIO RECEIVER DRIVER · 39 unmodified lines
522M: Hans Verkuil <hverkuil@xs4all.nl>522M: Hans Verkuil <hverkuil@xs4all.nl>
523L: linux-media@vger.kernel.org523L: linux-media@vger.kernel.org
524T: git git://linuxtv.org/media_tree.git524T: git git://linuxtv.org/media_tree.git
525W: http://linuxtv.org525W: https://linuxtv.org
526S: Maintained526S: Maintained
527F: drivers/media/radio/radio-aimslab*527F: drivers/media/radio/radio-aimslab*
528 528
@@ -536,7 +536,7 @@ F: include/linux/*aio*.h · 7 unmodified lines
536AIRSPY MEDIA DRIVER536AIRSPY MEDIA DRIVER
537M: Antti Palosaari <crope@iki.fi>537M: Antti Palosaari <crope@iki.fi>
538L: linux-media@vger.kernel.org538L: linux-media@vger.kernel.org
539W: http://linuxtv.org/539W: https://linuxtv.org
540W: http://palosaari.fi/linux/540W: http://palosaari.fi/linux/
541Q: http://patchwork.linuxtv.org/project/linux-media/list/541Q: http://patchwork.linuxtv.org/project/linux-media/list/
542T: git git://linuxtv.org/anttip/media_tree.git542T: git git://linuxtv.org/anttip/media_tree.git
@@ -1773,7 +1773,7 @@ L: linux-media@vger.kernel.org · 1230 unmodified lines
1773T: git git://linuxtv.org/media_tree.git1773T: git git://linuxtv.org/media_tree.git
1774S: Maintained1774S: Maintained
1775F: drivers/media/i2c/as3645a.c1775F: drivers/media/i2c/as3645a.c
1776F: include/media/as3645a.h1776F: include/media/i2c/as3645a.h
1777 1777
1778ASC7621 HARDWARE MONITOR DRIVER1778ASC7621 HARDWARE MONITOR DRIVER
1779M: George Joseph <george.joseph@fairview5.com>1779M: George Joseph <george.joseph@fairview5.com>
@@ -2064,7 +2064,7 @@ F: net/ax25/ · 284 unmodified lines
2064AZ6007 DVB DRIVER2064AZ6007 DVB DRIVER
2065M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>2065M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2066L: linux-media@vger.kernel.org2066L: linux-media@vger.kernel.org
2067W: http://linuxtv.org2067W: https://linuxtv.org
2068T: git git://linuxtv.org/media_tree.git2068T: git git://linuxtv.org/media_tree.git
2069S: Maintained2069S: Maintained
2070F: drivers/media/usb/dvb-usb-v2/az6007.c2070F: drivers/media/usb/dvb-usb-v2/az6007.c
@@ -2073,7 +2073,7 @@ AZTECH FM RADIO RECEIVER DRIVER · 2 unmodified lines
2073M: Hans Verkuil <hverkuil@xs4all.nl>2073M: Hans Verkuil <hverkuil@xs4all.nl>
2074L: linux-media@vger.kernel.org2074L: linux-media@vger.kernel.org
2075T: git git://linuxtv.org/media_tree.git2075T: git git://linuxtv.org/media_tree.git
2076W: http://linuxtv.org2076W: https://linuxtv.org
2077S: Maintained2077S: Maintained
2078F: drivers/media/radio/radio-aztech*2078F: drivers/media/radio/radio-aztech*
2079 2079
@@ -2126,7 +2126,7 @@ BDISP ST MEDIA DRIVER · 46 unmodified lines
2126M: Fabien Dessenne <fabien.dessenne@st.com>2126M: Fabien Dessenne <fabien.dessenne@st.com>
2127L: linux-media@vger.kernel.org2127L: linux-media@vger.kernel.org
2128T: git git://linuxtv.org/media_tree.git2128T: git git://linuxtv.org/media_tree.git
2129W: http://linuxtv.org2129W: https://linuxtv.org
2130S: Supported2130S: Supported
2131F: drivers/media/platform/sti/bdisp2131F: drivers/media/platform/sti/bdisp
2132 2132
@@ -2519,7 +2519,7 @@ F: fs/btrfs/ · 386 unmodified lines
2519BTTV VIDEO4LINUX DRIVER2519BTTV VIDEO4LINUX DRIVER
2520M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>2520M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2521L: linux-media@vger.kernel.org2521L: linux-media@vger.kernel.org
2522W: http://linuxtv.org2522W: https://linuxtv.org
2523T: git git://linuxtv.org/media_tree.git2523T: git git://linuxtv.org/media_tree.git
2524S: Odd fixes2524S: Odd fixes
2525F: Documentation/video4linux/bttv/2525F: Documentation/video4linux/bttv/
@@ -2558,7 +2558,7 @@ CADET FM/AM RADIO RECEIVER DRIVER · 32 unmodified lines
2558M: Hans Verkuil <hverkuil@xs4all.nl>2558M: Hans Verkuil <hverkuil@xs4all.nl>
2559L: linux-media@vger.kernel.org2559L: linux-media@vger.kernel.org
2560T: git git://linuxtv.org/media_tree.git2560T: git git://linuxtv.org/media_tree.git
2561W: http://linuxtv.org2561W: https://linuxtv.org
2562S: Maintained2562S: Maintained
2563F: drivers/media/radio/radio-cadet*2563F: drivers/media/radio/radio-cadet*
2564 2564
@@ -2851,7 +2851,7 @@ COBALT MEDIA DRIVER · 286 unmodified lines
2851M: Hans Verkuil <hans.verkuil@cisco.com>2851M: Hans Verkuil <hans.verkuil@cisco.com>
2852L: linux-media@vger.kernel.org2852L: linux-media@vger.kernel.org
2853T: git git://linuxtv.org/media_tree.git2853T: git git://linuxtv.org/media_tree.git
2854W: http://linuxtv.org2854W: https://linuxtv.org
2855S: Supported2855S: Supported
2856F: drivers/media/pci/cobalt/2856F: drivers/media/pci/cobalt/
2857 2857
@@ -3096,6 +3096,15 @@ S: Maintained · 238 unmodified lines
3096F: crypto/ansi_cprng.c3096F: crypto/ansi_cprng.c
3097F: crypto/rng.c3097F: crypto/rng.c
3098 3098
3099CS3308 MEDIA DRIVER
3100M: Hans Verkuil <hverkuil@xs4all.nl>
3101L: linux-media@vger.kernel.org
3102T: git git://linuxtv.org/media_tree.git
3103W: http://linuxtv.org
3104S: Odd Fixes
3105F: drivers/media/i2c/cs3308.c
3106F: drivers/media/i2c/cs3308.h
3107
3099CS5535 Audio ALSA driver3108CS5535 Audio ALSA driver
3100M: Jaya Kumar <jayakumar.alsa@gmail.com>3109M: Jaya Kumar <jayakumar.alsa@gmail.com>
3101S: Maintained3110S: Maintained
@@ -3111,7 +3120,7 @@ M: Andy Walls <awalls@md.metrocast.net> · 9 unmodified lines
3111L: ivtv-devel@ivtvdriver.org (subscribers-only)3120L: ivtv-devel@ivtvdriver.org (subscribers-only)
3112L: linux-media@vger.kernel.org3121L: linux-media@vger.kernel.org
3113T: git git://linuxtv.org/media_tree.git3122T: git git://linuxtv.org/media_tree.git
3114W: http://linuxtv.org3123W: https://linuxtv.org
3115W: http://www.ivtvdriver.org/index.php/Cx183124W: http://www.ivtvdriver.org/index.php/Cx18
3116S: Maintained3125S: Maintained
3117F: Documentation/video4linux/cx18.txt3126F: Documentation/video4linux/cx18.txt
@@ -3122,7 +3131,7 @@ CX2341X MPEG ENCODER HELPER MODULE · 4 unmodified lines
3122M: Hans Verkuil <hverkuil@xs4all.nl>3131M: Hans Verkuil <hverkuil@xs4all.nl>
3123L: linux-media@vger.kernel.org3132L: linux-media@vger.kernel.org
3124T: git git://linuxtv.org/media_tree.git3133T: git git://linuxtv.org/media_tree.git
3125W: http://linuxtv.org3134W: https://linuxtv.org
3126S: Maintained3135S: Maintained
3127F: drivers/media/common/cx2341x*3136F: drivers/media/common/cx2341x*
3128F: include/media/cx2341x*3137F: include/media/cx2341x*
@@ -3131,7 +3140,7 @@ CX24120 MEDIA DRIVER · 2 unmodified lines
3131M: Jemma Denson <jdenson@gmail.com>3140M: Jemma Denson <jdenson@gmail.com>
3132M: Patrick Boettcher <patrick.boettcher@posteo.de>3141M: Patrick Boettcher <patrick.boettcher@posteo.de>
3133L: linux-media@vger.kernel.org3142L: linux-media@vger.kernel.org
3134W: http://linuxtv.org/3143W: https://linuxtv.org
3135Q: http://patchwork.linuxtv.org/project/linux-media/list/3144Q: http://patchwork.linuxtv.org/project/linux-media/list/
3136S: Maintained3145S: Maintained
3137F: drivers/media/dvb-frontends/cx24120*3146F: drivers/media/dvb-frontends/cx24120*
@@ -3139,7 +3148,7 @@ F: drivers/media/dvb-frontends/cx24120* · 1 unmodified line
3139CX88 VIDEO4LINUX DRIVER3148CX88 VIDEO4LINUX DRIVER
3140M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>3149M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
3141L: linux-media@vger.kernel.org3150L: linux-media@vger.kernel.org
3142W: http://linuxtv.org3151W: https://linuxtv.org
3143T: git git://linuxtv.org/media_tree.git3152T: git git://linuxtv.org/media_tree.git
3144S: Odd fixes3153S: Odd fixes
3145F: Documentation/video4linux/cx88/3154F: Documentation/video4linux/cx88/
@@ -3148,7 +3157,7 @@ F: drivers/media/pci/cx88/ · 2 unmodified lines
3148CXD2820R MEDIA DRIVER3157CXD2820R MEDIA DRIVER
3149M: Antti Palosaari <crope@iki.fi>3158M: Antti Palosaari <crope@iki.fi>
3150L: linux-media@vger.kernel.org3159L: linux-media@vger.kernel.org
3151W: http://linuxtv.org/3160W: https://linuxtv.org
3152W: http://palosaari.fi/linux/3161W: http://palosaari.fi/linux/
3153Q: http://patchwork.linuxtv.org/project/linux-media/list/3162Q: http://patchwork.linuxtv.org/project/linux-media/list/
3154T: git git://linuxtv.org/anttip/media_tree.git3163T: git git://linuxtv.org/anttip/media_tree.git
@@ -3254,7 +3263,7 @@ F: drivers/net/wan/pc300* · 99 unmodified lines
3254CYPRESS_FIRMWARE MEDIA DRIVER3263CYPRESS_FIRMWARE MEDIA DRIVER
3255M: Antti Palosaari <crope@iki.fi>3264M: Antti Palosaari <crope@iki.fi>
3256L: linux-media@vger.kernel.org3265L: linux-media@vger.kernel.org
3257W: http://linuxtv.org/3266W: https://linuxtv.org
3258W: http://palosaari.fi/linux/3267W: http://palosaari.fi/linux/
3259Q: http://patchwork.linuxtv.org/project/linux-media/list/3268Q: http://patchwork.linuxtv.org/project/linux-media/list/
3260T: git git://linuxtv.org/anttip/media_tree.git3269T: git git://linuxtv.org/anttip/media_tree.git
@@ -3761,14 +3770,14 @@ DT3155 MEDIA DRIVER · 500 unmodified lines
3761M: Hans Verkuil <hverkuil@xs4all.nl>3770M: Hans Verkuil <hverkuil@xs4all.nl>
3762L: linux-media@vger.kernel.org3771L: linux-media@vger.kernel.org
3763T: git git://linuxtv.org/media_tree.git3772T: git git://linuxtv.org/media_tree.git
3764W: http://linuxtv.org3773W: https://linuxtv.org
3765S: Odd Fixes3774S: Odd Fixes
3766F: drivers/media/pci/dt3155/3775F: drivers/media/pci/dt3155/
3767 3776
3768DVB_USB_AF9015 MEDIA DRIVER3777DVB_USB_AF9015 MEDIA DRIVER
3769M: Antti Palosaari <crope@iki.fi>3778M: Antti Palosaari <crope@iki.fi>
3770L: linux-media@vger.kernel.org3779L: linux-media@vger.kernel.org
3771W: http://linuxtv.org/3780W: https://linuxtv.org
3772W: http://palosaari.fi/linux/3781W: http://palosaari.fi/linux/
3773Q: http://patchwork.linuxtv.org/project/linux-media/list/3782Q: http://patchwork.linuxtv.org/project/linux-media/list/
3774T: git git://linuxtv.org/anttip/media_tree.git3783T: git git://linuxtv.org/anttip/media_tree.git
@@ -3778,7 +3787,7 @@ F: drivers/media/usb/dvb-usb-v2/af9015* · 3 unmodified lines
3778DVB_USB_AF9035 MEDIA DRIVER3787DVB_USB_AF9035 MEDIA DRIVER
3779M: Antti Palosaari <crope@iki.fi>3788M: Antti Palosaari <crope@iki.fi>
3780L: linux-media@vger.kernel.org3789L: linux-media@vger.kernel.org
3781W: http://linuxtv.org/3790W: https://linuxtv.org
3782W: http://palosaari.fi/linux/3791W: http://palosaari.fi/linux/
3783Q: http://patchwork.linuxtv.org/project/linux-media/list/3792Q: http://patchwork.linuxtv.org/project/linux-media/list/
3784T: git git://linuxtv.org/anttip/media_tree.git3793T: git git://linuxtv.org/anttip/media_tree.git
@@ -3788,7 +3797,7 @@ F: drivers/media/usb/dvb-usb-v2/af9035* · 3 unmodified lines
3788DVB_USB_ANYSEE MEDIA DRIVER3797DVB_USB_ANYSEE MEDIA DRIVER
3789M: Antti Palosaari <crope@iki.fi>3798M: Antti Palosaari <crope@iki.fi>
3790L: linux-media@vger.kernel.org3799L: linux-media@vger.kernel.org
3791W: http://linuxtv.org/3800W: https://linuxtv.org
3792W: http://palosaari.fi/linux/3801W: http://palosaari.fi/linux/
3793Q: http://patchwork.linuxtv.org/project/linux-media/list/3802Q: http://patchwork.linuxtv.org/project/linux-media/list/
3794T: git git://linuxtv.org/anttip/media_tree.git3803T: git git://linuxtv.org/anttip/media_tree.git
@@ -3798,7 +3807,7 @@ F: drivers/media/usb/dvb-usb-v2/anysee* · 3 unmodified lines
3798DVB_USB_AU6610 MEDIA DRIVER3807DVB_USB_AU6610 MEDIA DRIVER
3799M: Antti Palosaari <crope@iki.fi>3808M: Antti Palosaari <crope@iki.fi>
3800L: linux-media@vger.kernel.org3809L: linux-media@vger.kernel.org
3801W: http://linuxtv.org/3810W: https://linuxtv.org
3802W: http://palosaari.fi/linux/3811W: http://palosaari.fi/linux/
3803Q: http://patchwork.linuxtv.org/project/linux-media/list/3812Q: http://patchwork.linuxtv.org/project/linux-media/list/
3804T: git git://linuxtv.org/anttip/media_tree.git3813T: git git://linuxtv.org/anttip/media_tree.git
@@ -3808,7 +3817,7 @@ F: drivers/media/usb/dvb-usb-v2/au6610* · 3 unmodified lines
3808DVB_USB_CE6230 MEDIA DRIVER3817DVB_USB_CE6230 MEDIA DRIVER
3809M: Antti Palosaari <crope@iki.fi>3818M: Antti Palosaari <crope@iki.fi>
3810L: linux-media@vger.kernel.org3819L: linux-media@vger.kernel.org
3811W: http://linuxtv.org/3820W: https://linuxtv.org
3812W: http://palosaari.fi/linux/3821W: http://palosaari.fi/linux/
3813Q: http://patchwork.linuxtv.org/project/linux-media/list/3822Q: http://patchwork.linuxtv.org/project/linux-media/list/
3814T: git git://linuxtv.org/anttip/media_tree.git3823T: git git://linuxtv.org/anttip/media_tree.git
@@ -3818,7 +3827,7 @@ F: drivers/media/usb/dvb-usb-v2/ce6230* · 3 unmodified lines
3818DVB_USB_CXUSB MEDIA DRIVER3827DVB_USB_CXUSB MEDIA DRIVER
3819M: Michael Krufky <mkrufky@linuxtv.org>3828M: Michael Krufky <mkrufky@linuxtv.org>
3820L: linux-media@vger.kernel.org3829L: linux-media@vger.kernel.org
3821W: http://linuxtv.org/3830W: https://linuxtv.org
3822W: http://github.com/mkrufky3831W: http://github.com/mkrufky
3823Q: http://patchwork.linuxtv.org/project/linux-media/list/3832Q: http://patchwork.linuxtv.org/project/linux-media/list/
3824T: git git://linuxtv.org/media_tree.git3833T: git git://linuxtv.org/media_tree.git
@@ -3828,7 +3837,7 @@ F: drivers/media/usb/dvb-usb/cxusb* · 3 unmodified lines
3828DVB_USB_EC168 MEDIA DRIVER3837DVB_USB_EC168 MEDIA DRIVER
3829M: Antti Palosaari <crope@iki.fi>3838M: Antti Palosaari <crope@iki.fi>
3830L: linux-media@vger.kernel.org3839L: linux-media@vger.kernel.org
3831W: http://linuxtv.org/3840W: https://linuxtv.org
3832W: http://palosaari.fi/linux/3841W: http://palosaari.fi/linux/
3833Q: http://patchwork.linuxtv.org/project/linux-media/list/3842Q: http://patchwork.linuxtv.org/project/linux-media/list/
3834T: git git://linuxtv.org/anttip/media_tree.git3843T: git git://linuxtv.org/anttip/media_tree.git
@@ -3838,7 +3847,7 @@ F: drivers/media/usb/dvb-usb-v2/ec168* · 3 unmodified lines
3838DVB_USB_GL861 MEDIA DRIVER3847DVB_USB_GL861 MEDIA DRIVER
3839M: Antti Palosaari <crope@iki.fi>3848M: Antti Palosaari <crope@iki.fi>
3840L: linux-media@vger.kernel.org3849L: linux-media@vger.kernel.org
3841W: http://linuxtv.org/3850W: https://linuxtv.org
3842Q: http://patchwork.linuxtv.org/project/linux-media/list/3851Q: http://patchwork.linuxtv.org/project/linux-media/list/
3843T: git git://linuxtv.org/anttip/media_tree.git3852T: git git://linuxtv.org/anttip/media_tree.git
3844S: Maintained3853S: Maintained
@@ -3847,7 +3856,7 @@ F: drivers/media/usb/dvb-usb-v2/gl861* · 2 unmodified lines
3847DVB_USB_MXL111SF MEDIA DRIVER3856DVB_USB_MXL111SF MEDIA DRIVER
3848M: Michael Krufky <mkrufky@linuxtv.org>3857M: Michael Krufky <mkrufky@linuxtv.org>
3849L: linux-media@vger.kernel.org3858L: linux-media@vger.kernel.org
3850W: http://linuxtv.org/3859W: https://linuxtv.org
3851W: http://github.com/mkrufky3860W: http://github.com/mkrufky
3852Q: http://patchwork.linuxtv.org/project/linux-media/list/3861Q: http://patchwork.linuxtv.org/project/linux-media/list/
3853T: git git://linuxtv.org/mkrufky/mxl111sf.git3862T: git git://linuxtv.org/mkrufky/mxl111sf.git
@@ -3857,7 +3866,7 @@ F: drivers/media/usb/dvb-usb-v2/mxl111sf* · 3 unmodified lines
3857DVB_USB_RTL28XXU MEDIA DRIVER3866DVB_USB_RTL28XXU MEDIA DRIVER
3858M: Antti Palosaari <crope@iki.fi>3867M: Antti Palosaari <crope@iki.fi>
3859L: linux-media@vger.kernel.org3868L: linux-media@vger.kernel.org
3860W: http://linuxtv.org/3869W: https://linuxtv.org
3861W: http://palosaari.fi/linux/3870W: http://palosaari.fi/linux/
3862Q: http://patchwork.linuxtv.org/project/linux-media/list/3871Q: http://patchwork.linuxtv.org/project/linux-media/list/
3863T: git git://linuxtv.org/anttip/media_tree.git3872T: git git://linuxtv.org/anttip/media_tree.git
@@ -3867,7 +3876,7 @@ F: drivers/media/usb/dvb-usb-v2/rtl28xxu* · 3 unmodified lines
3867DVB_USB_V2 MEDIA DRIVER3876DVB_USB_V2 MEDIA DRIVER
3868M: Antti Palosaari <crope@iki.fi>3877M: Antti Palosaari <crope@iki.fi>
3869L: linux-media@vger.kernel.org3878L: linux-media@vger.kernel.org
3870W: http://linuxtv.org/3879W: https://linuxtv.org
3871W: http://palosaari.fi/linux/3880W: http://palosaari.fi/linux/
3872Q: http://patchwork.linuxtv.org/project/linux-media/list/3881Q: http://patchwork.linuxtv.org/project/linux-media/list/
3873T: git git://linuxtv.org/anttip/media_tree.git3882T: git git://linuxtv.org/anttip/media_tree.git
@@ -3897,7 +3906,7 @@ F: Documentation/devicetree/bindings/input/e3x0-button.txt · 23 unmodified lines
3897E4000 MEDIA DRIVER3906E4000 MEDIA DRIVER
3898M: Antti Palosaari <crope@iki.fi>3907M: Antti Palosaari <crope@iki.fi>
3899L: linux-media@vger.kernel.org3908L: linux-media@vger.kernel.org
3900W: http://linuxtv.org/3909W: https://linuxtv.org
3901W: http://palosaari.fi/linux/3910W: http://palosaari.fi/linux/
3902Q: http://patchwork.linuxtv.org/project/linux-media/list/3911Q: http://patchwork.linuxtv.org/project/linux-media/list/
3903T: git git://linuxtv.org/anttip/media_tree.git3912T: git git://linuxtv.org/anttip/media_tree.git
@@ -3913,7 +3922,7 @@ F: drivers/scsi/eata.c · 9 unmodified lines
3913EC100 MEDIA DRIVER3922EC100 MEDIA DRIVER
3914M: Antti Palosaari <crope@iki.fi>3923M: Antti Palosaari <crope@iki.fi>
3915L: linux-media@vger.kernel.org3924L: linux-media@vger.kernel.org
3916W: http://linuxtv.org/3925W: https://linuxtv.org
3917W: http://palosaari.fi/linux/3926W: http://palosaari.fi/linux/
3918Q: http://patchwork.linuxtv.org/project/linux-media/list/3927Q: http://patchwork.linuxtv.org/project/linux-media/list/
3919T: git git://linuxtv.org/anttip/media_tree.git3928T: git git://linuxtv.org/anttip/media_tree.git
@@ -4137,7 +4146,7 @@ F: drivers/net/ethernet/ibm/ehea/ · 217 unmodified lines
4137EM28XX VIDEO4LINUX DRIVER4146EM28XX VIDEO4LINUX DRIVER
4138M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>4147M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
4139L: linux-media@vger.kernel.org4148L: linux-media@vger.kernel.org
4140W: http://linuxtv.org4149W: https://linuxtv.org
4141T: git git://linuxtv.org/media_tree.git4150T: git git://linuxtv.org/media_tree.git
4142S: Maintained4151S: Maintained
4143F: drivers/media/usb/em28xx/4152F: drivers/media/usb/em28xx/
@@ -4277,7 +4286,7 @@ F: drivers/media/tuners/fc0011.c · 133 unmodified lines
4277FC2580 MEDIA DRIVER4286FC2580 MEDIA DRIVER
4278M: Antti Palosaari <crope@iki.fi>4287M: Antti Palosaari <crope@iki.fi>
4279L: linux-media@vger.kernel.org4288L: linux-media@vger.kernel.org
4280W: http://linuxtv.org/4289W: https://linuxtv.org
4281W: http://palosaari.fi/linux/4290W: http://palosaari.fi/linux/
4282Q: http://patchwork.linuxtv.org/project/linux-media/list/4291Q: http://patchwork.linuxtv.org/project/linux-media/list/
4283T: git git://linuxtv.org/anttip/media_tree.git4292T: git git://linuxtv.org/anttip/media_tree.git
@@ -4600,7 +4609,7 @@ M: Heungjun Kim <riverful.kim@samsung.com> · 316 unmodified lines
4600L: linux-media@vger.kernel.org4609L: linux-media@vger.kernel.org
4601S: Maintained4610S: Maintained
4602F: drivers/media/i2c/m5mols/4611F: drivers/media/i2c/m5mols/
4603F: include/media/m5mols.h4612F: include/media/i2c/m5mols.h
4604 4613
4605FUJITSU TABLET EXTRAS4614FUJITSU TABLET EXTRAS
4606M: Robert Gerlach <khnz@gmx.de>4615M: Robert Gerlach <khnz@gmx.de>
@@ -4646,7 +4655,7 @@ GEMTEK FM RADIO RECEIVER DRIVER · 39 unmodified lines
4646M: Hans Verkuil <hverkuil@xs4all.nl>4655M: Hans Verkuil <hverkuil@xs4all.nl>
4647L: linux-media@vger.kernel.org4656L: linux-media@vger.kernel.org
4648T: git git://linuxtv.org/media_tree.git4657T: git git://linuxtv.org/media_tree.git
4649W: http://linuxtv.org4658W: https://linuxtv.org
4650S: Maintained4659S: Maintained
4651F: drivers/media/radio/radio-gemtek*4660F: drivers/media/radio/radio-gemtek*
4652 4661
@@ -4854,7 +4863,7 @@ HDPVR USB VIDEO ENCODER DRIVER · 201 unmodified lines
4854M: Hans Verkuil <hverkuil@xs4all.nl>4863M: Hans Verkuil <hverkuil@xs4all.nl>
4855L: linux-media@vger.kernel.org4864L: linux-media@vger.kernel.org
4856T: git git://linuxtv.org/media_tree.git4865T: git git://linuxtv.org/media_tree.git
4857W: http://linuxtv.org4866W: https://linuxtv.org
4858S: Odd Fixes4867S: Odd Fixes
4859F: drivers/media/usb/hdpvr/4868F: drivers/media/usb/hdpvr/
4860 4869
@@ -4873,7 +4882,7 @@ F: drivers/tty/hvc/ · 12 unmodified lines
4873HACKRF MEDIA DRIVER4882HACKRF MEDIA DRIVER
4874M: Antti Palosaari <crope@iki.fi>4883M: Antti Palosaari <crope@iki.fi>
4875L: linux-media@vger.kernel.org4884L: linux-media@vger.kernel.org
4876W: http://linuxtv.org/4885W: https://linuxtv.org
4877W: http://palosaari.fi/linux/4886W: http://palosaari.fi/linux/
4878Q: http://patchwork.linuxtv.org/project/linux-media/list/4887Q: http://patchwork.linuxtv.org/project/linux-media/list/
4879T: git git://linuxtv.org/anttip/media_tree.git4888T: git git://linuxtv.org/anttip/media_tree.git
@@ -4916,7 +4925,7 @@ F: sound/parisc/harmony.* · 36 unmodified lines
4916HD29L2 MEDIA DRIVER4925HD29L2 MEDIA DRIVER
4917M: Antti Palosaari <crope@iki.fi>4926M: Antti Palosaari <crope@iki.fi>
4918L: linux-media@vger.kernel.org4927L: linux-media@vger.kernel.org
4919W: http://linuxtv.org/4928W: https://linuxtv.org
4920W: http://palosaari.fi/linux/4929W: http://palosaari.fi/linux/
4921Q: http://patchwork.linuxtv.org/project/linux-media/list/4930Q: http://patchwork.linuxtv.org/project/linux-media/list/
4922T: git git://linuxtv.org/anttip/media_tree.git4931T: git git://linuxtv.org/anttip/media_tree.git
@@ -5822,7 +5831,7 @@ ISA RADIO MODULE · 899 unmodified lines
5822M: Hans Verkuil <hverkuil@xs4all.nl>5831M: Hans Verkuil <hverkuil@xs4all.nl>
5823L: linux-media@vger.kernel.org5832L: linux-media@vger.kernel.org
5824T: git git://linuxtv.org/media_tree.git5833T: git git://linuxtv.org/media_tree.git
5825W: http://linuxtv.org5834W: https://linuxtv.org
5826S: Maintained5835S: Maintained
5827F: drivers/media/radio/radio-isa*5836F: drivers/media/radio/radio-isa*
5828 5837
@@ -5892,7 +5901,7 @@ F: drivers/hwmon/it87.c · 63 unmodified lines
5892IT913X MEDIA DRIVER5901IT913X MEDIA DRIVER
5893M: Antti Palosaari <crope@iki.fi>5902M: Antti Palosaari <crope@iki.fi>
5894L: linux-media@vger.kernel.org5903L: linux-media@vger.kernel.org
5895W: http://linuxtv.org/5904W: https://linuxtv.org
5896W: http://palosaari.fi/linux/5905W: http://palosaari.fi/linux/
5897Q: http://patchwork.linuxtv.org/project/linux-media/list/5906Q: http://patchwork.linuxtv.org/project/linux-media/list/
5898T: git git://linuxtv.org/anttip/media_tree.git5907T: git git://linuxtv.org/anttip/media_tree.git
@@ -5913,7 +5922,7 @@ F: include/uapi/linux/ivtv* · 14 unmodified lines
5913IX2505V MEDIA DRIVER5922IX2505V MEDIA DRIVER
5914M: Malcolm Priestley <tvboxspy@gmail.com>5923M: Malcolm Priestley <tvboxspy@gmail.com>
5915L: linux-media@vger.kernel.org5924L: linux-media@vger.kernel.org
5916W: http://linuxtv.org/5925W: https://linuxtv.org
5917Q: http://patchwork.linuxtv.org/project/linux-media/list/5926Q: http://patchwork.linuxtv.org/project/linux-media/list/
5918S: Maintained5927S: Maintained
5919F: drivers/media/dvb-frontends/ix2505v*5928F: drivers/media/dvb-frontends/ix2505v*
@@ -6002,7 +6011,7 @@ KEENE FM RADIO TRANSMITTER DRIVER · 82 unmodified lines
6002M: Hans Verkuil <hverkuil@xs4all.nl>6011M: Hans Verkuil <hverkuil@xs4all.nl>
6003L: linux-media@vger.kernel.org6012L: linux-media@vger.kernel.org
6004T: git git://linuxtv.org/media_tree.git6013T: git git://linuxtv.org/media_tree.git
6005W: http://linuxtv.org6014W: https://linuxtv.org
6006S: Maintained6015S: Maintained
6007F: drivers/media/radio/radio-keene*6016F: drivers/media/radio/radio-keene*
6008 6017
@@ -6254,7 +6263,7 @@ F: drivers/usb/misc/legousbtower.c · 245 unmodified lines
6254LG2160 MEDIA DRIVER6263LG2160 MEDIA DRIVER
6255M: Michael Krufky <mkrufky@linuxtv.org>6264M: Michael Krufky <mkrufky@linuxtv.org>
6256L: linux-media@vger.kernel.org6265L: linux-media@vger.kernel.org
6257W: http://linuxtv.org/6266W: https://linuxtv.org
6258W: http://github.com/mkrufky6267W: http://github.com/mkrufky
6259Q: http://patchwork.linuxtv.org/project/linux-media/list/6268Q: http://patchwork.linuxtv.org/project/linux-media/list/
6260T: git git://linuxtv.org/mkrufky/tuners.git6269T: git git://linuxtv.org/mkrufky/tuners.git
@@ -6264,7 +6273,7 @@ F: drivers/media/dvb-frontends/lg2160.* · 3 unmodified lines
6264LGDT3305 MEDIA DRIVER6273LGDT3305 MEDIA DRIVER
6265M: Michael Krufky <mkrufky@linuxtv.org>6274M: Michael Krufky <mkrufky@linuxtv.org>
6266L: linux-media@vger.kernel.org6275L: linux-media@vger.kernel.org
6267W: http://linuxtv.org/6276W: https://linuxtv.org
6268W: http://github.com/mkrufky6277W: http://github.com/mkrufky
6269Q: http://patchwork.linuxtv.org/project/linux-media/list/6278Q: http://patchwork.linuxtv.org/project/linux-media/list/
6270T: git git://linuxtv.org/mkrufky/tuners.git6279T: git git://linuxtv.org/mkrufky/tuners.git
@@ -6521,7 +6530,7 @@ F: drivers/hwmon/lm95234.c · 250 unmodified lines
6521LME2510 MEDIA DRIVER6530LME2510 MEDIA DRIVER
6522M: Malcolm Priestley <tvboxspy@gmail.com>6531M: Malcolm Priestley <tvboxspy@gmail.com>
6523L: linux-media@vger.kernel.org6532L: linux-media@vger.kernel.org
6524W: http://linuxtv.org/6533W: https://linuxtv.org
6525Q: http://patchwork.linuxtv.org/project/linux-media/list/6534Q: http://patchwork.linuxtv.org/project/linux-media/list/
6526S: Maintained6535S: Maintained
6527F: drivers/media/usb/dvb-usb-v2/lmedm04*6536F: drivers/media/usb/dvb-usb-v2/lmedm04*
@@ -6627,7 +6636,7 @@ F: arch/m68k/hp300/ · 99 unmodified lines
6627M88DS3103 MEDIA DRIVER6636M88DS3103 MEDIA DRIVER
6628M: Antti Palosaari <crope@iki.fi>6637M: Antti Palosaari <crope@iki.fi>
6629L: linux-media@vger.kernel.org6638L: linux-media@vger.kernel.org
6630W: http://linuxtv.org/6639W: https://linuxtv.org
6631W: http://palosaari.fi/linux/6640W: http://palosaari.fi/linux/
6632Q: http://patchwork.linuxtv.org/project/linux-media/list/6641Q: http://patchwork.linuxtv.org/project/linux-media/list/
6633T: git git://linuxtv.org/anttip/media_tree.git6642T: git git://linuxtv.org/anttip/media_tree.git
@@ -6637,7 +6646,7 @@ F: drivers/media/dvb-frontends/m88ds3103* · 3 unmodified lines
6637M88RS2000 MEDIA DRIVER6646M88RS2000 MEDIA DRIVER
6638M: Malcolm Priestley <tvboxspy@gmail.com>6647M: Malcolm Priestley <tvboxspy@gmail.com>
6639L: linux-media@vger.kernel.org6648L: linux-media@vger.kernel.org
6640W: http://linuxtv.org/6649W: https://linuxtv.org
6641Q: http://patchwork.linuxtv.org/project/linux-media/list/6650Q: http://patchwork.linuxtv.org/project/linux-media/list/
6642S: Maintained6651S: Maintained
6643F: drivers/media/dvb-frontends/m88rs2000*6652F: drivers/media/dvb-frontends/m88rs2000*
@@ -6816,7 +6825,7 @@ MAXIRADIO FM RADIO RECEIVER DRIVER · 172 unmodified lines
6816M: Hans Verkuil <hverkuil@xs4all.nl>6825M: Hans Verkuil <hverkuil@xs4all.nl>
6817L: linux-media@vger.kernel.org6826L: linux-media@vger.kernel.org
6818T: git git://linuxtv.org/media_tree.git6827T: git git://linuxtv.org/media_tree.git
6819W: http://linuxtv.org6828W: https://linuxtv.org
6820S: Maintained6829S: Maintained
6821F: drivers/media/radio/radio-maxiradio*6830F: drivers/media/radio/radio-maxiradio*
6822 6831
@@ -6838,7 +6847,7 @@ F: drivers/media/platform/vsp1/ · 15 unmodified lines
6838MEDIA DRIVERS FOR ASCOT2E6847MEDIA DRIVERS FOR ASCOT2E
6839M: Sergey Kozlov <serjk@netup.ru>6848M: Sergey Kozlov <serjk@netup.ru>
6840L: linux-media@vger.kernel.org6849L: linux-media@vger.kernel.org
6841W: http://linuxtv.org6850W: https://linuxtv.org
6842W: http://netup.tv/6851W: http://netup.tv/
6843T: git git://linuxtv.org/media_tree.git6852T: git git://linuxtv.org/media_tree.git
6844S: Supported6853S: Supported
@@ -6847,7 +6856,7 @@ F: drivers/media/dvb-frontends/ascot2e* · 2 unmodified lines
6847MEDIA DRIVERS FOR CXD2841ER6856MEDIA DRIVERS FOR CXD2841ER
6848M: Sergey Kozlov <serjk@netup.ru>6857M: Sergey Kozlov <serjk@netup.ru>
6849L: linux-media@vger.kernel.org6858L: linux-media@vger.kernel.org
6850W: http://linuxtv.org/6859W: https://linuxtv.org
6851W: http://netup.tv/6860W: http://netup.tv/
6852T: git git://linuxtv.org/media_tree.git6861T: git git://linuxtv.org/media_tree.git
6853S: Supported6862S: Supported
@@ -6856,7 +6865,7 @@ F: drivers/media/dvb-frontends/cxd2841er* · 2 unmodified lines
6856MEDIA DRIVERS FOR HORUS3A6865MEDIA DRIVERS FOR HORUS3A
6857M: Sergey Kozlov <serjk@netup.ru>6866M: Sergey Kozlov <serjk@netup.ru>
6858L: linux-media@vger.kernel.org6867L: linux-media@vger.kernel.org
6859W: http://linuxtv.org/6868W: https://linuxtv.org
6860W: http://netup.tv/6869W: http://netup.tv/
6861T: git git://linuxtv.org/media_tree.git6870T: git git://linuxtv.org/media_tree.git
6862S: Supported6871S: Supported
@@ -6865,7 +6874,7 @@ F: drivers/media/dvb-frontends/horus3a* · 2 unmodified lines
6865MEDIA DRIVERS FOR LNBH256874MEDIA DRIVERS FOR LNBH25
6866M: Sergey Kozlov <serjk@netup.ru>6875M: Sergey Kozlov <serjk@netup.ru>
6867L: linux-media@vger.kernel.org6876L: linux-media@vger.kernel.org
6868W: http://linuxtv.org/6877W: https://linuxtv.org
6869W: http://netup.tv/6878W: http://netup.tv/
6870T: git git://linuxtv.org/media_tree.git6879T: git git://linuxtv.org/media_tree.git
6871S: Supported6880S: Supported
@@ -6874,7 +6883,7 @@ F: drivers/media/dvb-frontends/lnbh25* · 2 unmodified lines
6874MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices6883MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
6875M: Sergey Kozlov <serjk@netup.ru>6884M: Sergey Kozlov <serjk@netup.ru>
6876L: linux-media@vger.kernel.org6885L: linux-media@vger.kernel.org
6877W: http://linuxtv.org/6886W: https://linuxtv.org
6878W: http://netup.tv/6887W: http://netup.tv/
6879T: git git://linuxtv.org/media_tree.git6888T: git git://linuxtv.org/media_tree.git
6880S: Supported6889S: Supported
@@ -6884,7 +6893,7 @@ MEDIA INPUT INFRASTRUCTURE (V4L/DVB) · 3 unmodified lines
6884M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>6893M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6885P: LinuxTV.org Project6894P: LinuxTV.org Project
6886L: linux-media@vger.kernel.org6895L: linux-media@vger.kernel.org
6887W: http://linuxtv.org6896W: https://linuxtv.org
6888Q: http://patchwork.kernel.org/project/linux-media/list/6897Q: http://patchwork.kernel.org/project/linux-media/list/
6889T: git git://linuxtv.org/media_tree.git6898T: git git://linuxtv.org/media_tree.git
6890S: Maintained6899S: Maintained
@@ -6893,6 +6902,7 @@ F: Documentation/video4linux/ · 2 unmodified lines
6893F: Documentation/DocBook/media/6902F: Documentation/DocBook/media/
6894F: drivers/media/6903F: drivers/media/
6895F: drivers/staging/media/6904F: drivers/staging/media/
6905F: include/linux/platform_data/media/
6896F: include/media/6906F: include/media/
6897F: include/uapi/linux/dvb/6907F: include/uapi/linux/dvb/
6898F: include/uapi/linux/videodev2.h6908F: include/uapi/linux/videodev2.h
@@ -7044,7 +7054,7 @@ MIROSOUND PCM20 FM RADIO RECEIVER DRIVER · 145 unmodified lines
7044M: Hans Verkuil <hverkuil@xs4all.nl>7054M: Hans Verkuil <hverkuil@xs4all.nl>
7045L: linux-media@vger.kernel.org7055L: linux-media@vger.kernel.org
7046T: git git://linuxtv.org/media_tree.git7056T: git git://linuxtv.org/media_tree.git
7047W: http://linuxtv.org7057W: https://linuxtv.org
7048S: Odd Fixes7058S: Odd Fixes
7049F: drivers/media/radio/radio-miropcm20*7059F: drivers/media/radio/radio-miropcm20*
7050 7060
@@ -7080,7 +7090,7 @@ F: drivers/iio/temperature/mlx90614.c · 29 unmodified lines
7080MN88472 MEDIA DRIVER7090MN88472 MEDIA DRIVER
7081M: Antti Palosaari <crope@iki.fi>7091M: Antti Palosaari <crope@iki.fi>
7082L: linux-media@vger.kernel.org7092L: linux-media@vger.kernel.org
7083W: http://linuxtv.org/7093W: https://linuxtv.org
7084W: http://palosaari.fi/linux/7094W: http://palosaari.fi/linux/
7085Q: http://patchwork.linuxtv.org/project/linux-media/list/7095Q: http://patchwork.linuxtv.org/project/linux-media/list/
7086T: git git://linuxtv.org/anttip/media_tree.git7096T: git git://linuxtv.org/anttip/media_tree.git
@@ -7091,7 +7101,7 @@ F: drivers/media/dvb-frontends/mn88472.h · 4 unmodified lines
7091MN88473 MEDIA DRIVER7101MN88473 MEDIA DRIVER
7092M: Antti Palosaari <crope@iki.fi>7102M: Antti Palosaari <crope@iki.fi>
7093L: linux-media@vger.kernel.org7103L: linux-media@vger.kernel.org
7094W: http://linuxtv.org/7104W: https://linuxtv.org
7095W: http://palosaari.fi/linux/7105W: http://palosaari.fi/linux/
7096Q: http://patchwork.linuxtv.org/project/linux-media/list/7106Q: http://patchwork.linuxtv.org/project/linux-media/list/
7097T: git git://linuxtv.org/anttip/media_tree.git7107T: git git://linuxtv.org/anttip/media_tree.git
@@ -7146,7 +7156,7 @@ F: drivers/platform/x86/msi-wmi.c · 48 unmodified lines
7146MSI001 MEDIA DRIVER7156MSI001 MEDIA DRIVER
7147M: Antti Palosaari <crope@iki.fi>7157M: Antti Palosaari <crope@iki.fi>
7148L: linux-media@vger.kernel.org7158L: linux-media@vger.kernel.org
7149W: http://linuxtv.org/7159W: https://linuxtv.org
7150W: http://palosaari.fi/linux/7160W: http://palosaari.fi/linux/
7151Q: http://patchwork.linuxtv.org/project/linux-media/list/7161Q: http://patchwork.linuxtv.org/project/linux-media/list/
7152T: git git://linuxtv.org/anttip/media_tree.git7162T: git git://linuxtv.org/anttip/media_tree.git
@@ -7156,7 +7166,7 @@ F: drivers/media/tuners/msi001* · 3 unmodified lines
7156MSI2500 MEDIA DRIVER7166MSI2500 MEDIA DRIVER
7157M: Antti Palosaari <crope@iki.fi>7167M: Antti Palosaari <crope@iki.fi>
7158L: linux-media@vger.kernel.org7168L: linux-media@vger.kernel.org
7159W: http://linuxtv.org/7169W: https://linuxtv.org
7160W: http://palosaari.fi/linux/7170W: http://palosaari.fi/linux/
7161Q: http://patchwork.linuxtv.org/project/linux-media/list/7171Q: http://patchwork.linuxtv.org/project/linux-media/list/
7162T: git git://linuxtv.org/anttip/media_tree.git7172T: git git://linuxtv.org/anttip/media_tree.git
@@ -7175,7 +7185,7 @@ L: linux-media@vger.kernel.org · 12 unmodified lines
7175T: git git://linuxtv.org/media_tree.git7185T: git git://linuxtv.org/media_tree.git
7176S: Maintained7186S: Maintained
7177F: drivers/media/i2c/mt9m032.c7187F: drivers/media/i2c/mt9m032.c
7178F: include/media/mt9m032.h7188F: include/media/i2c/mt9m032.h
7179 7189
7180MT9P031 APTINA CAMERA SENSOR7190MT9P031 APTINA CAMERA SENSOR
7181M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>7191M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7183,7 +7193,7 @@ L: linux-media@vger.kernel.org · 1 unmodified line
7183T: git git://linuxtv.org/media_tree.git7193T: git git://linuxtv.org/media_tree.git
7184S: Maintained7194S: Maintained
7185F: drivers/media/i2c/mt9p031.c7195F: drivers/media/i2c/mt9p031.c
7186F: include/media/mt9p031.h7196F: include/media/i2c/mt9p031.h
7187 7197
7188MT9T001 APTINA CAMERA SENSOR7198MT9T001 APTINA CAMERA SENSOR
7189M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>7199M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7191,7 +7201,7 @@ L: linux-media@vger.kernel.org · 1 unmodified line
7191T: git git://linuxtv.org/media_tree.git7201T: git git://linuxtv.org/media_tree.git
7192S: Maintained7202S: Maintained
7193F: drivers/media/i2c/mt9t001.c7203F: drivers/media/i2c/mt9t001.c
7194F: include/media/mt9t001.h7204F: include/media/i2c/mt9t001.h
7195 7205
7196MT9V032 APTINA CAMERA SENSOR7206MT9V032 APTINA CAMERA SENSOR
7197M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>7207M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7200,7 +7210,7 @@ T: git git://linuxtv.org/media_tree.git · 2 unmodified lines
7200S: Maintained7210S: Maintained
7201F: Documentation/devicetree/bindings/media/i2c/mt9v032.txt7211F: Documentation/devicetree/bindings/media/i2c/mt9v032.txt
7202F: drivers/media/i2c/mt9v032.c7212F: drivers/media/i2c/mt9v032.c
7203F: include/media/mt9v032.h7213F: include/media/i2c/mt9v032.h
7204 7214
7205MULTIFUNCTION DEVICES (MFD)7215MULTIFUNCTION DEVICES (MFD)
7206M: Lee Jones <lee.jones@linaro.org>7216M: Lee Jones <lee.jones@linaro.org>
@@ -7244,7 +7254,7 @@ F: drivers/usb/musb/ · 37 unmodified lines
7244MXL5007T MEDIA DRIVER7254MXL5007T MEDIA DRIVER
7245M: Michael Krufky <mkrufky@linuxtv.org>7255M: Michael Krufky <mkrufky@linuxtv.org>
7246L: linux-media@vger.kernel.org7256L: linux-media@vger.kernel.org
7247W: http://linuxtv.org/7257W: https://linuxtv.org
7248W: http://github.com/mkrufky7258W: http://github.com/mkrufky
7249Q: http://patchwork.linuxtv.org/project/linux-media/list/7259Q: http://patchwork.linuxtv.org/project/linux-media/list/
7250T: git git://linuxtv.org/mkrufky/tuners.git7260T: git git://linuxtv.org/mkrufky/tuners.git
@@ -8745,7 +8755,7 @@ F: include/uapi/linux/qnxtypes.h · 1494 unmodified lines
8745QT1010 MEDIA DRIVER8755QT1010 MEDIA DRIVER
8746M: Antti Palosaari <crope@iki.fi>8756M: Antti Palosaari <crope@iki.fi>
8747L: linux-media@vger.kernel.org8757L: linux-media@vger.kernel.org
8748W: http://linuxtv.org/8758W: https://linuxtv.org
8749W: http://palosaari.fi/linux/8759W: http://palosaari.fi/linux/
8750Q: http://patchwork.linuxtv.org/project/linux-media/list/8760Q: http://patchwork.linuxtv.org/project/linux-media/list/
8751T: git git://linuxtv.org/anttip/media_tree.git8761T: git git://linuxtv.org/anttip/media_tree.git
@@ -9038,7 +9048,7 @@ F: net/rose/ · 286 unmodified lines
9038RTL2830 MEDIA DRIVER9048RTL2830 MEDIA DRIVER
9039M: Antti Palosaari <crope@iki.fi>9049M: Antti Palosaari <crope@iki.fi>
9040L: linux-media@vger.kernel.org9050L: linux-media@vger.kernel.org
9041W: http://linuxtv.org/9051W: https://linuxtv.org
9042W: http://palosaari.fi/linux/9052W: http://palosaari.fi/linux/
9043Q: http://patchwork.linuxtv.org/project/linux-media/list/9053Q: http://patchwork.linuxtv.org/project/linux-media/list/
9044T: git git://linuxtv.org/anttip/media_tree.git9054T: git git://linuxtv.org/anttip/media_tree.git
@@ -9048,7 +9058,7 @@ F: drivers/media/dvb-frontends/rtl2830* · 3 unmodified lines
9048RTL2832 MEDIA DRIVER9058RTL2832 MEDIA DRIVER
9049M: Antti Palosaari <crope@iki.fi>9059M: Antti Palosaari <crope@iki.fi>
9050L: linux-media@vger.kernel.org9060L: linux-media@vger.kernel.org
9051W: http://linuxtv.org/9061W: https://linuxtv.org
9052W: http://palosaari.fi/linux/9062W: http://palosaari.fi/linux/
9053Q: http://patchwork.linuxtv.org/project/linux-media/list/9063Q: http://patchwork.linuxtv.org/project/linux-media/list/
9054T: git git://linuxtv.org/anttip/media_tree.git9064T: git git://linuxtv.org/anttip/media_tree.git
@@ -9058,7 +9068,7 @@ F: drivers/media/dvb-frontends/rtl2832* · 3 unmodified lines
9058RTL2832_SDR MEDIA DRIVER9068RTL2832_SDR MEDIA DRIVER
9059M: Antti Palosaari <crope@iki.fi>9069M: Antti Palosaari <crope@iki.fi>
9060L: linux-media@vger.kernel.org9070L: linux-media@vger.kernel.org
9061W: http://linuxtv.org/9071W: https://linuxtv.org
9062W: http://palosaari.fi/linux/9072W: http://palosaari.fi/linux/
9063Q: http://patchwork.linuxtv.org/project/linux-media/list/9073Q: http://patchwork.linuxtv.org/project/linux-media/list/
9064T: git git://linuxtv.org/anttip/media_tree.git9074T: git git://linuxtv.org/anttip/media_tree.git
@@ -9189,14 +9199,14 @@ SAA6588 RDS RECEIVER DRIVER · 124 unmodified lines
9189M: Hans Verkuil <hverkuil@xs4all.nl>9199M: Hans Verkuil <hverkuil@xs4all.nl>
9190L: linux-media@vger.kernel.org9200L: linux-media@vger.kernel.org
9191T: git git://linuxtv.org/media_tree.git9201T: git git://linuxtv.org/media_tree.git
9192W: http://linuxtv.org9202W: https://linuxtv.org
9193S: Odd Fixes9203S: Odd Fixes
9194F: drivers/media/i2c/saa6588*9204F: drivers/media/i2c/saa6588*
9195 9205
9196SAA7134 VIDEO4LINUX DRIVER9206SAA7134 VIDEO4LINUX DRIVER
9197M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>9207M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9198L: linux-media@vger.kernel.org9208L: linux-media@vger.kernel.org
9199W: http://linuxtv.org9209W: https://linuxtv.org
9200T: git git://linuxtv.org/media_tree.git9210T: git git://linuxtv.org/media_tree.git
9201S: Odd fixes9211S: Odd fixes
9202F: Documentation/video4linux/*.saa71349212F: Documentation/video4linux/*.saa7134
@@ -9258,7 +9268,7 @@ L: linux-media@vger.kernel.org · 55 unmodified lines
9258L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)9268L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
9259S: Maintained9269S: Maintained
9260F: drivers/media/platform/s3c-camif/9270F: drivers/media/platform/s3c-camif/
9261F: include/media/s3c_camif.h9271F: include/media/drv-intf/s3c_camif.h
9262 9272
9263SAMSUNG S5C73M3 CAMERA DRIVER9273SAMSUNG S5C73M3 CAMERA DRIVER
9264M: Kyungmin Park <kyungmin.park@samsung.com>9274M: Kyungmin Park <kyungmin.park@samsung.com>
@@ -9633,7 +9643,7 @@ F: drivers/misc/sgi-xp/ · 368 unmodified lines
9633SI2157 MEDIA DRIVER9643SI2157 MEDIA DRIVER
9634M: Antti Palosaari <crope@iki.fi>9644M: Antti Palosaari <crope@iki.fi>
9635L: linux-media@vger.kernel.org9645L: linux-media@vger.kernel.org
9636W: http://linuxtv.org/9646W: https://linuxtv.org
9637W: http://palosaari.fi/linux/9647W: http://palosaari.fi/linux/
9638Q: http://patchwork.linuxtv.org/project/linux-media/list/9648Q: http://patchwork.linuxtv.org/project/linux-media/list/
9639T: git git://linuxtv.org/anttip/media_tree.git9649T: git git://linuxtv.org/anttip/media_tree.git
@@ -9643,7 +9653,7 @@ F: drivers/media/tuners/si2157* · 3 unmodified lines
9643SI2168 MEDIA DRIVER9653SI2168 MEDIA DRIVER
9644M: Antti Palosaari <crope@iki.fi>9654M: Antti Palosaari <crope@iki.fi>
9645L: linux-media@vger.kernel.org9655L: linux-media@vger.kernel.org
9646W: http://linuxtv.org/9656W: https://linuxtv.org
9647W: http://palosaari.fi/linux/9657W: http://palosaari.fi/linux/
9648Q: http://patchwork.linuxtv.org/project/linux-media/list/9658Q: http://patchwork.linuxtv.org/project/linux-media/list/
9649T: git git://linuxtv.org/anttip/media_tree.git9659T: git git://linuxtv.org/anttip/media_tree.git
@@ -9654,7 +9664,7 @@ SI470X FM RADIO RECEIVER I2C DRIVER · 4 unmodified lines
9654M: Hans Verkuil <hverkuil@xs4all.nl>9664M: Hans Verkuil <hverkuil@xs4all.nl>
9655L: linux-media@vger.kernel.org9665L: linux-media@vger.kernel.org
9656T: git git://linuxtv.org/media_tree.git9666T: git git://linuxtv.org/media_tree.git
9657W: http://linuxtv.org9667W: https://linuxtv.org
9658S: Odd Fixes9668S: Odd Fixes
9659F: drivers/media/radio/si470x/radio-si470x-i2c.c9669F: drivers/media/radio/si470x/radio-si470x-i2c.c
9660 9670
@@ -9662,7 +9672,7 @@ SI470X FM RADIO RECEIVER USB DRIVER · 1 unmodified line
9662M: Hans Verkuil <hverkuil@xs4all.nl>9672M: Hans Verkuil <hverkuil@xs4all.nl>
9663L: linux-media@vger.kernel.org9673L: linux-media@vger.kernel.org
9664T: git git://linuxtv.org/media_tree.git9674T: git git://linuxtv.org/media_tree.git
9665W: http://linuxtv.org9675W: https://linuxtv.org
9666S: Maintained9676S: Maintained
9667F: drivers/media/radio/si470x/radio-si470x-common.c9677F: drivers/media/radio/si470x/radio-si470x-common.c
9668F: drivers/media/radio/si470x/radio-si470x.h9678F: drivers/media/radio/si470x/radio-si470x.h
@@ -9672,7 +9682,7 @@ SI4713 FM RADIO TRANSMITTER I2C DRIVER · 3 unmodified lines
9672M: Eduardo Valentin <edubezval@gmail.com>9682M: Eduardo Valentin <edubezval@gmail.com>
9673L: linux-media@vger.kernel.org9683L: linux-media@vger.kernel.org
9674T: git git://linuxtv.org/media_tree.git9684T: git git://linuxtv.org/media_tree.git
9675W: http://linuxtv.org9685W: https://linuxtv.org
9676S: Odd Fixes9686S: Odd Fixes
9677F: drivers/media/radio/si4713/si4713.?9687F: drivers/media/radio/si4713/si4713.?
9678 9688
@@ -9680,7 +9690,7 @@ SI4713 FM RADIO TRANSMITTER PLATFORM DRIVER · 1 unmodified line
9680M: Eduardo Valentin <edubezval@gmail.com>9690M: Eduardo Valentin <edubezval@gmail.com>
9681L: linux-media@vger.kernel.org9691L: linux-media@vger.kernel.org
9682T: git git://linuxtv.org/media_tree.git9692T: git git://linuxtv.org/media_tree.git
9683W: http://linuxtv.org9693W: https://linuxtv.org
9684S: Odd Fixes9694S: Odd Fixes
9685F: drivers/media/radio/si4713/radio-platform-si4713.c9695F: drivers/media/radio/si4713/radio-platform-si4713.c
9686 9696
@@ -9688,14 +9698,14 @@ SI4713 FM RADIO TRANSMITTER USB DRIVER · 1 unmodified line
9688M: Hans Verkuil <hverkuil@xs4all.nl>9698M: Hans Verkuil <hverkuil@xs4all.nl>
9689L: linux-media@vger.kernel.org9699L: linux-media@vger.kernel.org
9690T: git git://linuxtv.org/media_tree.git9700T: git git://linuxtv.org/media_tree.git
9691W: http://linuxtv.org9701W: https://linuxtv.org
9692S: Maintained9702S: Maintained
9693F: drivers/media/radio/si4713/radio-usb-si4713.c9703F: drivers/media/radio/si4713/radio-usb-si4713.c
9694 9704
9695SIANO DVB DRIVER9705SIANO DVB DRIVER
9696M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>9706M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9697L: linux-media@vger.kernel.org9707L: linux-media@vger.kernel.org
9698W: http://linuxtv.org9708W: https://linuxtv.org
9699T: git git://linuxtv.org/media_tree.git9709T: git git://linuxtv.org/media_tree.git
9700S: Odd fixes9710S: Odd fixes
9701F: drivers/media/common/siano/9711F: drivers/media/common/siano/
@@ -9720,7 +9730,7 @@ SH_VOU V4L2 OUTPUT DRIVER · 18 unmodified lines
9720L: linux-media@vger.kernel.org9730L: linux-media@vger.kernel.org
9721S: Orphan9731S: Orphan
9722F: drivers/media/platform/sh_vou.c9732F: drivers/media/platform/sh_vou.c
9723F: include/media/sh_vou.h9733F: include/media/drv-intf/sh_vou.h
9724 9734
9725SIMPLE FIRMWARE INTERFACE (SFI)9735SIMPLE FIRMWARE INTERFACE (SFI)
9726M: Len Brown <lenb@kernel.org>9736M: Len Brown <lenb@kernel.org>
@@ -9761,7 +9771,7 @@ F: drivers/i2c/busses/i2c-davinci.c · 34 unmodified lines
9761TI DAVINCI SERIES MEDIA DRIVER9771TI DAVINCI SERIES MEDIA DRIVER
9762M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>9772M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
9763L: linux-media@vger.kernel.org9773L: linux-media@vger.kernel.org
9764W: http://linuxtv.org/9774W: https://linuxtv.org
9765Q: http://patchwork.linuxtv.org/project/linux-media/list/9775Q: http://patchwork.linuxtv.org/project/linux-media/list/
9766T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git9776T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
9767S: Maintained9777S: Maintained
@@ -9771,7 +9781,7 @@ F: include/media/davinci/ · 3 unmodified lines
9771TI AM437X VPFE DRIVER9781TI AM437X VPFE DRIVER
9772M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>9782M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
9773L: linux-media@vger.kernel.org9783L: linux-media@vger.kernel.org
9774W: http://linuxtv.org/9784W: https://linuxtv.org
9775Q: http://patchwork.linuxtv.org/project/linux-media/list/9785Q: http://patchwork.linuxtv.org/project/linux-media/list/
9776T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git9786T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
9777S: Maintained9787S: Maintained
@@ -9780,12 +9790,12 @@ F: drivers/media/platform/am437x/ · 2 unmodified lines
9780OV2659 OMNIVISION SENSOR DRIVER9790OV2659 OMNIVISION SENSOR DRIVER
9781M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>9791M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
9782L: linux-media@vger.kernel.org9792L: linux-media@vger.kernel.org
9783W: http://linuxtv.org/9793W: https://linuxtv.org
9784Q: http://patchwork.linuxtv.org/project/linux-media/list/9794Q: http://patchwork.linuxtv.org/project/linux-media/list/
9785T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git9795T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
9786S: Maintained9796S: Maintained
9787F: drivers/media/i2c/ov2659.c9797F: drivers/media/i2c/ov2659.c
9788F: include/media/ov2659.h9798F: include/media/i2c/ov2659.h
9789 9799
9790SILICON MOTION SM712 FRAME BUFFER DRIVER9800SILICON MOTION SM712 FRAME BUFFER DRIVER
9791M: Sudip Mukherjee <sudipm.mukherjee@gmail.com>9801M: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
@@ -9874,7 +9884,7 @@ M: Sakari Ailus <sakari.ailus@iki.fi> · 82 unmodified lines
9874L: linux-media@vger.kernel.org9884L: linux-media@vger.kernel.org
9875S: Maintained9885S: Maintained
9876F: drivers/media/i2c/smiapp/9886F: drivers/media/i2c/smiapp/
9877F: include/media/smiapp.h9887F: include/media/i2c/smiapp.h
9878F: drivers/media/i2c/smiapp-pll.c9888F: drivers/media/i2c/smiapp-pll.c
9879F: drivers/media/i2c/smiapp-pll.h9889F: drivers/media/i2c/smiapp-pll.h
9880F: include/uapi/linux/smiapp.h9890F: include/uapi/linux/smiapp.h
@@ -10038,7 +10048,7 @@ F: sound/soc/soc-generic-dmaengine-pcm.c · 157 unmodified lines
10038SP2 MEDIA DRIVER10048SP2 MEDIA DRIVER
10039M: Olli Salonen <olli.salonen@iki.fi>10049M: Olli Salonen <olli.salonen@iki.fi>
10040L: linux-media@vger.kernel.org10050L: linux-media@vger.kernel.org
10041W: http://linuxtv.org/10051W: https://linuxtv.org
10042Q: http://patchwork.linuxtv.org/project/linux-media/list/10052Q: http://patchwork.linuxtv.org/project/linux-media/list/
10043S: Maintained10053S: Maintained
10044F: drivers/media/dvb-frontends/sp2*10054F: drivers/media/dvb-frontends/sp2*
@@ -10400,7 +10410,7 @@ F: net/ipv4/tcp_lp.c · 355 unmodified lines
10400TDA10071 MEDIA DRIVER10410TDA10071 MEDIA DRIVER
10401M: Antti Palosaari <crope@iki.fi>10411M: Antti Palosaari <crope@iki.fi>
10402L: linux-media@vger.kernel.org10412L: linux-media@vger.kernel.org
10403W: http://linuxtv.org/10413W: https://linuxtv.org
10404W: http://palosaari.fi/linux/10414W: http://palosaari.fi/linux/
10405Q: http://patchwork.linuxtv.org/project/linux-media/list/10415Q: http://patchwork.linuxtv.org/project/linux-media/list/
10406T: git git://linuxtv.org/anttip/media_tree.git10416T: git git://linuxtv.org/anttip/media_tree.git
@@ -10410,7 +10420,7 @@ F: drivers/media/dvb-frontends/tda10071* · 3 unmodified lines
10410TDA18212 MEDIA DRIVER10420TDA18212 MEDIA DRIVER
10411M: Antti Palosaari <crope@iki.fi>10421M: Antti Palosaari <crope@iki.fi>
10412L: linux-media@vger.kernel.org10422L: linux-media@vger.kernel.org
10413W: http://linuxtv.org/10423W: https://linuxtv.org
10414W: http://palosaari.fi/linux/10424W: http://palosaari.fi/linux/
10415Q: http://patchwork.linuxtv.org/project/linux-media/list/10425Q: http://patchwork.linuxtv.org/project/linux-media/list/
10416T: git git://linuxtv.org/anttip/media_tree.git10426T: git git://linuxtv.org/anttip/media_tree.git
@@ -10420,7 +10430,7 @@ F: drivers/media/tuners/tda18212* · 3 unmodified lines
10420TDA18218 MEDIA DRIVER10430TDA18218 MEDIA DRIVER
10421M: Antti Palosaari <crope@iki.fi>10431M: Antti Palosaari <crope@iki.fi>
10422L: linux-media@vger.kernel.org10432L: linux-media@vger.kernel.org
10423W: http://linuxtv.org/10433W: https://linuxtv.org
10424W: http://palosaari.fi/linux/10434W: http://palosaari.fi/linux/
10425Q: http://patchwork.linuxtv.org/project/linux-media/list/10435Q: http://patchwork.linuxtv.org/project/linux-media/list/
10426T: git git://linuxtv.org/anttip/media_tree.git10436T: git git://linuxtv.org/anttip/media_tree.git
@@ -10430,7 +10440,7 @@ F: drivers/media/tuners/tda18218* · 3 unmodified lines
10430TDA18271 MEDIA DRIVER10440TDA18271 MEDIA DRIVER
10431M: Michael Krufky <mkrufky@linuxtv.org>10441M: Michael Krufky <mkrufky@linuxtv.org>
10432L: linux-media@vger.kernel.org10442L: linux-media@vger.kernel.org
10433W: http://linuxtv.org/10443W: https://linuxtv.org
10434W: http://github.com/mkrufky10444W: http://github.com/mkrufky
10435Q: http://patchwork.linuxtv.org/project/linux-media/list/10445Q: http://patchwork.linuxtv.org/project/linux-media/list/
10436T: git git://linuxtv.org/mkrufky/tuners.git10446T: git git://linuxtv.org/mkrufky/tuners.git
@@ -10440,7 +10450,7 @@ F: drivers/media/tuners/tda18271* · 3 unmodified lines
10440TDA827x MEDIA DRIVER10450TDA827x MEDIA DRIVER
10441M: Michael Krufky <mkrufky@linuxtv.org>10451M: Michael Krufky <mkrufky@linuxtv.org>
10442L: linux-media@vger.kernel.org10452L: linux-media@vger.kernel.org
10443W: http://linuxtv.org/10453W: https://linuxtv.org
10444W: http://github.com/mkrufky10454W: http://github.com/mkrufky
10445Q: http://patchwork.linuxtv.org/project/linux-media/list/10455Q: http://patchwork.linuxtv.org/project/linux-media/list/
10446T: git git://linuxtv.org/mkrufky/tuners.git10456T: git git://linuxtv.org/mkrufky/tuners.git
@@ -10450,7 +10460,7 @@ F: drivers/media/tuners/tda8290.* · 3 unmodified lines
10450TDA8290 MEDIA DRIVER10460TDA8290 MEDIA DRIVER
10451M: Michael Krufky <mkrufky@linuxtv.org>10461M: Michael Krufky <mkrufky@linuxtv.org>
10452L: linux-media@vger.kernel.org10462L: linux-media@vger.kernel.org
10453W: http://linuxtv.org/10463W: https://linuxtv.org
10454W: http://github.com/mkrufky10464W: http://github.com/mkrufky
10455Q: http://patchwork.linuxtv.org/project/linux-media/list/10465Q: http://patchwork.linuxtv.org/project/linux-media/list/
10456T: git git://linuxtv.org/mkrufky/tuners.git10466T: git git://linuxtv.org/mkrufky/tuners.git
@@ -10461,14 +10471,14 @@ TDA9840 MEDIA DRIVER · 4 unmodified lines
10461M: Hans Verkuil <hverkuil@xs4all.nl>10471M: Hans Verkuil <hverkuil@xs4all.nl>
10462L: linux-media@vger.kernel.org10472L: linux-media@vger.kernel.org
10463T: git git://linuxtv.org/media_tree.git10473T: git git://linuxtv.org/media_tree.git
10464W: http://linuxtv.org10474W: https://linuxtv.org
10465S: Maintained10475S: Maintained
10466F: drivers/media/i2c/tda9840*10476F: drivers/media/i2c/tda9840*
10467 10477
10468TEA5761 TUNER DRIVER10478TEA5761 TUNER DRIVER
10469M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>10479M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
10470L: linux-media@vger.kernel.org10480L: linux-media@vger.kernel.org
10471W: http://linuxtv.org10481W: https://linuxtv.org
10472T: git git://linuxtv.org/media_tree.git10482T: git git://linuxtv.org/media_tree.git
10473S: Odd fixes10483S: Odd fixes
10474F: drivers/media/tuners/tea5761.*10484F: drivers/media/tuners/tea5761.*
@@ -10476,7 +10486,7 @@ F: drivers/media/tuners/tea5761.* · 1 unmodified line
10476TEA5767 TUNER DRIVER10486TEA5767 TUNER DRIVER
10477M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>10487M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
10478L: linux-media@vger.kernel.org10488L: linux-media@vger.kernel.org
10479W: http://linuxtv.org10489W: https://linuxtv.org
10480T: git git://linuxtv.org/media_tree.git10490T: git git://linuxtv.org/media_tree.git
10481S: Maintained10491S: Maintained
10482F: drivers/media/tuners/tea5767.*10492F: drivers/media/tuners/tea5767.*
@@ -10485,7 +10495,7 @@ TEA6415C MEDIA DRIVER · 2 unmodified lines
10485M: Hans Verkuil <hverkuil@xs4all.nl>10495M: Hans Verkuil <hverkuil@xs4all.nl>
10486L: linux-media@vger.kernel.org10496L: linux-media@vger.kernel.org
10487T: git git://linuxtv.org/media_tree.git10497T: git git://linuxtv.org/media_tree.git
10488W: http://linuxtv.org10498W: https://linuxtv.org
10489S: Maintained10499S: Maintained
10490F: drivers/media/i2c/tea6415c*10500F: drivers/media/i2c/tea6415c*
10491 10501
@@ -10493,7 +10503,7 @@ TEA6420 MEDIA DRIVER · 1 unmodified line
10493M: Hans Verkuil <hverkuil@xs4all.nl>10503M: Hans Verkuil <hverkuil@xs4all.nl>
10494L: linux-media@vger.kernel.org10504L: linux-media@vger.kernel.org
10495T: git git://linuxtv.org/media_tree.git10505T: git git://linuxtv.org/media_tree.git
10496W: http://linuxtv.org10506W: https://linuxtv.org
10497S: Maintained10507S: Maintained
10498F: drivers/media/i2c/tea6420*10508F: drivers/media/i2c/tea6420*
10499 10509
@@ -10591,7 +10601,7 @@ THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER · 91 unmodified lines
10591M: Hans Verkuil <hverkuil@xs4all.nl>10601M: Hans Verkuil <hverkuil@xs4all.nl>
10592L: linux-media@vger.kernel.org10602L: linux-media@vger.kernel.org
10593T: git git://linuxtv.org/media_tree.git10603T: git git://linuxtv.org/media_tree.git
10594W: http://linuxtv.org10604W: https://linuxtv.org
10595S: Maintained10605S: Maintained
10596F: drivers/media/radio/radio-raremono.c10606F: drivers/media/radio/radio-raremono.c
10597 10607
@@ -10815,7 +10825,7 @@ M: Mats Randgaard <matrandg@cisco.com> · 217 unmodified lines
10815L: linux-media@vger.kernel.org10825L: linux-media@vger.kernel.org
10816S: Maintained10826S: Maintained
10817F: drivers/media/i2c/tc358743*10827F: drivers/media/i2c/tc358743*
10818F: include/media/tc358743.h10828F: include/media/i2c/tc358743.h
10819 10829
10820TMIO MMC DRIVER10830TMIO MMC DRIVER
10821M: Ian Molton <ian@mnementh.co.uk>10831M: Ian Molton <ian@mnementh.co.uk>
@@ -10843,7 +10853,7 @@ F: mm/shmem.c · 21 unmodified lines
10843TM6000 VIDEO4LINUX DRIVER10853TM6000 VIDEO4LINUX DRIVER
10844M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>10854M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
10845L: linux-media@vger.kernel.org10855L: linux-media@vger.kernel.org
10846W: http://linuxtv.org10856W: https://linuxtv.org
10847T: git git://linuxtv.org/media_tree.git10857T: git git://linuxtv.org/media_tree.git
10848S: Odd fixes10858S: Odd fixes
10849F: drivers/media/usb/tm6000/10859F: drivers/media/usb/tm6000/
@@ -10852,7 +10862,7 @@ TW68 VIDEO4LINUX DRIVER · 2 unmodified lines
10852M: Hans Verkuil <hverkuil@xs4all.nl>10862M: Hans Verkuil <hverkuil@xs4all.nl>
10853L: linux-media@vger.kernel.org10863L: linux-media@vger.kernel.org
10854T: git git://linuxtv.org/media_tree.git10864T: git git://linuxtv.org/media_tree.git
10855W: http://linuxtv.org10865W: https://linuxtv.org
10856S: Odd Fixes10866S: Odd Fixes
10857F: drivers/media/pci/tw68/10867F: drivers/media/pci/tw68/
10858 10868
@@ -10913,7 +10923,7 @@ F: include/uapi/linux/tty.h · 54 unmodified lines
10913TUA9001 MEDIA DRIVER10923TUA9001 MEDIA DRIVER
10914M: Antti Palosaari <crope@iki.fi>10924M: Antti Palosaari <crope@iki.fi>
10915L: linux-media@vger.kernel.org10925L: linux-media@vger.kernel.org
10916W: http://linuxtv.org/10926W: https://linuxtv.org
10917W: http://palosaari.fi/linux/10927W: http://palosaari.fi/linux/
10918Q: http://patchwork.linuxtv.org/project/linux-media/list/10928Q: http://patchwork.linuxtv.org/project/linux-media/list/
10919T: git git://linuxtv.org/anttip/media_tree.git10929T: git git://linuxtv.org/anttip/media_tree.git
@@ -11260,7 +11270,7 @@ USB VISION DRIVER · 340 unmodified lines
11260M: Hans Verkuil <hverkuil@xs4all.nl>11270M: Hans Verkuil <hverkuil@xs4all.nl>
11261L: linux-media@vger.kernel.org11271L: linux-media@vger.kernel.org
11262T: git git://linuxtv.org/media_tree.git11272T: git git://linuxtv.org/media_tree.git
11263W: http://linuxtv.org11273W: https://linuxtv.org
11264S: Odd Fixes11274S: Odd Fixes
11265F: drivers/media/usb/usbvision/11275F: drivers/media/usb/usbvision/
11266 11276
@@ -11474,7 +11484,7 @@ VIVID VIRTUAL VIDEO DRIVER · 207 unmodified lines
11474M: Hans Verkuil <hverkuil@xs4all.nl>11484M: Hans Verkuil <hverkuil@xs4all.nl>
11475L: linux-media@vger.kernel.org11485L: linux-media@vger.kernel.org
11476T: git git://linuxtv.org/media_tree.git11486T: git git://linuxtv.org/media_tree.git
11477W: http://linuxtv.org11487W: https://linuxtv.org
11478S: Maintained11488S: Maintained
11479F: drivers/media/platform/vivid/*11489F: drivers/media/platform/vivid/*
11480 11490
@@ -11763,7 +11773,7 @@ F: arch/x86/entry/vdso/ · 282 unmodified lines
11763XC2028/3028 TUNER DRIVER11773XC2028/3028 TUNER DRIVER
11764M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>11774M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
11765L: linux-media@vger.kernel.org11775L: linux-media@vger.kernel.org
11766W: http://linuxtv.org11776W: https://linuxtv.org
11767T: git git://linuxtv.org/media_tree.git11777T: git git://linuxtv.org/media_tree.git
11768S: Maintained11778S: Maintained
11769F: drivers/media/tuners/tuner-xc2028.*11779F: drivers/media/tuners/tuner-xc2028.*
@@ -11932,7 +11942,7 @@ ZR36067 VIDEO FOR LINUX DRIVER · 162 unmodified lines
11932L: mjpeg-users@lists.sourceforge.net11942L: mjpeg-users@lists.sourceforge.net
11933L: linux-media@vger.kernel.org11943L: linux-media@vger.kernel.org
11934W: http://mjpeg.sourceforge.net/driver-zoran/11944W: http://mjpeg.sourceforge.net/driver-zoran/
11935T: hg http://linuxtv.org/hg/v4l-dvb11945T: hg https://linuxtv.org/hg/v4l-dvb
11936S: Odd Fixes11946S: Odd Fixes
11937F: drivers/media/pci/zoran/11947F: drivers/media/pci/zoran/
11938 11948
arch/arm/boot/dts/stihxxx-b2120.dtsi+44−2
@@ -6,6 +6,9 @@ · 5 unmodified lines
6 * it under the terms of the GNU General Public License version 2 as6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.7 * published by the Free Software Foundation.
8 */8 */
9#include <dt-bindings/clock/stih407-clks.h>
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/media/c8sectpfe.h>
9/ {12/ {
10 soc {13 soc {
11 sbc_serial0: serial@9530000 {14 sbc_serial0: serial@9530000 {
@@ -35,12 +38,18 @@ · 23 unmodified lines
35 status = "okay";38 status = "okay";
36 };39 };
37 40
38 i2c@9842000 {41 ssc2: i2c@9842000 {
39 status = "okay";42 status = "okay";
43 clock-frequency = <100000>;
44 st,i2c-min-scl-pulse-width-us = <0>;
45 st,i2c-min-sda-pulse-width-us = <5>;
40 };46 };
41 47
42 i2c@9843000 {48 ssc3: i2c@9843000 {
43 status = "okay";49 status = "okay";
50 clock-frequency = <100000>;
51 st,i2c-min-scl-pulse-width-us = <0>;
52 st,i2c-min-sda-pulse-width-us = <5>;
44 };53 };
45 54
46 i2c@9844000 {55 i2c@9844000 {
@@ -93,5 +102,38 @@ · 46 unmodified lines
93 phy-mode = "rgmii";102 phy-mode = "rgmii";
94 fixed-link = <0 1 1000 0 0>;103 fixed-link = <0 1 1000 0 0>;
95 };104 };
105
106 demux@08a20000 {
107 compatible = "st,stih407-c8sectpfe";
108 status = "okay";
109 reg = <0x08a20000 0x10000>,
110 <0x08a00000 0x4000>;
111 reg-names = "c8sectpfe", "c8sectpfe-ram";
112 interrupts = <GIC_SPI 34 IRQ_TYPE_NONE>,
113 <GIC_SPI 35 IRQ_TYPE_NONE>;
114 interrupt-names = "c8sectpfe-error-irq",
115 "c8sectpfe-idle-irq";
116 pinctrl-0 = <&pinctrl_tsin0_serial>;
117 pinctrl-1 = <&pinctrl_tsin0_parallel>;
118 pinctrl-2 = <&pinctrl_tsin3_serial>;
119 pinctrl-3 = <&pinctrl_tsin4_serial_alt3>;
120 pinctrl-4 = <&pinctrl_tsin5_serial_alt1>;
121 pinctrl-names = "tsin0-serial",
122 "tsin0-parallel",
123 "tsin3-serial",
124 "tsin4-serial",
125 "tsin5-serial";
126 clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>;
127 clock-names = "c8sectpfe";
128
129 /* tsin0 is TSA on NIMA */
130 tsin0: port@0 {
131 tsin-num = <0>;
132 serial-not-parallel;
133 i2c-bus = <&ssc2>;
134 reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>;
135 dvb-card = <STV0367_TDA18212_NIMA_1>;
136 };
137 };
96 };138 };
97};139};
arch/arm/mach-davinci/board-da850-evm.c+2−2
@@ -49,8 +49,8 @@ · 48 unmodified lines
49#include <asm/mach/arch.h>49#include <asm/mach/arch.h>
50#include <asm/system_info.h>50#include <asm/system_info.h>
51 51
52#include <media/tvp514x.h>52#include <media/i2c/tvp514x.h>
53#include <media/adv7343.h>53#include <media/i2c/adv7343.h>
54 54
55#define DA850_EVM_PHY_ID "davinci_mdio-0:00"55#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
56#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)56#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
arch/arm/mach-davinci/board-dm355-evm.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19#include <linux/gpio.h>19#include <linux/gpio.h>
20#include <linux/clk.h>20#include <linux/clk.h>
21#include <linux/videodev2.h>21#include <linux/videodev2.h>
22#include <media/tvp514x.h>22#include <media/i2c/tvp514x.h>
23#include <linux/spi/spi.h>23#include <linux/spi/spi.h>
24#include <linux/spi/eeprom.h>24#include <linux/spi/eeprom.h>
25#include <linux/platform_data/gpio-davinci.h>25#include <linux/platform_data/gpio-davinci.h>
arch/arm/mach-davinci/board-dm365-evm.c+2−2
@@ -40,8 +40,8 @@ · 39 unmodified lines
40#include <linux/platform_data/mtd-davinci.h>40#include <linux/platform_data/mtd-davinci.h>
41#include <linux/platform_data/keyscan-davinci.h>41#include <linux/platform_data/keyscan-davinci.h>
42 42
43#include <media/ths7303.h>43#include <media/i2c/ths7303.h>
44#include <media/tvp514x.h>44#include <media/i2c/tvp514x.h>
45 45
46#include "davinci.h"46#include "davinci.h"
47 47
arch/arm/mach-davinci/board-dm644x-evm.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include <linux/v4l2-dv-timings.h>26#include <linux/v4l2-dv-timings.h>
27#include <linux/export.h>27#include <linux/export.h>
28 28
29#include <media/tvp514x.h>29#include <media/i2c/tvp514x.h>
30 30
31#include <asm/mach-types.h>31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>32#include <asm/mach/arch.h>
arch/arm/mach-davinci/board-dm646x-evm.c+2−2
@@ -25,8 +25,8 @@ · 24 unmodified lines
25#include <linux/platform_data/at24.h>25#include <linux/platform_data/at24.h>
26#include <linux/i2c/pcf857x.h>26#include <linux/i2c/pcf857x.h>
27 27
28#include <media/tvp514x.h>28#include <media/i2c/tvp514x.h>
29#include <media/adv7343.h>29#include <media/i2c/adv7343.h>
30 30
31#include <linux/mtd/mtd.h>31#include <linux/mtd/mtd.h>
32#include <linux/mtd/nand.h>32#include <linux/mtd/nand.h>
arch/arm/mach-imx/devices/devices-common.h+2−2
@@ -177,7 +177,7 @@ struct platform_device *__init imx_add_imx_uart_1irq( · 176 unmodified lines
177 const struct imxuart_platform_data *pdata);177 const struct imxuart_platform_data *pdata);
178 178
179#include <linux/platform_data/video-mx3fb.h>179#include <linux/platform_data/video-mx3fb.h>
180#include <linux/platform_data/camera-mx3.h>180#include <linux/platform_data/media/camera-mx3.h>
181struct imx_ipu_core_data {181struct imx_ipu_core_data {
182 resource_size_t iobase;182 resource_size_t iobase;
183 resource_size_t synirq;183 resource_size_t synirq;
@@ -192,7 +192,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb( · 8 unmodified lines
192 const struct imx_ipu_core_data *data,192 const struct imx_ipu_core_data *data,
193 struct mx3fb_platform_data *pdata);193 struct mx3fb_platform_data *pdata);
194 194
195#include <linux/platform_data/camera-mx2.h>195#include <linux/platform_data/media/camera-mx2.h>
196struct imx_mx2_camera_data {196struct imx_mx2_camera_data {
197 const char *devid;197 const char *devid;
198 resource_size_t iobasecsi;198 resource_size_t iobasecsi;
arch/arm/mach-omap1/include/mach/camera.h+1−1
@@ -1,7 +1,7 @@
1#ifndef __ASM_ARCH_CAMERA_H_1#ifndef __ASM_ARCH_CAMERA_H_
2#define __ASM_ARCH_CAMERA_H_2#define __ASM_ARCH_CAMERA_H_
3 3
4#include <media/omap1_camera.h>4#include <linux/platform_data/media/omap1_camera.h>
5 5
6void omap1_camera_init(void *);6void omap1_camera_init(void *);
7 7
arch/arm/mach-omap2/board-rx51-peripherals.c+2−2
@@ -39,7 +39,7 @@ · 38 unmodified lines
39 39
40#include <sound/tlv320aic3x.h>40#include <sound/tlv320aic3x.h>
41#include <sound/tpa6130a2-plat.h>41#include <sound/tpa6130a2-plat.h>
42#include <media/si4713.h>42#include <linux/platform_data/media/si4713.h>
43#include <linux/platform_data/leds-lp55xx.h>43#include <linux/platform_data/leds-lp55xx.h>
44 44
45#include <linux/platform_data/tsl2563.h>45#include <linux/platform_data/tsl2563.h>
@@ -48,7 +48,7 @@ · 2 unmodified lines
48#include <video/omap-panel-data.h>48#include <video/omap-panel-data.h>
49 49
50#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)50#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
51#include <media/ir-rx51.h>51#include <linux/platform_data/media/ir-rx51.h>
52#endif52#endif
53 53
54#include "mux.h"54#include "mux.h"
arch/arm/mach-pxa/devices.c+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
14#include <mach/irqs.h>14#include <mach/irqs.h>
15#include <linux/platform_data/usb-ohci-pxa27x.h>15#include <linux/platform_data/usb-ohci-pxa27x.h>
16#include <linux/platform_data/keypad-pxa27x.h>16#include <linux/platform_data/keypad-pxa27x.h>
17#include <linux/platform_data/camera-pxa.h>17#include <linux/platform_data/media/camera-pxa.h>
18#include <mach/audio.h>18#include <mach/audio.h>
19#include <mach/hardware.h>19#include <mach/hardware.h>
20#include <linux/platform_data/mmp_dma.h>20#include <linux/platform_data/mmp_dma.h>
arch/arm/mach-pxa/em-x270.c+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
46#include <linux/platform_data/usb-ohci-pxa27x.h>46#include <linux/platform_data/usb-ohci-pxa27x.h>
47#include <linux/platform_data/mmc-pxamci.h>47#include <linux/platform_data/mmc-pxamci.h>
48#include <linux/platform_data/keypad-pxa27x.h>48#include <linux/platform_data/keypad-pxa27x.h>
49#include <linux/platform_data/camera-pxa.h>49#include <linux/platform_data/media/camera-pxa.h>
50 50
51#include "generic.h"51#include "generic.h"
52#include "devices.h"52#include "devices.h"
arch/arm/mach-pxa/ezx.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
34#include <linux/platform_data/usb-ohci-pxa27x.h>34#include <linux/platform_data/usb-ohci-pxa27x.h>
35#include <mach/hardware.h>35#include <mach/hardware.h>
36#include <linux/platform_data/keypad-pxa27x.h>36#include <linux/platform_data/keypad-pxa27x.h>
37#include <linux/platform_data/camera-pxa.h>37#include <linux/platform_data/media/camera-pxa.h>
38 38
39#include "devices.h"39#include "devices.h"
40#include "generic.h"40#include "generic.h"
arch/arm/mach-pxa/mioa701.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
54#include <linux/platform_data/mmc-pxamci.h>54#include <linux/platform_data/mmc-pxamci.h>
55#include <mach/udc.h>55#include <mach/udc.h>
56#include <mach/pxa27x-udc.h>56#include <mach/pxa27x-udc.h>
57#include <linux/platform_data/camera-pxa.h>57#include <linux/platform_data/media/camera-pxa.h>
58#include <mach/audio.h>58#include <mach/audio.h>
59#include <mach/smemc.h>59#include <mach/smemc.h>
60#include <media/soc_camera.h>60#include <media/soc_camera.h>
arch/arm/mach-pxa/palmtreo.c+1−1
@@ -43,7 +43,7 @@ · 42 unmodified lines
43#include <linux/platform_data/usb-ohci-pxa27x.h>43#include <linux/platform_data/usb-ohci-pxa27x.h>
44#include <mach/pxa2xx-regs.h>44#include <mach/pxa2xx-regs.h>
45#include <linux/platform_data/asoc-palm27x.h>45#include <linux/platform_data/asoc-palm27x.h>
46#include <linux/platform_data/camera-pxa.h>46#include <linux/platform_data/media/camera-pxa.h>
47#include <mach/palm27x.h>47#include <mach/palm27x.h>
48 48
49#include <sound/pxa2xx-lib.h>49#include <sound/pxa2xx-lib.h>
arch/arm/mach-pxa/palmz72.c+1−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
49#include <mach/palm27x.h>49#include <mach/palm27x.h>
50 50
51#include <mach/pm.h>51#include <mach/pm.h>
52#include <linux/platform_data/camera-pxa.h>52#include <linux/platform_data/media/camera-pxa.h>
53 53
54#include <media/soc_camera.h>54#include <media/soc_camera.h>
55 55
arch/arm/mach-pxa/pcm990-baseboard.c+2−2
@@ -27,10 +27,10 @@ · 26 unmodified lines
27#include <linux/pwm.h>27#include <linux/pwm.h>
28#include <linux/pwm_backlight.h>28#include <linux/pwm_backlight.h>
29 29
30#include <media/mt9v022.h>30#include <media/i2c/mt9v022.h>
31#include <media/soc_camera.h>31#include <media/soc_camera.h>
32 32
33#include <linux/platform_data/camera-pxa.h>33#include <linux/platform_data/media/camera-pxa.h>
34#include <asm/mach/map.h>34#include <asm/mach/map.h>
35#include <mach/pxa27x.h>35#include <mach/pxa27x.h>
36#include <mach/audio.h>36#include <mach/audio.h>
arch/arm/plat-samsung/devs.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
36#include <linux/platform_data/s3c-hsotg.h>36#include <linux/platform_data/s3c-hsotg.h>
37#include <linux/platform_data/dma-s3c24xx.h>37#include <linux/platform_data/dma-s3c24xx.h>
38 38
39#include <media/s5p_hdmi.h>39#include <linux/platform_data/media/s5p_hdmi.h>
40 40
41#include <asm/irq.h>41#include <asm/irq.h>
42#include <asm/mach/arch.h>42#include <asm/mach/arch.h>
arch/blackfin/mach-bf561/boards/ezkit.c+1−1
@@ -443,7 +443,7 @@ static const struct ppi_info ppi_info = { · 442 unmodified lines
443};443};
444 444
445#if IS_ENABLED(CONFIG_VIDEO_ADV7183)445#if IS_ENABLED(CONFIG_VIDEO_ADV7183)
446#include <media/adv7183.h>446#include <media/i2c/adv7183.h>
447static struct v4l2_input adv7183_inputs[] = {447static struct v4l2_input adv7183_inputs[] = {
448 {448 {
449 .index = 0,449 .index = 0,
arch/blackfin/mach-bf609/boards/ezkit.c+3−3
@@ -933,7 +933,7 @@ static struct bfin_capture_config bfin_capture_data = { · 932 unmodified lines
933#endif933#endif
934 934
935#if IS_ENABLED(CONFIG_VIDEO_ADV7842)935#if IS_ENABLED(CONFIG_VIDEO_ADV7842)
936#include <media/adv7842.h>936#include <media/i2c/adv7842.h>
937 937
938static struct v4l2_input adv7842_inputs[] = {938static struct v4l2_input adv7842_inputs[] = {
939 {939 {
@@ -1084,7 +1084,7 @@ static const struct ppi_info ppi_info = { · 144 unmodified lines
1084};1084};
1085 1085
1086#if IS_ENABLED(CONFIG_VIDEO_ADV7511)1086#if IS_ENABLED(CONFIG_VIDEO_ADV7511)
1087#include <media/adv7511.h>1087#include <media/i2c/adv7511.h>
1088 1088
1089static struct v4l2_output adv7511_outputs[] = {1089static struct v4l2_output adv7511_outputs[] = {
1090 {1090 {
@@ -1125,7 +1125,7 @@ static struct bfin_display_config bfin_display_data = { · 34 unmodified lines
1125#endif1125#endif
1126 1126
1127#if IS_ENABLED(CONFIG_VIDEO_ADV7343)1127#if IS_ENABLED(CONFIG_VIDEO_ADV7343)
1128#include <media/adv7343.h>1128#include <media/i2c/adv7343.h>
1129 1129
1130static struct v4l2_output adv7343_outputs[] = {1130static struct v4l2_output adv7343_outputs[] = {
1131 {1131 {
arch/sh/boards/mach-ap325rxa/setup.c+3−3
@@ -27,10 +27,10 @@ · 26 unmodified lines
27#include <linux/gpio.h>27#include <linux/gpio.h>
28#include <linux/videodev2.h>28#include <linux/videodev2.h>
29#include <linux/sh_intc.h>29#include <linux/sh_intc.h>
30#include <media/ov772x.h>30#include <media/i2c/ov772x.h>
31#include <media/soc_camera.h>31#include <media/soc_camera.h>
32#include <media/soc_camera_platform.h>32#include <linux/platform_data/media/soc_camera_platform.h>
33#include <media/sh_mobile_ceu.h>33#include <media/drv-intf/sh_mobile_ceu.h>
34#include <video/sh_mobile_lcdc.h>34#include <video/sh_mobile_lcdc.h>
35#include <asm/io.h>35#include <asm/io.h>
36#include <asm/clock.h>36#include <asm/clock.h>
arch/sh/boards/mach-ecovec24/setup.c+5−5
@@ -38,10 +38,10 @@ · 37 unmodified lines
38#include <video/sh_mobile_lcdc.h>38#include <video/sh_mobile_lcdc.h>
39#include <sound/sh_fsi.h>39#include <sound/sh_fsi.h>
40#include <sound/simple_card.h>40#include <sound/simple_card.h>
41#include <media/sh_mobile_ceu.h>41#include <media/drv-intf/sh_mobile_ceu.h>
42#include <media/soc_camera.h>42#include <media/soc_camera.h>
43#include <media/tw9910.h>43#include <media/i2c/tw9910.h>
44#include <media/mt9t112.h>44#include <media/i2c/mt9t112.h>
45#include <asm/heartbeat.h>45#include <asm/heartbeat.h>
46#include <asm/clock.h>46#include <asm/clock.h>
47#include <asm/suspend.h>47#include <asm/suspend.h>
@@ -900,8 +900,8 @@ static struct platform_device irda_device = { · 852 unmodified lines
900 .resource = irda_resources,900 .resource = irda_resources,
901};901};
902 902
903#include <media/ak881x.h>903#include <media/i2c/ak881x.h>
904#include <media/sh_vou.h>904#include <media/drv-intf/sh_vou.h>
905 905
906static struct ak881x_pdata ak881x_pdata = {906static struct ak881x_pdata ak881x_pdata = {
907 .flags = AK881X_IF_MODE_SLAVE,907 .flags = AK881X_IF_MODE_SLAVE,
arch/sh/boards/mach-kfr2r09/setup.c+2−2
@@ -27,9 +27,9 @@ · 26 unmodified lines
27#include <linux/usb/r8a66597.h>27#include <linux/usb/r8a66597.h>
28#include <linux/videodev2.h>28#include <linux/videodev2.h>
29#include <linux/sh_intc.h>29#include <linux/sh_intc.h>
30#include <media/rj54n1cb0c.h>30#include <media/i2c/rj54n1cb0c.h>
31#include <media/soc_camera.h>31#include <media/soc_camera.h>
32#include <media/sh_mobile_ceu.h>32#include <media/drv-intf/sh_mobile_ceu.h>
33#include <video/sh_mobile_lcdc.h>33#include <video/sh_mobile_lcdc.h>
34#include <asm/suspend.h>34#include <asm/suspend.h>
35#include <asm/clock.h>35#include <asm/clock.h>
arch/sh/boards/mach-migor/setup.c+3−3
@@ -27,10 +27,10 @@ · 26 unmodified lines
27#include <linux/videodev2.h>27#include <linux/videodev2.h>
28#include <linux/sh_intc.h>28#include <linux/sh_intc.h>
29#include <video/sh_mobile_lcdc.h>29#include <video/sh_mobile_lcdc.h>
30#include <media/sh_mobile_ceu.h>30#include <media/drv-intf/sh_mobile_ceu.h>
31#include <media/ov772x.h>31#include <media/i2c/ov772x.h>
32#include <media/soc_camera.h>32#include <media/soc_camera.h>
33#include <media/tw9910.h>33#include <media/i2c/tw9910.h>
34#include <asm/clock.h>34#include <asm/clock.h>
35#include <asm/machvec.h>35#include <asm/machvec.h>
36#include <asm/io.h>36#include <asm/io.h>
arch/sh/boards/mach-se/7724/setup.c+3−3
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <linux/sh_intc.h>30#include <linux/sh_intc.h>
31#include <linux/videodev2.h>31#include <linux/videodev2.h>
32#include <video/sh_mobile_lcdc.h>32#include <video/sh_mobile_lcdc.h>
33#include <media/sh_mobile_ceu.h>33#include <media/drv-intf/sh_mobile_ceu.h>
34#include <sound/sh_fsi.h>34#include <sound/sh_fsi.h>
35#include <sound/simple_card.h>35#include <sound/simple_card.h>
36#include <asm/io.h>36#include <asm/io.h>
@@ -534,8 +534,8 @@ static struct platform_device irda_device = { · 497 unmodified lines
534 .resource = irda_resources,534 .resource = irda_resources,
535};535};
536 536
537#include <media/ak881x.h>537#include <media/i2c/ak881x.h>
538#include <media/sh_vou.h>538#include <media/drv-intf/sh_vou.h>
539 539
540static struct ak881x_pdata ak881x_pdata = {540static struct ak881x_pdata ak881x_pdata = {
541 .flags = AK881X_IF_MODE_SLAVE,541 .flags = AK881X_IF_MODE_SLAVE,
drivers/gpu/ipu-v3/ipu-cpmem.c+1−1
@@ -161,7 +161,7 @@ static u32 ipu_ch_param_read_field(struct ipuv3_channel *ch, u32 wbs) · 160 unmodified lines
161 * The DRM pixel formats and IPU internal representation are ordered the other161 * The DRM pixel formats and IPU internal representation are ordered the other
162 * way around, with the first named component ordered at the most significant162 * way around, with the first named component ordered at the most significant
163 * bits. Further, V4L2 formats are not well defined:163 * bits. Further, V4L2 formats are not well defined:
164 * http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html164 * https://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html
165 * We choose the interpretation which matches GStreamer behavior.165 * We choose the interpretation which matches GStreamer behavior.
166 */166 */
167static int v4l2_pix_fmt_to_drm_fourcc(u32 pixelformat)167static int v4l2_pix_fmt_to_drm_fourcc(u32 pixelformat)
drivers/input/touchscreen/sur40.c+6−7
@@ -444,7 +444,7 @@ static void sur40_process_video(struct sur40_state *sur40) · 443 unmodified lines
444 goto err_poll;444 goto err_poll;
445 445
446 /* mark as finished */446 /* mark as finished */
447 v4l2_get_timestamp(&new_buf->vb.timestamp);447 new_buf->vb.vb2_buf.timestamp = ktime_get_ns();
448 new_buf->vb.sequence = sur40->sequence++;448 new_buf->vb.sequence = sur40->sequence++;
449 new_buf->vb.field = V4L2_FIELD_NONE;449 new_buf->vb.field = V4L2_FIELD_NONE;
450 vb2_buffer_done(&new_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);450 vb2_buffer_done(&new_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
@@ -644,22 +644,21 @@ static void sur40_disconnect(struct usb_interface *interface) · 193 unmodified lines
644 * minimum number: many DMA engines need a minimum of 2 buffers in the644 * minimum number: many DMA engines need a minimum of 2 buffers in the
645 * queue and you need to have another available for userspace processing.645 * queue and you need to have another available for userspace processing.
646 */646 */
647static int sur40_queue_setup(struct vb2_queue *q, const void *parg,647static int sur40_queue_setup(struct vb2_queue *q,
648 unsigned int *nbuffers, unsigned int *nplanes,648 unsigned int *nbuffers, unsigned int *nplanes,
649 unsigned int sizes[], void *alloc_ctxs[])649 unsigned int sizes[], void *alloc_ctxs[])
650{650{
651 const struct v4l2_format *fmt = parg;
652 struct sur40_state *sur40 = vb2_get_drv_priv(q);651 struct sur40_state *sur40 = vb2_get_drv_priv(q);
653 652
654 if (q->num_buffers + *nbuffers < 3)653 if (q->num_buffers + *nbuffers < 3)
655 *nbuffers = 3 - q->num_buffers;654 *nbuffers = 3 - q->num_buffers;
655 alloc_ctxs[0] = sur40->alloc_ctx;
656 656
657 if (fmt && fmt->fmt.pix.sizeimage < sur40_video_format.sizeimage)657 if (*nplanes)
658 return -EINVAL;658 return sizes[0] < sur40_video_format.sizeimage ? -EINVAL : 0;
659 659
660 *nplanes = 1;660 *nplanes = 1;
661 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : sur40_video_format.sizeimage;661 sizes[0] = sur40_video_format.sizeimage;
662 alloc_ctxs[0] = sur40->alloc_ctx;
663 662
664 return 0;663 return 0;
665}664}
drivers/media/Kconfig+2−2
@@ -9,7 +9,7 @@ menuconfig MEDIA_SUPPORT · 8 unmodified lines
9 If you want to use Webcams, Video grabber devices and/or TV devices9 If you want to use Webcams, Video grabber devices and/or TV devices
10 enable this option and other options below.10 enable this option and other options below.
11 Additional info and docs are available on the web at11 Additional info and docs are available on the web at
12 <http://linuxtv.org>12 <https://linuxtv.org>
13 13
14if MEDIA_SUPPORT14if MEDIA_SUPPORT
15 15
@@ -51,7 +51,7 @@ config MEDIA_RADIO_SUPPORT · 35 unmodified lines
51 Enable AM/FM radio support.51 Enable AM/FM radio support.
52 52
53 Additional info and docs are available on the web at53 Additional info and docs are available on the web at
54 <http://linuxtv.org>54 <https://linuxtv.org>
55 55
56 Say Y when you have a board with radio support.56 Say Y when you have a board with radio support.
57 57
drivers/media/common/cx2341x.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include <linux/videodev2.h>27#include <linux/videodev2.h>
28 28
29#include <media/tuner.h>29#include <media/tuner.h>
30#include <media/cx2341x.h>30#include <media/drv-intf/cx2341x.h>
31#include <media/v4l2-common.h>31#include <media/v4l2-common.h>
32 32
33MODULE_DESCRIPTION("cx23415/6/8 driver");33MODULE_DESCRIPTION("cx23415/6/8 driver");
drivers/media/common/saa7146/saa7146_core.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
20 20
21#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt21#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22 22
23#include <media/saa7146.h>23#include <media/drv-intf/saa7146.h>
24#include <linux/module.h>24#include <linux/module.h>
25 25
26static int saa7146_num;26static int saa7146_num;
drivers/media/common/saa7146/saa7146_fops.c+1−1
@@ -1,6 +1,6 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2 2
3#include <media/saa7146_vv.h>3#include <media/drv-intf/saa7146_vv.h>
4#include <linux/module.h>4#include <linux/module.h>
5 5
6/****************************************************************************/6/****************************************************************************/
drivers/media/common/saa7146/saa7146_hlp.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2 2
3#include <linux/kernel.h>3#include <linux/kernel.h>
4#include <linux/export.h>4#include <linux/export.h>
5#include <media/saa7146_vv.h>5#include <media/drv-intf/saa7146_vv.h>
6 6
7static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format)7static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format)
8{8{
drivers/media/common/saa7146/saa7146_i2c.c+1−1
@@ -1,6 +1,6 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2 2
3#include <media/saa7146_vv.h>3#include <media/drv-intf/saa7146_vv.h>
4 4
5static u32 saa7146_i2c_func(struct i2c_adapter *adapter)5static u32 saa7146_i2c_func(struct i2c_adapter *adapter)
6{6{
drivers/media/common/saa7146/saa7146_vbi.c+1−1
@@ -1,4 +1,4 @@
1#include <media/saa7146_vv.h>1#include <media/drv-intf/saa7146_vv.h>
2 2
3static int vbi_pixel_to_capture = 720 * 2;3static int vbi_pixel_to_capture = 720 * 2;
4 4
drivers/media/common/saa7146/saa7146_video.c+1−1
@@ -1,6 +1,6 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2 2
3#include <media/saa7146_vv.h>3#include <media/drv-intf/saa7146_vv.h>
4#include <media/v4l2-event.h>4#include <media/v4l2-event.h>
5#include <media/v4l2-ctrls.h>5#include <media/v4l2-ctrls.h>
6#include <linux/module.h>6#include <linux/module.h>
drivers/media/common/siano/smsir.h+0−2
@@ -30,8 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. · 29 unmodified lines
30#include <linux/input.h>30#include <linux/input.h>
31#include <media/rc-core.h>31#include <media/rc-core.h>
32 32
33#define IR_DEFAULT_TIMEOUT 100
34
35struct smscore_device_t;33struct smscore_device_t;
36 34
37struct ir_t {35struct ir_t {
drivers/media/dvb-core/demux.h+65−2
@@ -32,6 +32,49 @@ · 31 unmodified lines
32#include <linux/time.h>32#include <linux/time.h>
33#include <linux/dvb/dmx.h>33#include <linux/dvb/dmx.h>
34 34
35/**
36 * DOC: Digital TV Demux
37 *
38 * The Kernel Digital TV Demux kABI defines a driver-internal interface for
39 * registering low-level, hardware specific driver to a hardware independent
40 * demux layer. It is only of interest for Digital TV device driver writers.
41 * The header file for this kABI is named demux.h and located in
42 * drivers/media/dvb-core.
43 *
44 * The demux kABI should be implemented for each demux in the system. It is
45 * used to select the TS source of a demux and to manage the demux resources.
46 * When the demux client allocates a resource via the demux kABI, it receives
47 * a pointer to the kABI of that resource.
48 *
49 * Each demux receives its TS input from a DVB front-end or from memory, as
50 * set via this demux kABI. In a system with more than one front-end, the kABI
51 * can be used to select one of the DVB front-ends as a TS source for a demux,
52 * unless this is fixed in the HW platform.
53 *
54 * The demux kABI only controls front-ends regarding to their connections with
55 * demuxes; the kABI used to set the other front-end parameters, such as
56 * tuning, are devined via the Digital TV Frontend kABI.
57 *
58 * The functions that implement the abstract interface demux should be defined
59 * static or module private and registered to the Demux core for external
60 * access. It is not necessary to implement every function in the struct
61 * &dmx_demux. For example, a demux interface might support Section filtering,
62 * but not PES filtering. The kABI client is expected to check the value of any
63 * function pointer before calling the function: the value of NULL means
64 * that the function is not available.
65 *
66 * Whenever the functions of the demux API modify shared data, the
67 * possibilities of lost update and race condition problems should be
68 * addressed, e.g. by protecting parts of code with mutexes.
69 *
70 * Note that functions called from a bottom half context must not sleep.
71 * Even a simple memory allocation without using %GFP_ATOMIC can result in a
72 * kernel thread being put to sleep if swapping is needed. For example, the
73 * Linux Kernel calls the functions of a network device interface from a
74 * bottom half context. Thus, if a demux kABI function is called from network
75 * device code, the function must not sleep.
76 */
77
35/*78/*
36 * Common definitions79 * Common definitions
37 */80 */
@@ -187,8 +230,28 @@ struct dmx_section_feed { · 149 unmodified lines
187 int (*stop_filtering)(struct dmx_section_feed *feed);230 int (*stop_filtering)(struct dmx_section_feed *feed);
188};231};
189 232
190/*233/**
191 * Callback functions234 * DOC: Demux Callback
235 *
236 * This kernel-space API comprises the callback functions that deliver filtered
237 * data to the demux client. Unlike the other DVB kABIs, these functions are
238 * provided by the client and called from the demux code.
239 *
240 * The function pointers of this abstract interface are not packed into a
241 * structure as in the other demux APIs, because the callback functions are
242 * registered and used independent of each other. As an example, it is possible
243 * for the API client to provide several callback functions for receiving TS
244 * packets and no callbacks for PES packets or sections.
245 *
246 * The functions that implement the callback API need not be re-entrant: when
247 * a demux driver calls one of these functions, the driver is not allowed to
248 * call the function again before the original call returns. If a callback is
249 * triggered by a hardware interrupt, it is recommended to use the Linux
250 * bottom half mechanism or start a tasklet instead of making the callback
251 * function call directly from a hardware interrupt.
252 *
253 * This mechanism is implemented by dmx_ts_cb() and dmx_section_cb()
254 * callbacks.
192 */255 */
193 256
194/**257/**
drivers/media/dvb-core/dvb-usb-ids.h+1−0
@@ -389,4 +389,5 @@ · 388 unmodified lines
389#define USB_PID_PCTV_2002E_SE 0x025d389#define USB_PID_PCTV_2002E_SE 0x025d
390#define USB_PID_SVEON_STV27 0xd3af390#define USB_PID_SVEON_STV27 0xd3af
391#define USB_PID_TURBOX_DTT_2000 0xd3a4391#define USB_PID_TURBOX_DTT_2000 0xd3a4
392#define USB_PID_WINTV_SOLOHD 0x0264
392#endif393#endif
drivers/media/dvb-core/dvb_frontend.c+16−11
@@ -891,21 +891,21 @@ static void dvb_frontend_stop(struct dvb_frontend *fe) · 890 unmodified lines
891}891}
892 892
893/*893/*
894 * Sleep until gettimeofday() > waketime + add_usec894 * Sleep for the amount of time given by add_usec parameter
895 * This needs to be as precise as possible, but as the delay is895 *
896 * usually between 2ms and 32ms, it is done using a scheduled msleep896 * This needs to be as precise as possible, as it affects the detection of
897 * followed by usleep (normally a busy-wait loop) for the remainder897 * the dish tone command at the satellite subsystem. The precision is improved
898 * by using a scheduled msleep followed by udelay for the remainder.
898 */899 */
899void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec)900void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec)
900{901{
901 s32 delta, newdelta;902 s32 delta;
902 903
903 ktime_add_us(*waketime, add_usec);904 *waketime = ktime_add_us(*waketime, add_usec);
904 delta = ktime_us_delta(ktime_get_real(), *waketime);905 delta = ktime_us_delta(ktime_get_real(), *waketime);
905 if (delta > 2500) {906 if (delta > 2500) {
906 msleep((delta - 1500) / 1000);907 msleep((delta - 1500) / 1000);
907 newdelta = ktime_us_delta(ktime_get_real(), *waketime);908 delta = ktime_us_delta(ktime_get_real(), *waketime);
908 delta = (newdelta > delta) ? 0 : newdelta;
909 }909 }
910 if (delta > 0)910 if (delta > 0)
911 udelay(delta);911 udelay(delta);
@@ -2313,9 +2313,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file, · 1401 unmodified lines
2313 dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",2313 dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",
2314 __func__, c->delivery_system, fe->ops.info.type);2314 __func__, c->delivery_system, fe->ops.info.type);
2315 2315
2316 /* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't2316 /* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */
2317 * do it, it is done for it. */2317 if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT))
2318 info->caps |= FE_CAN_INVERSION_AUTO;2318 info->caps |= FE_CAN_INVERSION_AUTO;
2319 err = 0;2319 err = 0;
2320 break;2320 break;
2321 }2321 }
@@ -2710,6 +2710,11 @@ int dvb_frontend_resume(struct dvb_frontend *fe) · 388 unmodified lines
2710 else if (fe->ops.tuner_ops.init)2710 else if (fe->ops.tuner_ops.init)
2711 ret = fe->ops.tuner_ops.init(fe);2711 ret = fe->ops.tuner_ops.init(fe);
2712 2712
2713 if (fe->ops.set_tone && fepriv->tone != -1)
2714 fe->ops.set_tone(fe, fepriv->tone);
2715 if (fe->ops.set_voltage && fepriv->voltage != -1)
2716 fe->ops.set_voltage(fe, fepriv->voltage);
2717
2713 fe->exit = DVB_FE_NO_EXIT;2718 fe->exit = DVB_FE_NO_EXIT;
2714 fepriv->state = FESTATE_RETUNE;2719 fepriv->state = FESTATE_RETUNE;
2715 dvb_frontend_wakeup(fe);2720 dvb_frontend_wakeup(fe);
drivers/media/dvb-core/dvb_frontend.h+168−53
@@ -42,6 +42,29 @@ · 41 unmodified lines
42 42
43#include "dvbdev.h"43#include "dvbdev.h"
44 44
45/**
46 * DOC: Digital TV Frontend
47 *
48 * The Digital TV Frontend kABI defines a driver-internal interface for
49 * registering low-level, hardware specific driver to a hardware independent
50 * frontend layer. It is only of interest for Digital TV device driver writers.
51 * The header file for this API is named dvb_frontend.h and located in
52 * drivers/media/dvb-core.
53 *
54 * Before using the Digital TV frontend core, the bridge driver should attach
55 * the frontend demod, tuner and SEC devices and call dvb_register_frontend(),
56 * in order to register the new frontend at the subsystem. At device
57 * detach/removal, the bridge driver should call dvb_unregister_frontend() to
58 * remove the frontend from the core and then dvb_frontend_detach() to free the
59 * memory allocated by the frontend drivers.
60 *
61 * The drivers should also call dvb_frontend_suspend() as part of their
62 * handler for the &device_driver.suspend(), and dvb_frontend_resume() as
63 * part of their handler for &device_driver.resume().
64 *
65 * A few other optional functions are provided to handle some special cases.
66 */
67
45/*68/*
46 * Maximum number of Delivery systems per frontend. It69 * Maximum number of Delivery systems per frontend. It
47 * should be smaller or equal to 3270 * should be smaller or equal to 32
@@ -112,16 +135,6 @@ struct analog_parameters { · 64 unmodified lines
112 u64 std;135 u64 std;
113};136};
114 137
115enum tuner_param {
116 DVBFE_TUNER_FREQUENCY = (1 << 0),
117 DVBFE_TUNER_TUNERSTEP = (1 << 1),
118 DVBFE_TUNER_IFFREQ = (1 << 2),
119 DVBFE_TUNER_BANDWIDTH = (1 << 3),
120 DVBFE_TUNER_REFCLOCK = (1 << 4),
121 DVBFE_TUNER_IQSENSE = (1 << 5),
122 DVBFE_TUNER_DUMMY = (1 << 31)
123};
124
125/**138/**
126 * enum dvbfe_algo - defines the algorithm used to tune into a channel139 * enum dvbfe_algo - defines the algorithm used to tune into a channel
127 *140 *
@@ -152,15 +165,6 @@ enum dvbfe_algo { · 24 unmodified lines
152 DVBFE_ALGO_RECOVERY = (1 << 31)165 DVBFE_ALGO_RECOVERY = (1 << 31)
153};166};
154 167
155struct tuner_state {
156 u32 frequency;
157 u32 tunerstep;
158 u32 ifreq;
159 u32 bandwidth;
160 u32 iqsense;
161 u32 refclock;
162};
163
164/**168/**
165 * enum dvbfe_search - search callback possible return status169 * enum dvbfe_search - search callback possible return status
166 *170 *
@@ -209,12 +213,12 @@ enum dvbfe_search { · 42 unmodified lines
209 * are stored at @dvb_frontend.dtv_property_cache;. The213 * are stored at @dvb_frontend.dtv_property_cache;. The
210 * tuner demod can change the parameters to reflect the214 * tuner demod can change the parameters to reflect the
211 * changes needed for the channel to be tuned, and215 * changes needed for the channel to be tuned, and
212 * update statistics.216 * update statistics. This is the recommended way to set
217 * the tuner parameters and should be used on newer
218 * drivers.
213 * @set_analog_params: callback function used to tune into an analog TV219 * @set_analog_params: callback function used to tune into an analog TV
214 * channel on hybrid tuners. It passes @analog_parameters;220 * channel on hybrid tuners. It passes @analog_parameters;
215 * to the driver.221 * to the driver.
216 * @calc_regs: callback function used to pass register data settings
217 * for simple tuners.
218 * @set_config: callback function used to send some tuner-specific222 * @set_config: callback function used to send some tuner-specific
219 * parameters.223 * parameters.
220 * @get_frequency: get the actual tuned frequency224 * @get_frequency: get the actual tuned frequency
@@ -227,16 +231,10 @@ enum dvbfe_search { · 6 unmodified lines
227 * via DVBv5 API (@dvb_frontend.dtv_property_cache;).231 * via DVBv5 API (@dvb_frontend.dtv_property_cache;).
228 * @get_afc: Used only by analog TV core. Reports the frequency232 * @get_afc: Used only by analog TV core. Reports the frequency
229 * drift due to AFC.233 * drift due to AFC.
230 * @set_frequency: Set a new frequency. Please notice that using234 * @calc_regs: callback function used to pass register data settings
231 * set_params is preferred.235 * for simple tuners. Shouldn't be used on newer drivers.
232 * @set_bandwidth: Set a new frequency. Please notice that using236 * @set_frequency: Set a new frequency. Shouldn't be used on newer drivers.
233 * set_params is preferred.237 * @set_bandwidth: Set a new frequency. Shouldn't be used on newer drivers.
234 * @set_state: callback function used on some legacy drivers that
235 * don't implement set_params in order to set properties.
236 * Shouldn't be used on new drivers.
237 * @get_state: callback function used to get properties by some
238 * legacy drivers that don't implement set_params.
239 * Shouldn't be used on new drivers.
240 *238 *
241 * NOTE: frequencies used on get_frequency and set_frequency are in Hz for239 * NOTE: frequencies used on get_frequency and set_frequency are in Hz for
242 * terrestrial/cable or kHz for satellite.240 * terrestrial/cable or kHz for satellite.
@@ -252,14 +250,10 @@ struct dvb_tuner_ops { · 9 unmodified lines
252 int (*suspend)(struct dvb_frontend *fe);250 int (*suspend)(struct dvb_frontend *fe);
253 int (*resume)(struct dvb_frontend *fe);251 int (*resume)(struct dvb_frontend *fe);
254 252
255 /** This is for simple PLLs - set all parameters in one go. */253 /* This is the recomended way to set the tuner */
256 int (*set_params)(struct dvb_frontend *fe);254 int (*set_params)(struct dvb_frontend *fe);
257 int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);255 int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
258 256
259 /** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */
260 int (*calc_regs)(struct dvb_frontend *fe, u8 *buf, int buf_len);
261
262 /** This is to allow setting tuner-specific configs */
263 int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);257 int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
264 258
265 int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);259 int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
@@ -272,17 +266,23 @@ struct dvb_tuner_ops { · 6 unmodified lines
272 int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);266 int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
273 int (*get_afc)(struct dvb_frontend *fe, s32 *afc);267 int (*get_afc)(struct dvb_frontend *fe, s32 *afc);
274 268
275 /** These are provided separately from set_params in order to facilitate silicon269 /*
276 * tuners which require sophisticated tuning loops, controlling each parameter separately. */270 * This is support for demods like the mt352 - fills out the supplied
277 int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);271 * buffer with what to write.
278 int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);272 *
273 * Don't use on newer drivers.
274 */
275 int (*calc_regs)(struct dvb_frontend *fe, u8 *buf, int buf_len);
279 276
280 /*277 /*
281 * These are provided separately from set_params in order to facilitate silicon278 * These are provided separately from set_params in order to
282 * tuners which require sophisticated tuning loops, controlling each parameter separately.279 * facilitate silicon tuners which require sophisticated tuning loops,
280 * controlling each parameter separately.
281 *
282 * Don't use on newer drivers.
283 */283 */
284 int (*set_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);284 int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
285 int (*get_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);285 int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
286};286};
287 287
288/**288/**
@@ -404,6 +404,11 @@ struct dtv_frontend_properties; · 115 unmodified lines
404 * FE_ENABLE_HIGH_LNB_VOLTAGE ioctl (only Satellite).404 * FE_ENABLE_HIGH_LNB_VOLTAGE ioctl (only Satellite).
405 * @dishnetwork_send_legacy_command: callback function to implement the405 * @dishnetwork_send_legacy_command: callback function to implement the
406 * FE_DISHNETWORK_SEND_LEGACY_CMD ioctl (only Satellite).406 * FE_DISHNETWORK_SEND_LEGACY_CMD ioctl (only Satellite).
407 * Drivers should not use this, except when the DVB
408 * core emulation fails to provide proper support (e.g.
409 * if set_voltage() takes more than 8ms to work), and
410 * when backward compatibility with this legacy API is
411 * required.
407 * @i2c_gate_ctrl: controls the I2C gate. Newer drivers should use I2C412 * @i2c_gate_ctrl: controls the I2C gate. Newer drivers should use I2C
408 * mux support instead.413 * mux support instead.
409 * @ts_bus_ctrl: callback function used to take control of the TS bus.414 * @ts_bus_ctrl: callback function used to take control of the TS bus.
@@ -466,7 +471,8 @@ struct dvb_frontend_ops { · 56 unmodified lines
466 int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);471 int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);
467 int (*set_lna)(struct dvb_frontend *);472 int (*set_lna)(struct dvb_frontend *);
468 473
469 /* These callbacks are for devices that implement their own474 /*
475 * These callbacks are for devices that implement their own
470 * tuning algorithms, rather than a simple swzigzag476 * tuning algorithms, rather than a simple swzigzag
471 */477 */
472 enum dvbfe_search (*search)(struct dvb_frontend *fe);478 enum dvbfe_search (*search)(struct dvb_frontend *fe);
@@ -682,17 +688,126 @@ struct dvb_frontend { · 209 unmodified lines
682 unsigned int exit;688 unsigned int exit;
683};689};
684 690
685extern int dvb_register_frontend(struct dvb_adapter *dvb,691/**
692 * dvb_register_frontend() - Registers a DVB frontend at the adapter
693 *
694 * @dvb: pointer to the dvb adapter
695 * @fe: pointer to the frontend struct
696 *
697 * Allocate and initialize the private data needed by the frontend core to
698 * manage the frontend and calls dvb_register_device() to register a new
699 * frontend. It also cleans the property cache that stores the frontend
700 * parameters and selects the first available delivery system.
701 */
702int dvb_register_frontend(struct dvb_adapter *dvb,
686 struct dvb_frontend *fe);703 struct dvb_frontend *fe);
687 704
688extern int dvb_unregister_frontend(struct dvb_frontend *fe);705/**
706 * dvb_unregister_frontend() - Unregisters a DVB frontend
707 *
708 * @fe: pointer to the frontend struct
709 *
710 * Stops the frontend kthread, calls dvb_unregister_device() and frees the
711 * private frontend data allocated by dvb_register_frontend().
712 *
713 * NOTE: This function doesn't frees the memory allocated by the demod,
714 * by the SEC driver and by the tuner. In order to free it, an explicit call to
715 * dvb_frontend_detach() is needed, after calling this function.
716 */
717int dvb_unregister_frontend(struct dvb_frontend *fe);
689 718
690extern void dvb_frontend_detach(struct dvb_frontend *fe);719/**
720 * dvb_frontend_detach() - Detaches and frees frontend specific data
721 *
722 * @fe: pointer to the frontend struct
723 *
724 * This function should be called after dvb_unregister_frontend(). It
725 * calls the SEC, tuner and demod release functions:
726 * &dvb_frontend_ops.release_sec, &dvb_frontend_ops.tuner_ops.release,
727 * &dvb_frontend_ops.analog_ops.release and &dvb_frontend_ops.release.
728 *
729 * If the driver is compiled with CONFIG_MEDIA_ATTACH, it also decreases
730 * the module reference count, needed to allow userspace to remove the
731 * previously used DVB frontend modules.
732 */
733void dvb_frontend_detach(struct dvb_frontend *fe);
734
735/**
736 * dvb_frontend_suspend() - Suspends a Digital TV frontend
737 *
738 * @fe: pointer to the frontend struct
739 *
740 * This function prepares a Digital TV frontend to suspend.
741 *
742 * In order to prepare the tuner to suspend, if
743 * &dvb_frontend_ops.tuner_ops.suspend() is available, it calls it. Otherwise,
744 * it will call &dvb_frontend_ops.tuner_ops.sleep(), if available.
745 *
746 * It will also call &dvb_frontend_ops.sleep() to put the demod to suspend.
747 *
748 * The drivers should also call dvb_frontend_suspend() as part of their
749 * handler for the &device_driver.suspend().
750 */
751int dvb_frontend_suspend(struct dvb_frontend *fe);
752
753/**
754 * dvb_frontend_resume() - Resumes a Digital TV frontend
755 *
756 * @fe: pointer to the frontend struct
757 *
758 * This function resumes the usual operation of the tuner after resume.
759 *
760 * In order to resume the frontend, it calls the demod &dvb_frontend_ops.init().
761 *
762 * If &dvb_frontend_ops.tuner_ops.resume() is available, It, it calls it.
763 * Otherwise,t will call &dvb_frontend_ops.tuner_ops.init(), if available.
764 *
765 * Once tuner and demods are resumed, it will enforce that the SEC voltage and
766 * tone are restored to their previous values and wake up the frontend's
767 * kthread in order to retune the frontend.
768 *
769 * The drivers should also call dvb_frontend_resume() as part of their
770 * handler for the &device_driver.resume().
771 */
772int dvb_frontend_resume(struct dvb_frontend *fe);
691 773
692extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);774/**
693extern int dvb_frontend_suspend(struct dvb_frontend *fe);775 * dvb_frontend_reinitialise() - forces a reinitialisation at the frontend
694extern int dvb_frontend_resume(struct dvb_frontend *fe);776 *
777 * @fe: pointer to the frontend struct
778 *
779 * Calls &dvb_frontend_ops.init() and &dvb_frontend_ops.tuner_ops.init(),
780 * and resets SEC tone and voltage (for Satellite systems).
781 *
782 * NOTE: Currently, this function is used only by one driver (budget-av).
783 * It seems to be due to address some special issue with that specific
784 * frontend.
785 */
786void dvb_frontend_reinitialise(struct dvb_frontend *fe);
695 787
696extern void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec);788/**
789 * dvb_frontend_sleep_until() - Sleep for the amount of time given by
790 * add_usec parameter
791 *
792 * @waketime: pointer to a struct ktime_t
793 * @add_usec: time to sleep, in microseconds
794 *
795 * This function is used to measure the time required for the
796 * %FE_DISHNETWORK_SEND_LEGACY_CMD ioctl to work. It needs to be as precise
797 * as possible, as it affects the detection of the dish tone command at the
798 * satellite subsystem.
799 *
800 * Its used internally by the DVB frontend core, in order to emulate
801 * %FE_DISHNETWORK_SEND_LEGACY_CMD using the &dvb_frontend_ops.set_voltage()
802 * callback.
803 *
804 * NOTE: it should not be used at the drivers, as the emulation for the
805 * legacy callback is provided by the Kernel. The only situation where this
806 * should be at the drivers is when there are some bugs at the hardware that
807 * would prevent the core emulation to work. On such cases, the driver would
808 * be writing a &dvb_frontend_ops.dishnetwork_send_legacy_command() and
809 * calling this function directly.
810 */
811void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec);
697 812
698#endif813#endif
drivers/media/dvb-frontends/Kconfig+1−1
@@ -264,7 +264,7 @@ config DVB_MB86A16 · 263 unmodified lines
264config DVB_TDA10071264config DVB_TDA10071
265 tristate "NXP TDA10071"265 tristate "NXP TDA10071"
266 depends on DVB_CORE && I2C266 depends on DVB_CORE && I2C
267 select REGMAP267 select REGMAP_I2C
268 default m if !MEDIA_SUBDRV_AUTOSELECT268 default m if !MEDIA_SUBDRV_AUTOSELECT
269 help269 help
270 Say Y when you want to support this frontend.270 Say Y when you want to support this frontend.
drivers/media/dvb-frontends/au8522_common.c+5−5
@@ -44,7 +44,7 @@ int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) · 43 unmodified lines
44 int ret;44 int ret;
45 u8 buf[] = { (reg >> 8) | 0x80, reg & 0xff, data };45 u8 buf[] = { (reg >> 8) | 0x80, reg & 0xff, data };
46 46
47 struct i2c_msg msg = { .addr = state->config->demod_address,47 struct i2c_msg msg = { .addr = state->config.demod_address,
48 .flags = 0, .buf = buf, .len = 3 };48 .flags = 0, .buf = buf, .len = 3 };
49 49
50 ret = i2c_transfer(state->i2c, &msg, 1);50 ret = i2c_transfer(state->i2c, &msg, 1);
@@ -64,9 +64,9 @@ u8 au8522_readreg(struct au8522_state *state, u16 reg) · 13 unmodified lines
64 u8 b1[] = { 0 };64 u8 b1[] = { 0 };
65 65
66 struct i2c_msg msg[] = {66 struct i2c_msg msg[] = {
67 { .addr = state->config->demod_address, .flags = 0,67 { .addr = state->config.demod_address, .flags = 0,
68 .buf = b0, .len = 2 },68 .buf = b0, .len = 2 },
69 { .addr = state->config->demod_address, .flags = I2C_M_RD,69 { .addr = state->config.demod_address, .flags = I2C_M_RD,
70 .buf = b1, .len = 1 } };70 .buf = b1, .len = 1 } };
71 71
72 ret = i2c_transfer(state->i2c, msg, 2);72 ret = i2c_transfer(state->i2c, msg, 2);
@@ -140,7 +140,7 @@ EXPORT_SYMBOL(au8522_release_state); · 67 unmodified lines
140 140
141static int au8522_led_gpio_enable(struct au8522_state *state, int onoff)141static int au8522_led_gpio_enable(struct au8522_state *state, int onoff)
142{142{
143 struct au8522_led_config *led_config = state->config->led_cfg;143 struct au8522_led_config *led_config = state->config.led_cfg;
144 u8 val;144 u8 val;
145 145
146 /* bail out if we can't control an LED */146 /* bail out if we can't control an LED */
@@ -170,7 +170,7 @@ static int au8522_led_gpio_enable(struct au8522_state *state, int onoff) · 23 unmodified lines
170 */170 */
171int au8522_led_ctrl(struct au8522_state *state, int led)171int au8522_led_ctrl(struct au8522_state *state, int led)
172{172{
173 struct au8522_led_config *led_config = state->config->led_cfg;173 struct au8522_led_config *led_config = state->config.led_cfg;
174 int i, ret = 0;174 int i, ret = 0;
175 175
176 /* bail out if we can't control an LED */176 /* bail out if we can't control an LED */
drivers/media/dvb-frontends/au8522_decoder.c+2−12
@@ -730,7 +730,6 @@ static int au8522_probe(struct i2c_client *client, · 729 unmodified lines
730 struct v4l2_ctrl_handler *hdl;730 struct v4l2_ctrl_handler *hdl;
731 struct v4l2_subdev *sd;731 struct v4l2_subdev *sd;
732 int instance;732 int instance;
733 struct au8522_config *demod_config;
734 733
735 /* Check if the adapter supports the needed features */734 /* Check if the adapter supports the needed features */
736 if (!i2c_check_functionality(client->adapter,735 if (!i2c_check_functionality(client->adapter,
@@ -754,15 +753,7 @@ static int au8522_probe(struct i2c_client *client, · 17 unmodified lines
754 break;753 break;
755 }754 }
756 755
757 demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL);756 state->config.demod_address = 0x8e >> 1;
758 if (demod_config == NULL) {
759 if (instance == 1)
760 kfree(state);
761 return -ENOMEM;
762 }
763 demod_config->demod_address = 0x8e >> 1;
764
765 state->config = demod_config;
766 state->i2c = client->adapter;757 state->i2c = client->adapter;
767 758
768 sd = &state->sd;759 sd = &state->sd;
@@ -784,8 +775,7 @@ static int au8522_probe(struct i2c_client *client, · 15 unmodified lines
784 int err = hdl->error;775 int err = hdl->error;
785 776
786 v4l2_ctrl_handler_free(hdl);777 v4l2_ctrl_handler_free(hdl);
787 kfree(demod_config);778 au8522_release_state(state);
788 kfree(state);
789 return err;779 return err;
790 }780 }
791 781
drivers/media/dvb-frontends/au8522_dig.c+8−8
@@ -566,7 +566,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, · 565 unmodified lines
566 au8522_writereg(state,566 au8522_writereg(state,
567 VSB_mod_tab[i].reg,567 VSB_mod_tab[i].reg,
568 VSB_mod_tab[i].data);568 VSB_mod_tab[i].data);
569 au8522_set_if(fe, state->config->vsb_if);569 au8522_set_if(fe, state->config.vsb_if);
570 break;570 break;
571 case QAM_64:571 case QAM_64:
572 dprintk("%s() QAM 64\n", __func__);572 dprintk("%s() QAM 64\n", __func__);
@@ -574,7 +574,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, · 1 unmodified line
574 au8522_writereg(state,574 au8522_writereg(state,
575 QAM64_mod_tab[i].reg,575 QAM64_mod_tab[i].reg,
576 QAM64_mod_tab[i].data);576 QAM64_mod_tab[i].data);
577 au8522_set_if(fe, state->config->qam_if);577 au8522_set_if(fe, state->config.qam_if);
578 break;578 break;
579 case QAM_256:579 case QAM_256:
580 if (zv_mode) {580 if (zv_mode) {
@@ -583,7 +583,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, · 2 unmodified lines
583 au8522_writereg(state,583 au8522_writereg(state,
584 QAM256_mod_tab_zv_mode[i].reg,584 QAM256_mod_tab_zv_mode[i].reg,
585 QAM256_mod_tab_zv_mode[i].data);585 QAM256_mod_tab_zv_mode[i].data);
586 au8522_set_if(fe, state->config->qam_if);586 au8522_set_if(fe, state->config.qam_if);
587 msleep(100);587 msleep(100);
588 au8522_writereg(state, 0x821a, 0x00);588 au8522_writereg(state, 0x821a, 0x00);
589 } else {589 } else {
@@ -592,7 +592,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, · 2 unmodified lines
592 au8522_writereg(state,592 au8522_writereg(state,
593 QAM256_mod_tab[i].reg,593 QAM256_mod_tab[i].reg,
594 QAM256_mod_tab[i].data);594 QAM256_mod_tab[i].data);
595 au8522_set_if(fe, state->config->qam_if);595 au8522_set_if(fe, state->config.qam_if);
596 }596 }
597 break;597 break;
598 default:598 default:
@@ -666,7 +666,7 @@ static int au8522_read_status(struct dvb_frontend *fe, enum fe_status *status) · 67 unmodified lines
666 *status |= FE_HAS_LOCK | FE_HAS_SYNC;666 *status |= FE_HAS_LOCK | FE_HAS_SYNC;
667 }667 }
668 668
669 switch (state->config->status_mode) {669 switch (state->config.status_mode) {
670 case AU8522_DEMODLOCKING:670 case AU8522_DEMODLOCKING:
671 dprintk("%s() DEMODLOCKING\n", __func__);671 dprintk("%s() DEMODLOCKING\n", __func__);
672 if (*status & FE_HAS_VITERBI)672 if (*status & FE_HAS_VITERBI)
@@ -704,7 +704,7 @@ static int au8522_read_status(struct dvb_frontend *fe, enum fe_status *status) · 31 unmodified lines
704 704
705static int au8522_led_status(struct au8522_state *state, const u16 *snr)705static int au8522_led_status(struct au8522_state *state, const u16 *snr)
706{706{
707 struct au8522_led_config *led_config = state->config->led_cfg;707 struct au8522_led_config *led_config = state->config.led_cfg;
708 int led;708 int led;
709 u16 strong;709 u16 strong;
710 710
@@ -758,7 +758,7 @@ static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr) · 47 unmodified lines
758 au8522_readreg(state, 0x4311),758 au8522_readreg(state, 0x4311),
759 snr);759 snr);
760 760
761 if (state->config->led_cfg)761 if (state->config.led_cfg)
762 au8522_led_status(state, snr);762 au8522_led_status(state, snr);
763 763
764 return ret;764 return ret;
@@ -866,7 +866,7 @@ struct dvb_frontend *au8522_attach(const struct au8522_config *config, · 101 unmodified lines
866 }866 }
867 867
868 /* setup the state */868 /* setup the state */
869 state->config = config;869 state->config = *config;
870 state->i2c = i2c;870 state->i2c = i2c;
871 state->operational_mode = AU8522_DIGITAL_MODE;871 state->operational_mode = AU8522_DIGITAL_MODE;
872 872
drivers/media/dvb-frontends/au8522_priv.h+1−1
@@ -50,7 +50,7 @@ struct au8522_state { · 49 unmodified lines
50 struct list_head hybrid_tuner_instance_list;50 struct list_head hybrid_tuner_instance_list;
51 51
52 /* configuration settings */52 /* configuration settings */
53 const struct au8522_config *config;53 struct au8522_config config;
54 54
55 struct dvb_frontend frontend;55 struct dvb_frontend frontend;
56 56
drivers/media/dvb-frontends/bsbe1-d01a.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html21 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
22 *22 *
23 *23 *
24 * the project's page is at http://www.linuxtv.org24 * the project's page is at https://linuxtv.org
25 */25 */
26 26
27#ifndef BSBE1_D01A_H27#ifndef BSBE1_D01A_H
drivers/media/dvb-frontends/bsbe1.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
20 *20 *
21 *21 *
22 * the project's page is at http://www.linuxtv.org22 * the project's page is at https://linuxtv.org
23 */23 */
24 24
25#ifndef BSBE1_H25#ifndef BSBE1_H
drivers/media/dvb-frontends/bsru6.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
20 *20 *
21 *21 *
22 * the project's page is at http://www.linuxtv.org22 * the project's page is at https://linuxtv.org
23 */23 */
24 24
25#ifndef BSRU6_H25#ifndef BSRU6_H
drivers/media/dvb-frontends/isl6405.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23 *23 *
24 *24 *
25 * the project's page is at http://www.linuxtv.org25 * the project's page is at https://linuxtv.org
26 */26 */
27#include <linux/delay.h>27#include <linux/delay.h>
28#include <linux/errno.h>28#include <linux/errno.h>
drivers/media/dvb-frontends/isl6405.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23 *23 *
24 *24 *
25 * the project's page is at http://www.linuxtv.org25 * the project's page is at https://linuxtv.org
26 */26 */
27 27
28#ifndef _ISL6405_H28#ifndef _ISL6405_H
drivers/media/dvb-frontends/isl6421.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23 *23 *
24 *24 *
25 * the project's page is at http://www.linuxtv.org25 * the project's page is at https://linuxtv.org
26 */26 */
27#include <linux/delay.h>27#include <linux/delay.h>
28#include <linux/errno.h>28#include <linux/errno.h>
drivers/media/dvb-frontends/isl6421.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23 *23 *
24 *24 *
25 * the project's page is at http://www.linuxtv.org25 * the project's page is at https://linuxtv.org
26 */26 */
27 27
28#ifndef _ISL6421_H28#ifndef _ISL6421_H
drivers/media/dvb-frontends/lnbp21.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23 *23 *
24 *24 *
25 * the project's page is at http://www.linuxtv.org25 * the project's page is at https://linuxtv.org
26 */26 */
27#include <linux/delay.h>27#include <linux/delay.h>
28#include <linux/errno.h>28#include <linux/errno.h>
drivers/media/dvb-frontends/lnbp21.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html21 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
22 *22 *
23 *23 *
24 * the project's page is at http://www.linuxtv.org24 * the project's page is at https://linuxtv.org
25 */25 */
26 26
27#ifndef _LNBP21_H27#ifndef _LNBP21_H
drivers/media/dvb-frontends/lnbp22.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23 *23 *
24 *24 *
25 * the project's page is at http://www.linuxtv.org25 * the project's page is at https://linuxtv.org
26 */26 */
27#include <linux/delay.h>27#include <linux/delay.h>
28#include <linux/errno.h>28#include <linux/errno.h>
drivers/media/dvb-frontends/lnbp22.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html22 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23 *23 *
24 *24 *
25 * the project's page is at http://www.linuxtv.org25 * the project's page is at https://linuxtv.org
26 */26 */
27 27
28#ifndef _LNBP22_H28#ifndef _LNBP22_H
drivers/media/dvb-frontends/rtl2832.c+6−15
@@ -976,7 +976,8 @@ static int rtl2832_regmap_read(void *context, const void *reg_buf, · 975 unmodified lines
976 976
977 ret = __i2c_transfer(client->adapter, msg, 2);977 ret = __i2c_transfer(client->adapter, msg, 2);
978 if (ret != 2) {978 if (ret != 2) {
979 dev_warn(&client->dev, "i2c reg read failed %d\n", ret);979 dev_warn(&client->dev, "i2c reg read failed %d reg %02x\n",
980 ret, *(u8 *)reg_buf);
980 if (ret >= 0)981 if (ret >= 0)
981 ret = -EREMOTEIO;982 ret = -EREMOTEIO;
982 return ret;983 return ret;
@@ -999,7 +1000,8 @@ static int rtl2832_regmap_write(void *context, const void *data, size_t count) · 16 unmodified lines
999 1000
1000 ret = __i2c_transfer(client->adapter, msg, 1);1001 ret = __i2c_transfer(client->adapter, msg, 1);
1001 if (ret != 1) {1002 if (ret != 1) {
1002 dev_warn(&client->dev, "i2c reg write failed %d\n", ret);1003 dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n",
1004 ret, *(u8 *)data);
1003 if (ret >= 0)1005 if (ret >= 0)
1004 ret = -EREMOTEIO;1006 ret = -EREMOTEIO;
1005 return ret;1007 return ret;
@@ -1028,7 +1030,8 @@ static int rtl2832_regmap_gather_write(void *context, const void *reg, · 22 unmodified lines
1028 1030
1029 ret = __i2c_transfer(client->adapter, msg, 1);1031 ret = __i2c_transfer(client->adapter, msg, 1);
1030 if (ret != 1) {1032 if (ret != 1) {
1031 dev_warn(&client->dev, "i2c reg write failed %d\n", ret);1033 dev_warn(&client->dev, "i2c reg write failed %d reg %02x\n",
1034 ret, *(u8 const *)reg);
1032 if (ret >= 0)1035 if (ret >= 0)
1033 ret = -EREMOTEIO;1036 ret = -EREMOTEIO;
1034 return ret;1037 return ret;
@@ -1097,18 +1100,6 @@ static int rtl2832_enable_slave_ts(struct i2c_client *client) · 62 unmodified lines
1097 if (ret)1100 if (ret)
1098 goto err;1101 goto err;
1099 1102
1100 ret = rtl2832_bulk_write(client, 0x022, "\x01", 1);
1101 if (ret)
1102 goto err;
1103
1104 ret = rtl2832_bulk_write(client, 0x026, "\x1f", 1);
1105 if (ret)
1106 goto err;
1107
1108 ret = rtl2832_bulk_write(client, 0x027, "\xff", 1);
1109 if (ret)
1110 goto err;
1111
1112 ret = rtl2832_bulk_write(client, 0x192, "\x7f\xf7\xff", 3);1103 ret = rtl2832_bulk_write(client, 0x192, "\x7f\xf7\xff", 3);
1113 if (ret)1104 if (ret)
1114 goto err;1105 goto err;
drivers/media/dvb-frontends/rtl2832_sdr.c+2−2
@@ -310,7 +310,7 @@ static void rtl2832_sdr_urb_complete(struct urb *urb) · 309 unmodified lines
310 len = rtl2832_sdr_convert_stream(dev, ptr, urb->transfer_buffer,310 len = rtl2832_sdr_convert_stream(dev, ptr, urb->transfer_buffer,
311 urb->actual_length);311 urb->actual_length);
312 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len);312 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len);
313 v4l2_get_timestamp(&fbuf->vb.timestamp);313 fbuf->vb.vb2_buf.timestamp = ktime_get_ns();
314 fbuf->vb.sequence = dev->sequence++;314 fbuf->vb.sequence = dev->sequence++;
315 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);315 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
316 }316 }
@@ -490,7 +490,7 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh, · 173 unmodified lines
490 490
491/* Videobuf2 operations */491/* Videobuf2 operations */
492static int rtl2832_sdr_queue_setup(struct vb2_queue *vq,492static int rtl2832_sdr_queue_setup(struct vb2_queue *vq,
493 const void *parg, unsigned int *nbuffers,493 unsigned int *nbuffers,
494 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])494 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
495{495{
496 struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq);496 struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq);
drivers/media/dvb-frontends/si2165.c+229−122
@@ -1,21 +1,21 @@
1/*1/*
2 Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator2 * Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator
3 3 *
4 Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org>4 * Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org>
5 5 *
6 This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by7 * it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or8 * the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.9 * (at your option) any later version.
10 10 *
11 This program is distributed in the hope that it will be useful,11 * This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.14 * GNU General Public License for more details.
15 15 *
16 References:16 * References:
17 http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf17 * http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf
18*/18 */
19 19
20#include <linux/delay.h>20#include <linux/delay.h>
21#include <linux/errno.h>21#include <linux/errno.h>
@@ -31,16 +31,18 @@ · 9 unmodified lines
31#include "si2165_priv.h"31#include "si2165_priv.h"
32#include "si2165.h"32#include "si2165.h"
33 33
34/* Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx34/*
35 * uses 16 MHz xtal */35 * Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx
36 36 * uses 16 MHz xtal
37/* Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx37 *
38 * uses 24 MHz clock provided by tuner */38 * Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx
39 * uses 24 MHz clock provided by tuner
40 */
39 41
40struct si2165_state {42struct si2165_state {
41 struct i2c_adapter *i2c;43 struct i2c_adapter *i2c;
42 44
43 struct dvb_frontend frontend;45 struct dvb_frontend fe;
44 46
45 struct si2165_config config;47 struct si2165_config config;
46 48
@@ -241,6 +243,27 @@ err: · 194 unmodified lines
241 return ret;243 return ret;
242}244}
243 245
246#define REG16(reg, val) { (reg), (val) & 0xff }, { (reg)+1, (val)>>8 & 0xff }
247struct si2165_reg_value_pair {
248 u16 reg;
249 u8 val;
250};
251
252static int si2165_write_reg_list(struct si2165_state *state,
253 const struct si2165_reg_value_pair *regs,
254 int count)
255{
256 int i;
257 int ret;
258
259 for (i = 0; i < count; i++) {
260 ret = si2165_writereg8(state, regs[i].reg, regs[i].val);
261 if (ret < 0)
262 return ret;
263 }
264 return 0;
265}
266
244static int si2165_get_tune_settings(struct dvb_frontend *fe,267static int si2165_get_tune_settings(struct dvb_frontend *fe,
245 struct dvb_frontend_tune_settings *s)268 struct dvb_frontend_tune_settings *s)
246{269{
@@ -258,8 +281,10 @@ static int si2165_init_pll(struct si2165_state *state) · 11 unmodified lines
258 u8 divl = 12;281 u8 divl = 12;
259 u8 buf[4];282 u8 buf[4];
260 283
261 /* hardcoded values can be deleted if calculation is verified284 /*
262 * or it yields the same values as the windows driver */285 * hardcoded values can be deleted if calculation is verified
286 * or it yields the same values as the windows driver
287 */
263 switch (ref_freq_Hz) {288 switch (ref_freq_Hz) {
264 case 16000000u:289 case 16000000u:
265 divn = 56;290 divn = 56;
@@ -274,8 +299,10 @@ static int si2165_init_pll(struct si2165_state *state) · 8 unmodified lines
274 if (ref_freq_Hz > 16000000u)299 if (ref_freq_Hz > 16000000u)
275 divr = 2;300 divr = 2;
276 301
277 /* now select divn and divp such that302 /*
278 * fvco is in 1624..1824 MHz */303 * now select divn and divp such that
304 * fvco is in 1624..1824 MHz
305 */
279 if (1624000000u * divr > ref_freq_Hz * 2u * 63u)306 if (1624000000u * divr > ref_freq_Hz * 2u * 63u)
280 divp = 4;307 divp = 4;
281 308
@@ -341,10 +368,12 @@ static int si2165_upload_firmware_block(struct si2165_state *state, · 59 unmodified lines
341 if (len % 4 != 0)368 if (len % 4 != 0)
342 return -EINVAL;369 return -EINVAL;
343 370
344 deb_fw_load("si2165_upload_firmware_block called with len=0x%x offset=0x%x blockcount=0x%x\n",371 deb_fw_load(
372 "si2165_upload_firmware_block called with len=0x%x offset=0x%x blockcount=0x%x\n",
345 len, offset, block_count);373 len, offset, block_count);
346 while (offset+12 <= len && cur_block < block_count) {374 while (offset+12 <= len && cur_block < block_count) {
347 deb_fw_load("si2165_upload_firmware_block in while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",375 deb_fw_load(
376 "si2165_upload_firmware_block in while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
348 len, offset, cur_block, block_count);377 len, offset, cur_block, block_count);
349 wordcount = data[offset];378 wordcount = data[offset];
350 if (wordcount < 1 || data[offset+1] ||379 if (wordcount < 1 || data[offset+1] ||
@@ -383,7 +412,8 @@ static int si2165_upload_firmware_block(struct si2165_state *state, · 32 unmodified lines
383 cur_block++;412 cur_block++;
384 }413 }
385 414
386 deb_fw_load("si2165_upload_firmware_block after while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",415 deb_fw_load(
416 "si2165_upload_firmware_block after while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
387 len, offset, cur_block, block_count);417 len, offset, cur_block, block_count);
388 418
389 if (poffset)419 if (poffset)
@@ -633,7 +663,7 @@ static int si2165_init(struct dvb_frontend *fe) · 243 unmodified lines
633 goto error;663 goto error;
634 664
635 /* ber_pkt */665 /* ber_pkt */
636 ret = si2165_writereg16(state, 0x0470 , 0x7530);666 ret = si2165_writereg16(state, 0x0470, 0x7530);
637 if (ret < 0)667 if (ret < 0)
638 goto error;668 goto error;
639 669
@@ -660,22 +690,19 @@ static int si2165_init(struct dvb_frontend *fe) · 20 unmodified lines
660 goto error;690 goto error;
661 }691 }
662 692
663 /* write adc values after each reset*/693 /* ts output config */
664 ret = si2165_writereg8(state, 0x012a, 0x46);694 ret = si2165_writereg8(state, 0x04e4, 0x20);
665 if (ret < 0)
666 goto error;
667 ret = si2165_writereg8(state, 0x012c, 0x00);
668 if (ret < 0)695 if (ret < 0)
669 goto error;696 return ret;
670 ret = si2165_writereg8(state, 0x012e, 0x0a);697 ret = si2165_writereg16(state, 0x04ef, 0x00fe);
671 if (ret < 0)698 if (ret < 0)
672 goto error;699 return ret;
673 ret = si2165_writereg8(state, 0x012f, 0xff);700 ret = si2165_writereg24(state, 0x04f4, 0x555555);
674 if (ret < 0)701 if (ret < 0)
675 goto error;702 return ret;
676 ret = si2165_writereg8(state, 0x0123, 0x70);703 ret = si2165_writereg8(state, 0x04e5, 0x01);
677 if (ret < 0)704 if (ret < 0)
678 goto error;705 return ret;
679 706
680 return 0;707 return 0;
681error:708error:
@@ -733,16 +760,26 @@ static int si2165_set_oversamp(struct si2165_state *state, u32 dvb_rate) · 51 unmodified lines
733 do_div(oversamp, dvb_rate);760 do_div(oversamp, dvb_rate);
734 reg_value = oversamp & 0x3fffffff;761 reg_value = oversamp & 0x3fffffff;
735 762
736 /* oversamp, usbdump contained 0x03100000; */763 dprintk("%s: Write oversamp=%#x\n", __func__, reg_value);
737 return si2165_writereg32(state, 0x00e4, reg_value);764 return si2165_writereg32(state, 0x00e4, reg_value);
738}765}
739 766
740static int si2165_set_if_freq_shift(struct si2165_state *state, u32 IF)767static int si2165_set_if_freq_shift(struct si2165_state *state)
741{768{
769 struct dvb_frontend *fe = &state->fe;
742 u64 if_freq_shift;770 u64 if_freq_shift;
743 s32 reg_value = 0;771 s32 reg_value = 0;
744 u32 fe_clk = si2165_get_fe_clk(state);772 u32 fe_clk = si2165_get_fe_clk(state);
773 u32 IF = 0;
745 774
775 if (!fe->ops.tuner_ops.get_if_frequency) {
776 dev_err(&state->i2c->dev,
777 "%s: Error: get_if_frequency() not defined at tuner. Can't work without it!\n",
778 KBUILD_MODNAME);
779 return -EINVAL;
780 }
781
782 fe->ops.tuner_ops.get_if_frequency(fe, &IF);
746 if_freq_shift = IF;783 if_freq_shift = IF;
747 if_freq_shift <<= 29;784 if_freq_shift <<= 29;
748 785
@@ -758,25 +795,39 @@ static int si2165_set_if_freq_shift(struct si2165_state *state, u32 IF) · 9 unmodified lines
758 return si2165_writereg32(state, 0x00e8, reg_value);795 return si2165_writereg32(state, 0x00e8, reg_value);
759}796}
760 797
761static int si2165_set_parameters(struct dvb_frontend *fe)798static const struct si2165_reg_value_pair dvbt_regs[] = {
799 /* standard = DVB-T */
800 { 0x00ec, 0x01 },
801 { 0x08f8, 0x00 },
802 /* impulsive_noise_remover */
803 { 0x031c, 0x01 },
804 { 0x00cb, 0x00 },
805 /* agc2 */
806 { 0x016e, 0x41 },
807 { 0x016c, 0x0e },
808 { 0x016d, 0x10 },
809 /* agc */
810 { 0x015b, 0x03 },
811 { 0x0150, 0x78 },
812 /* agc */
813 { 0x01a0, 0x78 },
814 { 0x01c8, 0x68 },
815 /* freq_sync_range */
816 REG16(0x030c, 0x0064),
817 /* gp_reg0 */
818 { 0x0387, 0x00 }
819};
820
821static int si2165_set_frontend_dvbt(struct dvb_frontend *fe)
762{822{
763 int ret;823 int ret;
764 struct dtv_frontend_properties *p = &fe->dtv_property_cache;824 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
765 struct si2165_state *state = fe->demodulator_priv;825 struct si2165_state *state = fe->demodulator_priv;
766 u8 val[3];
767 u32 IF;
768 u32 dvb_rate = 0;826 u32 dvb_rate = 0;
769 u16 bw10k;827 u16 bw10k;
770 828
771 dprintk("%s: called\n", __func__);829 dprintk("%s: called\n", __func__);
772 830
773 if (!fe->ops.tuner_ops.get_if_frequency) {
774 dev_err(&state->i2c->dev,
775 "%s: Error: get_if_frequency() not defined at tuner. Can't work without it!\n",
776 KBUILD_MODNAME);
777 return -EINVAL;
778 }
779
780 if (!state->has_dvbt)831 if (!state->has_dvbt)
781 return -EINVAL;832 return -EINVAL;
782 833
@@ -788,34 +839,10 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 5 unmodified lines
788 bw10k = 800;839 bw10k = 800;
789 }840 }
790 841
791 /* standard = DVB-T */
792 ret = si2165_writereg8(state, 0x00ec, 0x01);
793 if (ret < 0)
794 return ret;
795 ret = si2165_adjust_pll_divl(state, 12);842 ret = si2165_adjust_pll_divl(state, 12);
796 if (ret < 0)843 if (ret < 0)
797 return ret;844 return ret;
798 845
799 fe->ops.tuner_ops.get_if_frequency(fe, &IF);
800 ret = si2165_set_if_freq_shift(state, IF);
801 if (ret < 0)
802 return ret;
803 ret = si2165_writereg8(state, 0x08f8, 0x00);
804 if (ret < 0)
805 return ret;
806 /* ts output config */
807 ret = si2165_writereg8(state, 0x04e4, 0x20);
808 if (ret < 0)
809 return ret;
810 ret = si2165_writereg16(state, 0x04ef, 0x00fe);
811 if (ret < 0)
812 return ret;
813 ret = si2165_writereg24(state, 0x04f4, 0x555555);
814 if (ret < 0)
815 return ret;
816 ret = si2165_writereg8(state, 0x04e5, 0x01);
817 if (ret < 0)
818 return ret;
819 /* bandwidth in 10KHz steps */846 /* bandwidth in 10KHz steps */
820 ret = si2165_writereg16(state, 0x0308, bw10k);847 ret = si2165_writereg16(state, 0x0308, bw10k);
821 if (ret < 0)848 if (ret < 0)
@@ -823,48 +850,115 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 1 unmodified line
823 ret = si2165_set_oversamp(state, dvb_rate);850 ret = si2165_set_oversamp(state, dvb_rate);
824 if (ret < 0)851 if (ret < 0)
825 return ret;852 return ret;
826 /* impulsive_noise_remover */853
827 ret = si2165_writereg8(state, 0x031c, 0x01);854 ret = si2165_write_reg_list(state, dvbt_regs, ARRAY_SIZE(dvbt_regs));
828 if (ret < 0)
829 return ret;
830 ret = si2165_writereg8(state, 0x00cb, 0x00);
831 if (ret < 0)855 if (ret < 0)
832 return ret;856 return ret;
857
858 return 0;
859}
860
861static const struct si2165_reg_value_pair dvbc_regs[] = {
862 /* standard = DVB-C */
863 { 0x00ec, 0x05 },
864 { 0x08f8, 0x00 },
865
833 /* agc2 */866 /* agc2 */
834 ret = si2165_writereg8(state, 0x016e, 0x41);867 { 0x016e, 0x50 },
835 if (ret < 0)868 { 0x016c, 0x0e },
836 return ret;869 { 0x016d, 0x10 },
837 ret = si2165_writereg8(state, 0x016c, 0x0e);
838 if (ret < 0)
839 return ret;
840 ret = si2165_writereg8(state, 0x016d, 0x10);
841 if (ret < 0)
842 return ret;
843 /* agc */870 /* agc */
844 ret = si2165_writereg8(state, 0x015b, 0x03);871 { 0x015b, 0x03 },
845 if (ret < 0)872 { 0x0150, 0x68 },
846 return ret;
847 ret = si2165_writereg8(state, 0x0150, 0x78);
848 if (ret < 0)
849 return ret;
850 /* agc */873 /* agc */
851 ret = si2165_writereg8(state, 0x01a0, 0x78);874 { 0x01a0, 0x68 },
875 { 0x01c8, 0x50 },
876
877 { 0x0278, 0x0d },
878
879 { 0x023a, 0x05 },
880 { 0x0261, 0x09 },
881 REG16(0x0350, 0x3e80),
882 { 0x02f4, 0x00 },
883
884 { 0x00cb, 0x01 },
885 REG16(0x024c, 0x0000),
886 REG16(0x027c, 0x0000),
887 { 0x0232, 0x03 },
888 { 0x02f4, 0x0b },
889 { 0x018b, 0x00 },
890};
891
892static int si2165_set_frontend_dvbc(struct dvb_frontend *fe)
893{
894 struct si2165_state *state = fe->demodulator_priv;
895 int ret;
896 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
897 const u32 dvb_rate = p->symbol_rate;
898 const u32 bw_hz = p->bandwidth_hz;
899
900 if (!state->has_dvbc)
901 return -EINVAL;
902
903 if (dvb_rate == 0)
904 return -EINVAL;
905
906 ret = si2165_adjust_pll_divl(state, 14);
852 if (ret < 0)907 if (ret < 0)
853 return ret;908 return ret;
854 ret = si2165_writereg8(state, 0x01c8, 0x68);909
910 /* Oversampling */
911 ret = si2165_set_oversamp(state, dvb_rate);
855 if (ret < 0)912 if (ret < 0)
856 return ret;913 return ret;
857 /* freq_sync_range */914
858 ret = si2165_writereg16(state, 0x030c, 0x0064);915 ret = si2165_writereg32(state, 0x00c4, bw_hz);
859 if (ret < 0)916 if (ret < 0)
860 return ret;917 return ret;
861 /* gp_reg0 */918
862 ret = si2165_readreg8(state, 0x0387, val);919 ret = si2165_write_reg_list(state, dvbc_regs, ARRAY_SIZE(dvbc_regs));
863 if (ret < 0)920 if (ret < 0)
864 return ret;921 return ret;
865 ret = si2165_writereg8(state, 0x0387, 0x00);922
923 return 0;
924}
925
926static const struct si2165_reg_value_pair agc_rewrite[] = {
927 { 0x012a, 0x46 },
928 { 0x012c, 0x00 },
929 { 0x012e, 0x0a },
930 { 0x012f, 0xff },
931 { 0x0123, 0x70 }
932};
933
934static int si2165_set_frontend(struct dvb_frontend *fe)
935{
936 struct si2165_state *state = fe->demodulator_priv;
937 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
938 u32 delsys = p->delivery_system;
939 int ret;
940 u8 val[3];
941
942 /* initial setting of if freq shift */
943 ret = si2165_set_if_freq_shift(state);
866 if (ret < 0)944 if (ret < 0)
867 return ret;945 return ret;
946
947 switch (delsys) {
948 case SYS_DVBT:
949 ret = si2165_set_frontend_dvbt(fe);
950 if (ret < 0)
951 return ret;
952 break;
953 case SYS_DVBC_ANNEX_A:
954 ret = si2165_set_frontend_dvbc(fe);
955 if (ret < 0)
956 return ret;
957 break;
958 default:
959 return -EINVAL;
960 }
961
868 /* dsp_addr_jump */962 /* dsp_addr_jump */
869 ret = si2165_writereg32(state, 0x0348, 0xf4000000);963 ret = si2165_writereg32(state, 0x0348, 0xf4000000);
870 if (ret < 0)964 if (ret < 0)
@@ -874,8 +968,7 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 3 unmodified lines
874 fe->ops.tuner_ops.set_params(fe);968 fe->ops.tuner_ops.set_params(fe);
875 969
876 /* recalc if_freq_shift if IF might has changed */970 /* recalc if_freq_shift if IF might has changed */
877 fe->ops.tuner_ops.get_if_frequency(fe, &IF);971 ret = si2165_set_if_freq_shift(state);
878 ret = si2165_set_if_freq_shift(state, IF);
879 if (ret < 0)972 if (ret < 0)
880 return ret;973 return ret;
881 974
@@ -886,6 +979,7 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 4 unmodified lines
886 ret = si2165_writereg8(state, 0x0341, 0x00);979 ret = si2165_writereg8(state, 0x0341, 0x00);
887 if (ret < 0)980 if (ret < 0)
888 return ret;981 return ret;
982
889 /* reset all */983 /* reset all */
890 ret = si2165_writereg8(state, 0x00c0, 0x00);984 ret = si2165_writereg8(state, 0x00c0, 0x00);
891 if (ret < 0)985 if (ret < 0)
@@ -894,6 +988,13 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 2 unmodified lines
894 ret = si2165_writereg32(state, 0x0384, 0x00000000);988 ret = si2165_writereg32(state, 0x0384, 0x00000000);
895 if (ret < 0)989 if (ret < 0)
896 return ret;990 return ret;
991
992 /* write adc values after each reset*/
993 ret = si2165_write_reg_list(state, agc_rewrite,
994 ARRAY_SIZE(agc_rewrite));
995 if (ret < 0)
996 return ret;
997
897 /* start_synchro */998 /* start_synchro */
898 ret = si2165_writereg8(state, 0x02e0, 0x01);999 ret = si2165_writereg8(state, 0x02e0, 0x01);
899 if (ret < 0)1000 if (ret < 0)
@@ -917,7 +1018,12 @@ static void si2165_release(struct dvb_frontend *fe) · 17 unmodified lines
917static struct dvb_frontend_ops si2165_ops = {1018static struct dvb_frontend_ops si2165_ops = {
918 .info = {1019 .info = {
919 .name = "Silicon Labs ",1020 .name = "Silicon Labs ",
920 .caps = FE_CAN_FEC_1_2 |1021 /* For DVB-C */
1022 .symbol_rate_min = 1000000,
1023 .symbol_rate_max = 7200000,
1024 /* For DVB-T */
1025 .frequency_stepsize = 166667,
1026 .caps = FE_CAN_FEC_1_2 |
921 FE_CAN_FEC_2_3 |1027 FE_CAN_FEC_2_3 |
922 FE_CAN_FEC_3_4 |1028 FE_CAN_FEC_3_4 |
923 FE_CAN_FEC_5_6 |1029 FE_CAN_FEC_5_6 |
@@ -930,7 +1036,6 @@ static struct dvb_frontend_ops si2165_ops = { · 6 unmodified lines
930 FE_CAN_QAM_128 |1036 FE_CAN_QAM_128 |
931 FE_CAN_QAM_256 |1037 FE_CAN_QAM_256 |
932 FE_CAN_QAM_AUTO |1038 FE_CAN_QAM_AUTO |
933 FE_CAN_TRANSMISSION_MODE_AUTO |
934 FE_CAN_GUARD_INTERVAL_AUTO |1039 FE_CAN_GUARD_INTERVAL_AUTO |
935 FE_CAN_HIERARCHY_AUTO |1040 FE_CAN_HIERARCHY_AUTO |
936 FE_CAN_MUTE_TS |1041 FE_CAN_MUTE_TS |
@@ -943,7 +1048,7 @@ static struct dvb_frontend_ops si2165_ops = { · 6 unmodified lines
943 .init = si2165_init,1048 .init = si2165_init,
944 .sleep = si2165_sleep,1049 .sleep = si2165_sleep,
945 1050
946 .set_frontend = si2165_set_parameters,1051 .set_frontend = si2165_set_frontend,
947 .read_status = si2165_read_status,1052 .read_status = si2165_read_status,
948 1053
949 .release = si2165_release,1054 .release = si2165_release,
@@ -979,9 +1084,9 @@ struct dvb_frontend *si2165_attach(const struct si2165_config *config, · 29 unmodified lines
979 }1084 }
980 1085
981 /* create dvb_frontend */1086 /* create dvb_frontend */
982 memcpy(&state->frontend.ops, &si2165_ops,1087 memcpy(&state->fe.ops, &si2165_ops,
983 sizeof(struct dvb_frontend_ops));1088 sizeof(struct dvb_frontend_ops));
984 state->frontend.demodulator_priv = state;1089 state->fe.demodulator_priv = state;
985 1090
986 /* powerup */1091 /* powerup */
987 io_ret = si2165_writereg8(state, 0x0000, state->config.chip_mode);1092 io_ret = si2165_writereg8(state, 0x0000, state->config.chip_mode);
@@ -1033,20 +1138,22 @@ struct dvb_frontend *si2165_attach(const struct si2165_config *config, · 45 unmodified lines
1033 KBUILD_MODNAME, chip_name, rev_char, state->chip_type,1138 KBUILD_MODNAME, chip_name, rev_char, state->chip_type,
1034 state->chip_revcode);1139 state->chip_revcode);
1035 1140
1036 strlcat(state->frontend.ops.info.name, chip_name,1141 strlcat(state->fe.ops.info.name, chip_name,
1037 sizeof(state->frontend.ops.info.name));1142 sizeof(state->fe.ops.info.name));
1038 1143
1039 n = 0;1144 n = 0;
1040 if (state->has_dvbt) {1145 if (state->has_dvbt) {
1041 state->frontend.ops.delsys[n++] = SYS_DVBT;1146 state->fe.ops.delsys[n++] = SYS_DVBT;
1042 strlcat(state->frontend.ops.info.name, " DVB-T",1147 strlcat(state->fe.ops.info.name, " DVB-T",
1043 sizeof(state->frontend.ops.info.name));1148 sizeof(state->fe.ops.info.name));
1149 }
1150 if (state->has_dvbc) {
1151 state->fe.ops.delsys[n++] = SYS_DVBC_ANNEX_A;
1152 strlcat(state->fe.ops.info.name, " DVB-C",
1153 sizeof(state->fe.ops.info.name));
1044 }1154 }
1045 if (state->has_dvbc)
1046 dev_warn(&state->i2c->dev, "%s: DVB-C is not yet supported.\n",
1047 KBUILD_MODNAME);
1048 1155
1049 return &state->frontend;1156 return &state->fe;
1050 1157
1051error:1158error:
1052 kfree(state);1159 kfree(state);
drivers/media/dvb-frontends/stb6100.c+19−57
@@ -252,6 +252,7 @@ static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) · 251 unmodified lines
252{252{
253 int rc;253 int rc;
254 u8 f;254 u8 f;
255 u32 bw;
255 struct stb6100_state *state = fe->tuner_priv;256 struct stb6100_state *state = fe->tuner_priv;
256 257
257 rc = stb6100_read_reg(state, STB6100_F);258 rc = stb6100_read_reg(state, STB6100_F);
@@ -259,9 +260,9 @@ static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) · 1 unmodified line
259 return rc;260 return rc;
260 f = rc & STB6100_F_F;261 f = rc & STB6100_F_F;
261 262
262 state->status.bandwidth = (f + 5) * 2000; /* x2 for ZIF */263 bw = (f + 5) * 2000; /* x2 for ZIF */
263 264
264 *bandwidth = state->bandwidth = state->status.bandwidth * 1000;265 *bandwidth = state->bandwidth = bw * 1000;
265 dprintk(verbose, FE_DEBUG, 1, "bandwidth = %u Hz", state->bandwidth);266 dprintk(verbose, FE_DEBUG, 1, "bandwidth = %u Hz", state->bandwidth);
266 return 0;267 return 0;
267}268}
@@ -495,68 +496,28 @@ static int stb6100_sleep(struct dvb_frontend *fe) · 227 unmodified lines
495static int stb6100_init(struct dvb_frontend *fe)496static int stb6100_init(struct dvb_frontend *fe)
496{497{
497 struct stb6100_state *state = fe->tuner_priv;498 struct stb6100_state *state = fe->tuner_priv;
498 struct tuner_state *status = &state->status;499 int refclk = 27000000; /* Hz */
499 500
500 status->tunerstep = 125000;501 /*
501 status->ifreq = 0;502 * iqsense = 1
502 status->refclock = 27000000; /* Hz */503 * tunerstep = 125000
503 status->iqsense = 1;504 */
504 status->bandwidth = 36000; /* kHz */505 state->bandwidth = 36000000; /* Hz */
505 state->bandwidth = status->bandwidth * 1000; /* Hz */506 state->reference = refclk / 1000; /* kHz */
506 state->reference = status->refclock / 1000; /* kHz */
507 507
508 /* Set default bandwidth. Modified, PN 13-May-10 */508 /* Set default bandwidth. Modified, PN 13-May-10 */
509 return 0;509 return 0;
510}510}
511 511
512static int stb6100_get_state(struct dvb_frontend *fe,512static int stb6100_set_params(struct dvb_frontend *fe)
513 enum tuner_param param,
514 struct tuner_state *state)
515{513{
516 switch (param) {514 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
517 case DVBFE_TUNER_FREQUENCY:
518 stb6100_get_frequency(fe, &state->frequency);
519 break;
520 case DVBFE_TUNER_TUNERSTEP:
521 break;
522 case DVBFE_TUNER_IFFREQ:
523 break;
524 case DVBFE_TUNER_BANDWIDTH:
525 stb6100_get_bandwidth(fe, &state->bandwidth);
526 break;
527 case DVBFE_TUNER_REFCLOCK:
528 break;
529 default:
530 break;
531 }
532 515
533 return 0;516 if (c->frequency > 0)
534}517 stb6100_set_frequency(fe, c->frequency);
535 518
536static int stb6100_set_state(struct dvb_frontend *fe,519 if (c->bandwidth_hz > 0)
537 enum tuner_param param,520 stb6100_set_bandwidth(fe, c->bandwidth_hz);
538 struct tuner_state *state)
539{
540 struct stb6100_state *tstate = fe->tuner_priv;
541
542 switch (param) {
543 case DVBFE_TUNER_FREQUENCY:
544 stb6100_set_frequency(fe, state->frequency);
545 tstate->frequency = state->frequency;
546 break;
547 case DVBFE_TUNER_TUNERSTEP:
548 break;
549 case DVBFE_TUNER_IFFREQ:
550 break;
551 case DVBFE_TUNER_BANDWIDTH:
552 stb6100_set_bandwidth(fe, state->bandwidth);
553 tstate->bandwidth = state->bandwidth;
554 break;
555 case DVBFE_TUNER_REFCLOCK:
556 break;
557 default:
558 break;
559 }
560 521
561 return 0;522 return 0;
562}523}
@@ -572,8 +533,9 @@ static struct dvb_tuner_ops stb6100_ops = { · 9 unmodified lines
572 .init = stb6100_init,533 .init = stb6100_init,
573 .sleep = stb6100_sleep,534 .sleep = stb6100_sleep,
574 .get_status = stb6100_get_status,535 .get_status = stb6100_get_status,
575 .get_state = stb6100_get_state,536 .set_params = stb6100_set_params,
576 .set_state = stb6100_set_state,537 .get_frequency = stb6100_get_frequency,
538 .get_bandwidth = stb6100_get_bandwidth,
577 .release = stb6100_release539 .release = stb6100_release
578};540};
579 541
drivers/media/dvb-frontends/stb6100.h+0−1
@@ -86,7 +86,6 @@ struct stb6100_state { · 85 unmodified lines
86 const struct stb6100_config *config;86 const struct stb6100_config *config;
87 struct dvb_tuner_ops ops;87 struct dvb_tuner_ops ops;
88 struct dvb_frontend *frontend;88 struct dvb_frontend *frontend;
89 struct tuner_state status;
90 89
91 u32 frequency;90 u32 frequency;
92 u32 srate;91 u32 srate;
drivers/media/dvb-frontends/stb6100_cfg.h+21−16
@@ -19,20 +19,21 @@ · 18 unmodified lines
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/20*/
21 21
22#include <linux/dvb/frontend.h>
23#include "dvb_frontend.h"
24
22static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)25static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)
23{26{
24 struct dvb_frontend_ops *frontend_ops = &fe->ops;27 struct dvb_frontend_ops *frontend_ops = &fe->ops;
25 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;28 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
26 struct tuner_state t_state;
27 int err = 0;29 int err = 0;
28 30
29 if (tuner_ops->get_state) {31 if (tuner_ops->get_frequency) {
30 err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);32 err = tuner_ops->get_frequency(fe, frequency);
31 if (err < 0) {33 if (err < 0) {
32 printk("%s: Invalid parameter\n", __func__);34 printk("%s: Invalid parameter\n", __func__);
33 return err;35 return err;
34 }36 }
35 *frequency = t_state.frequency;
36 }37 }
37 return 0;38 return 0;
38}39}
@@ -41,13 +42,16 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency) · 2 unmodified lines
41{42{
42 struct dvb_frontend_ops *frontend_ops = &fe->ops;43 struct dvb_frontend_ops *frontend_ops = &fe->ops;
43 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;44 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
44 struct tuner_state t_state;45 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
46 u32 bw = c->bandwidth_hz;
45 int err = 0;47 int err = 0;
46 48
47 t_state.frequency = frequency;49 c->frequency = frequency;
50 c->bandwidth_hz = 0; /* Don't adjust the bandwidth */
48 51
49 if (tuner_ops->set_state) {52 if (tuner_ops->set_params) {
50 err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);53 err = tuner_ops->set_params(fe);
54 c->bandwidth_hz = bw;
51 if (err < 0) {55 if (err < 0) {
52 printk("%s: Invalid parameter\n", __func__);56 printk("%s: Invalid parameter\n", __func__);
53 return err;57 return err;
@@ -60,16 +64,14 @@ static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) · 6 unmodified lines
60{64{
61 struct dvb_frontend_ops *frontend_ops = &fe->ops;65 struct dvb_frontend_ops *frontend_ops = &fe->ops;
62 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;66 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
63 struct tuner_state t_state;
64 int err = 0;67 int err = 0;
65 68
66 if (tuner_ops->get_state) {69 if (tuner_ops->get_bandwidth) {
67 err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);70 err = tuner_ops->get_bandwidth(fe, bandwidth);
68 if (err < 0) {71 if (err < 0) {
69 printk("%s: Invalid parameter\n", __func__);72 printk("%s: Invalid parameter\n", __func__);
70 return err;73 return err;
71 }74 }
72 *bandwidth = t_state.bandwidth;
73 }75 }
74 return 0;76 return 0;
75}77}
@@ -78,13 +80,16 @@ static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth) · 2 unmodified lines
78{80{
79 struct dvb_frontend_ops *frontend_ops = &fe->ops;81 struct dvb_frontend_ops *frontend_ops = &fe->ops;
80 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;82 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
81 struct tuner_state t_state;83 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
84 u32 freq = c->frequency;
82 int err = 0;85 int err = 0;
83 86
84 t_state.bandwidth = bandwidth;87 c->bandwidth_hz = bandwidth;
88 c->frequency = 0; /* Don't adjust the frequency */
85 89
86 if (tuner_ops->set_state) {90 if (tuner_ops->set_params) {
87 err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);91 err = tuner_ops->set_params(fe);
92 c->frequency = freq;
88 if (err < 0) {93 if (err < 0) {
89 printk("%s: Invalid parameter\n", __func__);94 printk("%s: Invalid parameter\n", __func__);
90 return err;95 return err;
drivers/media/dvb-frontends/stb6100_proc.h+23−20
@@ -17,27 +17,27 @@ · 16 unmodified lines
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/18*/
19 19
20#include <linux/dvb/frontend.h>
21#include "dvb_frontend.h"
22
20static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency)23static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency)
21{24{
22 struct dvb_frontend_ops *frontend_ops = &fe->ops;25 struct dvb_frontend_ops *frontend_ops = &fe->ops;
23 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;26 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
24 struct tuner_state state;
25 int err = 0;27 int err = 0;
26 28
27 if (tuner_ops->get_state) {29 if (tuner_ops->get_frequency) {
28 if (frontend_ops->i2c_gate_ctrl)30 if (frontend_ops->i2c_gate_ctrl)
29 frontend_ops->i2c_gate_ctrl(fe, 1);31 frontend_ops->i2c_gate_ctrl(fe, 1);
30 32
31 err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &state);33 err = tuner_ops->get_frequency(fe, frequency);
32 if (err < 0) {34 if (err < 0) {
33 printk(KERN_ERR "%s: Invalid parameter\n", __func__);35 printk("%s: Invalid parameter\n", __func__);
34 return err;36 return err;
35 }37 }
36 38
37 if (frontend_ops->i2c_gate_ctrl)39 if (frontend_ops->i2c_gate_ctrl)
38 frontend_ops->i2c_gate_ctrl(fe, 0);40 frontend_ops->i2c_gate_ctrl(fe, 0);
39
40 *frequency = state.frequency;
41 }41 }
42 42
43 return 0;43 return 0;
@@ -47,18 +47,21 @@ static int stb6100_set_freq(struct dvb_frontend *fe, u32 frequency) · 3 unmodified lines
47{47{
48 struct dvb_frontend_ops *frontend_ops = &fe->ops;48 struct dvb_frontend_ops *frontend_ops = &fe->ops;
49 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;49 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
50 struct tuner_state state;50 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
51 u32 bw = c->bandwidth_hz;
51 int err = 0;52 int err = 0;
52 53
53 state.frequency = frequency;54 c->frequency = frequency;
55 c->bandwidth_hz = 0; /* Don't adjust the bandwidth */
54 56
55 if (tuner_ops->set_state) {57 if (tuner_ops->set_params) {
56 if (frontend_ops->i2c_gate_ctrl)58 if (frontend_ops->i2c_gate_ctrl)
57 frontend_ops->i2c_gate_ctrl(fe, 1);59 frontend_ops->i2c_gate_ctrl(fe, 1);
58 60
59 err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &state);61 err = tuner_ops->set_params(fe);
62 c->bandwidth_hz = bw;
60 if (err < 0) {63 if (err < 0) {
61 printk(KERN_ERR "%s: Invalid parameter\n", __func__);64 printk("%s: Invalid parameter\n", __func__);
62 return err;65 return err;
63 }66 }
64 67
@@ -74,14 +77,13 @@ static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth) · 9 unmodified lines
74{77{
75 struct dvb_frontend_ops *frontend_ops = &fe->ops;78 struct dvb_frontend_ops *frontend_ops = &fe->ops;
76 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;79 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
77 struct tuner_state state;
78 int err = 0;80 int err = 0;
79 81
80 if (tuner_ops->get_state) {82 if (tuner_ops->get_bandwidth) {
81 if (frontend_ops->i2c_gate_ctrl)83 if (frontend_ops->i2c_gate_ctrl)
82 frontend_ops->i2c_gate_ctrl(fe, 1);84 frontend_ops->i2c_gate_ctrl(fe, 1);
83 85
84 err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &state);86 err = tuner_ops->get_bandwidth(fe, bandwidth);
85 if (err < 0) {87 if (err < 0) {
86 printk(KERN_ERR "%s: Invalid parameter\n", __func__);88 printk(KERN_ERR "%s: Invalid parameter\n", __func__);
87 return err;89 return err;
@@ -89,8 +91,6 @@ static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth) · 1 unmodified line
89 91
90 if (frontend_ops->i2c_gate_ctrl)92 if (frontend_ops->i2c_gate_ctrl)
91 frontend_ops->i2c_gate_ctrl(fe, 0);93 frontend_ops->i2c_gate_ctrl(fe, 0);
92
93 *bandwidth = state.bandwidth;
94 }94 }
95 95
96 return 0;96 return 0;
@@ -100,16 +100,19 @@ static int stb6100_set_bandw(struct dvb_frontend *fe, u32 bandwidth) · 3 unmodified lines
100{100{
101 struct dvb_frontend_ops *frontend_ops = &fe->ops;101 struct dvb_frontend_ops *frontend_ops = &fe->ops;
102 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;102 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
103 struct tuner_state state;103 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
104 u32 freq = c->frequency;
104 int err = 0;105 int err = 0;
105 106
106 state.bandwidth = bandwidth;107 c->bandwidth_hz = bandwidth;
108 c->frequency = 0; /* Don't adjust the frequency */
107 109
108 if (tuner_ops->set_state) {110 if (tuner_ops->set_params) {
109 if (frontend_ops->i2c_gate_ctrl)111 if (frontend_ops->i2c_gate_ctrl)
110 frontend_ops->i2c_gate_ctrl(fe, 1);112 frontend_ops->i2c_gate_ctrl(fe, 1);
111 113
112 err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &state);114 err = tuner_ops->set_params(fe);
115 c->frequency = freq;
113 if (err < 0) {116 if (err < 0) {
114 printk(KERN_ERR "%s: Invalid parameter\n", __func__);117 printk(KERN_ERR "%s: Invalid parameter\n", __func__);
115 return err;118 return err;
drivers/media/dvb-frontends/tda665x.c+88−95
@@ -66,26 +66,13 @@ exit: · 65 unmodified lines
66 return err;66 return err;
67}67}
68 68
69static int tda665x_get_state(struct dvb_frontend *fe,69static int tda665x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
70 enum tuner_param param,
71 struct tuner_state *tstate)
72{70{
73 struct tda665x_state *state = fe->tuner_priv;71 struct tda665x_state *state = fe->tuner_priv;
74 int err = 0;
75 72
76 switch (param) {73 *frequency = state->frequency;
77 case DVBFE_TUNER_FREQUENCY:
78 tstate->frequency = state->frequency;
79 break;
80 case DVBFE_TUNER_BANDWIDTH:
81 break;
82 default:
83 printk(KERN_ERR "%s: Unknown parameter (param=%d)\n", __func__, param);
84 err = -EINVAL;
85 break;
86 }
87 74
88 return err;75 return 0;
89}76}
90 77
91static int tda665x_get_status(struct dvb_frontend *fe, u32 *status)78static int tda665x_get_status(struct dvb_frontend *fe, u32 *status)
@@ -111,9 +98,8 @@ exit: · 19 unmodified lines
111 return err;98 return err;
112}99}
113 100
114static int tda665x_set_state(struct dvb_frontend *fe,101static int tda665x_set_frequency(struct dvb_frontend *fe,
115 enum tuner_param param,102 u32 new_frequency)
116 struct tuner_state *tstate)
117{103{
118 struct tda665x_state *state = fe->tuner_priv;104 struct tda665x_state *state = fe->tuner_priv;
119 const struct tda665x_config *config = state->config;105 const struct tda665x_config *config = state->config;
@@ -121,88 +107,96 @@ static int tda665x_set_state(struct dvb_frontend *fe, · 1 unmodified line
121 u8 buf[4];107 u8 buf[4];
122 int err = 0;108 int err = 0;
123 109
124 if (param & DVBFE_TUNER_FREQUENCY) {110 if ((new_frequency < config->frequency_max)
125 111 || (new_frequency > config->frequency_min)) {
126 frequency = tstate->frequency;112 printk(KERN_ERR "%s: Frequency beyond limits, frequency=%d\n",
127 if ((frequency < config->frequency_max) || (frequency > config->frequency_min)) {113 __func__, new_frequency);
128 printk(KERN_ERR "%s: Frequency beyond limits, frequency=%d\n", __func__, frequency);
129 return -EINVAL;
130 }
131
132 frequency += config->frequency_offst;
133 frequency *= config->ref_multiplier;
134 frequency += config->ref_divider >> 1;
135 frequency /= config->ref_divider;
136
137 buf[0] = (u8) ((frequency & 0x7f00) >> 8);
138 buf[1] = (u8) (frequency & 0x00ff) >> 0;
139 buf[2] = 0x80 | 0x40 | 0x02;
140 buf[3] = 0x00;
141
142 /* restore frequency */
143 frequency = tstate->frequency;
144
145 if (frequency < 153000000) {
146 /* VHF-L */
147 buf[3] |= 0x01; /* fc, Low Band, 47 - 153 MHz */
148 if (frequency < 68000000)
149 buf[3] |= 0x40; /* 83uA */
150 if (frequency < 1040000000)
151 buf[3] |= 0x60; /* 122uA */
152 if (frequency < 1250000000)
153 buf[3] |= 0x80; /* 163uA */
154 else
155 buf[3] |= 0xa0; /* 254uA */
156 } else if (frequency < 438000000) {
157 /* VHF-H */
158 buf[3] |= 0x02; /* fc, Mid Band, 153 - 438 MHz */
159 if (frequency < 230000000)
160 buf[3] |= 0x40;
161 if (frequency < 300000000)
162 buf[3] |= 0x60;
163 else
164 buf[3] |= 0x80;
165 } else {
166 /* UHF */
167 buf[3] |= 0x04; /* fc, High Band, 438 - 862 MHz */
168 if (frequency < 470000000)
169 buf[3] |= 0x60;
170 if (frequency < 526000000)
171 buf[3] |= 0x80;
172 else
173 buf[3] |= 0xa0;
174 }
175
176 /* Set params */
177 err = tda665x_write(state, buf, 5);
178 if (err < 0)
179 goto exit;
180
181 /* sleep for some time */
182 printk(KERN_DEBUG "%s: Waiting to Phase LOCK\n", __func__);
183 msleep(20);
184 /* check status */
185 err = tda665x_get_status(fe, &status);
186 if (err < 0)
187 goto exit;
188
189 if (status == 1) {
190 printk(KERN_DEBUG "%s: Tuner Phase locked: status=%d\n", __func__, status);
191 state->frequency = frequency; /* cache successful state */
192 } else {
193 printk(KERN_ERR "%s: No Phase lock: status=%d\n", __func__, status);
194 }
195 } else {
196 printk(KERN_ERR "%s: Unknown parameter (param=%d)\n", __func__, param);
197 return -EINVAL;114 return -EINVAL;
198 }115 }
199 116
117 frequency = new_frequency;
118
119 frequency += config->frequency_offst;
120 frequency *= config->ref_multiplier;
121 frequency += config->ref_divider >> 1;
122 frequency /= config->ref_divider;
123
124 buf[0] = (u8) ((frequency & 0x7f00) >> 8);
125 buf[1] = (u8) (frequency & 0x00ff) >> 0;
126 buf[2] = 0x80 | 0x40 | 0x02;
127 buf[3] = 0x00;
128
129 /* restore frequency */
130 frequency = new_frequency;
131
132 if (frequency < 153000000) {
133 /* VHF-L */
134 buf[3] |= 0x01; /* fc, Low Band, 47 - 153 MHz */
135 if (frequency < 68000000)
136 buf[3] |= 0x40; /* 83uA */
137 if (frequency < 1040000000)
138 buf[3] |= 0x60; /* 122uA */
139 if (frequency < 1250000000)
140 buf[3] |= 0x80; /* 163uA */
141 else
142 buf[3] |= 0xa0; /* 254uA */
143 } else if (frequency < 438000000) {
144 /* VHF-H */
145 buf[3] |= 0x02; /* fc, Mid Band, 153 - 438 MHz */
146 if (frequency < 230000000)
147 buf[3] |= 0x40;
148 if (frequency < 300000000)
149 buf[3] |= 0x60;
150 else
151 buf[3] |= 0x80;
152 } else {
153 /* UHF */
154 buf[3] |= 0x04; /* fc, High Band, 438 - 862 MHz */
155 if (frequency < 470000000)
156 buf[3] |= 0x60;
157 if (frequency < 526000000)
158 buf[3] |= 0x80;
159 else
160 buf[3] |= 0xa0;
161 }
162
163 /* Set params */
164 err = tda665x_write(state, buf, 5);
165 if (err < 0)
166 goto exit;
167
168 /* sleep for some time */
169 printk(KERN_DEBUG "%s: Waiting to Phase LOCK\n", __func__);
170 msleep(20);
171 /* check status */
172 err = tda665x_get_status(fe, &status);
173 if (err < 0)
174 goto exit;
175
176 if (status == 1) {
177 printk(KERN_DEBUG "%s: Tuner Phase locked: status=%d\n",
178 __func__, status);
179 state->frequency = frequency; /* cache successful state */
180 } else {
181 printk(KERN_ERR "%s: No Phase lock: status=%d\n",
182 __func__, status);
183 }
184
200 return 0;185 return 0;
201exit:186exit:
202 printk(KERN_ERR "%s: I/O Error\n", __func__);187 printk(KERN_ERR "%s: I/O Error\n", __func__);
203 return err;188 return err;
204}189}
205 190
191static int tda665x_set_params(struct dvb_frontend *fe)
192{
193 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
194
195 tda665x_set_frequency(fe, c->frequency);
196
197 return 0;
198}
199
206static int tda665x_release(struct dvb_frontend *fe)200static int tda665x_release(struct dvb_frontend *fe)
207{201{
208 struct tda665x_state *state = fe->tuner_priv;202 struct tda665x_state *state = fe->tuner_priv;
@@ -213,10 +207,9 @@ static int tda665x_release(struct dvb_frontend *fe) · 4 unmodified lines
213}207}
214 208
215static struct dvb_tuner_ops tda665x_ops = {209static struct dvb_tuner_ops tda665x_ops = {
216
217 .set_state = tda665x_set_state,
218 .get_state = tda665x_get_state,
219 .get_status = tda665x_get_status,210 .get_status = tda665x_get_status,
211 .set_params = tda665x_set_params,
212 .get_frequency = tda665x_get_frequency,
220 .release = tda665x_release213 .release = tda665x_release
221};214};
222 215
drivers/media/dvb-frontends/tda8261.c+52−73
@@ -83,88 +83,71 @@ static int tda8261_get_status(struct dvb_frontend *fe, u32 *status) · 82 unmodified lines
83static const u32 div_tab[] = { 2000, 1000, 500, 250, 125 }; /* kHz */83static const u32 div_tab[] = { 2000, 1000, 500, 250, 125 }; /* kHz */
84static const u8 ref_div[] = { 0x00, 0x01, 0x02, 0x05, 0x07 };84static const u8 ref_div[] = { 0x00, 0x01, 0x02, 0x05, 0x07 };
85 85
86static int tda8261_get_state(struct dvb_frontend *fe,86static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
87 enum tuner_param param,
88 struct tuner_state *tstate)
89{87{
90 struct tda8261_state *state = fe->tuner_priv;88 struct tda8261_state *state = fe->tuner_priv;
91 int err = 0;
92 89
93 switch (param) {90 *frequency = state->frequency;
94 case DVBFE_TUNER_FREQUENCY:
95 tstate->frequency = state->frequency;
96 break;
97 case DVBFE_TUNER_BANDWIDTH:
98 tstate->bandwidth = 40000000; /* FIXME! need to calculate Bandwidth */
99 break;
100 default:
101 pr_err("%s: Unknown parameter (param=%d)\n", __func__, param);
102 err = -EINVAL;
103 break;
104 }
105 91
106 return err;92 return 0;
107}93}
108 94
109static int tda8261_set_state(struct dvb_frontend *fe,95static int tda8261_set_params(struct dvb_frontend *fe)
110 enum tuner_param param,
111 struct tuner_state *tstate)
112{96{
97 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
113 struct tda8261_state *state = fe->tuner_priv;98 struct tda8261_state *state = fe->tuner_priv;
114 const struct tda8261_config *config = state->config;99 const struct tda8261_config *config = state->config;
115 u32 frequency, N, status = 0;100 u32 frequency, N, status = 0;
116 u8 buf[4];101 u8 buf[4];
117 int err = 0;102 int err = 0;
118 103
119 if (param & DVBFE_TUNER_FREQUENCY) {104 /*
120 /**105 * N = Max VCO Frequency / Channel Spacing
121 * N = Max VCO Frequency / Channel Spacing106 * Max VCO Frequency = VCO frequency + (channel spacing - 1)
122 * Max VCO Frequency = VCO frequency + (channel spacing - 1)107 * (to account for half channel spacing on either side)
123 * (to account for half channel spacing on either side)108 */
124 */109 frequency = c->frequency;
125 frequency = tstate->frequency;110 if ((frequency < 950000) || (frequency > 2150000)) {
126 if ((frequency < 950000) || (frequency > 2150000)) {111 pr_warn("%s: Frequency beyond limits, frequency=%d\n",
127 pr_warn("%s: Frequency beyond limits, frequency=%d\n", __func__, frequency);112 __func__, frequency);
128 return -EINVAL;
129 }
130 N = (frequency + (div_tab[config->step_size] - 1)) / div_tab[config->step_size];
131 pr_debug("%s: Step size=%d, Divider=%d, PG=0x%02x (%d)\n",
132 __func__, config->step_size, div_tab[config->step_size], N, N);
133
134 buf[0] = (N >> 8) & 0xff;
135 buf[1] = N & 0xff;
136 buf[2] = (0x01 << 7) | ((ref_div[config->step_size] & 0x07) << 1);
137
138 if (frequency < 1450000)
139 buf[3] = 0x00;
140 else if (frequency < 2000000)
141 buf[3] = 0x40;
142 else if (frequency < 2150000)
143 buf[3] = 0x80;
144
145 /* Set params */
146 if ((err = tda8261_write(state, buf)) < 0) {
147 pr_err("%s: I/O Error\n", __func__);
148 return err;
149 }
150 /* sleep for some time */
151 pr_debug("%s: Waiting to Phase LOCK\n", __func__);
152 msleep(20);
153 /* check status */
154 if ((err = tda8261_get_status(fe, &status)) < 0) {
155 pr_err("%s: I/O Error\n", __func__);
156 return err;
157 }
158 if (status == 1) {
159 pr_debug("%s: Tuner Phase locked: status=%d\n", __func__, status);
160 state->frequency = frequency; /* cache successful state */
161 } else {
162 pr_debug("%s: No Phase lock: status=%d\n", __func__, status);
163 }
164 } else {
165 pr_err("%s: Unknown parameter (param=%d)\n", __func__, param);
166 return -EINVAL;113 return -EINVAL;
167 }114 }
115 N = (frequency + (div_tab[config->step_size] - 1)) / div_tab[config->step_size];
116 pr_debug("%s: Step size=%d, Divider=%d, PG=0x%02x (%d)\n",
117 __func__, config->step_size, div_tab[config->step_size], N, N);
118
119 buf[0] = (N >> 8) & 0xff;
120 buf[1] = N & 0xff;
121 buf[2] = (0x01 << 7) | ((ref_div[config->step_size] & 0x07) << 1);
122
123 if (frequency < 1450000)
124 buf[3] = 0x00;
125 else if (frequency < 2000000)
126 buf[3] = 0x40;
127 else if (frequency < 2150000)
128 buf[3] = 0x80;
129
130 /* Set params */
131 err = tda8261_write(state, buf);
132 if (err < 0) {
133 pr_err("%s: I/O Error\n", __func__);
134 return err;
135 }
136 /* sleep for some time */
137 pr_debug("%s: Waiting to Phase LOCK\n", __func__);
138 msleep(20);
139 /* check status */
140 if ((err = tda8261_get_status(fe, &status)) < 0) {
141 pr_err("%s: I/O Error\n", __func__);
142 return err;
143 }
144 if (status == 1) {
145 pr_debug("%s: Tuner Phase locked: status=%d\n", __func__,
146 status);
147 state->frequency = frequency; /* cache successful state */
148 } else {
149 pr_debug("%s: No Phase lock: status=%d\n", __func__, status);
150 }
168 151
169 return 0;152 return 0;
170}153}
@@ -182,14 +165,13 @@ static struct dvb_tuner_ops tda8261_ops = { · 11 unmodified lines
182 165
183 .info = {166 .info = {
184 .name = "TDA8261",167 .name = "TDA8261",
185// .tuner_name = NULL,
186 .frequency_min = 950000,168 .frequency_min = 950000,
187 .frequency_max = 2150000,169 .frequency_max = 2150000,
188 .frequency_step = 0170 .frequency_step = 0
189 },171 },
190 172
191 .set_state = tda8261_set_state,173 .set_params = tda8261_set_params,
192 .get_state = tda8261_get_state,174 .get_frequency = tda8261_get_frequency,
193 .get_status = tda8261_get_status,175 .get_status = tda8261_get_status,
194 .release = tda8261_release176 .release = tda8261_release
195};177};
@@ -210,10 +192,7 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, · 14 unmodified lines
210 fe->ops.tuner_ops = tda8261_ops;192 fe->ops.tuner_ops = tda8261_ops;
211 193
212 fe->ops.tuner_ops.info.frequency_step = div_tab[config->step_size];194 fe->ops.tuner_ops.info.frequency_step = div_tab[config->step_size];
213// fe->ops.tuner_ops.tuner_name = &config->buf;
214 195
215// printk("%s: Attaching %s TDA8261 8PSK/QPSK tuner\n",
216// __func__, fe->ops.tuner_ops.tuner_name);
217 pr_info("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__);196 pr_info("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__);
218 197
219 return fe;198 return fe;
drivers/media/dvb-frontends/tda8261_cfg.h+11−26
@@ -21,17 +21,15 @@ static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency) · 20 unmodified lines
21{21{
22 struct dvb_frontend_ops *frontend_ops = &fe->ops;22 struct dvb_frontend_ops *frontend_ops = &fe->ops;
23 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;23 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
24 struct tuner_state t_state;
25 int err = 0;24 int err = 0;
26 25
27 if (tuner_ops->get_state) {26 if (tuner_ops->get_frequency) {
28 err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);27 err = tuner_ops->get_frequency(fe, frequency);
29 if (err < 0) {28 if (err < 0) {
30 printk("%s: Invalid parameter\n", __func__);29 pr_err("%s: Invalid parameter\n", __func__);
31 return err;30 return err;
32 }31 }
33 *frequency = t_state.frequency;32 pr_debug("%s: Frequency=%d\n", __func__, *frequency);
34 printk("%s: Frequency=%d\n", __func__, t_state.frequency);
35 }33 }
36 return 0;34 return 0;
37}35}
@@ -40,37 +38,24 @@ static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency) · 2 unmodified lines
40{38{
41 struct dvb_frontend_ops *frontend_ops = &fe->ops;39 struct dvb_frontend_ops *frontend_ops = &fe->ops;
42 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;40 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
43 struct tuner_state t_state;41 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
44 int err = 0;42 int err = 0;
45 43
46 t_state.frequency = frequency;44 if (tuner_ops->set_params) {
47 45 err = tuner_ops->set_params(fe);
48 if (tuner_ops->set_state) {
49 err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
50 if (err < 0) {46 if (err < 0) {
51 printk("%s: Invalid parameter\n", __func__);47 pr_err("%s: Invalid parameter\n", __func__);
52 return err;48 return err;
53 }49 }
54 }50 }
55 printk("%s: Frequency=%d\n", __func__, t_state.frequency);51 pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
56 return 0;52 return 0;
57}53}
58 54
59static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)55static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
60{56{
61 struct dvb_frontend_ops *frontend_ops = &fe->ops;57 /* FIXME! need to calculate Bandwidth */
62 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;58 *bandwidth = 40000000;
63 struct tuner_state t_state;
64 int err = 0;
65 59
66 if (tuner_ops->get_state) {
67 err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
68 if (err < 0) {
69 printk("%s: Invalid parameter\n", __func__);
70 return err;
71 }
72 *bandwidth = t_state.bandwidth;
73 printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
74 }
75 return 0;60 return 0;
76}61}
drivers/media/dvb-frontends/tdhd1.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
20 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html20 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
21 *21 *
22 *22 *
23 * The project's page is at http://www.linuxtv.org23 * The project's page is at https://linuxtv.org
24 */24 */
25 25
26#ifndef TDHD1_H26#ifndef TDHD1_H
drivers/media/i2c/Kconfig+10−0
@@ -83,6 +83,16 @@ config VIDEO_MSP3400 · 82 unmodified lines
83 To compile this driver as a module, choose M here: the83 To compile this driver as a module, choose M here: the
84 module will be called msp3400.84 module will be called msp3400.
85 85
86config VIDEO_CS3308
87 tristate "Cirrus Logic CS3308 audio ADC"
88 depends on VIDEO_V4L2 && I2C
89 ---help---
90 Support for the Cirrus Logic CS3308 High Performance 8-Channel
91 Analog Volume Control
92
93 To compile this driver as a module, choose M here: the
94 module will be called cs3308.
95
86config VIDEO_CS534596config VIDEO_CS5345
87 tristate "Cirrus Logic CS5345 audio ADC"97 tristate "Cirrus Logic CS5345 audio ADC"
88 depends on VIDEO_V4L2 && I2C98 depends on VIDEO_V4L2 && I2C
drivers/media/i2c/Makefile+1−0
@@ -43,6 +43,7 @@ obj-$(CONFIG_VIDEO_TVP7002) += tvp7002.o · 42 unmodified lines
43obj-$(CONFIG_VIDEO_TW2804) += tw2804.o43obj-$(CONFIG_VIDEO_TW2804) += tw2804.o
44obj-$(CONFIG_VIDEO_TW9903) += tw9903.o44obj-$(CONFIG_VIDEO_TW9903) += tw9903.o
45obj-$(CONFIG_VIDEO_TW9906) += tw9906.o45obj-$(CONFIG_VIDEO_TW9906) += tw9906.o
46obj-$(CONFIG_VIDEO_CS3308) += cs3308.o
46obj-$(CONFIG_VIDEO_CS5345) += cs5345.o47obj-$(CONFIG_VIDEO_CS5345) += cs5345.o
47obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o48obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o
48obj-$(CONFIG_VIDEO_M52790) += m52790.o49obj-$(CONFIG_VIDEO_M52790) += m52790.o
drivers/media/i2c/ad9389b.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
35#include <media/v4l2-common.h>35#include <media/v4l2-common.h>
36#include <media/v4l2-dv-timings.h>36#include <media/v4l2-dv-timings.h>
37#include <media/v4l2-ctrls.h>37#include <media/v4l2-ctrls.h>
38#include <media/ad9389b.h>38#include <media/i2c/ad9389b.h>
39 39
40static int debug;40static int debug;
41module_param(debug, int, 0644);41module_param(debug, int, 0644);
drivers/media/i2c/adp1653.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
37#include <linux/slab.h>37#include <linux/slab.h>
38#include <linux/of.h>38#include <linux/of.h>
39#include <linux/gpio/consumer.h>39#include <linux/gpio/consumer.h>
40#include <media/adp1653.h>40#include <media/i2c/adp1653.h>
41#include <media/v4l2-device.h>41#include <media/v4l2-device.h>
42 42
43#define TIMEOUT_MAX 82000043#define TIMEOUT_MAX 820000
drivers/media/i2c/adv7180.c+1−1
@@ -1112,7 +1112,7 @@ static int init_device(struct adv7180_state *state) · 1111 unmodified lines
1112 mutex_lock(&state->mutex);1112 mutex_lock(&state->mutex);
1113 1113
1114 adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES);1114 adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES);
1115 usleep_range(2000, 10000);1115 usleep_range(5000, 10000);
1116 1116
1117 ret = state->chip_info->init(state);1117 ret = state->chip_info->init(state);
1118 if (ret)1118 if (ret)
drivers/media/i2c/adv7183.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include <linux/types.h>27#include <linux/types.h>
28#include <linux/videodev2.h>28#include <linux/videodev2.h>
29 29
30#include <media/adv7183.h>30#include <media/i2c/adv7183.h>
31#include <media/v4l2-ctrls.h>31#include <media/v4l2-ctrls.h>
32#include <media/v4l2-device.h>32#include <media/v4l2-device.h>
33 33
drivers/media/i2c/adv7343.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
28#include <linux/of.h>28#include <linux/of.h>
29#include <linux/of_graph.h>29#include <linux/of_graph.h>
30 30
31#include <media/adv7343.h>31#include <media/i2c/adv7343.h>
32#include <media/v4l2-async.h>32#include <media/v4l2-async.h>
33#include <media/v4l2-device.h>33#include <media/v4l2-device.h>
34#include <media/v4l2-ctrls.h>34#include <media/v4l2-ctrls.h>
drivers/media/i2c/adv7393.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <linux/videodev2.h>31#include <linux/videodev2.h>
32#include <linux/uaccess.h>32#include <linux/uaccess.h>
33 33
34#include <media/adv7393.h>34#include <media/i2c/adv7393.h>
35#include <media/v4l2-device.h>35#include <media/v4l2-device.h>
36#include <media/v4l2-ctrls.h>36#include <media/v4l2-ctrls.h>
37 37
drivers/media/i2c/adv7511.c+2−2
@@ -32,7 +32,7 @@ · 31 unmodified lines
32#include <media/v4l2-common.h>32#include <media/v4l2-common.h>
33#include <media/v4l2-ctrls.h>33#include <media/v4l2-ctrls.h>
34#include <media/v4l2-dv-timings.h>34#include <media/v4l2-dv-timings.h>
35#include <media/adv7511.h>35#include <media/i2c/adv7511.h>
36 36
37static int debug;37static int debug;
38module_param(debug, int, 0644);38module_param(debug, int, 0644);
@@ -1116,7 +1116,7 @@ static int adv7511_set_fmt(struct v4l2_subdev *sd, · 1077 unmodified lines
1116 adv7511_wr_and_or(sd, 0x55, 0x9f, y << 5);1116 adv7511_wr_and_or(sd, 0x55, 0x9f, y << 5);
1117 adv7511_wr_and_or(sd, 0x56, 0x3f, c << 6);1117 adv7511_wr_and_or(sd, 0x56, 0x3f, c << 6);
1118 adv7511_wr_and_or(sd, 0x57, 0x83, (ec << 4) | (q << 2));1118 adv7511_wr_and_or(sd, 0x57, 0x83, (ec << 4) | (q << 2));
1119 adv7511_wr_and_or(sd, 0x59, 0x0f, yq << 4);1119 adv7511_wr_and_or(sd, 0x59, 0x3f, yq << 6);
1120 adv7511_wr_and_or(sd, 0x4a, 0xff, 1);1120 adv7511_wr_and_or(sd, 0x4a, 0xff, 1);
1121 1121
1122 return 0;1122 return 0;
drivers/media/i2c/adv7604.c+4−4
@@ -39,7 +39,7 @@ · 38 unmodified lines
39#include <linux/workqueue.h>39#include <linux/workqueue.h>
40#include <linux/regmap.h>40#include <linux/regmap.h>
41 41
42#include <media/adv7604.h>42#include <media/i2c/adv7604.h>
43#include <media/v4l2-ctrls.h>43#include <media/v4l2-ctrls.h>
44#include <media/v4l2-device.h>44#include <media/v4l2-device.h>
45#include <media/v4l2-event.h>45#include <media/v4l2-event.h>
@@ -905,7 +905,7 @@ static int find_and_set_predefined_video_timings(struct v4l2_subdev *sd, · 859 unmodified lines
905 905
906 for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {906 for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {
907 if (!v4l2_match_dv_timings(timings, &predef_vid_timings[i].timings,907 if (!v4l2_match_dv_timings(timings, &predef_vid_timings[i].timings,
908 is_digital_input(sd) ? 250000 : 1000000))908 is_digital_input(sd) ? 250000 : 1000000, false))
909 continue;909 continue;
910 io_write(sd, 0x00, predef_vid_timings[i].vid_std); /* video std */910 io_write(sd, 0x00, predef_vid_timings[i].vid_std); /* video std */
911 io_write(sd, 0x01, (predef_vid_timings[i].v_freq << 4) +911 io_write(sd, 0x01, (predef_vid_timings[i].v_freq << 4) +
@@ -1479,7 +1479,7 @@ static void adv76xx_fill_optional_dv_timings_fields(struct v4l2_subdev *sd, · 567 unmodified lines
1479 1479
1480 for (i = 0; adv76xx_timings[i].bt.width; i++) {1480 for (i = 0; adv76xx_timings[i].bt.width; i++) {
1481 if (v4l2_match_dv_timings(timings, &adv76xx_timings[i],1481 if (v4l2_match_dv_timings(timings, &adv76xx_timings[i],
1482 is_digital_input(sd) ? 250000 : 1000000)) {1482 is_digital_input(sd) ? 250000 : 1000000, false)) {
1483 *timings = adv76xx_timings[i];1483 *timings = adv76xx_timings[i];
1484 break;1484 break;
1485 }1485 }
@@ -1644,7 +1644,7 @@ static int adv76xx_s_dv_timings(struct v4l2_subdev *sd, · 158 unmodified lines
1644 if (!timings)1644 if (!timings)
1645 return -EINVAL;1645 return -EINVAL;
1646 1646
1647 if (v4l2_match_dv_timings(&state->timings, timings, 0)) {1647 if (v4l2_match_dv_timings(&state->timings, timings, 0, false)) {
1648 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);1648 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
1649 return 0;1649 return 0;
1650 }1650 }
drivers/media/i2c/adv7842.c+4−4
@@ -43,7 +43,7 @@ · 42 unmodified lines
43#include <media/v4l2-event.h>43#include <media/v4l2-event.h>
44#include <media/v4l2-ctrls.h>44#include <media/v4l2-ctrls.h>
45#include <media/v4l2-dv-timings.h>45#include <media/v4l2-dv-timings.h>
46#include <media/adv7842.h>46#include <media/i2c/adv7842.h>
47 47
48static int debug;48static int debug;
49module_param(debug, int, 0644);49module_param(debug, int, 0644);
@@ -155,7 +155,7 @@ static bool adv7842_check_dv_timings(const struct v4l2_dv_timings *t, void *hdl) · 105 unmodified lines
155 int i;155 int i;
156 156
157 for (i = 0; adv7842_timings_exceptions[i].bt.width; i++)157 for (i = 0; adv7842_timings_exceptions[i].bt.width; i++)
158 if (v4l2_match_dv_timings(t, adv7842_timings_exceptions + i, 0))158 if (v4l2_match_dv_timings(t, adv7842_timings_exceptions + i, 0, false))
159 return false;159 return false;
160 return true;160 return true;
161}161}
@@ -1008,7 +1008,7 @@ static int find_and_set_predefined_video_timings(struct v4l2_subdev *sd, · 846 unmodified lines
1008 1008
1009 for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {1009 for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {
1010 if (!v4l2_match_dv_timings(timings, &predef_vid_timings[i].timings,1010 if (!v4l2_match_dv_timings(timings, &predef_vid_timings[i].timings,
1011 is_digital_input(sd) ? 250000 : 1000000))1011 is_digital_input(sd) ? 250000 : 1000000, false))
1012 continue;1012 continue;
1013 /* video std */1013 /* video std */
1014 io_write(sd, 0x00, predef_vid_timings[i].vid_std);1014 io_write(sd, 0x00, predef_vid_timings[i].vid_std);
@@ -1659,7 +1659,7 @@ static int adv7842_s_dv_timings(struct v4l2_subdev *sd, · 644 unmodified lines
1659 if (state->mode == ADV7842_MODE_SDP)1659 if (state->mode == ADV7842_MODE_SDP)
1660 return -ENODATA;1660 return -ENODATA;
1661 1661
1662 if (v4l2_match_dv_timings(&state->timings, timings, 0)) {1662 if (v4l2_match_dv_timings(&state->timings, timings, 0, false)) {
1663 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);1663 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
1664 return 0;1664 return 0;
1665 }1665 }
drivers/media/i2c/ak881x.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
15#include <linux/videodev2.h>15#include <linux/videodev2.h>
16#include <linux/module.h>16#include <linux/module.h>
17 17
18#include <media/ak881x.h>18#include <media/i2c/ak881x.h>
19#include <media/v4l2-common.h>19#include <media/v4l2-common.h>
20#include <media/v4l2-device.h>20#include <media/v4l2-device.h>
21 21
drivers/media/i2c/as3645a.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <linux/mutex.h>31#include <linux/mutex.h>
32#include <linux/slab.h>32#include <linux/slab.h>
33 33
34#include <media/as3645a.h>34#include <media/i2c/as3645a.h>
35#include <media/v4l2-ctrls.h>35#include <media/v4l2-ctrls.h>
36#include <media/v4l2-device.h>36#include <media/v4l2-device.h>
37 37
drivers/media/i2c/bt819.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
37#include <linux/slab.h>37#include <linux/slab.h>
38#include <media/v4l2-device.h>38#include <media/v4l2-device.h>
39#include <media/v4l2-ctrls.h>39#include <media/v4l2-ctrls.h>
40#include <media/bt819.h>40#include <media/i2c/bt819.h>
41 41
42MODULE_DESCRIPTION("Brooktree-819 video decoder driver");42MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
43MODULE_AUTHOR("Mike Bernson & Dave Perks");43MODULE_AUTHOR("Mike Bernson & Dave Perks");
drivers/media/i2c/cs3308.c+138−0
@@ -0,0 +1,138 @@
1/*
2 * Cirrus Logic cs3308 8-Channel Analog Volume Control
3 *
4 * Copyright (C) 2010 Devin Heitmueller <dheitmueller@kernellabs.com>
5 * Copyright (C) 2012 Steven Toth <stoth@kernellabs.com>
6 *
7 * Derived from cs5345.c Copyright (C) 2007 Hans Verkuil
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 as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20
21#include <linux/module.h>
22#include <linux/kernel.h>
23#include <linux/i2c.h>
24#include <linux/slab.h>
25#include <linux/videodev2.h>
26#include <media/v4l2-device.h>
27
28MODULE_DESCRIPTION("i2c device driver for cs3308 8-channel volume control");
29MODULE_AUTHOR("Devin Heitmueller");
30MODULE_LICENSE("GPL");
31
32static inline int cs3308_write(struct v4l2_subdev *sd, u8 reg, u8 value)
33{
34 struct i2c_client *client = v4l2_get_subdevdata(sd);
35
36 return i2c_smbus_write_byte_data(client, reg, value);
37}
38
39static inline int cs3308_read(struct v4l2_subdev *sd, u8 reg)
40{
41 struct i2c_client *client = v4l2_get_subdevdata(sd);
42
43 return i2c_smbus_read_byte_data(client, reg);
44}
45
46#ifdef CONFIG_VIDEO_ADV_DEBUG
47static int cs3308_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
48{
49 reg->val = cs3308_read(sd, reg->reg & 0xffff);
50 reg->size = 1;
51 return 0;
52}
53
54static int cs3308_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
55{
56 cs3308_write(sd, reg->reg & 0xffff, reg->val & 0xff);
57 return 0;
58}
59#endif
60
61/* ----------------------------------------------------------------------- */
62
63static const struct v4l2_subdev_core_ops cs3308_core_ops = {
64#ifdef CONFIG_VIDEO_ADV_DEBUG
65 .g_register = cs3308_g_register,
66 .s_register = cs3308_s_register,
67#endif
68};
69
70static const struct v4l2_subdev_ops cs3308_ops = {
71 .core = &cs3308_core_ops,
72};
73
74/* ----------------------------------------------------------------------- */
75
76static int cs3308_probe(struct i2c_client *client,
77 const struct i2c_device_id *id)
78{
79 struct v4l2_subdev *sd;
80 unsigned i;
81
82 /* Check if the adapter supports the needed features */
83 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
84 return -EIO;
85
86 if ((i2c_smbus_read_byte_data(client, 0x1c) & 0xf0) != 0xe0)
87 return -ENODEV;
88
89 v4l_info(client, "chip found @ 0x%x (%s)\n",
90 client->addr << 1, client->adapter->name);
91
92 sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
93 if (sd == NULL)
94 return -ENOMEM;
95
96 v4l2_i2c_subdev_init(sd, client, &cs3308_ops);
97
98 /* Set some reasonable defaults */
99 cs3308_write(sd, 0x0d, 0x00); /* Power up all channels */
100 cs3308_write(sd, 0x0e, 0x00); /* Master Power */
101 cs3308_write(sd, 0x0b, 0x00); /* Device Configuration */
102 /* Set volume for each channel */
103 for (i = 1; i <= 8; i++)
104 cs3308_write(sd, i, 0xd2);
105 cs3308_write(sd, 0x0a, 0x00); /* Unmute all channels */
106 return 0;
107}
108
109/* ----------------------------------------------------------------------- */
110
111static int cs3308_remove(struct i2c_client *client)
112{
113 struct v4l2_subdev *sd = i2c_get_clientdata(client);
114
115 v4l2_device_unregister_subdev(sd);
116 kfree(sd);
117 return 0;
118}
119
120/* ----------------------------------------------------------------------- */
121
122static const struct i2c_device_id cs3308_id[] = {
123 { "cs3308", 0 },
124 { }
125};
126MODULE_DEVICE_TABLE(i2c, cs3308_id);
127
128static struct i2c_driver cs3308_driver = {
129 .driver = {
130 .owner = THIS_MODULE,
131 .name = "cs3308",
132 },
133 .probe = cs3308_probe,
134 .remove = cs3308_remove,
135 .id_table = cs3308_id,
136};
137
138module_i2c_driver(cs3308_driver);
drivers/media/i2c/cx25840/cx25840-audio.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19#include <linux/videodev2.h>19#include <linux/videodev2.h>
20#include <linux/i2c.h>20#include <linux/i2c.h>
21#include <media/v4l2-common.h>21#include <media/v4l2-common.h>
22#include <media/cx25840.h>22#include <media/drv-intf/cx25840.h>
23 23
24#include "cx25840-core.h"24#include "cx25840-core.h"
25 25
drivers/media/i2c/cx25840/cx25840-core.c+61−56
@@ -45,7 +45,7 @@ · 44 unmodified lines
45#include <linux/delay.h>45#include <linux/delay.h>
46#include <linux/math64.h>46#include <linux/math64.h>
47#include <media/v4l2-common.h>47#include <media/v4l2-common.h>
48#include <media/cx25840.h>48#include <media/drv-intf/cx25840.h>
49 49
50#include "cx25840-core.h"50#include "cx25840-core.h"
51 51
@@ -559,7 +559,10 @@ static void cx23885_initialize(struct i2c_client *client) · 507 unmodified lines
559 cx25840_write4(client, 0x414, 0x00107d12);559 cx25840_write4(client, 0x414, 0x00107d12);
560 560
561 /* Chroma */561 /* Chroma */
562 cx25840_write4(client, 0x420, 0x3d008282);562 if (is_cx23888(state))
563 cx25840_write4(client, 0x418, 0x1d008282);
564 else
565 cx25840_write4(client, 0x420, 0x3d008282);
563 566
564 /*567 /*
565 * Aux PLL568 * Aux PLL
@@ -666,14 +669,17 @@ static void cx23885_initialize(struct i2c_client *client) · 100 unmodified lines
666 cx25840_write4(client, 0x404, 0x0010253e);669 cx25840_write4(client, 0x404, 0x0010253e);
667 670
668 /* CC on - Undocumented Register */671 /* CC on - Undocumented Register */
669 cx25840_write(client, 0x42f, 0x66);672 cx25840_write(client, state->vbi_regs_offset + 0x42f, 0x66);
670 673
671 /* HVR-1250 / HVR1850 DIF related */674 /* HVR-1250 / HVR1850 DIF related */
672 /* Power everything up */675 /* Power everything up */
673 cx25840_write4(client, 0x130, 0x0);676 cx25840_write4(client, 0x130, 0x0);
674 677
675 /* Undocumented */678 /* Undocumented */
676 cx25840_write4(client, 0x478, 0x6628021F);679 if (is_cx23888(state))
680 cx25840_write4(client, 0x454, 0x6628021F);
681 else
682 cx25840_write4(client, 0x478, 0x6628021F);
677 683
678 /* AFE_CLK_OUT_CTRL - Select the clock output source as output */684 /* AFE_CLK_OUT_CTRL - Select the clock output source as output */
679 cx25840_write4(client, 0x144, 0x5);685 cx25840_write4(client, 0x144, 0x5);
@@ -1106,31 +1112,15 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp · 426 unmodified lines
1106 cx25840_write4(client, 0x410, 0xffff0dbf);1112 cx25840_write4(client, 0x410, 0xffff0dbf);
1107 cx25840_write4(client, 0x414, 0x00137d03);1113 cx25840_write4(client, 0x414, 0x00137d03);
1108 1114
1109 /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is 1115 cx25840_write4(client, state->vbi_regs_offset + 0x42c, 0x42600000);
1110 CHROMA_CTRL */1116 cx25840_write4(client, state->vbi_regs_offset + 0x430, 0x0000039b);
1111 if (is_cx23888(state))1117 cx25840_write4(client, state->vbi_regs_offset + 0x438, 0x00000000);
1112 cx25840_write4(client, 0x418, 0x01008080);
1113 else
1114 cx25840_write4(client, 0x418, 0x01000000);
1115 1118
1116 cx25840_write4(client, 0x41c, 0x00000000);1119 cx25840_write4(client, state->vbi_regs_offset + 0x440, 0xF8E3E824);
1117 1120 cx25840_write4(client, state->vbi_regs_offset + 0x444, 0x401040dc);
1118 /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is 1121 cx25840_write4(client, state->vbi_regs_offset + 0x448, 0xcd3f02a0);
1119 CRUSH_CTRL */1122 cx25840_write4(client, state->vbi_regs_offset + 0x44c, 0x161f1000);
1120 if (is_cx23888(state))1123 cx25840_write4(client, state->vbi_regs_offset + 0x450, 0x00000802);
1121 cx25840_write4(client, 0x420, 0x001c3e0f);
1122 else
1123 cx25840_write4(client, 0x420, 0x001c8282);
1124
1125 cx25840_write4(client, 0x42c, 0x42600000);
1126 cx25840_write4(client, 0x430, 0x0000039b);
1127 cx25840_write4(client, 0x438, 0x00000000);
1128
1129 cx25840_write4(client, 0x440, 0xF8E3E824);
1130 cx25840_write4(client, 0x444, 0x401040dc);
1131 cx25840_write4(client, 0x448, 0xcd3f02a0);
1132 cx25840_write4(client, 0x44c, 0x161f1000);
1133 cx25840_write4(client, 0x450, 0x00000802);
1134 1124
1135 cx25840_write4(client, 0x91c, 0x01000000);1125 cx25840_write4(client, 0x91c, 0x01000000);
1136 cx25840_write4(client, 0x8e0, 0x03063870);1126 cx25840_write4(client, 0x8e0, 0x03063870);
@@ -1400,8 +1390,14 @@ static int cx25840_set_fmt(struct v4l2_subdev *sd, · 263 unmodified lines
1400 1390
1401 Vlines = fmt->height + (is_50Hz ? 4 : 7);1391 Vlines = fmt->height + (is_50Hz ? 4 : 7);
1402 1392
1393 /*
1394 * We keep 1 margin for the Vsrc < Vlines check since the
1395 * cx23888 reports a Vsrc of 486 instead of 487 for the NTSC
1396 * height. Without that margin the cx23885 fails in this
1397 * check.
1398 */
1403 if ((fmt->width * 16 < Hsrc) || (Hsrc < fmt->width) ||1399 if ((fmt->width * 16 < Hsrc) || (Hsrc < fmt->width) ||
1404 (Vlines * 8 < Vsrc) || (Vsrc < Vlines)) {1400 (Vlines * 8 < Vsrc) || (Vsrc + 1 < Vlines)) {
1405 v4l_err(client, "%dx%d is not a valid size!\n",1401 v4l_err(client, "%dx%d is not a valid size!\n",
1406 fmt->width, fmt->height);1402 fmt->width, fmt->height);
1407 return -ERANGE;1403 return -ERANGE;
@@ -1426,14 +1422,20 @@ static int cx25840_set_fmt(struct v4l2_subdev *sd, · 18 unmodified lines
1426 fmt->width, fmt->height, HSC, VSC);1422 fmt->width, fmt->height, HSC, VSC);
1427 1423
1428 /* HSCALE=HSC */1424 /* HSCALE=HSC */
1429 cx25840_write(client, 0x418, HSC & 0xff);1425 if (is_cx23888(state)) {
1430 cx25840_write(client, 0x419, (HSC >> 8) & 0xff);1426 cx25840_write4(client, 0x434, HSC | (1 << 24));
1431 cx25840_write(client, 0x41a, HSC >> 16);1427 /* VSCALE=VSC VS_INTRLACE=1 VFILT=filter */
1432 /* VSCALE=VSC */1428 cx25840_write4(client, 0x438, VSC | (1 << 19) | (filter << 16));
1433 cx25840_write(client, 0x41c, VSC & 0xff);1429 } else {
1434 cx25840_write(client, 0x41d, VSC >> 8);1430 cx25840_write(client, 0x418, HSC & 0xff);
1435 /* VS_INTRLACE=1 VFILT=filter */1431 cx25840_write(client, 0x419, (HSC >> 8) & 0xff);
1436 cx25840_write(client, 0x41e, 0x8 | filter);1432 cx25840_write(client, 0x41a, HSC >> 16);
1433 /* VSCALE=VSC */
1434 cx25840_write(client, 0x41c, VSC & 0xff);
1435 cx25840_write(client, 0x41d, VSC >> 8);
1436 /* VS_INTRLACE=1 VFILT=filter */
1437 cx25840_write(client, 0x41e, 0x8 | filter);
1438 }
1437 return 0;1439 return 0;
1438}1440}
1439 1441
@@ -1714,26 +1716,27 @@ static int cx25840_s_stream(struct v4l2_subdev *sd, int enable) · 274 unmodified lines
1714 1716
1715 v4l_dbg(1, cx25840_debug, client, "%s video output\n",1717 v4l_dbg(1, cx25840_debug, client, "%s video output\n",
1716 enable ? "enable" : "disable");1718 enable ? "enable" : "disable");
1719
1720 /*
1721 * It's not clear what should be done for these devices.
1722 * The original code used the same addresses as for the cx25840, but
1723 * those addresses do something else entirely on the cx2388x and
1724 * cx231xx. Since it never did anything in the first place, just do
1725 * nothing.
1726 */
1727 if (is_cx2388x(state) || is_cx231xx(state))
1728 return 0;
1729
1717 if (enable) {1730 if (enable) {
1718 if (is_cx2388x(state) || is_cx231xx(state)) {1731 v = cx25840_read(client, 0x115) | 0x0c;
1719 v = cx25840_read(client, 0x421) | 0x0b;1732 cx25840_write(client, 0x115, v);
1720 cx25840_write(client, 0x421, v);1733 v = cx25840_read(client, 0x116) | 0x04;
1721 } else {1734 cx25840_write(client, 0x116, v);
1722 v = cx25840_read(client, 0x115) | 0x0c;
1723 cx25840_write(client, 0x115, v);
1724 v = cx25840_read(client, 0x116) | 0x04;
1725 cx25840_write(client, 0x116, v);
1726 }
1727 } else {1735 } else {
1728 if (is_cx2388x(state) || is_cx231xx(state)) {1736 v = cx25840_read(client, 0x115) & ~(0x0c);
1729 v = cx25840_read(client, 0x421) & ~(0x0b);1737 cx25840_write(client, 0x115, v);
1730 cx25840_write(client, 0x421, v);1738 v = cx25840_read(client, 0x116) & ~(0x04);
1731 } else {1739 cx25840_write(client, 0x116, v);
1732 v = cx25840_read(client, 0x115) & ~(0x0c);
1733 cx25840_write(client, 0x115, v);
1734 v = cx25840_read(client, 0x116) & ~(0x04);
1735 cx25840_write(client, 0x116, v);
1736 }
1737 }1740 }
1738 return 0;1741 return 0;
1739}1742}
@@ -4974,7 +4977,7 @@ static void cx23888_std_setup(struct i2c_client *client) · 3234 unmodified lines
4974 cx25840_write4(client, 0x4b4, 0x20524030);4977 cx25840_write4(client, 0x4b4, 0x20524030);
4975 cx25840_write4(client, 0x47c, 0x010a8263);4978 cx25840_write4(client, 0x47c, 0x010a8263);
4976 4979
4977 if (std & V4L2_STD_NTSC) {4980 if (std & V4L2_STD_525_60) {
4978 v4l_dbg(1, cx25840_debug, client, "%s() Selecting NTSC",4981 v4l_dbg(1, cx25840_debug, client, "%s() Selecting NTSC",
4979 __func__);4982 __func__);
4980 4983
@@ -5264,6 +5267,8 @@ static int cx25840_probe(struct i2c_client *client, · 283 unmodified lines
5264 state->vbi_line_offset = 8;5267 state->vbi_line_offset = 8;
5265 state->id = id;5268 state->id = id;
5266 state->rev = device_id;5269 state->rev = device_id;
5270 state->vbi_regs_offset = id == CX23888_AV ? 0x500 - 0x424 : 0;
5271 state->std = V4L2_STD_NTSC_M;
5267 v4l2_ctrl_handler_init(&state->hdl, 9);5272 v4l2_ctrl_handler_init(&state->hdl, 9);
5268 v4l2_ctrl_new_std(&state->hdl, &cx25840_ctrl_ops,5273 v4l2_ctrl_new_std(&state->hdl, &cx25840_ctrl_ops,
5269 V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);5274 V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
drivers/media/i2c/cx25840/cx25840-core.h+1−0
@@ -69,6 +69,7 @@ struct cx25840_state { · 68 unmodified lines
69 enum cx25840_model id;69 enum cx25840_model id;
70 u32 rev;70 u32 rev;
71 int is_initialized;71 int is_initialized;
72 unsigned vbi_regs_offset;
72 wait_queue_head_t fw_wait; /* wake up when the fw load is finished */73 wait_queue_head_t fw_wait; /* wake up when the fw load is finished */
73 struct work_struct fw_work; /* work entry for fw load */74 struct work_struct fw_work; /* work entry for fw load */
74 struct cx25840_ir_state *ir_state;75 struct cx25840_ir_state *ir_state;
drivers/media/i2c/cx25840/cx25840-firmware.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19#include <linux/i2c.h>19#include <linux/i2c.h>
20#include <linux/firmware.h>20#include <linux/firmware.h>
21#include <media/v4l2-common.h>21#include <media/v4l2-common.h>
22#include <media/cx25840.h>22#include <media/drv-intf/cx25840.h>
23 23
24#include "cx25840-core.h"24#include "cx25840-core.h"
25 25
drivers/media/i2c/cx25840/cx25840-ir.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
24#include <linux/slab.h>24#include <linux/slab.h>
25#include <linux/kfifo.h>25#include <linux/kfifo.h>
26#include <linux/module.h>26#include <linux/module.h>
27#include <media/cx25840.h>27#include <media/drv-intf/cx25840.h>
28#include <media/rc-core.h>28#include <media/rc-core.h>
29 29
30#include "cx25840-core.h"30#include "cx25840-core.h"
drivers/media/i2c/cx25840/cx25840-vbi.c+24−10
@@ -19,7 +19,7 @@ · 18 unmodified lines
19#include <linux/videodev2.h>19#include <linux/videodev2.h>
20#include <linux/i2c.h>20#include <linux/i2c.h>
21#include <media/v4l2-common.h>21#include <media/v4l2-common.h>
22#include <media/cx25840.h>22#include <media/drv-intf/cx25840.h>
23 23
24#include "cx25840-core.h"24#include "cx25840-core.h"
25 25
@@ -104,7 +104,8 @@ int cx25840_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format * · 78 unmodified lines
104 104
105 if (is_pal) {105 if (is_pal) {
106 for (i = 7; i <= 23; i++) {106 for (i = 7; i <= 23; i++) {
107 u8 v = cx25840_read(client, 0x424 + i - 7);107 u8 v = cx25840_read(client,
108 state->vbi_regs_offset + 0x424 + i - 7);
108 109
109 svbi->service_lines[0][i] = lcr2vbi[v >> 4];110 svbi->service_lines[0][i] = lcr2vbi[v >> 4];
110 svbi->service_lines[1][i] = lcr2vbi[v & 0xf];111 svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
@@ -113,7 +114,8 @@ int cx25840_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format * · 2 unmodified lines
113 }114 }
114 } else {115 } else {
115 for (i = 10; i <= 21; i++) {116 for (i = 10; i <= 21; i++) {
116 u8 v = cx25840_read(client, 0x424 + i - 10);117 u8 v = cx25840_read(client,
118 state->vbi_regs_offset + 0x424 + i - 10);
117 119
118 svbi->service_lines[0][i] = lcr2vbi[v >> 4];120 svbi->service_lines[0][i] = lcr2vbi[v >> 4];
119 svbi->service_lines[1][i] = lcr2vbi[v & 0xf];121 svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
@@ -135,7 +137,10 @@ int cx25840_s_raw_fmt(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt) · 15 unmodified lines
135 cx25840_std_setup(client);137 cx25840_std_setup(client);
136 138
137 /* VBI Offset */139 /* VBI Offset */
138 cx25840_write(client, 0x47f, vbi_offset);140 if (is_cx23888(state))
141 cx25840_write(client, 0x54f, vbi_offset);
142 else
143 cx25840_write(client, 0x47f, vbi_offset);
139 cx25840_write(client, 0x404, 0x2e);144 cx25840_write(client, 0x404, 0x2e);
140 return 0;145 return 0;
141}146}
@@ -158,7 +163,10 @@ int cx25840_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format * · 16 unmodified lines
158 /* Sliced VBI */163 /* Sliced VBI */
159 cx25840_write(client, 0x404, 0x32); /* Ancillary data */164 cx25840_write(client, 0x404, 0x32); /* Ancillary data */
160 cx25840_write(client, 0x406, 0x13);165 cx25840_write(client, 0x406, 0x13);
161 cx25840_write(client, 0x47f, vbi_offset);166 if (is_cx23888(state))
167 cx25840_write(client, 0x54f, vbi_offset);
168 else
169 cx25840_write(client, 0x47f, vbi_offset);
162 170
163 if (is_pal) {171 if (is_pal) {
164 for (i = 0; i <= 6; i++)172 for (i = 0; i <= 6; i++)
@@ -194,17 +202,23 @@ int cx25840_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format * · 29 unmodified lines
194 }202 }
195 203
196 if (is_pal) {204 if (is_pal) {
197 for (x = 1, i = 0x424; i <= 0x434; i++, x++)205 for (x = 1, i = state->vbi_regs_offset + 0x424;
206 i <= state->vbi_regs_offset + 0x434; i++, x++)
198 cx25840_write(client, i, lcr[6 + x]);207 cx25840_write(client, i, lcr[6 + x]);
199 } else {208 } else {
200 for (x = 1, i = 0x424; i <= 0x430; i++, x++)209 for (x = 1, i = state->vbi_regs_offset + 0x424;
210 i <= state->vbi_regs_offset + 0x430; i++, x++)
201 cx25840_write(client, i, lcr[9 + x]);211 cx25840_write(client, i, lcr[9 + x]);
202 for (i = 0x431; i <= 0x434; i++)212 for (i = state->vbi_regs_offset + 0x431;
213 i <= state->vbi_regs_offset + 0x434; i++)
203 cx25840_write(client, i, 0);214 cx25840_write(client, i, 0);
204 }215 }
205 216
206 cx25840_write(client, 0x43c, 0x16);217 cx25840_write(client, state->vbi_regs_offset + 0x43c, 0x16);
207 cx25840_write(client, 0x474, is_pal ? 0x2a : 0x22);218 if (is_cx23888(state))
219 cx25840_write(client, 0x428, is_pal ? 0x2a : 0x22);
220 else
221 cx25840_write(client, 0x474, is_pal ? 0x2a : 0x22);
208 return 0;222 return 0;
209}223}
210 224
drivers/media/i2c/ir-kbd-i2c.c+1−1
@@ -47,7 +47,7 @@ · 46 unmodified lines
47#include <linux/workqueue.h>47#include <linux/workqueue.h>
48 48
49#include <media/rc-core.h>49#include <media/rc-core.h>
50#include <media/ir-kbd-i2c.h>50#include <media/i2c/ir-kbd-i2c.h>
51 51
52/* ----------------------------------------------------------------------- */52/* ----------------------------------------------------------------------- */
53/* insmod parameters */53/* insmod parameters */
drivers/media/i2c/lm3560.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
24#include <linux/mutex.h>24#include <linux/mutex.h>
25#include <linux/regmap.h>25#include <linux/regmap.h>
26#include <linux/videodev2.h>26#include <linux/videodev2.h>
27#include <media/lm3560.h>27#include <media/i2c/lm3560.h>
28#include <media/v4l2-ctrls.h>28#include <media/v4l2-ctrls.h>
29#include <media/v4l2-device.h>29#include <media/v4l2-device.h>
30 30
drivers/media/i2c/lm3646.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
18#include <linux/slab.h>18#include <linux/slab.h>
19#include <linux/regmap.h>19#include <linux/regmap.h>
20#include <linux/videodev2.h>20#include <linux/videodev2.h>
21#include <media/lm3646.h>21#include <media/i2c/lm3646.h>
22#include <media/v4l2-ctrls.h>22#include <media/v4l2-ctrls.h>
23#include <media/v4l2-device.h>23#include <media/v4l2-device.h>
24 24
drivers/media/i2c/m52790.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include <asm/uaccess.h>27#include <asm/uaccess.h>
28#include <linux/i2c.h>28#include <linux/i2c.h>
29#include <linux/videodev2.h>29#include <linux/videodev2.h>
30#include <media/m52790.h>30#include <media/i2c/m52790.h>
31#include <media/v4l2-device.h>31#include <media/v4l2-device.h>
32 32
33MODULE_DESCRIPTION("i2c device driver for m52790 A/V switch");33MODULE_DESCRIPTION("i2c device driver for m52790 A/V switch");
drivers/media/i2c/m5mols/m5mols_capture.c+2−2
@@ -25,8 +25,8 @@ · 24 unmodified lines
25#include <media/v4l2-ctrls.h>25#include <media/v4l2-ctrls.h>
26#include <media/v4l2-device.h>26#include <media/v4l2-device.h>
27#include <media/v4l2-subdev.h>27#include <media/v4l2-subdev.h>
28#include <media/m5mols.h>28#include <media/i2c/m5mols.h>
29#include <media/exynos-fimc.h>29#include <media/drv-intf/exynos-fimc.h>
30 30
31#include "m5mols.h"31#include "m5mols.h"
32#include "m5mols_reg.h"32#include "m5mols_reg.h"
drivers/media/i2c/m5mols/m5mols_core.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include <media/v4l2-ctrls.h>25#include <media/v4l2-ctrls.h>
26#include <media/v4l2-device.h>26#include <media/v4l2-device.h>
27#include <media/v4l2-subdev.h>27#include <media/v4l2-subdev.h>
28#include <media/m5mols.h>28#include <media/i2c/m5mols.h>
29 29
30#include "m5mols.h"30#include "m5mols.h"
31#include "m5mols_reg.h"31#include "m5mols_reg.h"
drivers/media/i2c/msp3400-driver.c+2−2
@@ -56,8 +56,8 @@ · 55 unmodified lines
56#include <linux/videodev2.h>56#include <linux/videodev2.h>
57#include <media/v4l2-device.h>57#include <media/v4l2-device.h>
58#include <media/v4l2-ioctl.h>58#include <media/v4l2-ioctl.h>
59#include <media/msp3400.h>59#include <media/drv-intf/msp3400.h>
60#include <media/tvaudio.h>60#include <media/i2c/tvaudio.h>
61#include "msp3400-driver.h"61#include "msp3400-driver.h"
62 62
63/* ---------------------------------------------------------------------- */63/* ---------------------------------------------------------------------- */
drivers/media/i2c/msp3400-driver.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
4#ifndef MSP3400_DRIVER_H4#ifndef MSP3400_DRIVER_H
5#define MSP3400_DRIVER_H5#define MSP3400_DRIVER_H
6 6
7#include <media/msp3400.h>7#include <media/drv-intf/msp3400.h>
8#include <media/v4l2-device.h>8#include <media/v4l2-device.h>
9#include <media/v4l2-ctrls.h>9#include <media/v4l2-ctrls.h>
10 10
drivers/media/i2c/msp3400-kthreads.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include <linux/freezer.h>26#include <linux/freezer.h>
27#include <linux/videodev2.h>27#include <linux/videodev2.h>
28#include <media/v4l2-common.h>28#include <media/v4l2-common.h>
29#include <media/msp3400.h>29#include <media/drv-intf/msp3400.h>
30#include <linux/kthread.h>30#include <linux/kthread.h>
31#include <linux/suspend.h>31#include <linux/suspend.h>
32#include "msp3400-driver.h"32#include "msp3400-driver.h"
drivers/media/i2c/mt9m032.c+2−2
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <linux/v4l2-mediabus.h>31#include <linux/v4l2-mediabus.h>
32 32
33#include <media/media-entity.h>33#include <media/media-entity.h>
34#include <media/mt9m032.h>34#include <media/i2c/mt9m032.h>
35#include <media/v4l2-ctrls.h>35#include <media/v4l2-ctrls.h>
36#include <media/v4l2-device.h>36#include <media/v4l2-device.h>
37#include <media/v4l2-subdev.h>37#include <media/v4l2-subdev.h>
@@ -671,7 +671,7 @@ static int mt9m032_set_ctrl(struct v4l2_ctrl *ctrl) · 633 unmodified lines
671 return 0;671 return 0;
672}672}
673 673
674static struct v4l2_ctrl_ops mt9m032_ctrl_ops = {674static const struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
675 .s_ctrl = mt9m032_set_ctrl,675 .s_ctrl = mt9m032_set_ctrl,
676 .try_ctrl = mt9m032_try_ctrl,676 .try_ctrl = mt9m032_try_ctrl,
677};677};
drivers/media/i2c/mt9p031.c+2−2
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include <linux/slab.h>26#include <linux/slab.h>
27#include <linux/videodev2.h>27#include <linux/videodev2.h>
28 28
29#include <media/mt9p031.h>29#include <media/i2c/mt9p031.h>
30#include <media/v4l2-async.h>30#include <media/v4l2-async.h>
31#include <media/v4l2-ctrls.h>31#include <media/v4l2-ctrls.h>
32#include <media/v4l2-device.h>32#include <media/v4l2-device.h>
@@ -817,7 +817,7 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl) · 784 unmodified lines
817 return 0;817 return 0;
818}818}
819 819
820static struct v4l2_ctrl_ops mt9p031_ctrl_ops = {820static const struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
821 .s_ctrl = mt9p031_s_ctrl,821 .s_ctrl = mt9p031_s_ctrl,
822};822};
823 823
drivers/media/i2c/mt9t001.c+2−2
@@ -21,7 +21,7 @@ · 20 unmodified lines
21#include <linux/videodev2.h>21#include <linux/videodev2.h>
22#include <linux/v4l2-mediabus.h>22#include <linux/v4l2-mediabus.h>
23 23
24#include <media/mt9t001.h>24#include <media/i2c/mt9t001.h>
25#include <media/v4l2-ctrls.h>25#include <media/v4l2-ctrls.h>
26#include <media/v4l2-device.h>26#include <media/v4l2-device.h>
27#include <media/v4l2-subdev.h>27#include <media/v4l2-subdev.h>
@@ -626,7 +626,7 @@ static int mt9t001_s_ctrl(struct v4l2_ctrl *ctrl) · 598 unmodified lines
626 return 0;626 return 0;
627}627}
628 628
629static struct v4l2_ctrl_ops mt9t001_ctrl_ops = {629static const struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
630 .s_ctrl = mt9t001_s_ctrl,630 .s_ctrl = mt9t001_s_ctrl,
631};631};
632 632
drivers/media/i2c/mt9v011.c+2−2
@@ -13,7 +13,7 @@ · 12 unmodified lines
13#include <asm/div64.h>13#include <asm/div64.h>
14#include <media/v4l2-device.h>14#include <media/v4l2-device.h>
15#include <media/v4l2-ctrls.h>15#include <media/v4l2-ctrls.h>
16#include <media/mt9v011.h>16#include <media/i2c/mt9v011.h>
17 17
18MODULE_DESCRIPTION("Micron mt9v011 sensor driver");18MODULE_DESCRIPTION("Micron mt9v011 sensor driver");
19MODULE_AUTHOR("Mauro Carvalho Chehab");19MODULE_AUTHOR("Mauro Carvalho Chehab");
@@ -454,7 +454,7 @@ static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl) · 434 unmodified lines
454 return 0;454 return 0;
455}455}
456 456
457static struct v4l2_ctrl_ops mt9v011_ctrl_ops = {457static const struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
458 .s_ctrl = mt9v011_s_ctrl,458 .s_ctrl = mt9v011_s_ctrl,
459};459};
460 460
drivers/media/i2c/mt9v032.c+2−2
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include <linux/v4l2-mediabus.h>25#include <linux/v4l2-mediabus.h>
26#include <linux/module.h>26#include <linux/module.h>
27 27
28#include <media/mt9v032.h>28#include <media/i2c/mt9v032.h>
29#include <media/v4l2-ctrls.h>29#include <media/v4l2-ctrls.h>
30#include <media/v4l2-device.h>30#include <media/v4l2-device.h>
31#include <media/v4l2-of.h>31#include <media/v4l2-of.h>
@@ -703,7 +703,7 @@ static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl) · 671 unmodified lines
703 return 0;703 return 0;
704}704}
705 705
706static struct v4l2_ctrl_ops mt9v032_ctrl_ops = {706static const struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
707 .s_ctrl = mt9v032_s_ctrl,707 .s_ctrl = mt9v032_s_ctrl,
708};708};
709 709
drivers/media/i2c/noon010pc30.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
18#include <linux/i2c.h>18#include <linux/i2c.h>
19#include <linux/slab.h>19#include <linux/slab.h>
20#include <linux/regulator/consumer.h>20#include <linux/regulator/consumer.h>
21#include <media/noon010pc30.h>21#include <media/i2c/noon010pc30.h>
22#include <linux/videodev2.h>22#include <linux/videodev2.h>
23#include <linux/module.h>23#include <linux/module.h>
24#include <media/v4l2-ctrls.h>24#include <media/v4l2-ctrls.h>
drivers/media/i2c/ov2659.c+2−2
@@ -37,7 +37,7 @@ · 36 unmodified lines
37#include <linux/videodev2.h>37#include <linux/videodev2.h>
38 38
39#include <media/media-entity.h>39#include <media/media-entity.h>
40#include <media/ov2659.h>40#include <media/i2c/ov2659.h>
41#include <media/v4l2-common.h>41#include <media/v4l2-common.h>
42#include <media/v4l2-ctrls.h>42#include <media/v4l2-ctrls.h>
43#include <media/v4l2-device.h>43#include <media/v4l2-device.h>
@@ -1249,7 +1249,7 @@ static int ov2659_s_ctrl(struct v4l2_ctrl *ctrl) · 1205 unmodified lines
1249 return 0;1249 return 0;
1250}1250}
1251 1251
1252static struct v4l2_ctrl_ops ov2659_ctrl_ops = {1252static const struct v4l2_ctrl_ops ov2659_ctrl_ops = {
1253 .s_ctrl = ov2659_s_ctrl,1253 .s_ctrl = ov2659_s_ctrl,
1254};1254};
1255 1255
drivers/media/i2c/ov7670.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
20#include <media/v4l2-ctrls.h>20#include <media/v4l2-ctrls.h>
21#include <media/v4l2-mediabus.h>21#include <media/v4l2-mediabus.h>
22#include <media/v4l2-image-sizes.h>22#include <media/v4l2-image-sizes.h>
23#include <media/ov7670.h>23#include <media/i2c/ov7670.h>
24 24
25MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");25MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");
26MODULE_DESCRIPTION("A low-level driver for OmniVision ov7670 sensors");26MODULE_DESCRIPTION("A low-level driver for OmniVision ov7670 sensors");
drivers/media/i2c/ov9650.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include <media/v4l2-image-sizes.h>29#include <media/v4l2-image-sizes.h>
30#include <media/v4l2-subdev.h>30#include <media/v4l2-subdev.h>
31#include <media/v4l2-mediabus.h>31#include <media/v4l2-mediabus.h>
32#include <media/ov9650.h>32#include <media/i2c/ov9650.h>
33 33
34static int debug;34static int debug;
35module_param(debug, int, 0644);35module_param(debug, int, 0644);
drivers/media/i2c/s5c73m3/s5c73m3-core.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
34#include <media/v4l2-device.h>34#include <media/v4l2-device.h>
35#include <media/v4l2-subdev.h>35#include <media/v4l2-subdev.h>
36#include <media/v4l2-mediabus.h>36#include <media/v4l2-mediabus.h>
37#include <media/s5c73m3.h>37#include <media/i2c/s5c73m3.h>
38#include <media/v4l2-of.h>38#include <media/v4l2-of.h>
39 39
40#include "s5c73m3.h"40#include "s5c73m3.h"
drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
32#include <media/v4l2-device.h>32#include <media/v4l2-device.h>
33#include <media/v4l2-subdev.h>33#include <media/v4l2-subdev.h>
34#include <media/v4l2-mediabus.h>34#include <media/v4l2-mediabus.h>
35#include <media/s5c73m3.h>35#include <media/i2c/s5c73m3.h>
36 36
37#include "s5c73m3.h"37#include "s5c73m3.h"
38 38
drivers/media/i2c/s5c73m3/s5c73m3-spi.c+1−0
@@ -37,6 +37,7 @@ enum spi_direction { · 36 unmodified lines
37 SPI_DIR_RX,37 SPI_DIR_RX,
38 SPI_DIR_TX38 SPI_DIR_TX
39};39};
40MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids);
40 41
41static int spi_xmit(struct spi_device *spi_dev, void *addr, const int len,42static int spi_xmit(struct spi_device *spi_dev, void *addr, const int len,
42 enum spi_direction dir)43 enum spi_direction dir)
drivers/media/i2c/s5c73m3/s5c73m3.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
23#include <media/v4l2-common.h>23#include <media/v4l2-common.h>
24#include <media/v4l2-ctrls.h>24#include <media/v4l2-ctrls.h>
25#include <media/v4l2-subdev.h>25#include <media/v4l2-subdev.h>
26#include <media/s5c73m3.h>26#include <media/i2c/s5c73m3.h>
27 27
28#define DRIVER_NAME "S5C73M3"28#define DRIVER_NAME "S5C73M3"
29 29
drivers/media/i2c/s5k4ecgx.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include <asm/unaligned.h>27#include <asm/unaligned.h>
28 28
29#include <media/media-entity.h>29#include <media/media-entity.h>
30#include <media/s5k4ecgx.h>30#include <media/i2c/s5k4ecgx.h>
31#include <media/v4l2-ctrls.h>31#include <media/v4l2-ctrls.h>
32#include <media/v4l2-device.h>32#include <media/v4l2-device.h>
33#include <media/v4l2-mediabus.h>33#include <media/v4l2-mediabus.h>
drivers/media/i2c/s5k6aa.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
28#include <media/v4l2-device.h>28#include <media/v4l2-device.h>
29#include <media/v4l2-subdev.h>29#include <media/v4l2-subdev.h>
30#include <media/v4l2-mediabus.h>30#include <media/v4l2-mediabus.h>
31#include <media/s5k6aa.h>31#include <media/i2c/s5k6aa.h>
32 32
33static int debug;33static int debug;
34module_param(debug, int, 0644);34module_param(debug, int, 0644);
drivers/media/i2c/saa6588.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <linux/wait.h>31#include <linux/wait.h>
32#include <asm/uaccess.h>32#include <asm/uaccess.h>
33 33
34#include <media/saa6588.h>34#include <media/i2c/saa6588.h>
35#include <media/v4l2-device.h>35#include <media/v4l2-device.h>
36 36
37 37
drivers/media/i2c/saa7115.c+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
46#include <linux/videodev2.h>46#include <linux/videodev2.h>
47#include <media/v4l2-device.h>47#include <media/v4l2-device.h>
48#include <media/v4l2-ctrls.h>48#include <media/v4l2-ctrls.h>
49#include <media/saa7115.h>49#include <media/i2c/saa7115.h>
50#include <asm/div64.h>50#include <asm/div64.h>
51 51
52#define VRES_60HZ (480+16)52#define VRES_60HZ (480+16)
drivers/media/i2c/saa7127.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
54#include <linux/i2c.h>54#include <linux/i2c.h>
55#include <linux/videodev2.h>55#include <linux/videodev2.h>
56#include <media/v4l2-device.h>56#include <media/v4l2-device.h>
57#include <media/saa7127.h>57#include <media/i2c/saa7127.h>
58 58
59static int debug;59static int debug;
60static int test_image;60static int test_image;
drivers/media/i2c/smiapp/smiapp.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22#include <linux/mutex.h>22#include <linux/mutex.h>
23#include <media/v4l2-ctrls.h>23#include <media/v4l2-ctrls.h>
24#include <media/v4l2-subdev.h>24#include <media/v4l2-subdev.h>
25#include <media/smiapp.h>25#include <media/i2c/smiapp.h>
26 26
27#include "smiapp-pll.h"27#include "smiapp-pll.h"
28#include "smiapp-reg.h"28#include "smiapp-reg.h"
drivers/media/i2c/soc_camera/mt9m001.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
15#include <linux/module.h>15#include <linux/module.h>
16 16
17#include <media/soc_camera.h>17#include <media/soc_camera.h>
18#include <media/soc_mediabus.h>18#include <media/drv-intf/soc_mediabus.h>
19#include <media/v4l2-clk.h>19#include <media/v4l2-clk.h>
20#include <media/v4l2-subdev.h>20#include <media/v4l2-subdev.h>
21#include <media/v4l2-ctrls.h>21#include <media/v4l2-ctrls.h>
drivers/media/i2c/soc_camera/mt9t112.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include <linux/v4l2-mediabus.h>25#include <linux/v4l2-mediabus.h>
26#include <linux/videodev2.h>26#include <linux/videodev2.h>
27 27
28#include <media/mt9t112.h>28#include <media/i2c/mt9t112.h>
29#include <media/soc_camera.h>29#include <media/soc_camera.h>
30#include <media/v4l2-clk.h>30#include <media/v4l2-clk.h>
31#include <media/v4l2-common.h>31#include <media/v4l2-common.h>
drivers/media/i2c/soc_camera/mt9v022.c+2−2
@@ -15,9 +15,9 @@ · 14 unmodified lines
15#include <linux/log2.h>15#include <linux/log2.h>
16#include <linux/module.h>16#include <linux/module.h>
17 17
18#include <media/mt9v022.h>18#include <media/i2c/mt9v022.h>
19#include <media/soc_camera.h>19#include <media/soc_camera.h>
20#include <media/soc_mediabus.h>20#include <media/drv-intf/soc_mediabus.h>
21#include <media/v4l2-subdev.h>21#include <media/v4l2-subdev.h>
22#include <media/v4l2-clk.h>22#include <media/v4l2-clk.h>
23#include <media/v4l2-ctrls.h>23#include <media/v4l2-ctrls.h>
drivers/media/i2c/soc_camera/ov772x.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
24#include <linux/v4l2-mediabus.h>24#include <linux/v4l2-mediabus.h>
25#include <linux/videodev2.h>25#include <linux/videodev2.h>
26 26
27#include <media/ov772x.h>27#include <media/i2c/ov772x.h>
28#include <media/soc_camera.h>28#include <media/soc_camera.h>
29#include <media/v4l2-clk.h>29#include <media/v4l2-clk.h>
30#include <media/v4l2-ctrls.h>30#include <media/v4l2-ctrls.h>
drivers/media/i2c/soc_camera/rj54n1cb0c.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
15#include <linux/videodev2.h>15#include <linux/videodev2.h>
16#include <linux/module.h>16#include <linux/module.h>
17 17
18#include <media/rj54n1cb0c.h>18#include <media/i2c/rj54n1cb0c.h>
19#include <media/soc_camera.h>19#include <media/soc_camera.h>
20#include <media/v4l2-clk.h>20#include <media/v4l2-clk.h>
21#include <media/v4l2-subdev.h>21#include <media/v4l2-subdev.h>
drivers/media/i2c/soc_camera/tw9910.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include <linux/videodev2.h>26#include <linux/videodev2.h>
27 27
28#include <media/soc_camera.h>28#include <media/soc_camera.h>
29#include <media/tw9910.h>29#include <media/i2c/tw9910.h>
30#include <media/v4l2-clk.h>30#include <media/v4l2-clk.h>
31#include <media/v4l2-subdev.h>31#include <media/v4l2-subdev.h>
32 32
drivers/media/i2c/sr030pc30.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
24#include <media/v4l2-subdev.h>24#include <media/v4l2-subdev.h>
25#include <media/v4l2-mediabus.h>25#include <media/v4l2-mediabus.h>
26#include <media/v4l2-ctrls.h>26#include <media/v4l2-ctrls.h>
27#include <media/sr030pc30.h>27#include <media/i2c/sr030pc30.h>
28 28
29static int debug;29static int debug;
30module_param(debug, int, 0644);30module_param(debug, int, 0644);
drivers/media/i2c/tc358743.c+3−3
@@ -42,7 +42,7 @@ · 41 unmodified lines
42#include <media/v4l2-ctrls.h>42#include <media/v4l2-ctrls.h>
43#include <media/v4l2-event.h>43#include <media/v4l2-event.h>
44#include <media/v4l2-of.h>44#include <media/v4l2-of.h>
45#include <media/tc358743.h>45#include <media/i2c/tc358743.h>
46 46
47#include "tc358743_regs.h"47#include "tc358743_regs.h"
48 48
@@ -862,7 +862,7 @@ static void tc358743_format_change(struct v4l2_subdev *sd) · 813 unmodified lines
862 v4l2_dbg(1, debug, sd, "%s: Format changed. No signal\n",862 v4l2_dbg(1, debug, sd, "%s: Format changed. No signal\n",
863 __func__);863 __func__);
864 } else {864 } else {
865 if (!v4l2_match_dv_timings(&state->timings, &timings, 0))865 if (!v4l2_match_dv_timings(&state->timings, &timings, 0, false))
866 enable_stream(sd, false);866 enable_stream(sd, false);
867 867
868 v4l2_print_dv_timings(sd->name,868 v4l2_print_dv_timings(sd->name,
@@ -1366,7 +1366,7 @@ static int tc358743_s_dv_timings(struct v4l2_subdev *sd, · 497 unmodified lines
1366 v4l2_print_dv_timings(sd->name, "tc358743_s_dv_timings: ",1366 v4l2_print_dv_timings(sd->name, "tc358743_s_dv_timings: ",
1367 timings, false);1367 timings, false);
1368 1368
1369 if (v4l2_match_dv_timings(&state->timings, timings, 0)) {1369 if (v4l2_match_dv_timings(&state->timings, timings, 0, false)) {
1370 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);1370 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
1371 return 0;1371 return 0;
1372 }1372 }
drivers/media/i2c/ths7303.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include <linux/module.h>25#include <linux/module.h>
26#include <linux/slab.h>26#include <linux/slab.h>
27 27
28#include <media/ths7303.h>28#include <media/i2c/ths7303.h>
29#include <media/v4l2-device.h>29#include <media/v4l2-device.h>
30 30
31#define THS7303_CHANNEL_1 131#define THS7303_CHANNEL_1 1
drivers/media/i2c/tvaudio.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
36#include <linux/kthread.h>36#include <linux/kthread.h>
37#include <linux/freezer.h>37#include <linux/freezer.h>
38 38
39#include <media/tvaudio.h>39#include <media/i2c/tvaudio.h>
40#include <media/v4l2-device.h>40#include <media/v4l2-device.h>
41#include <media/v4l2-ctrls.h>41#include <media/v4l2-ctrls.h>
42 42
drivers/media/i2c/tvp514x.c+1−1
@@ -44,7 +44,7 @@ · 43 unmodified lines
44#include <media/v4l2-mediabus.h>44#include <media/v4l2-mediabus.h>
45#include <media/v4l2-of.h>45#include <media/v4l2-of.h>
46#include <media/v4l2-ctrls.h>46#include <media/v4l2-ctrls.h>
47#include <media/tvp514x.h>47#include <media/i2c/tvp514x.h>
48#include <media/media-entity.h>48#include <media/media-entity.h>
49 49
50#include "tvp514x_regs.h"50#include "tvp514x_regs.h"
drivers/media/i2c/tvp5150.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
12#include <linux/module.h>12#include <linux/module.h>
13#include <media/v4l2-async.h>13#include <media/v4l2-async.h>
14#include <media/v4l2-device.h>14#include <media/v4l2-device.h>
15#include <media/tvp5150.h>15#include <media/i2c/tvp5150.h>
16#include <media/v4l2-ctrls.h>16#include <media/v4l2-ctrls.h>
17 17
18#include "tvp5150_reg.h"18#include "tvp5150_reg.h"
drivers/media/i2c/tvp7002.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
32#include <linux/of.h>32#include <linux/of.h>
33#include <linux/of_graph.h>33#include <linux/of_graph.h>
34#include <linux/v4l2-dv-timings.h>34#include <linux/v4l2-dv-timings.h>
35#include <media/tvp7002.h>35#include <media/i2c/tvp7002.h>
36#include <media/v4l2-async.h>36#include <media/v4l2-async.h>
37#include <media/v4l2-device.h>37#include <media/v4l2-device.h>
38#include <media/v4l2-common.h>38#include <media/v4l2-common.h>
drivers/media/i2c/uda1342.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
20#include <linux/i2c.h>20#include <linux/i2c.h>
21#include <linux/videodev2.h>21#include <linux/videodev2.h>
22#include <media/v4l2-device.h>22#include <media/v4l2-device.h>
23#include <media/uda1342.h>23#include <media/i2c/uda1342.h>
24#include <linux/slab.h>24#include <linux/slab.h>
25 25
26static int write_reg(struct i2c_client *client, int reg, int value)26static int write_reg(struct i2c_client *client, int reg, int value)
drivers/media/i2c/upd64031a.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include <linux/videodev2.h>27#include <linux/videodev2.h>
28#include <linux/slab.h>28#include <linux/slab.h>
29#include <media/v4l2-device.h>29#include <media/v4l2-device.h>
30#include <media/upd64031a.h>30#include <media/i2c/upd64031a.h>
31 31
32/* --------------------- read registers functions define -------------------- */32/* --------------------- read registers functions define -------------------- */
33 33
drivers/media/i2c/upd64083.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include <linux/videodev2.h>27#include <linux/videodev2.h>
28#include <linux/slab.h>28#include <linux/slab.h>
29#include <media/v4l2-device.h>29#include <media/v4l2-device.h>
30#include <media/upd64083.h>30#include <media/i2c/upd64083.h>
31 31
32MODULE_DESCRIPTION("uPD64083 driver");32MODULE_DESCRIPTION("uPD64083 driver");
33MODULE_AUTHOR("T. Adachi, Takeru KOMORIYA, Hans Verkuil");33MODULE_AUTHOR("T. Adachi, Takeru KOMORIYA, Hans Verkuil");
drivers/media/i2c/wm8775.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
34#include <linux/videodev2.h>34#include <linux/videodev2.h>
35#include <media/v4l2-device.h>35#include <media/v4l2-device.h>
36#include <media/v4l2-ctrls.h>36#include <media/v4l2-ctrls.h>
37#include <media/wm8775.h>37#include <media/i2c/wm8775.h>
38 38
39MODULE_DESCRIPTION("wm8775 driver");39MODULE_DESCRIPTION("wm8775 driver");
40MODULE_AUTHOR("Ulf Eklund, Hans Verkuil");40MODULE_AUTHOR("Ulf Eklund, Hans Verkuil");
drivers/media/pci/bt8xx/bttv-cards.c+2−2
@@ -41,7 +41,7 @@ · 40 unmodified lines
41 41
42#include "bttvp.h"42#include "bttvp.h"
43#include <media/v4l2-common.h>43#include <media/v4l2-common.h>
44#include <media/tvaudio.h>44#include <media/i2c/tvaudio.h>
45#include "bttv-audio-hook.h"45#include "bttv-audio-hook.h"
46 46
47/* fwd decl */47/* fwd decl */
@@ -3808,7 +3808,7 @@ static void bttv_tea575x_set_direction(struct snd_tea575x *tea, bool output) · 3760 unmodified lines
3808 gpio_inout(mask, (1 << gpio.clk) | (1 << gpio.wren));3808 gpio_inout(mask, (1 << gpio.clk) | (1 << gpio.wren));
3809}3809}
3810 3810
3811static struct snd_tea575x_ops bttv_tea_ops = {3811static const struct snd_tea575x_ops bttv_tea_ops = {
3812 .set_pins = bttv_tea575x_set_pins,3812 .set_pins = bttv_tea575x_set_pins,
3813 .get_pins = bttv_tea575x_get_pins,3813 .get_pins = bttv_tea575x_get_pins,
3814 .set_direction = bttv_tea575x_set_direction,3814 .set_direction = bttv_tea575x_set_direction,
drivers/media/pci/bt8xx/bttv-driver.c+3−3
@@ -50,15 +50,15 @@ · 49 unmodified lines
50#include <media/v4l2-common.h>50#include <media/v4l2-common.h>
51#include <media/v4l2-ioctl.h>51#include <media/v4l2-ioctl.h>
52#include <media/v4l2-event.h>52#include <media/v4l2-event.h>
53#include <media/tvaudio.h>53#include <media/i2c/tvaudio.h>
54#include <media/msp3400.h>54#include <media/drv-intf/msp3400.h>
55 55
56#include <linux/dma-mapping.h>56#include <linux/dma-mapping.h>
57 57
58#include <asm/io.h>58#include <asm/io.h>
59#include <asm/byteorder.h>59#include <asm/byteorder.h>
60 60
61#include <media/saa6588.h>61#include <media/i2c/saa6588.h>
62 62
63#define BTTV_VERSION "0.9.19"63#define BTTV_VERSION "0.9.19"
64 64
drivers/media/pci/bt8xx/bttvp.h+2−2
@@ -41,8 +41,8 @@ · 40 unmodified lines
41#include <media/videobuf-dma-sg.h>41#include <media/videobuf-dma-sg.h>
42#include <media/tveeprom.h>42#include <media/tveeprom.h>
43#include <media/rc-core.h>43#include <media/rc-core.h>
44#include <media/ir-kbd-i2c.h>44#include <media/i2c/ir-kbd-i2c.h>
45#include <media/tea575x.h>45#include <media/drv-intf/tea575x.h>
46 46
47#include "bt848.h"47#include "bt848.h"
48#include "bttv.h"48#include "bttv.h"
drivers/media/pci/cobalt/cobalt-driver.c+3−3
@@ -21,9 +21,9 @@ · 20 unmodified lines
21 */21 */
22 22
23#include <linux/delay.h>23#include <linux/delay.h>
24#include <media/adv7604.h>24#include <media/i2c/adv7604.h>
25#include <media/adv7842.h>25#include <media/i2c/adv7842.h>
26#include <media/adv7511.h>26#include <media/i2c/adv7511.h>
27#include <media/v4l2-event.h>27#include <media/v4l2-event.h>
28#include <media/v4l2-ctrls.h>28#include <media/v4l2-ctrls.h>
29 29
drivers/media/pci/cobalt/cobalt-irq.c+2−2
@@ -18,7 +18,7 @@ · 17 unmodified lines
18 * SOFTWARE.18 * SOFTWARE.
19 */19 */
20 20
21#include <media/adv7604.h>21#include <media/i2c/adv7604.h>
22 22
23#include "cobalt-driver.h"23#include "cobalt-driver.h"
24#include "cobalt-irq.h"24#include "cobalt-irq.h"
@@ -134,7 +134,7 @@ done: · 109 unmodified lines
134 skip = true;134 skip = true;
135 s->skip_first_frames--;135 s->skip_first_frames--;
136 }136 }
137 v4l2_get_timestamp(&cb->vb.timestamp);137 cb->vb.vb2_buf.timestamp = ktime_get_ns();
138 /* TODO: the sequence number should be read from the FPGA so we138 /* TODO: the sequence number should be read from the FPGA so we
139 also know about dropped frames. */139 also know about dropped frames. */
140 cb->vb.sequence = s->sequence++;140 cb->vb.sequence = s->sequence++;
drivers/media/pci/cobalt/cobalt-v4l2.c+7−11
@@ -29,8 +29,8 @@ · 28 unmodified lines
29#include <media/v4l2-ctrls.h>29#include <media/v4l2-ctrls.h>
30#include <media/v4l2-event.h>30#include <media/v4l2-event.h>
31#include <media/v4l2-dv-timings.h>31#include <media/v4l2-dv-timings.h>
32#include <media/adv7604.h>32#include <media/i2c/adv7604.h>
33#include <media/adv7842.h>33#include <media/i2c/adv7842.h>
34 34
35#include "cobalt-alsa.h"35#include "cobalt-alsa.h"
36#include "cobalt-cpld.h"36#include "cobalt-cpld.h"
@@ -43,11 +43,10 @@ static const struct v4l2_dv_timings cea1080p60 = V4L2_DV_BT_CEA_1920X1080P60; · 6 unmodified lines
43 43
44/* vb2 DMA streaming ops */44/* vb2 DMA streaming ops */
45 45
46static int cobalt_queue_setup(struct vb2_queue *q, const void *parg,46static int cobalt_queue_setup(struct vb2_queue *q,
47 unsigned int *num_buffers, unsigned int *num_planes,47 unsigned int *num_buffers, unsigned int *num_planes,
48 unsigned int sizes[], void *alloc_ctxs[])48 unsigned int sizes[], void *alloc_ctxs[])
49{49{
50 const struct v4l2_format *fmt = parg;
51 struct cobalt_stream *s = q->drv_priv;50 struct cobalt_stream *s = q->drv_priv;
52 unsigned size = s->stride * s->height;51 unsigned size = s->stride * s->height;
53 52
@@ -55,14 +54,11 @@ static int cobalt_queue_setup(struct vb2_queue *q, const void *parg, · 1 unmodified line
55 *num_buffers = 3;54 *num_buffers = 3;
56 if (*num_buffers > NR_BUFS)55 if (*num_buffers > NR_BUFS)
57 *num_buffers = NR_BUFS;56 *num_buffers = NR_BUFS;
57 alloc_ctxs[0] = s->cobalt->alloc_ctx;
58 if (*num_planes)
59 return sizes[0] < size ? -EINVAL : 0;
58 *num_planes = 1;60 *num_planes = 1;
59 if (fmt) {
60 if (fmt->fmt.pix.sizeimage < size)
61 return -EINVAL;
62 size = fmt->fmt.pix.sizeimage;
63 }
64 sizes[0] = size;61 sizes[0] = size;
65 alloc_ctxs[0] = s->cobalt->alloc_ctx;
66 return 0;62 return 0;
67}63}
68 64
@@ -649,7 +645,7 @@ static int cobalt_s_dv_timings(struct file *file, void *priv_fh, · 580 unmodified lines
649 return 0;645 return 0;
650 }646 }
651 647
652 if (v4l2_match_dv_timings(timings, &s->timings, 0))648 if (v4l2_match_dv_timings(timings, &s->timings, 0, false))
653 return 0;649 return 0;
654 650
655 if (vb2_is_busy(&s->q))651 if (vb2_is_busy(&s->q))
drivers/media/pci/cx18/cx18-cards.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include "cx18-cards.h"26#include "cx18-cards.h"
27#include "cx18-av-core.h"27#include "cx18-av-core.h"
28#include "cx18-i2c.h"28#include "cx18-i2c.h"
29#include <media/cs5345.h>29#include <media/i2c/cs5345.h>
30 30
31#define V4L2_STD_PAL_SECAM (V4L2_STD_PAL|V4L2_STD_SECAM)31#define V4L2_STD_PAL_SECAM (V4L2_STD_PAL|V4L2_STD_SECAM)
32 32
drivers/media/pci/cx18/cx18-controls.c+1−1
@@ -126,7 +126,7 @@ static int cx18_s_audio_mode(struct cx2341x_handler *cxhdl, u32 val) · 125 unmodified lines
126 return 0;126 return 0;
127}127}
128 128
129struct cx2341x_handler_ops cx18_cxhdl_ops = {129const struct cx2341x_handler_ops cx18_cxhdl_ops = {
130 .s_audio_mode = cx18_s_audio_mode,130 .s_audio_mode = cx18_s_audio_mode,
131 .s_audio_sampling_freq = cx18_s_audio_sampling_freq,131 .s_audio_sampling_freq = cx18_s_audio_sampling_freq,
132 .s_video_encoding = cx18_s_video_encoding,132 .s_video_encoding = cx18_s_video_encoding,
drivers/media/pci/cx18/cx18-controls.h+1−1
@@ -21,4 +21,4 @@ · 20 unmodified lines
21 * 02111-1307 USA21 * 02111-1307 USA
22 */22 */
23 23
24extern struct cx2341x_handler_ops cx18_cxhdl_ops;24extern const struct cx2341x_handler_ops cx18_cxhdl_ops;
drivers/media/pci/cx18/cx18-driver.h+1−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
49#include <media/v4l2-device.h>49#include <media/v4l2-device.h>
50#include <media/v4l2-fh.h>50#include <media/v4l2-fh.h>
51#include <media/tuner.h>51#include <media/tuner.h>
52#include <media/ir-kbd-i2c.h>52#include <media/i2c/ir-kbd-i2c.h>
53#include "cx18-mailbox.h"53#include "cx18-mailbox.h"
54#include "cx18-av-core.h"54#include "cx18-av-core.h"
55#include "cx23418.h"55#include "cx23418.h"
drivers/media/pci/cx18/cx18-ioctl.c+2−2
@@ -453,8 +453,8 @@ static int cx18_cropcap(struct file *file, void *fh, · 452 unmodified lines
453 453
454 if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)454 if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
455 return -EINVAL;455 return -EINVAL;
456 cropcap->pixelaspect.numerator = cx->is_50hz ? 59 : 10;456 cropcap->pixelaspect.numerator = cx->is_50hz ? 54 : 11;
457 cropcap->pixelaspect.denominator = cx->is_50hz ? 54 : 11;457 cropcap->pixelaspect.denominator = cx->is_50hz ? 59 : 10;
458 return 0;458 return 0;
459}459}
460 460
drivers/media/pci/cx18/cx23418.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22#ifndef CX23418_H22#ifndef CX23418_H
23#define CX23418_H23#define CX23418_H
24 24
25#include <media/cx2341x.h>25#include <media/drv-intf/cx2341x.h>
26 26
27#define MGR_CMD_MASK 0x4000000027#define MGR_CMD_MASK 0x40000000
28/* The MSB of the command code indicates that this is the completion of a28/* The MSB of the command code indicates that this is the completion of a
drivers/media/pci/cx23885/Kconfig+1−0
@@ -10,6 +10,7 @@ config VIDEO_CX23885 · 9 unmodified lines
10 select VIDEOBUF2_DMA_SG10 select VIDEOBUF2_DMA_SG
11 select VIDEO_CX2584011 select VIDEO_CX25840
12 select VIDEO_CX2341X12 select VIDEO_CX2341X
13 select VIDEO_CS3308
13 select DVB_DIB7000P if MEDIA_SUBDRV_AUTOSELECT14 select DVB_DIB7000P if MEDIA_SUBDRV_AUTOSELECT
14 select DVB_DRXK if MEDIA_SUBDRV_AUTOSELECT15 select DVB_DRXK if MEDIA_SUBDRV_AUTOSELECT
15 select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT16 select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT
drivers/media/pci/cx23885/cx23885-417.c+2−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <linux/slab.h>30#include <linux/slab.h>
31#include <media/v4l2-common.h>31#include <media/v4l2-common.h>
32#include <media/v4l2-ioctl.h>32#include <media/v4l2-ioctl.h>
33#include <media/cx2341x.h>33#include <media/drv-intf/cx2341x.h>
34 34
35#include "cx23885.h"35#include "cx23885.h"
36#include "cx23885-ioctl.h"36#include "cx23885-ioctl.h"
@@ -1138,7 +1138,7 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev, int startencoder) · 1101 unmodified lines
1138 1138
1139/* ------------------------------------------------------------------ */1139/* ------------------------------------------------------------------ */
1140 1140
1141static int queue_setup(struct vb2_queue *q, const void *parg,1141static int queue_setup(struct vb2_queue *q,
1142 unsigned int *num_buffers, unsigned int *num_planes,1142 unsigned int *num_buffers, unsigned int *num_planes,
1143 unsigned int sizes[], void *alloc_ctxs[])1143 unsigned int sizes[], void *alloc_ctxs[])
1144{1144{
drivers/media/pci/cx23885/cx23885-cards.c+115−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19#include <linux/module.h>19#include <linux/module.h>
20#include <linux/pci.h>20#include <linux/pci.h>
21#include <linux/delay.h>21#include <linux/delay.h>
22#include <media/cx25840.h>22#include <media/drv-intf/cx25840.h>
23#include <linux/firmware.h>23#include <linux/firmware.h>
24#include <misc/altera.h>24#include <misc/altera.h>
25 25
@@ -715,6 +715,56 @@ struct cx23885_board cx23885_boards[] = { · 689 unmodified lines
715 .portb = CX23885_MPEG_DVB,715 .portb = CX23885_MPEG_DVB,
716 .portc = CX23885_MPEG_DVB,716 .portc = CX23885_MPEG_DVB,
717 },717 },
718 [CX23885_BOARD_VIEWCAST_260E] = {
719 .name = "ViewCast 260e",
720 .porta = CX23885_ANALOG_VIDEO,
721 .force_bff = 1,
722 .input = {{
723 .type = CX23885_VMUX_COMPOSITE1,
724 .vmux = CX25840_VIN6_CH1,
725 .amux = CX25840_AUDIO7,
726 }, {
727 .type = CX23885_VMUX_SVIDEO,
728 .vmux = CX25840_VIN7_CH3 |
729 CX25840_VIN5_CH1 |
730 CX25840_SVIDEO_ON,
731 .amux = CX25840_AUDIO7,
732 }, {
733 .type = CX23885_VMUX_COMPONENT,
734 .vmux = CX25840_VIN7_CH3 |
735 CX25840_VIN6_CH2 |
736 CX25840_VIN5_CH1 |
737 CX25840_COMPONENT_ON,
738 .amux = CX25840_AUDIO7,
739 } },
740 },
741 [CX23885_BOARD_VIEWCAST_460E] = {
742 .name = "ViewCast 460e",
743 .porta = CX23885_ANALOG_VIDEO,
744 .force_bff = 1,
745 .input = {{
746 .type = CX23885_VMUX_COMPOSITE1,
747 .vmux = CX25840_VIN4_CH1,
748 .amux = CX25840_AUDIO7,
749 }, {
750 .type = CX23885_VMUX_SVIDEO,
751 .vmux = CX25840_VIN7_CH3 |
752 CX25840_VIN6_CH1 |
753 CX25840_SVIDEO_ON,
754 .amux = CX25840_AUDIO7,
755 }, {
756 .type = CX23885_VMUX_COMPONENT,
757 .vmux = CX25840_VIN7_CH3 |
758 CX25840_VIN6_CH1 |
759 CX25840_VIN5_CH2 |
760 CX25840_COMPONENT_ON,
761 .amux = CX25840_AUDIO7,
762 }, {
763 .type = CX23885_VMUX_COMPOSITE2,
764 .vmux = CX25840_VIN6_CH1,
765 .amux = CX25840_AUDIO7,
766 } },
767 },
718};768};
719const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);769const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
720 770
@@ -1002,6 +1052,14 @@ struct cx23885_subid cx23885_subids[] = { · 281 unmodified lines
1002 .subvendor = 0x0070,1052 .subvendor = 0x0070,
1003 .subdevice = 0xf038,1053 .subdevice = 0xf038,
1004 .card = CX23885_BOARD_HAUPPAUGE_HVR5525,1054 .card = CX23885_BOARD_HAUPPAUGE_HVR5525,
1055 }, {
1056 .subvendor = 0x1576,
1057 .subdevice = 0x0260,
1058 .card = CX23885_BOARD_VIEWCAST_260E,
1059 }, {
1060 .subvendor = 0x1576,
1061 .subdevice = 0x0460,
1062 .card = CX23885_BOARD_VIEWCAST_460E,
1005 },1063 },
1006};1064};
1007const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);1065const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -1034,6 +1092,28 @@ void cx23885_card_list(struct cx23885_dev *dev) · 26 unmodified lines
1034 dev->name, i, cx23885_boards[i].name);1092 dev->name, i, cx23885_boards[i].name);
1035}1093}
1036 1094
1095static void viewcast_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
1096{
1097 u32 sn;
1098
1099 /* The serial number record begins with tag 0x59 */
1100 if (*(eeprom_data + 0x00) != 0x59) {
1101 pr_info("%s() eeprom records are undefined, no serial number\n",
1102 __func__);
1103 return;
1104 }
1105
1106 sn = (*(eeprom_data + 0x06) << 24) |
1107 (*(eeprom_data + 0x05) << 16) |
1108 (*(eeprom_data + 0x04) << 8) |
1109 (*(eeprom_data + 0x03));
1110
1111 pr_info("%s: card '%s' sn# MM%d\n",
1112 dev->name,
1113 cx23885_boards[dev->board].name,
1114 sn);
1115}
1116
1037static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)1117static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
1038{1118{
1039 struct tveeprom tv;1119 struct tveeprom tv;
@@ -1671,6 +1751,12 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) · 631 unmodified lines
1671 cx23885_gpio_set(dev, GPIO_8 | GPIO_9);1751 cx23885_gpio_set(dev, GPIO_8 | GPIO_9);
1672 msleep(100);1752 msleep(100);
1673 break;1753 break;
1754 case CX23885_BOARD_VIEWCAST_260E:
1755 case CX23885_BOARD_VIEWCAST_460E:
1756 /* For documentation purposes, it's worth noting that this
1757 * card does not have any GPIO's connected to subcomponents.
1758 */
1759 break;
1674 }1760 }
1675}1761}
1676 1762
@@ -1917,6 +2003,14 @@ void cx23885_card_setup(struct cx23885_dev *dev) · 240 unmodified lines
1917 if (dev->i2c_bus[0].i2c_rc == 0)2003 if (dev->i2c_bus[0].i2c_rc == 0)
1918 hauppauge_eeprom(dev, eeprom+0xc0);2004 hauppauge_eeprom(dev, eeprom+0xc0);
1919 break;2005 break;
2006 case CX23885_BOARD_VIEWCAST_260E:
2007 case CX23885_BOARD_VIEWCAST_460E:
2008 dev->i2c_bus[1].i2c_client.addr = 0xa0 >> 1;
2009 tveeprom_read(&dev->i2c_bus[1].i2c_client,
2010 eeprom, sizeof(eeprom));
2011 if (dev->i2c_bus[0].i2c_rc == 0)
2012 viewcast_eeprom(dev, eeprom);
2013 break;
1920 }2014 }
1921 2015
1922 switch (dev->board) {2016 switch (dev->board) {
@@ -2120,6 +2214,8 @@ void cx23885_card_setup(struct cx23885_dev *dev) · 197 unmodified lines
2120 case CX23885_BOARD_DVBSKY_S950:2214 case CX23885_BOARD_DVBSKY_S950:
2121 case CX23885_BOARD_DVBSKY_S952:2215 case CX23885_BOARD_DVBSKY_S952:
2122 case CX23885_BOARD_DVBSKY_T982:2216 case CX23885_BOARD_DVBSKY_T982:
2217 case CX23885_BOARD_VIEWCAST_260E:
2218 case CX23885_BOARD_VIEWCAST_460E:
2123 dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,2219 dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
2124 &dev->i2c_bus[2].i2c_adap,2220 &dev->i2c_bus[2].i2c_adap,
2125 "cx25840", 0x88 >> 1, NULL);2221 "cx25840", 0x88 >> 1, NULL);
@@ -2130,6 +2226,24 @@ void cx23885_card_setup(struct cx23885_dev *dev) · 4 unmodified lines
2130 break;2226 break;
2131 }2227 }
2132 2228
2229 switch (dev->board) {
2230 case CX23885_BOARD_VIEWCAST_260E:
2231 v4l2_i2c_new_subdev(&dev->v4l2_dev,
2232 &dev->i2c_bus[0].i2c_adap,
2233 "cs3308", 0x82 >> 1, NULL);
2234 break;
2235 case CX23885_BOARD_VIEWCAST_460E:
2236 /* This cs3308 controls the audio from the breakout cable */
2237 v4l2_i2c_new_subdev(&dev->v4l2_dev,
2238 &dev->i2c_bus[0].i2c_adap,
2239 "cs3308", 0x80 >> 1, NULL);
2240 /* This cs3308 controls the audio from the onboard header */
2241 v4l2_i2c_new_subdev(&dev->v4l2_dev,
2242 &dev->i2c_bus[0].i2c_adap,
2243 "cs3308", 0x82 >> 1, NULL);
2244 break;
2245 }
2246
2133 /* AUX-PLL 27MHz CLK */2247 /* AUX-PLL 27MHz CLK */
2134 switch (dev->board) {2248 switch (dev->board) {
2135 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:2249 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:
drivers/media/pci/cx23885/cx23885-core.c+11−1
@@ -427,7 +427,7 @@ static void cx23885_wakeup(struct cx23885_tsport *port, · 426 unmodified lines
427 buf = list_entry(q->active.next,427 buf = list_entry(q->active.next,
428 struct cx23885_buffer, queue);428 struct cx23885_buffer, queue);
429 429
430 v4l2_get_timestamp(&buf->vb.timestamp);430 buf->vb.vb2_buf.timestamp = ktime_get_ns();
431 buf->vb.sequence = q->count++;431 buf->vb.sequence = q->count++;
432 dprintk(1, "[%p/%d] wakeup reg=%d buf=%d\n", buf,432 dprintk(1, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
433 buf->vb.vb2_buf.index,433 buf->vb.vb2_buf.index,
@@ -968,6 +968,16 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) · 534 unmodified lines
968 call_all(dev, core, s_power, 0);968 call_all(dev, core, s_power, 0);
969 cx23885_ir_init(dev);969 cx23885_ir_init(dev);
970 970
971 if (dev->board == CX23885_BOARD_VIEWCAST_460E) {
972 /*
973 * GPIOs 9/8 are input detection bits for the breakout video
974 * (gpio 8) and audio (gpio 9) cables. When they're attached,
975 * this gpios are pulled high. Make sure these GPIOs are marked
976 * as inputs.
977 */
978 cx23885_gpio_enable(dev, 0x300, 0);
979 }
980
971 if (cx23885_boards[dev->board].porta == CX23885_ANALOG_VIDEO) {981 if (cx23885_boards[dev->board].porta == CX23885_ANALOG_VIDEO) {
972 if (cx23885_video_register(dev) < 0) {982 if (cx23885_video_register(dev) < 0) {
973 printk(KERN_ERR "%s() Failed to register analog "983 printk(KERN_ERR "%s() Failed to register analog "
drivers/media/pci/cx23885/cx23885-dvb.c+5−3
@@ -92,7 +92,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); · 91 unmodified lines
92 92
93/* ------------------------------------------------------------------ */93/* ------------------------------------------------------------------ */
94 94
95static int queue_setup(struct vb2_queue *q, const void *parg,95static int queue_setup(struct vb2_queue *q,
96 unsigned int *num_buffers, unsigned int *num_planes,96 unsigned int *num_buffers, unsigned int *num_planes,
97 unsigned int sizes[], void *alloc_ctxs[])97 unsigned int sizes[], void *alloc_ctxs[])
98{98{
@@ -2168,11 +2168,12 @@ static int dvb_register(struct cx23885_tsport *port) · 2069 unmodified lines
2168 }2168 }
2169 port->i2c_client_tuner = client_tuner;2169 port->i2c_client_tuner = client_tuner;
2170 break;2170 break;
2171 case CX23885_BOARD_HAUPPAUGE_HVR5525:2171 case CX23885_BOARD_HAUPPAUGE_HVR5525: {
2172 switch (port->nr) {
2173 struct m88rs6000t_config m88rs6000t_config;2172 struct m88rs6000t_config m88rs6000t_config;
2174 struct a8293_platform_data a8293_pdata = {};2173 struct a8293_platform_data a8293_pdata = {};
2175 2174
2175 switch (port->nr) {
2176
2176 /* port b - satellite */2177 /* port b - satellite */
2177 case 1:2178 case 1:
2178 /* attach frontend */2179 /* attach frontend */
@@ -2267,6 +2268,7 @@ static int dvb_register(struct cx23885_tsport *port) · 88 unmodified lines
2267 break;2268 break;
2268 }2269 }
2269 break;2270 break;
2271 }
2270 default:2272 default:
2271 printk(KERN_INFO "%s: The frontend of your DVB/ATSC card "2273 printk(KERN_INFO "%s: The frontend of your DVB/ATSC card "
2272 " isn't supported yet\n",2274 " isn't supported yet\n",
drivers/media/pci/cx23885/cx23885-i2c.c+2−0
@@ -279,6 +279,8 @@ static char *i2c_devs[128] = { · 278 unmodified lines
279 [0x10 >> 1] = "tda10048",279 [0x10 >> 1] = "tda10048",
280 [0x12 >> 1] = "dib7000pc",280 [0x12 >> 1] = "dib7000pc",
281 [0x1c >> 1] = "lgdt3303",281 [0x1c >> 1] = "lgdt3303",
282 [0x80 >> 1] = "cs3308",
283 [0x82 >> 1] = "cs3308",
282 [0x86 >> 1] = "tda9887",284 [0x86 >> 1] = "tda9887",
283 [0x32 >> 1] = "cx24227",285 [0x32 >> 1] = "cx24227",
284 [0x88 >> 1] = "cx25837",286 [0x88 >> 1] = "cx25837",
drivers/media/pci/cx23885/cx23885-input.c+1−1
@@ -268,7 +268,7 @@ int cx23885_input_init(struct cx23885_dev *dev) · 267 unmodified lines
268 struct rc_dev *rc;268 struct rc_dev *rc;
269 char *rc_map;269 char *rc_map;
270 enum rc_driver_type driver_type;270 enum rc_driver_type driver_type;
271 unsigned long allowed_protos;271 u64 allowed_protos;
272 272
273 int ret;273 int ret;
274 274
drivers/media/pci/cx23885/cx23885-vbi.c+2−3
@@ -83,7 +83,7 @@ int cx23885_vbi_irq(struct cx23885_dev *dev, u32 status) · 82 unmodified lines
83 if (status & VID_BC_MSK_VBI_RISCI1) {83 if (status & VID_BC_MSK_VBI_RISCI1) {
84 dprintk(1, "%s() VID_BC_MSK_VBI_RISCI1\n", __func__);84 dprintk(1, "%s() VID_BC_MSK_VBI_RISCI1\n", __func__);
85 spin_lock(&dev->slock);85 spin_lock(&dev->slock);
86 count = cx_read(VID_A_GPCNT);86 count = cx_read(VBI_A_GPCNT);
87 cx23885_video_wakeup(dev, &dev->vbiq, count);87 cx23885_video_wakeup(dev, &dev->vbiq, count);
88 spin_unlock(&dev->slock);88 spin_unlock(&dev->slock);
89 handled++;89 handled++;
@@ -103,7 +103,6 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev, · 13 unmodified lines
103 VBI_LINE_LENGTH, buf->risc.dma);103 VBI_LINE_LENGTH, buf->risc.dma);
104 104
105 /* reset counter */105 /* reset counter */
106 cx_write(VID_A_GPCNT_CTL, 3);
107 cx_write(VID_A_VBI_CTRL, 3);106 cx_write(VID_A_VBI_CTRL, 3);
108 cx_write(VBI_A_GPCNT_CTL, 3);107 cx_write(VBI_A_GPCNT_CTL, 3);
109 q->count = 0;108 q->count = 0;
@@ -121,7 +120,7 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev, · 11 unmodified lines
121 120
122/* ------------------------------------------------------------------ */121/* ------------------------------------------------------------------ */
123 122
124static int queue_setup(struct vb2_queue *q, const void *parg,123static int queue_setup(struct vb2_queue *q,
125 unsigned int *num_buffers, unsigned int *num_planes,124 unsigned int *num_buffers, unsigned int *num_planes,
126 unsigned int sizes[], void *alloc_ctxs[])125 unsigned int sizes[], void *alloc_ctxs[])
127{126{
drivers/media/pci/cx23885/cx23885-video.c+44−5
@@ -35,7 +35,7 @@ · 34 unmodified lines
35#include "cx23885-ioctl.h"35#include "cx23885-ioctl.h"
36#include "tuner-xc2028.h"36#include "tuner-xc2028.h"
37 37
38#include <media/cx25840.h>38#include <media/drv-intf/cx25840.h>
39 39
40MODULE_DESCRIPTION("v4l2 driver module for cx23885 based TV cards");40MODULE_DESCRIPTION("v4l2 driver module for cx23885 based TV cards");
41MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>");41MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>");
@@ -105,7 +105,7 @@ void cx23885_video_wakeup(struct cx23885_dev *dev, · 63 unmodified lines
105 struct cx23885_buffer, queue);105 struct cx23885_buffer, queue);
106 106
107 buf->vb.sequence = q->count++;107 buf->vb.sequence = q->count++;
108 v4l2_get_timestamp(&buf->vb.timestamp);108 buf->vb.vb2_buf.timestamp = ktime_get_ns();
109 dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf,109 dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
110 buf->vb.vb2_buf.index, count, q->count);110 buf->vb.vb2_buf.index, count, q->count);
111 list_del(&buf->queue);111 list_del(&buf->queue);
@@ -114,11 +114,19 @@ void cx23885_video_wakeup(struct cx23885_dev *dev, · 2 unmodified lines
114 114
115int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm)115int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm)
116{116{
117 struct v4l2_subdev_format format = {
118 .which = V4L2_SUBDEV_FORMAT_ACTIVE,
119 .format.code = MEDIA_BUS_FMT_FIXED,
120 };
121
117 dprintk(1, "%s(norm = 0x%08x) name: [%s]\n",122 dprintk(1, "%s(norm = 0x%08x) name: [%s]\n",
118 __func__,123 __func__,
119 (unsigned int)norm,124 (unsigned int)norm,
120 v4l2_norm_to_name(norm));125 v4l2_norm_to_name(norm));
121 126
127 if (dev->tvnorm == norm)
128 return 0;
129
122 if (dev->tvnorm != norm) {130 if (dev->tvnorm != norm) {
123 if (vb2_is_busy(&dev->vb2_vidq) || vb2_is_busy(&dev->vb2_vbiq) ||131 if (vb2_is_busy(&dev->vb2_vidq) || vb2_is_busy(&dev->vb2_vbiq) ||
124 vb2_is_busy(&dev->vb2_mpegq))132 vb2_is_busy(&dev->vb2_mpegq))
@@ -126,9 +134,17 @@ int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm) · 1 unmodified line
126 }134 }
127 135
128 dev->tvnorm = norm;136 dev->tvnorm = norm;
137 dev->width = 720;
138 dev->height = norm_maxh(norm);
139 dev->field = V4L2_FIELD_INTERLACED;
129 140
130 call_all(dev, video, s_std, norm);141 call_all(dev, video, s_std, norm);
131 142
143 format.format.width = dev->width;
144 format.format.height = dev->height;
145 format.format.field = dev->field;
146 call_all(dev, pad, set_fmt, NULL, &format);
147
132 return 0;148 return 0;
133}149}
134 150
@@ -247,7 +263,9 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) · 112 unmodified lines
247 (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111) ||263 (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111) ||
248 (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) ||264 (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) ||
249 (dev->board == CX23885_BOARD_MYGICA_X8507) ||265 (dev->board == CX23885_BOARD_MYGICA_X8507) ||
250 (dev->board == CX23885_BOARD_AVERMEDIA_HC81R)) {266 (dev->board == CX23885_BOARD_AVERMEDIA_HC81R) ||
267 (dev->board == CX23885_BOARD_VIEWCAST_260E) ||
268 (dev->board == CX23885_BOARD_VIEWCAST_460E)) {
251 /* Configure audio routing */269 /* Configure audio routing */
252 v4l2_subdev_call(dev->sd_cx25840, audio, s_routing,270 v4l2_subdev_call(dev->sd_cx25840, audio, s_routing,
253 INPUT(input)->amux, 0, 0);271 INPUT(input)->amux, 0, 0);
@@ -315,7 +333,7 @@ static int cx23885_start_video_dma(struct cx23885_dev *dev, · 61 unmodified lines
315 return 0;333 return 0;
316}334}
317 335
318static int queue_setup(struct vb2_queue *q, const void *parg,336static int queue_setup(struct vb2_queue *q,
319 unsigned int *num_buffers, unsigned int *num_planes,337 unsigned int *num_buffers, unsigned int *num_planes,
320 unsigned int sizes[], void *alloc_ctxs[])338 unsigned int sizes[], void *alloc_ctxs[])
321{339{
@@ -545,7 +563,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, · 223 unmodified lines
545 return -EINVAL;563 return -EINVAL;
546 564
547 field = f->fmt.pix.field;565 field = f->fmt.pix.field;
548 maxw = norm_maxw(dev->tvnorm);566 maxw = 720;
549 maxh = norm_maxh(dev->tvnorm);567 maxh = norm_maxh(dev->tvnorm);
550 568
551 if (V4L2_FIELD_ANY == field) {569 if (V4L2_FIELD_ANY == field) {
@@ -648,6 +666,26 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, · 96 unmodified lines
648 return 0;666 return 0;
649}667}
650 668
669static int vidioc_cropcap(struct file *file, void *priv,
670 struct v4l2_cropcap *cc)
671{
672 struct cx23885_dev *dev = video_drvdata(file);
673 bool is_50hz = dev->tvnorm & V4L2_STD_625_50;
674
675 if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
676 return -EINVAL;
677
678 cc->bounds.left = 0;
679 cc->bounds.top = 0;
680 cc->bounds.width = 720;
681 cc->bounds.height = norm_maxh(dev->tvnorm);
682 cc->defrect = cc->bounds;
683 cc->pixelaspect.numerator = is_50hz ? 54 : 11;
684 cc->pixelaspect.denominator = is_50hz ? 59 : 10;
685
686 return 0;
687}
688
651static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)689static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
652{690{
653 struct cx23885_dev *dev = video_drvdata(file);691 struct cx23885_dev *dev = video_drvdata(file);
@@ -1082,6 +1120,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { · 428 unmodified lines
1082 .vidioc_dqbuf = vb2_ioctl_dqbuf,1120 .vidioc_dqbuf = vb2_ioctl_dqbuf,
1083 .vidioc_streamon = vb2_ioctl_streamon,1121 .vidioc_streamon = vb2_ioctl_streamon,
1084 .vidioc_streamoff = vb2_ioctl_streamoff,1122 .vidioc_streamoff = vb2_ioctl_streamoff,
1123 .vidioc_cropcap = vidioc_cropcap,
1085 .vidioc_s_std = vidioc_s_std,1124 .vidioc_s_std = vidioc_s_std,
1086 .vidioc_g_std = vidioc_g_std,1125 .vidioc_g_std = vidioc_g_std,
1087 .vidioc_enum_input = vidioc_enum_input,1126 .vidioc_enum_input = vidioc_enum_input,
drivers/media/pci/cx23885/cx23885.h+3−6
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <media/rc-core.h>30#include <media/rc-core.h>
31 31
32#include "cx23885-reg.h"32#include "cx23885-reg.h"
33#include "media/cx2341x.h"33#include "media/drv-intf/cx2341x.h"
34 34
35#include <linux/mutex.h>35#include <linux/mutex.h>
36 36
@@ -101,6 +101,8 @@ · 64 unmodified lines
101#define CX23885_BOARD_DVBSKY_T982 51101#define CX23885_BOARD_DVBSKY_T982 51
102#define CX23885_BOARD_HAUPPAUGE_HVR5525 52102#define CX23885_BOARD_HAUPPAUGE_HVR5525 52
103#define CX23885_BOARD_HAUPPAUGE_STARBURST 53103#define CX23885_BOARD_HAUPPAUGE_STARBURST 53
104#define CX23885_BOARD_VIEWCAST_260E 54
105#define CX23885_BOARD_VIEWCAST_460E 55
104 106
105#define GPIO_0 0x00000001107#define GPIO_0 0x00000001
106#define GPIO_1 0x00000002108#define GPIO_1 0x00000002
@@ -627,11 +629,6 @@ extern int cx23885_risc_databuffer(struct pci_dev *pci, · 520 unmodified lines
627/* ----------------------------------------------------------- */629/* ----------------------------------------------------------- */
628/* tv norms */630/* tv norms */
629 631
630static inline unsigned int norm_maxw(v4l2_std_id norm)
631{
632 return (norm & V4L2_STD_525_60) ? 720 : 768;
633}
634
635static inline unsigned int norm_maxh(v4l2_std_id norm)632static inline unsigned int norm_maxh(v4l2_std_id norm)
636{633{
637 return (norm & V4L2_STD_525_60) ? 480 : 576;634 return (norm & V4L2_STD_525_60) ? 480 : 576;
drivers/media/pci/cx25821/cx25821-video.c+7−7
@@ -130,7 +130,7 @@ int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status) · 129 unmodified lines
130 buf = list_entry(dmaq->active.next,130 buf = list_entry(dmaq->active.next,
131 struct cx25821_buffer, queue);131 struct cx25821_buffer, queue);
132 132
133 v4l2_get_timestamp(&buf->vb.timestamp);133 buf->vb.vb2_buf.timestamp = ktime_get_ns();
134 buf->vb.sequence = dmaq->count++;134 buf->vb.sequence = dmaq->count++;
135 list_del(&buf->queue);135 list_del(&buf->queue);
136 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);136 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
@@ -141,20 +141,20 @@ int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status) · 4 unmodified lines
141 return handled;141 return handled;
142}142}
143 143
144static int cx25821_queue_setup(struct vb2_queue *q, const void *parg,144static int cx25821_queue_setup(struct vb2_queue *q,
145 unsigned int *num_buffers, unsigned int *num_planes,145 unsigned int *num_buffers, unsigned int *num_planes,
146 unsigned int sizes[], void *alloc_ctxs[])146 unsigned int sizes[], void *alloc_ctxs[])
147{147{
148 const struct v4l2_format *fmt = parg;
149 struct cx25821_channel *chan = q->drv_priv;148 struct cx25821_channel *chan = q->drv_priv;
150 unsigned size = (chan->fmt->depth * chan->width * chan->height) >> 3;149 unsigned size = (chan->fmt->depth * chan->width * chan->height) >> 3;
151 150
152 if (fmt && fmt->fmt.pix.sizeimage < size)151 alloc_ctxs[0] = chan->dev->alloc_ctx;
153 return -EINVAL;152
153 if (*num_planes)
154 return sizes[0] < size ? -EINVAL : 0;
154 155
155 *num_planes = 1;156 *num_planes = 1;
156 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : size;157 sizes[0] = size;
157 alloc_ctxs[0] = chan->dev->alloc_ctx;
158 return 0;158 return 0;
159}159}
160 160
drivers/media/pci/cx88/cx88-alsa.c+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
40#include <sound/control.h>40#include <sound/control.h>
41#include <sound/initval.h>41#include <sound/initval.h>
42#include <sound/tlv.h>42#include <sound/tlv.h>
43#include <media/wm8775.h>43#include <media/i2c/wm8775.h>
44 44
45#include "cx88.h"45#include "cx88.h"
46#include "cx88-reg.h"46#include "cx88-reg.h"
drivers/media/pci/cx88/cx88-blackbird.c+2−2
@@ -36,7 +36,7 @@ · 35 unmodified lines
36#include <media/v4l2-common.h>36#include <media/v4l2-common.h>
37#include <media/v4l2-ioctl.h>37#include <media/v4l2-ioctl.h>
38#include <media/v4l2-event.h>38#include <media/v4l2-event.h>
39#include <media/cx2341x.h>39#include <media/drv-intf/cx2341x.h>
40 40
41#include "cx88.h"41#include "cx88.h"
42 42
@@ -637,7 +637,7 @@ static int blackbird_stop_codec(struct cx8802_dev *dev) · 594 unmodified lines
637 637
638/* ------------------------------------------------------------------ */638/* ------------------------------------------------------------------ */
639 639
640static int queue_setup(struct vb2_queue *q, const void *parg,640static int queue_setup(struct vb2_queue *q,
641 unsigned int *num_buffers, unsigned int *num_planes,641 unsigned int *num_buffers, unsigned int *num_planes,
642 unsigned int sizes[], void *alloc_ctxs[])642 unsigned int sizes[], void *alloc_ctxs[])
643{643{
drivers/media/pci/cx88/cx88-core.c+1−1
@@ -518,7 +518,7 @@ void cx88_wakeup(struct cx88_core *core, · 517 unmodified lines
518 518
519 buf = list_entry(q->active.next,519 buf = list_entry(q->active.next,
520 struct cx88_buffer, list);520 struct cx88_buffer, list);
521 v4l2_get_timestamp(&buf->vb.timestamp);521 buf->vb.vb2_buf.timestamp = ktime_get_ns();
522 buf->vb.field = core->field;522 buf->vb.field = core->field;
523 buf->vb.sequence = q->count++;523 buf->vb.sequence = q->count++;
524 list_del(&buf->list);524 list_del(&buf->list);
drivers/media/pci/cx88/cx88-dvb.c+1−1
@@ -82,7 +82,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); · 81 unmodified lines
82 82
83/* ------------------------------------------------------------------ */83/* ------------------------------------------------------------------ */
84 84
85static int queue_setup(struct vb2_queue *q, const void *parg,85static int queue_setup(struct vb2_queue *q,
86 unsigned int *num_buffers, unsigned int *num_planes,86 unsigned int *num_buffers, unsigned int *num_planes,
87 unsigned int sizes[], void *alloc_ctxs[])87 unsigned int sizes[], void *alloc_ctxs[])
88{88{
drivers/media/pci/cx88/cx88-vbi.c+1−1
@@ -107,7 +107,7 @@ int cx8800_restart_vbi_queue(struct cx8800_dev *dev, · 106 unmodified lines
107 107
108/* ------------------------------------------------------------------ */108/* ------------------------------------------------------------------ */
109 109
110static int queue_setup(struct vb2_queue *q, const void *parg,110static int queue_setup(struct vb2_queue *q,
111 unsigned int *num_buffers, unsigned int *num_planes,111 unsigned int *num_buffers, unsigned int *num_planes,
112 unsigned int sizes[], void *alloc_ctxs[])112 unsigned int sizes[], void *alloc_ctxs[])
113{113{
drivers/media/pci/cx88/cx88-video.c+2−2
@@ -41,7 +41,7 @@ · 40 unmodified lines
41#include <media/v4l2-common.h>41#include <media/v4l2-common.h>
42#include <media/v4l2-ioctl.h>42#include <media/v4l2-ioctl.h>
43#include <media/v4l2-event.h>43#include <media/v4l2-event.h>
44#include <media/wm8775.h>44#include <media/i2c/wm8775.h>
45 45
46MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");46MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");
47MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");47MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
@@ -429,7 +429,7 @@ static int restart_video_queue(struct cx8800_dev *dev, · 381 unmodified lines
429 429
430/* ------------------------------------------------------------------ */430/* ------------------------------------------------------------------ */
431 431
432static int queue_setup(struct vb2_queue *q, const void *parg,432static int queue_setup(struct vb2_queue *q,
433 unsigned int *num_buffers, unsigned int *num_planes,433 unsigned int *num_buffers, unsigned int *num_planes,
434 unsigned int sizes[], void *alloc_ctxs[])434 unsigned int sizes[], void *alloc_ctxs[])
435{435{
drivers/media/pci/cx88/cx88.h+3−3
@@ -30,10 +30,10 @@ · 29 unmodified lines
30#include <media/tuner.h>30#include <media/tuner.h>
31#include <media/tveeprom.h>31#include <media/tveeprom.h>
32#include <media/videobuf2-dma-sg.h>32#include <media/videobuf2-dma-sg.h>
33#include <media/cx2341x.h>33#include <media/drv-intf/cx2341x.h>
34#include <media/videobuf2-dvb.h>34#include <media/videobuf2-dvb.h>
35#include <media/ir-kbd-i2c.h>35#include <media/i2c/ir-kbd-i2c.h>
36#include <media/wm8775.h>36#include <media/i2c/wm8775.h>
37 37
38#include "cx88-reg.h"38#include "cx88-reg.h"
39#include "tuner-xc2028.h"39#include "tuner-xc2028.h"
drivers/media/pci/ddbridge/ddbridge-core.c+2−2
@@ -81,13 +81,13 @@ static int i2c_read_reg16(struct i2c_adapter *adapter, u8 adr, · 80 unmodified lines
81static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)81static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
82{82{
83 struct ddb *dev = i2c->dev;83 struct ddb *dev = i2c->dev;
84 int stat;84 long stat;
85 u32 val;85 u32 val;
86 86
87 i2c->done = 0;87 i2c->done = 0;
88 ddbwritel((adr << 9) | cmd, i2c->regs + I2C_COMMAND);88 ddbwritel((adr << 9) | cmd, i2c->regs + I2C_COMMAND);
89 stat = wait_event_timeout(i2c->wq, i2c->done == 1, HZ);89 stat = wait_event_timeout(i2c->wq, i2c->done == 1, HZ);
90 if (stat <= 0) {90 if (stat == 0) {
91 printk(KERN_ERR "I2C timeout\n");91 printk(KERN_ERR "I2C timeout\n");
92 { /* MSI debugging*/92 { /* MSI debugging*/
93 u32 istat = ddbreadl(INTERRUPT_STATUS);93 u32 istat = ddbreadl(INTERRUPT_STATUS);
drivers/media/pci/dm1105/dm1105.c+0−1
@@ -1206,7 +1206,6 @@ static void dm1105_remove(struct pci_dev *pdev) · 1205 unmodified lines
1206 i2c_del_adapter(&dev->i2c_adap);1206 i2c_del_adapter(&dev->i2c_adap);
1207 1207
1208 dm1105_hw_exit(dev);1208 dm1105_hw_exit(dev);
1209 synchronize_irq(pdev->irq);
1210 free_irq(pdev->irq, dev);1209 free_irq(pdev->irq, dev);
1211 pci_iounmap(pdev, dev->io_mem);1210 pci_iounmap(pdev, dev->io_mem);
1212 pci_release_regions(pdev);1211 pci_release_regions(pdev);
drivers/media/pci/dt3155/dt3155.c+6−7
@@ -131,22 +131,21 @@ static int wait_i2c_reg(void __iomem *addr) · 130 unmodified lines
131}131}
132 132
133static int133static int
134dt3155_queue_setup(struct vb2_queue *vq, const void *parg,134dt3155_queue_setup(struct vb2_queue *vq,
135 unsigned int *nbuffers, unsigned int *num_planes,135 unsigned int *nbuffers, unsigned int *num_planes,
136 unsigned int sizes[], void *alloc_ctxs[])136 unsigned int sizes[], void *alloc_ctxs[])
137 137
138{138{
139 const struct v4l2_format *fmt = parg;
140 struct dt3155_priv *pd = vb2_get_drv_priv(vq);139 struct dt3155_priv *pd = vb2_get_drv_priv(vq);
141 unsigned size = pd->width * pd->height;140 unsigned size = pd->width * pd->height;
142 141
143 if (vq->num_buffers + *nbuffers < 2)142 if (vq->num_buffers + *nbuffers < 2)
144 *nbuffers = 2 - vq->num_buffers;143 *nbuffers = 2 - vq->num_buffers;
145 if (fmt && fmt->fmt.pix.sizeimage < size)
146 return -EINVAL;
147 *num_planes = 1;
148 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : size;
149 alloc_ctxs[0] = pd->alloc_ctx;144 alloc_ctxs[0] = pd->alloc_ctx;
145 if (*num_planes)
146 return sizes[0] < size ? -EINVAL : 0;
147 *num_planes = 1;
148 sizes[0] = size;
150 return 0;149 return 0;
151}150}
152 151
@@ -271,7 +270,7 @@ static irqreturn_t dt3155_irq_handler_even(int irq, void *dev_id) · 118 unmodified lines
271 270
272 spin_lock(&ipd->lock);271 spin_lock(&ipd->lock);
273 if (ipd->curr_buf && !list_empty(&ipd->dmaq)) {272 if (ipd->curr_buf && !list_empty(&ipd->dmaq)) {
274 v4l2_get_timestamp(&ipd->curr_buf->timestamp);273 ipd->curr_buf->vb2_buf.timestamp = ktime_get_ns();
275 ipd->curr_buf->sequence = ipd->sequence++;274 ipd->curr_buf->sequence = ipd->sequence++;
276 ipd->curr_buf->field = V4L2_FIELD_NONE;275 ipd->curr_buf->field = V4L2_FIELD_NONE;
277 vb2_buffer_done(&ipd->curr_buf->vb2_buf, VB2_BUF_STATE_DONE);276 vb2_buffer_done(&ipd->curr_buf->vb2_buf, VB2_BUF_STATE_DONE);
drivers/media/pci/ivtv/ivtv-cards.c+6−6
@@ -22,12 +22,12 @@ · 21 unmodified lines
22#include "ivtv-cards.h"22#include "ivtv-cards.h"
23#include "ivtv-i2c.h"23#include "ivtv-i2c.h"
24 24
25#include <media/msp3400.h>25#include <media/drv-intf/msp3400.h>
26#include <media/m52790.h>26#include <media/i2c/m52790.h>
27#include <media/wm8775.h>27#include <media/i2c/wm8775.h>
28#include <media/cs53l32a.h>28#include <media/i2c/cs53l32a.h>
29#include <media/cx25840.h>29#include <media/drv-intf/cx25840.h>
30#include <media/upd64031a.h>30#include <media/i2c/upd64031a.h>
31 31
32#define MSP_TUNER MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \32#define MSP_TUNER MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
33 MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)33 MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)
drivers/media/pci/ivtv/ivtv-controls.c+1−1
@@ -96,7 +96,7 @@ static int ivtv_s_audio_mode(struct cx2341x_handler *cxhdl, u32 val) · 95 unmodified lines
96 return 0;96 return 0;
97}97}
98 98
99struct cx2341x_handler_ops ivtv_cxhdl_ops = {99const struct cx2341x_handler_ops ivtv_cxhdl_ops = {
100 .s_audio_mode = ivtv_s_audio_mode,100 .s_audio_mode = ivtv_s_audio_mode,
101 .s_audio_sampling_freq = ivtv_s_audio_sampling_freq,101 .s_audio_sampling_freq = ivtv_s_audio_sampling_freq,
102 .s_video_encoding = ivtv_s_video_encoding,102 .s_video_encoding = ivtv_s_video_encoding,
drivers/media/pci/ivtv/ivtv-controls.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21#ifndef IVTV_CONTROLS_H21#ifndef IVTV_CONTROLS_H
22#define IVTV_CONTROLS_H22#define IVTV_CONTROLS_H
23 23
24extern struct cx2341x_handler_ops ivtv_cxhdl_ops;24extern const struct cx2341x_handler_ops ivtv_cxhdl_ops;
25extern const struct v4l2_ctrl_ops ivtv_hdl_out_ops;25extern const struct v4l2_ctrl_ops ivtv_hdl_out_ops;
26int ivtv_g_pts_frame(struct ivtv *itv, s64 *pts, s64 *frame);26int ivtv_g_pts_frame(struct ivtv *itv, s64 *pts, s64 *frame);
27 27
drivers/media/pci/ivtv/ivtv-driver.c+2−2
@@ -57,7 +57,7 @@ · 56 unmodified lines
57#include "ivtv-gpio.h"57#include "ivtv-gpio.h"
58#include <linux/dma-mapping.h>58#include <linux/dma-mapping.h>
59#include <media/tveeprom.h>59#include <media/tveeprom.h>
60#include <media/saa7115.h>60#include <media/i2c/saa7115.h>
61#include "tuner-xc2028.h"61#include "tuner-xc2028.h"
62 62
63/* If you have already X v4l cards, then set this to X. This way63/* If you have already X v4l cards, then set this to X. This way
@@ -826,7 +826,7 @@ static void ivtv_init_struct2(struct ivtv *itv) · 762 unmodified lines
826 IVTV_CARD_INPUT_VID_TUNER)826 IVTV_CARD_INPUT_VID_TUNER)
827 break;827 break;
828 }828 }
829 if (i == itv->nof_inputs)829 if (i >= itv->nof_inputs)
830 i = 0;830 i = 0;
831 itv->active_input = i;831 itv->active_input = i;
832 itv->audio_input = itv->card->video_inputs[i].audio_index;832 itv->audio_input = itv->card->video_inputs[i].audio_index;
drivers/media/pci/ivtv/ivtv-driver.h+2−2
@@ -64,8 +64,8 @@ · 63 unmodified lines
64#include <media/v4l2-device.h>64#include <media/v4l2-device.h>
65#include <media/v4l2-fh.h>65#include <media/v4l2-fh.h>
66#include <media/tuner.h>66#include <media/tuner.h>
67#include <media/cx2341x.h>67#include <media/drv-intf/cx2341x.h>
68#include <media/ir-kbd-i2c.h>68#include <media/i2c/ir-kbd-i2c.h>
69 69
70#include <linux/ivtv.h>70#include <linux/ivtv.h>
71 71
drivers/media/pci/ivtv/ivtv-fileops.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
34#include "ivtv-cards.h"34#include "ivtv-cards.h"
35#include "ivtv-firmware.h"35#include "ivtv-firmware.h"
36#include <media/v4l2-event.h>36#include <media/v4l2-event.h>
37#include <media/saa7115.h>37#include <media/i2c/saa7115.h>
38 38
39/* This function tries to claim the stream for a specific file descriptor.39/* This function tries to claim the stream for a specific file descriptor.
40 If no one else is using this stream then the stream is claimed and40 If no one else is using this stream then the stream is claimed and
drivers/media/pci/ivtv/ivtv-firmware.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include "ivtv-ioctl.h"26#include "ivtv-ioctl.h"
27#include "ivtv-cards.h"27#include "ivtv-cards.h"
28#include <linux/firmware.h>28#include <linux/firmware.h>
29#include <media/saa7127.h>29#include <media/i2c/saa7127.h>
30 30
31#define IVTV_MASK_SPU_ENABLE 0xFFFFFFFE31#define IVTV_MASK_SPU_ENABLE 0xFFFFFFFE
32#define IVTV_MASK_VPU_ENABLE15 0xFFFFFFF632#define IVTV_MASK_VPU_ENABLE15 0xFFFFFFF6
drivers/media/pci/ivtv/ivtv-i2c.c+1−1
@@ -63,7 +63,7 @@ · 62 unmodified lines
63#include "ivtv-cards.h"63#include "ivtv-cards.h"
64#include "ivtv-gpio.h"64#include "ivtv-gpio.h"
65#include "ivtv-i2c.h"65#include "ivtv-i2c.h"
66#include <media/cx25840.h>66#include <media/drv-intf/cx25840.h>
67 67
68/* i2c implementation for cx23415/6 chip, ivtv project.68/* i2c implementation for cx23415/6 chip, ivtv project.
69 * Author: Kevin Thayer (nufan_wfk at yahoo.com)69 * Author: Kevin Thayer (nufan_wfk at yahoo.com)
drivers/media/pci/ivtv/ivtv-ioctl.c+5−5
@@ -32,7 +32,7 @@ · 31 unmodified lines
32#include "ivtv-gpio.h"32#include "ivtv-gpio.h"
33#include "ivtv-controls.h"33#include "ivtv-controls.h"
34#include "ivtv-cards.h"34#include "ivtv-cards.h"
35#include <media/saa7127.h>35#include <media/i2c/saa7127.h>
36#include <media/tveeprom.h>36#include <media/tveeprom.h>
37#include <media/v4l2-event.h>37#include <media/v4l2-event.h>
38#include <linux/dvb/audio.h>38#include <linux/dvb/audio.h>
@@ -831,11 +831,11 @@ static int ivtv_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropca · 792 unmodified lines
831 struct ivtv *itv = id->itv;831 struct ivtv *itv = id->itv;
832 832
833 if (cropcap->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {833 if (cropcap->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
834 cropcap->pixelaspect.numerator = itv->is_50hz ? 59 : 10;834 cropcap->pixelaspect.numerator = itv->is_50hz ? 54 : 11;
835 cropcap->pixelaspect.denominator = itv->is_50hz ? 54 : 11;835 cropcap->pixelaspect.denominator = itv->is_50hz ? 59 : 10;
836 } else if (cropcap->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {836 } else if (cropcap->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
837 cropcap->pixelaspect.numerator = itv->is_out_50hz ? 59 : 10;837 cropcap->pixelaspect.numerator = itv->is_out_50hz ? 54 : 11;
838 cropcap->pixelaspect.denominator = itv->is_out_50hz ? 54 : 11;838 cropcap->pixelaspect.denominator = itv->is_out_50hz ? 59 : 10;
839 } else {839 } else {
840 return -EINVAL;840 return -EINVAL;
841 }841 }
drivers/media/pci/ivtv/ivtv-routing.c+4−4
@@ -24,10 +24,10 @@ · 23 unmodified lines
24#include "ivtv-gpio.h"24#include "ivtv-gpio.h"
25#include "ivtv-routing.h"25#include "ivtv-routing.h"
26 26
27#include <media/msp3400.h>27#include <media/drv-intf/msp3400.h>
28#include <media/m52790.h>28#include <media/i2c/m52790.h>
29#include <media/upd64031a.h>29#include <media/i2c/upd64031a.h>
30#include <media/upd64083.h>30#include <media/i2c/upd64083.h>
31 31
32/* Selects the audio input and output according to the current32/* Selects the audio input and output according to the current
33 settings. */33 settings. */
drivers/media/pci/netup_unidvb/netup_unidvb_core.c+1−2
@@ -277,7 +277,6 @@ static irqreturn_t netup_unidvb_isr(int irq, void *dev_id) · 276 unmodified lines
277}277}
278 278
279static int netup_unidvb_queue_setup(struct vb2_queue *vq,279static int netup_unidvb_queue_setup(struct vb2_queue *vq,
280 const void *parg,
281 unsigned int *nbuffers,280 unsigned int *nbuffers,
282 unsigned int *nplanes,281 unsigned int *nplanes,
283 unsigned int sizes[],282 unsigned int sizes[],
@@ -580,7 +579,7 @@ static void netup_unidvb_dma_worker(struct work_struct *work) · 296 unmodified lines
580 dev_dbg(&ndev->pci_dev->dev,579 dev_dbg(&ndev->pci_dev->dev,
581 "%s(): buffer %p done, size %d\n",580 "%s(): buffer %p done, size %d\n",
582 __func__, buf, buf->size);581 __func__, buf, buf->size);
583 v4l2_get_timestamp(&buf->vb.timestamp);582 buf->vb.vb2_buf.timestamp = ktime_get_ns();
584 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->size);583 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->size);
585 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);584 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
586 }585 }
drivers/media/pci/saa7134/saa7134-core.c+1−1
@@ -309,7 +309,7 @@ void saa7134_buffer_finish(struct saa7134_dev *dev, · 308 unmodified lines
309 core_dbg("buffer_finish %p\n", q->curr);309 core_dbg("buffer_finish %p\n", q->curr);
310 310
311 /* finish current buffer */311 /* finish current buffer */
312 v4l2_get_timestamp(&q->curr->vb2.timestamp);312 q->curr->vb2.vb2_buf.timestamp = ktime_get_ns();
313 q->curr->vb2.sequence = q->seq_nr++;313 q->curr->vb2.sequence = q->seq_nr++;
314 vb2_buffer_done(&q->curr->vb2.vb2_buf, state);314 vb2_buffer_done(&q->curr->vb2.vb2_buf, state);
315 q->curr = NULL;315 q->curr = NULL;
drivers/media/pci/saa7134/saa7134-ts.c+1−1
@@ -116,7 +116,7 @@ int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2) · 115 unmodified lines
116}116}
117EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare);117EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare);
118 118
119int saa7134_ts_queue_setup(struct vb2_queue *q, const void *parg,119int saa7134_ts_queue_setup(struct vb2_queue *q,
120 unsigned int *nbuffers, unsigned int *nplanes,120 unsigned int *nbuffers, unsigned int *nplanes,
121 unsigned int sizes[], void *alloc_ctxs[])121 unsigned int sizes[], void *alloc_ctxs[])
122{122{
drivers/media/pci/saa7134/saa7134-vbi.c+1−1
@@ -138,7 +138,7 @@ static int buffer_prepare(struct vb2_buffer *vb2) · 137 unmodified lines
138 saa7134_buffer_startpage(buf));138 saa7134_buffer_startpage(buf));
139}139}
140 140
141static int queue_setup(struct vb2_queue *q, const void *parg,141static int queue_setup(struct vb2_queue *q,
142 unsigned int *nbuffers, unsigned int *nplanes,142 unsigned int *nbuffers, unsigned int *nplanes,
143 unsigned int sizes[], void *alloc_ctxs[])143 unsigned int sizes[], void *alloc_ctxs[])
144{144{
drivers/media/pci/saa7134/saa7134-video.c+2−2
@@ -32,7 +32,7 @@ · 31 unmodified lines
32 32
33#include <media/v4l2-common.h>33#include <media/v4l2-common.h>
34#include <media/v4l2-event.h>34#include <media/v4l2-event.h>
35#include <media/saa6588.h>35#include <media/i2c/saa6588.h>
36 36
37/* ------------------------------------------------------------------ */37/* ------------------------------------------------------------------ */
38 38
@@ -904,7 +904,7 @@ static int buffer_prepare(struct vb2_buffer *vb2) · 865 unmodified lines
904 saa7134_buffer_startpage(buf));904 saa7134_buffer_startpage(buf));
905}905}
906 906
907static int queue_setup(struct vb2_queue *q, const void *parg,907static int queue_setup(struct vb2_queue *q,
908 unsigned int *nbuffers, unsigned int *nplanes,908 unsigned int *nbuffers, unsigned int *nplanes,
909 unsigned int sizes[], void *alloc_ctxs[])909 unsigned int sizes[], void *alloc_ctxs[])
910{910{
drivers/media/pci/saa7134/saa7134.h+2−2
@@ -42,7 +42,7 @@ · 41 unmodified lines
42#include <media/v4l2-ctrls.h>42#include <media/v4l2-ctrls.h>
43#include <media/tuner.h>43#include <media/tuner.h>
44#include <media/rc-core.h>44#include <media/rc-core.h>
45#include <media/ir-kbd-i2c.h>45#include <media/i2c/ir-kbd-i2c.h>
46#include <media/videobuf2-dma-sg.h>46#include <media/videobuf2-dma-sg.h>
47#include <sound/core.h>47#include <sound/core.h>
48#include <sound/pcm.h>48#include <sound/pcm.h>
@@ -820,7 +820,7 @@ void saa7134_video_fini(struct saa7134_dev *dev); · 771 unmodified lines
820 820
821int saa7134_ts_buffer_init(struct vb2_buffer *vb2);821int saa7134_ts_buffer_init(struct vb2_buffer *vb2);
822int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2);822int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2);
823int saa7134_ts_queue_setup(struct vb2_queue *q, const void *parg,823int saa7134_ts_queue_setup(struct vb2_queue *q,
824 unsigned int *nbuffers, unsigned int *nplanes,824 unsigned int *nbuffers, unsigned int *nplanes,
825 unsigned int sizes[], void *alloc_ctxs[]);825 unsigned int sizes[], void *alloc_ctxs[]);
826int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count);826int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count);
drivers/media/pci/saa7146/hexium_gemini.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25 25
26#define DEBUG_VARIABLE debug26#define DEBUG_VARIABLE debug
27 27
28#include <media/saa7146_vv.h>28#include <media/drv-intf/saa7146_vv.h>
29#include <linux/module.h>29#include <linux/module.h>
30 30
31static int debug;31static int debug;
drivers/media/pci/saa7146/hexium_orion.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25 25
26#define DEBUG_VARIABLE debug26#define DEBUG_VARIABLE debug
27 27
28#include <media/saa7146_vv.h>28#include <media/drv-intf/saa7146_vv.h>
29#include <linux/module.h>29#include <linux/module.h>
30 30
31static int debug;31static int debug;
drivers/media/pci/saa7146/mxb.c+2−2
@@ -25,10 +25,10 @@ · 24 unmodified lines
25 25
26#define DEBUG_VARIABLE debug26#define DEBUG_VARIABLE debug
27 27
28#include <media/saa7146_vv.h>28#include <media/drv-intf/saa7146_vv.h>
29#include <media/tuner.h>29#include <media/tuner.h>
30#include <media/v4l2-common.h>30#include <media/v4l2-common.h>
31#include <media/saa7115.h>31#include <media/i2c/saa7115.h>
32#include <linux/module.h>32#include <linux/module.h>
33 33
34#include "tea6415c.h"34#include "tea6415c.h"
drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c+1−3
@@ -531,8 +531,7 @@ static int solo_enc_fillbuf(struct solo_enc_dev *solo_enc, · 530 unmodified lines
531 531
532 if (!ret) {532 if (!ret) {
533 vbuf->sequence = solo_enc->sequence++;533 vbuf->sequence = solo_enc->sequence++;
534 vbuf->timestamp.tv_sec = vop_sec(vh);534 vb->timestamp = ktime_get_ns();
535 vbuf->timestamp.tv_usec = vop_usec(vh);
536 535
537 /* Check for motion flags */536 /* Check for motion flags */
538 if (solo_is_motion_on(solo_enc) && enc_buf->motion) {537 if (solo_is_motion_on(solo_enc) && enc_buf->motion) {
@@ -663,7 +662,6 @@ static int solo_ring_thread(void *data) · 124 unmodified lines
663}662}
664 663
665static int solo_enc_queue_setup(struct vb2_queue *q,664static int solo_enc_queue_setup(struct vb2_queue *q,
666 const void *parg,
667 unsigned int *num_buffers,665 unsigned int *num_buffers,
668 unsigned int *num_planes, unsigned int sizes[],666 unsigned int *num_planes, unsigned int sizes[],
669 void *alloc_ctxs[])667 void *alloc_ctxs[])
drivers/media/pci/solo6x10/solo6x10-v4l2.c+2−2
@@ -225,7 +225,7 @@ finish_buf: · 224 unmodified lines
225 vb2_set_plane_payload(vb, 0,225 vb2_set_plane_payload(vb, 0,
226 solo_vlines(solo_dev) * solo_bytesperline(solo_dev));226 solo_vlines(solo_dev) * solo_bytesperline(solo_dev));
227 vbuf->sequence = solo_dev->sequence++;227 vbuf->sequence = solo_dev->sequence++;
228 v4l2_get_timestamp(&vbuf->timestamp);228 vb->timestamp = ktime_get_ns();
229 }229 }
230 230
231 vb2_buffer_done(vb, error ? VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);231 vb2_buffer_done(vb, error ? VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
@@ -313,7 +313,7 @@ static void solo_stop_thread(struct solo_dev *solo_dev) · 81 unmodified lines
313 solo_dev->kthread = NULL;313 solo_dev->kthread = NULL;
314}314}
315 315
316static int solo_queue_setup(struct vb2_queue *q, const void *parg,316static int solo_queue_setup(struct vb2_queue *q,
317 unsigned int *num_buffers, unsigned int *num_planes,317 unsigned int *num_buffers, unsigned int *num_planes,
318 unsigned int sizes[], void *alloc_ctxs[])318 unsigned int sizes[], void *alloc_ctxs[])
319{319{
drivers/media/pci/sta2x11/sta2x11_vip.c+2−2
@@ -265,7 +265,7 @@ static void vip_active_buf_next(struct sta2x11_vip *vip) · 264 unmodified lines
265 265
266 266
267/* Videobuf2 Operations */267/* Videobuf2 Operations */
268static int queue_setup(struct vb2_queue *vq, const void *parg,268static int queue_setup(struct vb2_queue *vq,
269 unsigned int *nbuffers, unsigned int *nplanes,269 unsigned int *nbuffers, unsigned int *nplanes,
270 unsigned int sizes[], void *alloc_ctxs[])270 unsigned int sizes[], void *alloc_ctxs[])
271{271{
@@ -817,7 +817,7 @@ static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip) · 545 unmodified lines
817 /* Disable acquisition */817 /* Disable acquisition */
818 reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA);818 reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA);
819 /* Remove the active buffer from the list */819 /* Remove the active buffer from the list */
820 v4l2_get_timestamp(&vip->active->vb.timestamp);820 vip->active->vb.vb2_buf.timestamp = ktime_get_ns();
821 vip->active->vb.sequence = vip->sequence++;821 vip->active->vb.sequence = vip->sequence++;
822 vb2_buffer_done(&vip->active->vb.vb2_buf, VB2_BUF_STATE_DONE);822 vb2_buffer_done(&vip->active->vb.vb2_buf, VB2_BUF_STATE_DONE);
823 }823 }
drivers/media/pci/ttpci/av7110.c+3−3
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
27 *27 *
28 *28 *
29 * the project's page is at http://www.linuxtv.org/ 29 * the project's page is at https://linuxtv.org
30 */30 */
31 31
32 32
@@ -1537,7 +1537,7 @@ static int get_firmware(struct av7110* av7110) · 1504 unmodified lines
1537 printk(KERN_ERR "dvb-ttpci: usually this should be in "1537 printk(KERN_ERR "dvb-ttpci: usually this should be in "
1538 "/usr/lib/hotplug/firmware or /lib/firmware\n");1538 "/usr/lib/hotplug/firmware or /lib/firmware\n");
1539 printk(KERN_ERR "dvb-ttpci: and can be downloaded from"1539 printk(KERN_ERR "dvb-ttpci: and can be downloaded from"
1540 " http://www.linuxtv.org/download/dvb/firmware/\n");1540 " https://linuxtv.org/download/dvb/firmware/\n");
1541 } else1541 } else
1542 printk(KERN_ERR "dvb-ttpci: cannot request firmware"1542 printk(KERN_ERR "dvb-ttpci: cannot request firmware"
1543 " (error %i)\n", ret);1543 " (error %i)\n", ret);
@@ -2314,7 +2314,7 @@ static int frontend_init(struct av7110 *av7110) · 770 unmodified lines
2314/* Budgetpatch note:2314/* Budgetpatch note:
2315 * Original hardware design by Roberto Deza:2315 * Original hardware design by Roberto Deza:
2316 * There is a DVB_Wiki at2316 * There is a DVB_Wiki at
2317 * http://www.linuxtv.org/2317 * https://linuxtv.org
2318 *2318 *
2319 * New software triggering design by Emard that works on2319 * New software triggering design by Emard that works on
2320 * original Roberto Deza's hardware:2320 * original Roberto Deza's hardware:
drivers/media/pci/ttpci/av7110.h+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
32#include "stv0297.h"32#include "stv0297.h"
33#include "l64781.h"33#include "l64781.h"
34 34
35#include <media/saa7146_vv.h>35#include <media/drv-intf/saa7146_vv.h>
36 36
37 37
38#define ANALOG_TUNER_VES1820 138#define ANALOG_TUNER_VES1820 1
drivers/media/pci/ttpci/av7110_av.c+8−3
@@ -25,7 +25,7 @@ · 24 unmodified lines
25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
26 *26 *
27 *27 *
28 * the project's page is at http://www.linuxtv.org/ 28 * the project's page is at https://linuxtv.org
29 */29 */
30 30
31#include <linux/types.h>31#include <linux/types.h>
@@ -280,9 +280,11 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen) · 248 unmodified lines
280}280}
281 281
282 282
283int av7110_set_volume(struct av7110 *av7110, int volleft, int volright)283int av7110_set_volume(struct av7110 *av7110, unsigned int volleft,
284 unsigned int volright)
284{285{
285 int err, vol, val, balance = 0;286 unsigned int vol, val, balance = 0;
287 int err;
286 288
287 dprintk(2, "av7110:%p, \n", av7110);289 dprintk(2, "av7110:%p, \n", av7110);
288 290
@@ -1043,6 +1045,9 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len · 754 unmodified lines
1043 1045
1044 dprintk(2, "av7110:%p, \n", av7110);1046 dprintk(2, "av7110:%p, \n", av7110);
1045 1047
1048 if (len == 0)
1049 return 0;
1050
1046 if (!(av7110->playing & RP_VIDEO)) {1051 if (!(av7110->playing & RP_VIDEO)) {
1047 if (av7110_av_start_play(av7110, RP_VIDEO) < 0)1052 if (av7110_av_start_play(av7110, RP_VIDEO) < 0)
1048 return -EBUSY;1053 return -EBUSY;
drivers/media/pci/ttpci/av7110_av.h+2−1
@@ -10,7 +10,8 @@ extern int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len); · 9 unmodified lines
10extern int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen);10extern int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen);
11extern int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len);11extern int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len);
12 12
13extern int av7110_set_volume(struct av7110 *av7110, int volleft, int volright);13extern int av7110_set_volume(struct av7110 *av7110, unsigned int volleft,
14 unsigned int volright);
14extern int av7110_av_stop(struct av7110 *av7110, int av);15extern int av7110_av_stop(struct av7110 *av7110, int av);
15extern int av7110_av_start_record(struct av7110 *av7110, int av,16extern int av7110_av_start_record(struct av7110 *av7110, int av,
16 struct dvb_demux_feed *dvbdmxfeed);17 struct dvb_demux_feed *dvbdmxfeed);
drivers/media/pci/ttpci/av7110_ca.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
26 *26 *
27 *27 *
28 * the project's page is at http://www.linuxtv.org/ 28 * the project's page is at https://linuxtv.org
29 */29 */
30 30
31#include <linux/kernel.h>31#include <linux/kernel.h>
drivers/media/pci/ttpci/av7110_hw.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
24 *24 *
25 * the project's page is at http://www.linuxtv.org/25 * the project's page is at https://linuxtv.org
26 */26 */
27 27
28/* for debugging ARM communication: */28/* for debugging ARM communication: */
drivers/media/pci/ttpci/av7110_v4l.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
24 *24 *
25 * the project's page is at http://www.linuxtv.org/ 25 * the project's page is at https://linuxtv.org
26 */26 */
27 27
28#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt28#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
drivers/media/pci/ttpci/budget-av.c+2−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html30 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
31 *31 *
32 *32 *
33 * the project's page is at http://www.linuxtv.org/ 33 * the project's page is at https://linuxtv.org
34 */34 */
35 35
36#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt36#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -46,7 +46,7 @@ · 9 unmodified lines
46#include "tda1004x.h"46#include "tda1004x.h"
47#include "tua6100.h"47#include "tua6100.h"
48#include "dvb-pll.h"48#include "dvb-pll.h"
49#include <media/saa7146_vv.h>49#include <media/drv-intf/saa7146_vv.h>
50#include <linux/module.h>50#include <linux/module.h>
51#include <linux/errno.h>51#include <linux/errno.h>
52#include <linux/slab.h>52#include <linux/slab.h>
drivers/media/pci/ttpci/budget-ci.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
27 *27 *
28 *28 *
29 * the project's page is at http://www.linuxtv.org/29 * the project's page is at https://linuxtv.org
30 */30 */
31 31
32#include <linux/module.h>32#include <linux/module.h>
drivers/media/pci/ttpci/budget-core.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
32 *32 *
33 *33 *
34 * the project's page is at http://www.linuxtv.org/ 34 * the project's page is at https://linuxtv.org
35 */35 */
36 36
37 37
drivers/media/pci/ttpci/budget-patch.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html27 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
28 *28 *
29 *29 *
30 * the project's page is at http://www.linuxtv.org/ 30 * the project's page is at https://linuxtv.org
31 */31 */
32 32
33#include "av7110.h"33#include "av7110.h"
drivers/media/pci/ttpci/budget.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
32 *32 *
33 *33 *
34 * the project's page is at http://www.linuxtv.org/ 34 * the project's page is at https://linuxtv.org
35 */35 */
36 36
37#include "budget.h"37#include "budget.h"
drivers/media/pci/ttpci/budget.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13#include <linux/module.h>13#include <linux/module.h>
14#include <linux/mutex.h>14#include <linux/mutex.h>
15 15
16#include <media/saa7146.h>16#include <media/drv-intf/saa7146.h>
17 17
18extern int budget_debug;18extern int budget_debug;
19 19
drivers/media/pci/tw68/tw68-video.c+11−11
@@ -376,28 +376,28 @@ static int tw68_buffer_count(unsigned int size, unsigned int count) · 375 unmodified lines
376/* ------------------------------------------------------------- */376/* ------------------------------------------------------------- */
377/* vb2 queue operations */377/* vb2 queue operations */
378 378
379static int tw68_queue_setup(struct vb2_queue *q, const void *parg,379static int tw68_queue_setup(struct vb2_queue *q,
380 unsigned int *num_buffers, unsigned int *num_planes,380 unsigned int *num_buffers, unsigned int *num_planes,
381 unsigned int sizes[], void *alloc_ctxs[])381 unsigned int sizes[], void *alloc_ctxs[])
382{382{
383 const struct v4l2_format *fmt = parg;
384 struct tw68_dev *dev = vb2_get_drv_priv(q);383 struct tw68_dev *dev = vb2_get_drv_priv(q);
385 unsigned tot_bufs = q->num_buffers + *num_buffers;384 unsigned tot_bufs = q->num_buffers + *num_buffers;
385 unsigned size = (dev->fmt->depth * dev->width * dev->height) >> 3;
386 386
387 sizes[0] = (dev->fmt->depth * dev->width * dev->height) >> 3;387 if (tot_bufs < 2)
388 tot_bufs = 2;
389 tot_bufs = tw68_buffer_count(size, tot_bufs);
390 *num_buffers = tot_bufs - q->num_buffers;
388 alloc_ctxs[0] = dev->alloc_ctx;391 alloc_ctxs[0] = dev->alloc_ctx;
389 /*392 /*
390 * We allow create_bufs, but only if the sizeimage is the same as the393 * We allow create_bufs, but only if the sizeimage is >= as the
391 * current sizeimage. The tw68_buffer_count calculation becomes quite394 * current sizeimage. The tw68_buffer_count calculation becomes quite
392 * difficult otherwise.395 * difficult otherwise.
393 */396 */
394 if (fmt && fmt->fmt.pix.sizeimage < sizes[0])397 if (*num_planes)
395 return -EINVAL;398 return sizes[0] < size ? -EINVAL : 0;
396 *num_planes = 1;399 *num_planes = 1;
397 if (tot_bufs < 2)400 sizes[0] = size;
398 tot_bufs = 2;
399 tot_bufs = tw68_buffer_count(sizes[0], tot_bufs);
400 *num_buffers = tot_bufs - q->num_buffers;
401 401
402 return 0;402 return 0;
403}403}
@@ -1016,7 +1016,7 @@ void tw68_irq_video_done(struct tw68_dev *dev, unsigned long status) · 612 unmodified lines
1016 buf = list_entry(dev->active.next, struct tw68_buf, list);1016 buf = list_entry(dev->active.next, struct tw68_buf, list);
1017 list_del(&buf->list);1017 list_del(&buf->list);
1018 spin_unlock(&dev->slock);1018 spin_unlock(&dev->slock);
1019 v4l2_get_timestamp(&buf->vb.timestamp);1019 buf->vb.vb2_buf.timestamp = ktime_get_ns();
1020 buf->vb.field = dev->field;1020 buf->vb.field = dev->field;
1021 buf->vb.sequence = dev->seqnr++;1021 buf->vb.sequence = dev->seqnr++;
1022 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);1022 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
drivers/media/pci/zoran/zoran_card.c+1−1
@@ -50,7 +50,7 @@ · 49 unmodified lines
50#include <linux/mutex.h>50#include <linux/mutex.h>
51#include <linux/io.h>51#include <linux/io.h>
52#include <media/v4l2-common.h>52#include <media/v4l2-common.h>
53#include <media/bt819.h>53#include <media/i2c/bt819.h>
54 54
55#include "videocodec.h"55#include "videocodec.h"
56#include "zoran.h"56#include "zoran.h"
drivers/media/platform/Kconfig+1−1
@@ -38,7 +38,7 @@ config VIDEO_SH_VOU · 37 unmodified lines
38 depends on MEDIA_CAMERA_SUPPORT38 depends on MEDIA_CAMERA_SUPPORT
39 depends on VIDEO_DEV && I2C && HAS_DMA39 depends on VIDEO_DEV && I2C && HAS_DMA
40 depends on ARCH_SHMOBILE || COMPILE_TEST40 depends on ARCH_SHMOBILE || COMPILE_TEST
41 select VIDEOBUF_DMA_CONTIG41 select VIDEOBUF2_DMA_CONTIG
42 help42 help
43 Support for the Video Output Unit (VOU) on SuperH SoCs.43 Support for the Video Output Unit (VOU) on SuperH SoCs.
44 44
drivers/media/platform/am437x/am437x-vpfe.c+10−9
@@ -1281,7 +1281,7 @@ static inline void vpfe_schedule_bottom_field(struct vpfe_device *vpfe) · 1280 unmodified lines
1281 */1281 */
1282static inline void vpfe_process_buffer_complete(struct vpfe_device *vpfe)1282static inline void vpfe_process_buffer_complete(struct vpfe_device *vpfe)
1283{1283{
1284 v4l2_get_timestamp(&vpfe->cur_frm->vb.timestamp);1284 vpfe->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
1285 vpfe->cur_frm->vb.field = vpfe->fmt.fmt.pix.field;1285 vpfe->cur_frm->vb.field = vpfe->fmt.fmt.pix.field;
1286 vpfe->cur_frm->vb.sequence = vpfe->sequence++;1286 vpfe->cur_frm->vb.sequence = vpfe->sequence++;
1287 vb2_buffer_done(&vpfe->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);1287 vb2_buffer_done(&vpfe->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
@@ -1898,7 +1898,6 @@ static void vpfe_calculate_offsets(struct vpfe_device *vpfe) · 610 unmodified lines
1898/*1898/*
1899 * vpfe_queue_setup - Callback function for buffer setup.1899 * vpfe_queue_setup - Callback function for buffer setup.
1900 * @vq: vb2_queue ptr1900 * @vq: vb2_queue ptr
1901 * @fmt: v4l2 format
1902 * @nbuffers: ptr to number of buffers requested by application1901 * @nbuffers: ptr to number of buffers requested by application
1903 * @nplanes:: contains number of distinct video planes needed to hold a frame1902 * @nplanes:: contains number of distinct video planes needed to hold a frame
1904 * @sizes[]: contains the size (in bytes) of each plane.1903 * @sizes[]: contains the size (in bytes) of each plane.
@@ -1908,22 +1907,24 @@ static void vpfe_calculate_offsets(struct vpfe_device *vpfe) · 3 unmodified lines
1908 * the buffer count and buffer size1907 * the buffer count and buffer size
1909 */1908 */
1910static int vpfe_queue_setup(struct vb2_queue *vq,1909static int vpfe_queue_setup(struct vb2_queue *vq,
1911 const void *parg,
1912 unsigned int *nbuffers, unsigned int *nplanes,1910 unsigned int *nbuffers, unsigned int *nplanes,
1913 unsigned int sizes[], void *alloc_ctxs[])1911 unsigned int sizes[], void *alloc_ctxs[])
1914{1912{
1915 const struct v4l2_format *fmt = parg;
1916 struct vpfe_device *vpfe = vb2_get_drv_priv(vq);1913 struct vpfe_device *vpfe = vb2_get_drv_priv(vq);
1917 1914 unsigned size = vpfe->fmt.fmt.pix.sizeimage;
1918 if (fmt && fmt->fmt.pix.sizeimage < vpfe->fmt.fmt.pix.sizeimage)
1919 return -EINVAL;
1920 1915
1921 if (vq->num_buffers + *nbuffers < 3)1916 if (vq->num_buffers + *nbuffers < 3)
1922 *nbuffers = 3 - vq->num_buffers;1917 *nbuffers = 3 - vq->num_buffers;
1918 alloc_ctxs[0] = vpfe->alloc_ctx;
1919
1920 if (*nplanes) {
1921 if (sizes[0] < size)
1922 return -EINVAL;
1923 size = sizes[0];
1924 }
1923 1925
1924 *nplanes = 1;1926 *nplanes = 1;
1925 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : vpfe->fmt.fmt.pix.sizeimage;1927 sizes[0] = size;
1926 alloc_ctxs[0] = vpfe->alloc_ctx;
1927 1928
1928 vpfe_dbg(1, vpfe,1929 vpfe_dbg(1, vpfe,
1929 "nbuffers=%d, size=%u\n", *nbuffers, sizes[0]);1930 "nbuffers=%d, size=%u\n", *nbuffers, sizes[0]);
drivers/media/platform/blackfin/bfin_capture.c+6−8
@@ -202,22 +202,20 @@ static void bcap_free_sensor_formats(struct bcap_device *bcap_dev) · 201 unmodified lines
202}202}
203 203
204static int bcap_queue_setup(struct vb2_queue *vq,204static int bcap_queue_setup(struct vb2_queue *vq,
205 const void *parg,
206 unsigned int *nbuffers, unsigned int *nplanes,205 unsigned int *nbuffers, unsigned int *nplanes,
207 unsigned int sizes[], void *alloc_ctxs[])206 unsigned int sizes[], void *alloc_ctxs[])
208{207{
209 const struct v4l2_format *fmt = parg;
210 struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);208 struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
211 209
212 if (fmt && fmt->fmt.pix.sizeimage < bcap_dev->fmt.sizeimage)
213 return -EINVAL;
214
215 if (vq->num_buffers + *nbuffers < 2)210 if (vq->num_buffers + *nbuffers < 2)
216 *nbuffers = 2;211 *nbuffers = 2;
212 alloc_ctxs[0] = bcap_dev->alloc_ctx;
213
214 if (*nplanes)
215 return sizes[0] < bcap_dev->fmt.sizeimage ? -EINVAL : 0;
217 216
218 *nplanes = 1;217 *nplanes = 1;
219 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : bcap_dev->fmt.sizeimage;218 sizes[0] = bcap_dev->fmt.sizeimage;
220 alloc_ctxs[0] = bcap_dev->alloc_ctx;
221 219
222 return 0;220 return 0;
223}221}
@@ -406,7 +404,7 @@ static irqreturn_t bcap_isr(int irq, void *dev_id) · 182 unmodified lines
406 spin_lock(&bcap_dev->lock);404 spin_lock(&bcap_dev->lock);
407 405
408 if (!list_empty(&bcap_dev->dma_queue)) {406 if (!list_empty(&bcap_dev->dma_queue)) {
409 v4l2_get_timestamp(&vbuf->timestamp);407 vb->timestamp = ktime_get_ns();
410 if (ppi->err) {408 if (ppi->err) {
411 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);409 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
412 ppi->err = false;410 ppi->err = false;
drivers/media/platform/coda/coda-bit.c+4−4
@@ -246,7 +246,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, bool streaming) · 245 unmodified lines
246 246
247 /* Drop frames that do not start/end with a SOI/EOI markers */247 /* Drop frames that do not start/end with a SOI/EOI markers */
248 if (ctx->codec->src_fourcc == V4L2_PIX_FMT_JPEG &&248 if (ctx->codec->src_fourcc == V4L2_PIX_FMT_JPEG &&
249 !coda_jpeg_check_buffer(ctx, src_buf)) {249 !coda_jpeg_check_buffer(ctx, &src_buf->vb2_buf)) {
250 v4l2_err(&ctx->dev->v4l2_dev,250 v4l2_err(&ctx->dev->v4l2_dev,
251 "dropping invalid JPEG frame %d\n",251 "dropping invalid JPEG frame %d\n",
252 ctx->qsequence);252 ctx->qsequence);
@@ -279,7 +279,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, bool streaming) · 26 unmodified lines
279 if (meta) {279 if (meta) {
280 meta->sequence = src_buf->sequence;280 meta->sequence = src_buf->sequence;
281 meta->timecode = src_buf->timecode;281 meta->timecode = src_buf->timecode;
282 meta->timestamp = src_buf->timestamp;282 meta->timestamp = src_buf->vb2_buf.timestamp;
283 meta->start = start;283 meta->start = start;
284 meta->end = ctx->bitstream_fifo.kfifo.in &284 meta->end = ctx->bitstream_fifo.kfifo.in &
285 ctx->bitstream_fifo.kfifo.mask;285 ctx->bitstream_fifo.kfifo.mask;
@@ -1364,7 +1364,7 @@ static void coda_finish_encode(struct coda_ctx *ctx) · 1078 unmodified lines
1364 dst_buf->flags &= ~V4L2_BUF_FLAG_KEYFRAME;1364 dst_buf->flags &= ~V4L2_BUF_FLAG_KEYFRAME;
1365 }1365 }
1366 1366
1367 dst_buf->timestamp = src_buf->timestamp;1367 dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
1368 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;1368 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
1369 dst_buf->flags |=1369 dst_buf->flags |=
1370 src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;1370 src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
@@ -2040,7 +2040,7 @@ static void coda_finish_decode(struct coda_ctx *ctx) · 669 unmodified lines
2040 dst_buf->flags |= ctx->frame_types[ctx->display_idx];2040 dst_buf->flags |= ctx->frame_types[ctx->display_idx];
2041 meta = &ctx->frame_metas[ctx->display_idx];2041 meta = &ctx->frame_metas[ctx->display_idx];
2042 dst_buf->timecode = meta->timecode;2042 dst_buf->timecode = meta->timecode;
2043 dst_buf->timestamp = meta->timestamp;2043 dst_buf->vb2_buf.timestamp = meta->timestamp;
2044 2044
2045 trace_coda_dec_rot_done(ctx, dst_buf, meta);2045 trace_coda_dec_rot_done(ctx, dst_buf, meta);
2046 2046
drivers/media/platform/coda/coda-common.c+12−13
@@ -28,7 +28,7 @@ · 27 unmodified lines
28#include <linux/slab.h>28#include <linux/slab.h>
29#include <linux/videodev2.h>29#include <linux/videodev2.h>
30#include <linux/of.h>30#include <linux/of.h>
31#include <linux/platform_data/coda.h>31#include <linux/platform_data/media/coda.h>
32#include <linux/reset.h>32#include <linux/reset.h>
33 33
34#include <media/v4l2-ctrls.h>34#include <media/v4l2-ctrls.h>
@@ -131,6 +131,7 @@ static const struct coda_codec coda7_codecs[] = { · 96 unmodified lines
131 CODA_CODEC(CODA7_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1280, 720),131 CODA_CODEC(CODA7_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1280, 720),
132 CODA_CODEC(CODA7_MODE_ENCODE_MJPG, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_JPEG, 8192, 8192),132 CODA_CODEC(CODA7_MODE_ENCODE_MJPG, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_JPEG, 8192, 8192),
133 CODA_CODEC(CODA7_MODE_DECODE_H264, V4L2_PIX_FMT_H264, V4L2_PIX_FMT_YUV420, 1920, 1088),133 CODA_CODEC(CODA7_MODE_DECODE_H264, V4L2_PIX_FMT_H264, V4L2_PIX_FMT_YUV420, 1920, 1088),
134 CODA_CODEC(CODA7_MODE_DECODE_MP2, V4L2_PIX_FMT_MPEG2, V4L2_PIX_FMT_YUV420, 1920, 1088),
134 CODA_CODEC(CODA7_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1920, 1088),135 CODA_CODEC(CODA7_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1920, 1088),
135 CODA_CODEC(CODA7_MODE_DECODE_MJPG, V4L2_PIX_FMT_JPEG, V4L2_PIX_FMT_YUV420, 8192, 8192),136 CODA_CODEC(CODA7_MODE_DECODE_MJPG, V4L2_PIX_FMT_JPEG, V4L2_PIX_FMT_YUV420, 8192, 8192),
136};137};
@@ -139,6 +140,7 @@ static const struct coda_codec coda9_codecs[] = { · 2 unmodified lines
139 CODA_CODEC(CODA9_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 1920, 1088),140 CODA_CODEC(CODA9_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 1920, 1088),
140 CODA_CODEC(CODA9_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1920, 1088),141 CODA_CODEC(CODA9_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1920, 1088),
141 CODA_CODEC(CODA9_MODE_DECODE_H264, V4L2_PIX_FMT_H264, V4L2_PIX_FMT_YUV420, 1920, 1088),142 CODA_CODEC(CODA9_MODE_DECODE_H264, V4L2_PIX_FMT_H264, V4L2_PIX_FMT_YUV420, 1920, 1088),
143 CODA_CODEC(CODA9_MODE_DECODE_MP2, V4L2_PIX_FMT_MPEG2, V4L2_PIX_FMT_YUV420, 1920, 1088),
142 CODA_CODEC(CODA9_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1920, 1088),144 CODA_CODEC(CODA9_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1920, 1088),
143};145};
144 146
@@ -187,6 +189,7 @@ static const struct coda_video_device coda_bit_decoder = { · 42 unmodified lines
187 .ops = &coda_bit_decode_ops,189 .ops = &coda_bit_decode_ops,
188 .src_formats = {190 .src_formats = {
189 V4L2_PIX_FMT_H264,191 V4L2_PIX_FMT_H264,
192 V4L2_PIX_FMT_MPEG2,
190 V4L2_PIX_FMT_MPEG4,193 V4L2_PIX_FMT_MPEG4,
191 },194 },
192 .dst_formats = {195 .dst_formats = {
@@ -293,7 +296,8 @@ static void coda_get_max_dimensions(struct coda_dev *dev, · 100 unmodified lines
293 *max_h = h;296 *max_h = h;
294}297}
295 298
296const struct coda_video_device *to_coda_video_device(struct video_device *vdev)299static const struct coda_video_device *to_coda_video_device(struct video_device
300 *vdev)
297{301{
298 struct coda_dev *dev = video_get_drvdata(vdev);302 struct coda_dev *dev = video_get_drvdata(vdev);
299 unsigned int i = vdev - dev->vfd;303 unsigned int i = vdev - dev->vfd;
@@ -469,6 +473,7 @@ static int coda_try_fmt(struct coda_ctx *ctx, const struct coda_codec *codec, · 169 unmodified lines
469 /* fallthrough */473 /* fallthrough */
470 case V4L2_PIX_FMT_H264:474 case V4L2_PIX_FMT_H264:
471 case V4L2_PIX_FMT_MPEG4:475 case V4L2_PIX_FMT_MPEG4:
476 case V4L2_PIX_FMT_MPEG2:
472 f->fmt.pix.bytesperline = 0;477 f->fmt.pix.bytesperline = 0;
473 f->fmt.pix.sizeimage = coda_estimate_sizeimage(ctx,478 f->fmt.pix.sizeimage = coda_estimate_sizeimage(ctx,
474 f->fmt.pix.sizeimage,479 f->fmt.pix.sizeimage,
@@ -920,6 +925,7 @@ static const struct v4l2_ioctl_ops coda_ioctl_ops = { · 445 unmodified lines
920 .vidioc_expbuf = v4l2_m2m_ioctl_expbuf,925 .vidioc_expbuf = v4l2_m2m_ioctl_expbuf,
921 .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf,926 .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf,
922 .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs,927 .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs,
928 .vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf,
923 929
924 .vidioc_streamon = v4l2_m2m_ioctl_streamon,930 .vidioc_streamon = v4l2_m2m_ioctl_streamon,
925 .vidioc_streamoff = v4l2_m2m_ioctl_streamoff,931 .vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
@@ -1131,7 +1137,7 @@ static void set_default_params(struct coda_ctx *ctx) · 205 unmodified lines
1131/*1137/*
1132 * Queue operations1138 * Queue operations
1133 */1139 */
1134static int coda_queue_setup(struct vb2_queue *vq, const void *parg,1140static int coda_queue_setup(struct vb2_queue *vq,
1135 unsigned int *nbuffers, unsigned int *nplanes,1141 unsigned int *nbuffers, unsigned int *nplanes,
1136 unsigned int sizes[], void *alloc_ctxs[])1142 unsigned int sizes[], void *alloc_ctxs[])
1137{1143{
@@ -1250,6 +1256,9 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) · 112 unmodified lines
1250 struct vb2_v4l2_buffer *buf;1256 struct vb2_v4l2_buffer *buf;
1251 int ret = 0;1257 int ret = 0;
1252 1258
1259 if (count < 1)
1260 return -EINVAL;
1261
1253 q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);1262 q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
1254 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {1263 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
1255 if (ctx->inst_type == CODA_INST_DECODER && ctx->use_bit) {1264 if (ctx->inst_type == CODA_INST_DECODER && ctx->use_bit) {
@@ -1262,20 +1271,10 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) · 6 unmodified lines
1262 ret = -EINVAL;1271 ret = -EINVAL;
1263 goto err;1272 goto err;
1264 }1273 }
1265 } else {
1266 if (count < 1) {
1267 ret = -EINVAL;
1268 goto err;
1269 }
1270 }1274 }
1271 1275
1272 ctx->streamon_out = 1;1276 ctx->streamon_out = 1;
1273 } else {1277 } else {
1274 if (count < 1) {
1275 ret = -EINVAL;
1276 goto err;
1277 }
1278
1279 ctx->streamon_cap = 1;1278 ctx->streamon_cap = 1;
1280 }1279 }
1281 1280
drivers/media/platform/coda/coda-jpeg.c+20−6
@@ -178,14 +178,28 @@ int coda_jpeg_write_tables(struct coda_ctx *ctx) · 177 unmodified lines
178 return 0;178 return 0;
179}179}
180 180
181bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_v4l2_buffer *vb)181bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_buffer *vb)
182{182{
183 void *vaddr = vb2_plane_vaddr(&vb->vb2_buf, 0);183 void *vaddr = vb2_plane_vaddr(vb, 0);
184 u16 soi = be16_to_cpup((__be16 *)vaddr);184 u16 soi, eoi;
185 u16 eoi = be16_to_cpup((__be16 *)(vaddr +185 int len, i;
186 vb2_get_plane_payload(&vb->vb2_buf, 0) - 2));186
187 soi = be16_to_cpup((__be16 *)vaddr);
188 if (soi != SOI_MARKER)
189 return false;
190
191 len = vb2_get_plane_payload(vb, 0);
192 vaddr += len - 2;
193 for (i = 0; i < 32; i++) {
194 eoi = be16_to_cpup((__be16 *)(vaddr - i));
195 if (eoi == EOI_MARKER) {
196 if (i > 0)
197 vb2_set_plane_payload(vb, 0, len - i);
198 return true;
199 }
200 }
187 201
188 return soi == SOI_MARKER && eoi == EOI_MARKER;202 return false;
189}203}
190 204
191/*205/*
drivers/media/platform/coda/coda.h+2−2
@@ -138,7 +138,7 @@ struct coda_buffer_meta { · 137 unmodified lines
138 struct list_head list;138 struct list_head list;
139 u32 sequence;139 u32 sequence;
140 struct v4l2_timecode timecode;140 struct v4l2_timecode timecode;
141 struct timeval timestamp;141 u64 timestamp;
142 u32 start;142 u32 start;
143 u32 end;143 u32 end;
144};144};
@@ -289,7 +289,7 @@ void coda_m2m_buf_done(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf, · 144 unmodified lines
289 289
290int coda_h264_padding(int size, char *p);290int coda_h264_padding(int size, char *p);
291 291
292bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_v4l2_buffer *vb);292bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_buffer *vb);
293int coda_jpeg_write_tables(struct coda_ctx *ctx);293int coda_jpeg_write_tables(struct coda_ctx *ctx);
294void coda_set_jpeg_compression_quality(struct coda_ctx *ctx, int quality);294void coda_set_jpeg_compression_quality(struct coda_ctx *ctx, int quality);
295 295
drivers/media/platform/davinci/Kconfig+6−0
@@ -3,6 +3,7 @@ config VIDEO_DAVINCI_VPIF_DISPLAY · 2 unmodified lines
3 depends on VIDEO_V4L23 depends on VIDEO_V4L2
4 depends on ARCH_DAVINCI || COMPILE_TEST4 depends on ARCH_DAVINCI || COMPILE_TEST
5 depends on HAS_DMA5 depends on HAS_DMA
6 depends on I2C
6 select VIDEOBUF2_DMA_CONTIG7 select VIDEOBUF2_DMA_CONTIG
7 select VIDEO_ADV7343 if MEDIA_SUBDRV_AUTOSELECT8 select VIDEO_ADV7343 if MEDIA_SUBDRV_AUTOSELECT
8 select VIDEO_THS7303 if MEDIA_SUBDRV_AUTOSELECT9 select VIDEO_THS7303 if MEDIA_SUBDRV_AUTOSELECT
@@ -19,6 +20,7 @@ config VIDEO_DAVINCI_VPIF_CAPTURE · 10 unmodified lines
19 depends on VIDEO_V4L220 depends on VIDEO_V4L2
20 depends on ARCH_DAVINCI || COMPILE_TEST21 depends on ARCH_DAVINCI || COMPILE_TEST
21 depends on HAS_DMA22 depends on HAS_DMA
23 depends on I2C
22 select VIDEOBUF2_DMA_CONTIG24 select VIDEOBUF2_DMA_CONTIG
23 help25 help
24 Enables Davinci VPIF module used for capture devices.26 Enables Davinci VPIF module used for capture devices.
@@ -33,6 +35,7 @@ config VIDEO_DM6446_CCDC · 8 unmodified lines
33 depends on VIDEO_V4L235 depends on VIDEO_V4L2
34 depends on ARCH_DAVINCI || COMPILE_TEST36 depends on ARCH_DAVINCI || COMPILE_TEST
35 depends on HAS_DMA37 depends on HAS_DMA
38 depends on I2C
36 select VIDEOBUF_DMA_CONTIG39 select VIDEOBUF_DMA_CONTIG
37 help40 help
38 Enables DaVinci CCD hw module. DaVinci CCDC hw interfaces41 Enables DaVinci CCD hw module. DaVinci CCDC hw interfaces
@@ -49,6 +52,7 @@ config VIDEO_DM355_CCDC · 10 unmodified lines
49 depends on VIDEO_V4L252 depends on VIDEO_V4L2
50 depends on ARCH_DAVINCI || COMPILE_TEST53 depends on ARCH_DAVINCI || COMPILE_TEST
51 depends on HAS_DMA54 depends on HAS_DMA
55 depends on I2C
52 select VIDEOBUF_DMA_CONTIG56 select VIDEOBUF_DMA_CONTIG
53 help57 help
54 Enables DM355 CCD hw module. DM355 CCDC hw interfaces58 Enables DM355 CCD hw module. DM355 CCDC hw interfaces
@@ -64,6 +68,7 @@ config VIDEO_DM365_ISIF · 9 unmodified lines
64 tristate "TI DM365 ISIF video capture driver"68 tristate "TI DM365 ISIF video capture driver"
65 depends on VIDEO_V4L2 && ARCH_DAVINCI69 depends on VIDEO_V4L2 && ARCH_DAVINCI
66 depends on HAS_DMA70 depends on HAS_DMA
71 depends on I2C
67 select VIDEOBUF_DMA_CONTIG72 select VIDEOBUF_DMA_CONTIG
68 help73 help
69 Enables ISIF hw module. This is the hardware module for74 Enables ISIF hw module. This is the hardware module for
@@ -77,6 +82,7 @@ config VIDEO_DAVINCI_VPBE_DISPLAY · 7 unmodified lines
77 tristate "TI DaVinci VPBE V4L2-Display driver"82 tristate "TI DaVinci VPBE V4L2-Display driver"
78 depends on VIDEO_V4L2 && ARCH_DAVINCI83 depends on VIDEO_V4L2 && ARCH_DAVINCI
79 depends on HAS_DMA84 depends on HAS_DMA
85 depends on I2C
80 select VIDEOBUF2_DMA_CONTIG86 select VIDEOBUF2_DMA_CONTIG
81 help87 help
82 Enables Davinci VPBE module used for display devices.88 Enables Davinci VPBE module used for display devices.
drivers/media/platform/davinci/vpbe_display.c+7−8
@@ -74,7 +74,7 @@ static void vpbe_isr_even_field(struct vpbe_display *disp_obj, · 73 unmodified lines
74 if (layer->cur_frm == layer->next_frm)74 if (layer->cur_frm == layer->next_frm)
75 return;75 return;
76 76
77 v4l2_get_timestamp(&layer->cur_frm->vb.timestamp);77 layer->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
78 vb2_buffer_done(&layer->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);78 vb2_buffer_done(&layer->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
79 /* Make cur_frm pointing to next_frm */79 /* Make cur_frm pointing to next_frm */
80 layer->cur_frm = layer->next_frm;80 layer->cur_frm = layer->next_frm;
@@ -228,28 +228,27 @@ static int vpbe_buffer_prepare(struct vb2_buffer *vb) · 147 unmodified lines
228 * This function allocates memory for the buffers228 * This function allocates memory for the buffers
229 */229 */
230static int230static int
231vpbe_buffer_queue_setup(struct vb2_queue *vq, const void *parg,231vpbe_buffer_queue_setup(struct vb2_queue *vq,
232 unsigned int *nbuffers, unsigned int *nplanes,232 unsigned int *nbuffers, unsigned int *nplanes,
233 unsigned int sizes[], void *alloc_ctxs[])233 unsigned int sizes[], void *alloc_ctxs[])
234 234
235{235{
236 const struct v4l2_format *fmt = parg;
237 /* Get the file handle object and layer object */236 /* Get the file handle object and layer object */
238 struct vpbe_layer *layer = vb2_get_drv_priv(vq);237 struct vpbe_layer *layer = vb2_get_drv_priv(vq);
239 struct vpbe_device *vpbe_dev = layer->disp_dev->vpbe_dev;238 struct vpbe_device *vpbe_dev = layer->disp_dev->vpbe_dev;
240 239
241 v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev, "vpbe_buffer_setup\n");240 v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev, "vpbe_buffer_setup\n");
242 241
243 if (fmt && fmt->fmt.pix.sizeimage < layer->pix_fmt.sizeimage)
244 return -EINVAL;
245
246 /* Store number of buffers allocated in numbuffer member */242 /* Store number of buffers allocated in numbuffer member */
247 if (vq->num_buffers + *nbuffers < VPBE_DEFAULT_NUM_BUFS)243 if (vq->num_buffers + *nbuffers < VPBE_DEFAULT_NUM_BUFS)
248 *nbuffers = VPBE_DEFAULT_NUM_BUFS - vq->num_buffers;244 *nbuffers = VPBE_DEFAULT_NUM_BUFS - vq->num_buffers;
245 alloc_ctxs[0] = layer->alloc_ctx;
246
247 if (*nplanes)
248 return sizes[0] < layer->pix_fmt.sizeimage ? -EINVAL : 0;
249 249
250 *nplanes = 1;250 *nplanes = 1;
251 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : layer->pix_fmt.sizeimage;251 sizes[0] = layer->pix_fmt.sizeimage;
252 alloc_ctxs[0] = layer->alloc_ctx;
253 252
254 return 0;253 return 0;
255}254}
drivers/media/platform/davinci/vpif_capture.c+9−10
@@ -104,7 +104,6 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb) · 103 unmodified lines
104/**104/**
105 * vpif_buffer_queue_setup : Callback function for buffer setup.105 * vpif_buffer_queue_setup : Callback function for buffer setup.
106 * @vq: vb2_queue ptr106 * @vq: vb2_queue ptr
107 * @fmt: v4l2 format
108 * @nbuffers: ptr to number of buffers requested by application107 * @nbuffers: ptr to number of buffers requested by application
109 * @nplanes:: contains number of distinct video planes needed to hold a frame108 * @nplanes:: contains number of distinct video planes needed to hold a frame
110 * @sizes[]: contains the size (in bytes) of each plane.109 * @sizes[]: contains the size (in bytes) of each plane.
@@ -114,26 +113,26 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb) · 3 unmodified lines
114 * the buffer count and buffer size113 * the buffer count and buffer size
115 */114 */
116static int vpif_buffer_queue_setup(struct vb2_queue *vq,115static int vpif_buffer_queue_setup(struct vb2_queue *vq,
117 const void *parg,
118 unsigned int *nbuffers, unsigned int *nplanes,116 unsigned int *nbuffers, unsigned int *nplanes,
119 unsigned int sizes[], void *alloc_ctxs[])117 unsigned int sizes[], void *alloc_ctxs[])
120{118{
121 const struct v4l2_format *fmt = parg;
122 struct channel_obj *ch = vb2_get_drv_priv(vq);119 struct channel_obj *ch = vb2_get_drv_priv(vq);
123 struct common_obj *common;120 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
124 121 unsigned size = common->fmt.fmt.pix.sizeimage;
125 common = &ch->common[VPIF_VIDEO_INDEX];
126 122
127 vpif_dbg(2, debug, "vpif_buffer_setup\n");123 vpif_dbg(2, debug, "vpif_buffer_setup\n");
128 124
129 if (fmt && fmt->fmt.pix.sizeimage < common->fmt.fmt.pix.sizeimage)125 if (*nplanes) {
130 return -EINVAL;126 if (sizes[0] < size)
127 return -EINVAL;
128 size = sizes[0];
129 }
131 130
132 if (vq->num_buffers + *nbuffers < 3)131 if (vq->num_buffers + *nbuffers < 3)
133 *nbuffers = 3 - vq->num_buffers;132 *nbuffers = 3 - vq->num_buffers;
134 133
135 *nplanes = 1;134 *nplanes = 1;
136 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : common->fmt.fmt.pix.sizeimage;135 sizes[0] = size;
137 alloc_ctxs[0] = common->alloc_ctx;136 alloc_ctxs[0] = common->alloc_ctx;
138 137
139 /* Calculate the offset for Y and C data in the buffer */138 /* Calculate the offset for Y and C data in the buffer */
@@ -331,7 +330,7 @@ static struct vb2_ops video_qops = { · 191 unmodified lines
331 */330 */
332static void vpif_process_buffer_complete(struct common_obj *common)331static void vpif_process_buffer_complete(struct common_obj *common)
333{332{
334 v4l2_get_timestamp(&common->cur_frm->vb.timestamp);333 common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
335 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);334 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
336 /* Make curFrm pointing to nextFrm */335 /* Make curFrm pointing to nextFrm */
337 common->cur_frm = common->next_frm;336 common->cur_frm = common->next_frm;
drivers/media/platform/davinci/vpif_display.c+10−9
@@ -99,7 +99,6 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb) · 98 unmodified lines
99/**99/**
100 * vpif_buffer_queue_setup : Callback function for buffer setup.100 * vpif_buffer_queue_setup : Callback function for buffer setup.
101 * @vq: vb2_queue ptr101 * @vq: vb2_queue ptr
102 * @fmt: v4l2 format
103 * @nbuffers: ptr to number of buffers requested by application102 * @nbuffers: ptr to number of buffers requested by application
104 * @nplanes:: contains number of distinct video planes needed to hold a frame103 * @nplanes:: contains number of distinct video planes needed to hold a frame
105 * @sizes[]: contains the size (in bytes) of each plane.104 * @sizes[]: contains the size (in bytes) of each plane.
@@ -109,22 +108,24 @@ static int vpif_buffer_prepare(struct vb2_buffer *vb) · 3 unmodified lines
109 * the buffer count and buffer size108 * the buffer count and buffer size
110 */109 */
111static int vpif_buffer_queue_setup(struct vb2_queue *vq,110static int vpif_buffer_queue_setup(struct vb2_queue *vq,
112 const void *parg,
113 unsigned int *nbuffers, unsigned int *nplanes,111 unsigned int *nbuffers, unsigned int *nplanes,
114 unsigned int sizes[], void *alloc_ctxs[])112 unsigned int sizes[], void *alloc_ctxs[])
115{113{
116 const struct v4l2_format *fmt = parg;
117 struct channel_obj *ch = vb2_get_drv_priv(vq);114 struct channel_obj *ch = vb2_get_drv_priv(vq);
118 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];115 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
116 unsigned size = common->fmt.fmt.pix.sizeimage;
119 117
120 if (fmt && fmt->fmt.pix.sizeimage < common->fmt.fmt.pix.sizeimage)118 if (*nplanes) {
121 return -EINVAL;119 if (sizes[0] < size)
120 return -EINVAL;
121 size = sizes[0];
122 }
122 123
123 if (vq->num_buffers + *nbuffers < 3)124 if (vq->num_buffers + *nbuffers < 3)
124 *nbuffers = 3 - vq->num_buffers;125 *nbuffers = 3 - vq->num_buffers;
125 126
126 *nplanes = 1;127 *nplanes = 1;
127 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : common->fmt.fmt.pix.sizeimage;128 sizes[0] = size;
128 alloc_ctxs[0] = common->alloc_ctx;129 alloc_ctxs[0] = common->alloc_ctx;
129 130
130 /* Calculate the offset for Y and C data in the buffer */131 /* Calculate the offset for Y and C data in the buffer */
@@ -330,7 +331,7 @@ static void process_interlaced_mode(int fid, struct common_obj *common) · 199 unmodified lines
330 /* one frame is displayed If next frame is331 /* one frame is displayed If next frame is
331 * available, release cur_frm and move on */332 * available, release cur_frm and move on */
332 /* Copy frame display time */333 /* Copy frame display time */
333 v4l2_get_timestamp(&common->cur_frm->vb.timestamp);334 common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
334 /* Change status of the cur_frm */335 /* Change status of the cur_frm */
335 vb2_buffer_done(&common->cur_frm->vb.vb2_buf,336 vb2_buffer_done(&common->cur_frm->vb.vb2_buf,
336 VB2_BUF_STATE_DONE);337 VB2_BUF_STATE_DONE);
@@ -386,8 +387,8 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id) · 49 unmodified lines
386 if (!channel_first_int[i][channel_id]) {387 if (!channel_first_int[i][channel_id]) {
387 /* Mark status of the cur_frm to388 /* Mark status of the cur_frm to
388 * done and unlock semaphore on it */389 * done and unlock semaphore on it */
389 v4l2_get_timestamp(390 common->cur_frm->vb.vb2_buf.timestamp =
390 &common->cur_frm->vb.timestamp);391 ktime_get_ns();
391 vb2_buffer_done(&common->cur_frm->vb.vb2_buf,392 vb2_buffer_done(&common->cur_frm->vb.vb2_buf,
392 VB2_BUF_STATE_DONE);393 VB2_BUF_STATE_DONE);
393 /* Make cur_frm pointing to next_frm */394 /* Make cur_frm pointing to next_frm */
drivers/media/platform/exynos-gsc/gsc-m2m.c+2−3
@@ -86,7 +86,7 @@ void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state) · 85 unmodified lines
86 dst_vb = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);86 dst_vb = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
87 87
88 if (src_vb && dst_vb) {88 if (src_vb && dst_vb) {
89 dst_vb->timestamp = src_vb->timestamp;89 dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
90 dst_vb->timecode = src_vb->timecode;90 dst_vb->timecode = src_vb->timecode;
91 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;91 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
92 dst_vb->flags |=92 dst_vb->flags |=
@@ -125,7 +125,7 @@ static int gsc_get_bufs(struct gsc_ctx *ctx) · 32 unmodified lines
125 if (ret)125 if (ret)
126 return ret;126 return ret;
127 127
128 dst_vb->timestamp = src_vb->timestamp;128 dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
129 129
130 return 0;130 return 0;
131}131}
@@ -212,7 +212,6 @@ put_device: · 80 unmodified lines
212}212}
213 213
214static int gsc_m2m_queue_setup(struct vb2_queue *vq,214static int gsc_m2m_queue_setup(struct vb2_queue *vq,
215 const void *parg,
216 unsigned int *num_buffers, unsigned int *num_planes,215 unsigned int *num_buffers, unsigned int *num_planes,
217 unsigned int sizes[], void *allocators[])216 unsigned int sizes[], void *allocators[])
218{217{
drivers/media/platform/exynos4-is/common.c+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
10 */10 */
11 11
12#include <linux/module.h>12#include <linux/module.h>
13#include <media/exynos-fimc.h>13#include <media/drv-intf/exynos-fimc.h>
14#include "common.h"14#include "common.h"
15 15
16/* Called with the media graph mutex held or entity->stream_count > 0. */16/* Called with the media graph mutex held or entity->stream_count > 0. */
drivers/media/platform/exynos4-is/fimc-capture.c+16−17
@@ -193,7 +193,7 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf) · 192 unmodified lines
193 test_bit(ST_CAPT_RUN, &fimc->state) && deq_buf) {193 test_bit(ST_CAPT_RUN, &fimc->state) && deq_buf) {
194 v_buf = fimc_active_queue_pop(cap);194 v_buf = fimc_active_queue_pop(cap);
195 195
196 v4l2_get_timestamp(&v_buf->vb.timestamp);196 v_buf->vb.vb2_buf.timestamp = ktime_get_ns();
197 v_buf->vb.sequence = cap->frame_count++;197 v_buf->vb.sequence = cap->frame_count++;
198 198
199 vb2_buffer_done(&v_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);199 vb2_buffer_done(&v_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
@@ -338,37 +338,36 @@ int fimc_capture_resume(struct fimc_dev *fimc) · 138 unmodified lines
338 338
339}339}
340 340
341static int queue_setup(struct vb2_queue *vq, const void *parg,341static int queue_setup(struct vb2_queue *vq,
342 unsigned int *num_buffers, unsigned int *num_planes,342 unsigned int *num_buffers, unsigned int *num_planes,
343 unsigned int sizes[], void *allocators[])343 unsigned int sizes[], void *allocators[])
344{344{
345 const struct v4l2_format *pfmt = parg;
346 const struct v4l2_pix_format_mplane *pixm = NULL;
347 struct fimc_ctx *ctx = vq->drv_priv;345 struct fimc_ctx *ctx = vq->drv_priv;
348 struct fimc_frame *frame = &ctx->d_frame;346 struct fimc_frame *frame = &ctx->d_frame;
349 struct fimc_fmt *fmt = frame->fmt;347 struct fimc_fmt *fmt = frame->fmt;
350 unsigned long wh;348 unsigned long wh = frame->f_width * frame->f_height;
351 int i;349 int i;
352 350
353 if (pfmt) {
354 pixm = &pfmt->fmt.pix_mp;
355 fmt = fimc_find_format(&pixm->pixelformat, NULL,
356 FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1);
357 wh = pixm->width * pixm->height;
358 } else {
359 wh = frame->f_width * frame->f_height;
360 }
361
362 if (fmt == NULL)351 if (fmt == NULL)
363 return -EINVAL;352 return -EINVAL;
364 353
354 if (*num_planes) {
355 if (*num_planes != fmt->memplanes)
356 return -EINVAL;
357 for (i = 0; i < *num_planes; i++) {
358 if (sizes[i] < (wh * fmt->depth[i]) / 8)
359 return -EINVAL;
360 allocators[i] = ctx->fimc_dev->alloc_ctx;
361 }
362 return 0;
363 }
364
365 *num_planes = fmt->memplanes;365 *num_planes = fmt->memplanes;
366 366
367 for (i = 0; i < fmt->memplanes; i++) {367 for (i = 0; i < fmt->memplanes; i++) {
368 unsigned int size = (wh * fmt->depth[i]) / 8;368 unsigned int size = (wh * fmt->depth[i]) / 8;
369 if (pixm)369
370 sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);370 if (fimc_fmt_is_user_defined(fmt->color))
371 else if (fimc_fmt_is_user_defined(fmt->color))
372 sizes[i] = frame->payload[i];371 sizes[i] = frame->payload[i];
373 else372 else
374 sizes[i] = max_t(u32, size, frame->payload[i]);373 sizes[i] = max_t(u32, size, frame->payload[i]);
drivers/media/platform/exynos4-is/fimc-core.h+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include <media/v4l2-device.h>27#include <media/v4l2-device.h>
28#include <media/v4l2-mem2mem.h>28#include <media/v4l2-mem2mem.h>
29#include <media/v4l2-mediabus.h>29#include <media/v4l2-mediabus.h>
30#include <media/exynos-fimc.h>30#include <media/drv-intf/exynos-fimc.h>
31 31
32#define dbg(fmt, args...) \32#define dbg(fmt, args...) \
33 pr_debug("%s:%d: " fmt "\n", __func__, __LINE__, ##args)33 pr_debug("%s:%d: " fmt "\n", __func__, __LINE__, ##args)
drivers/media/platform/exynos4-is/fimc-isp-video.c+16−19
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <media/v4l2-ioctl.h>30#include <media/v4l2-ioctl.h>
31#include <media/videobuf2-v4l2.h>31#include <media/videobuf2-v4l2.h>
32#include <media/videobuf2-dma-contig.h>32#include <media/videobuf2-dma-contig.h>
33#include <media/exynos-fimc.h>33#include <media/drv-intf/exynos-fimc.h>
34 34
35#include "common.h"35#include "common.h"
36#include "media-dev.h"36#include "media-dev.h"
@@ -39,39 +39,36 @@ · 2 unmodified lines
39#include "fimc-is-param.h"39#include "fimc-is-param.h"
40 40
41static int isp_video_capture_queue_setup(struct vb2_queue *vq,41static int isp_video_capture_queue_setup(struct vb2_queue *vq,
42 const void *parg,
43 unsigned int *num_buffers, unsigned int *num_planes,42 unsigned int *num_buffers, unsigned int *num_planes,
44 unsigned int sizes[], void *allocators[])43 unsigned int sizes[], void *allocators[])
45{44{
46 const struct v4l2_format *pfmt = parg;
47 struct fimc_isp *isp = vb2_get_drv_priv(vq);45 struct fimc_isp *isp = vb2_get_drv_priv(vq);
48 struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt;46 struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt;
49 const struct v4l2_pix_format_mplane *pixm = NULL;47 const struct fimc_fmt *fmt = isp->video_capture.format;
50 const struct fimc_fmt *fmt;
51 unsigned int wh, i;48 unsigned int wh, i;
52 49
53 if (pfmt) {50 wh = vid_fmt->width * vid_fmt->height;
54 pixm = &pfmt->fmt.pix_mp;
55 fmt = fimc_isp_find_format(&pixm->pixelformat, NULL, -1);
56 wh = pixm->width * pixm->height;
57 } else {
58 fmt = isp->video_capture.format;
59 wh = vid_fmt->width * vid_fmt->height;
60 }
61 51
62 if (fmt == NULL)52 if (fmt == NULL)
63 return -EINVAL;53 return -EINVAL;
64 54
65 *num_buffers = clamp_t(u32, *num_buffers, FIMC_ISP_REQ_BUFS_MIN,55 *num_buffers = clamp_t(u32, *num_buffers, FIMC_ISP_REQ_BUFS_MIN,
66 FIMC_ISP_REQ_BUFS_MAX);56 FIMC_ISP_REQ_BUFS_MAX);
57 if (*num_planes) {
58 if (*num_planes != fmt->memplanes)
59 return -EINVAL;
60 for (i = 0; i < *num_planes; i++) {
61 if (sizes[i] < (wh * fmt->depth[i]) / 8)
62 return -EINVAL;
63 allocators[i] = isp->alloc_ctx;
64 }
65 return 0;
66 }
67
67 *num_planes = fmt->memplanes;68 *num_planes = fmt->memplanes;
68 69
69 for (i = 0; i < fmt->memplanes; i++) {70 for (i = 0; i < fmt->memplanes; i++) {
70 unsigned int size = (wh * fmt->depth[i]) / 8;71 sizes[i] = (wh * fmt->depth[i]) / 8;
71 if (pixm)
72 sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
73 else
74 sizes[i] = size;
75 allocators[i] = isp->alloc_ctx;72 allocators[i] = isp->alloc_ctx;
76 }73 }
77 74
@@ -254,7 +251,7 @@ void fimc_isp_video_irq_handler(struct fimc_is *is) · 176 unmodified lines
254 buf_index = (is->i2h_cmd.args[1] - 1) % video->buf_count;251 buf_index = (is->i2h_cmd.args[1] - 1) % video->buf_count;
255 vbuf = &video->buffers[buf_index]->vb;252 vbuf = &video->buffers[buf_index]->vb;
256 253
257 v4l2_get_timestamp(&vbuf->timestamp);254 vbuf->vb2_buf.timestamp = ktime_get_ns();
258 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);255 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
259 256
260 video->buf_mask &= ~BIT(buf_index);257 video->buf_mask &= ~BIT(buf_index);
drivers/media/platform/exynos4-is/fimc-isp.h+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
24#include <media/videobuf2-v4l2.h>24#include <media/videobuf2-v4l2.h>
25#include <media/v4l2-device.h>25#include <media/v4l2-device.h>
26#include <media/v4l2-mediabus.h>26#include <media/v4l2-mediabus.h>
27#include <media/exynos-fimc.h>27#include <media/drv-intf/exynos-fimc.h>
28 28
29extern int fimc_isp_debug;29extern int fimc_isp_debug;
30 30
drivers/media/platform/exynos4-is/fimc-lite-reg.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
12#include <linux/bitops.h>12#include <linux/bitops.h>
13#include <linux/delay.h>13#include <linux/delay.h>
14#include <linux/io.h>14#include <linux/io.h>
15#include <media/exynos-fimc.h>15#include <media/drv-intf/exynos-fimc.h>
16 16
17#include "fimc-lite-reg.h"17#include "fimc-lite-reg.h"
18#include "fimc-lite.h"18#include "fimc-lite.h"
drivers/media/platform/exynos4-is/fimc-lite.c+16−19
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <media/v4l2-mem2mem.h>30#include <media/v4l2-mem2mem.h>
31#include <media/videobuf2-v4l2.h>31#include <media/videobuf2-v4l2.h>
32#include <media/videobuf2-dma-contig.h>32#include <media/videobuf2-dma-contig.h>
33#include <media/exynos-fimc.h>33#include <media/drv-intf/exynos-fimc.h>
34 34
35#include "common.h"35#include "common.h"
36#include "fimc-core.h"36#include "fimc-core.h"
@@ -292,7 +292,7 @@ static irqreturn_t flite_irq_handler(int irq, void *priv) · 255 unmodified lines
292 test_bit(ST_FLITE_RUN, &fimc->state) &&292 test_bit(ST_FLITE_RUN, &fimc->state) &&
293 !list_empty(&fimc->active_buf_q)) {293 !list_empty(&fimc->active_buf_q)) {
294 vbuf = fimc_lite_active_queue_pop(fimc);294 vbuf = fimc_lite_active_queue_pop(fimc);
295 v4l2_get_timestamp(&vbuf->vb.timestamp);295 vbuf->vb.vb2_buf.timestamp = ktime_get_ns();
296 vbuf->vb.sequence = fimc->frame_count++;296 vbuf->vb.sequence = fimc->frame_count++;
297 flite_hw_mask_dma_buffer(fimc, vbuf->index);297 flite_hw_mask_dma_buffer(fimc, vbuf->index);
298 vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);298 vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
@@ -355,37 +355,34 @@ static void stop_streaming(struct vb2_queue *q) · 56 unmodified lines
355 fimc_lite_stop_capture(fimc, false);355 fimc_lite_stop_capture(fimc, false);
356}356}
357 357
358static int queue_setup(struct vb2_queue *vq, const void *parg,358static int queue_setup(struct vb2_queue *vq,
359 unsigned int *num_buffers, unsigned int *num_planes,359 unsigned int *num_buffers, unsigned int *num_planes,
360 unsigned int sizes[], void *allocators[])360 unsigned int sizes[], void *allocators[])
361{361{
362 const struct v4l2_format *pfmt = parg;
363 const struct v4l2_pix_format_mplane *pixm = NULL;
364 struct fimc_lite *fimc = vq->drv_priv;362 struct fimc_lite *fimc = vq->drv_priv;
365 struct flite_frame *frame = &fimc->out_frame;363 struct flite_frame *frame = &fimc->out_frame;
366 const struct fimc_fmt *fmt = frame->fmt;364 const struct fimc_fmt *fmt = frame->fmt;
367 unsigned long wh;365 unsigned long wh = frame->f_width * frame->f_height;
368 int i;366 int i;
369 367
370 if (pfmt) {
371 pixm = &pfmt->fmt.pix_mp;
372 fmt = fimc_lite_find_format(&pixm->pixelformat, NULL, 0, -1);
373 wh = pixm->width * pixm->height;
374 } else {
375 wh = frame->f_width * frame->f_height;
376 }
377
378 if (fmt == NULL)368 if (fmt == NULL)
379 return -EINVAL;369 return -EINVAL;
380 370
371 if (*num_planes) {
372 if (*num_planes != fmt->memplanes)
373 return -EINVAL;
374 for (i = 0; i < *num_planes; i++) {
375 if (sizes[i] < (wh * fmt->depth[i]) / 8)
376 return -EINVAL;
377 allocators[i] = fimc->alloc_ctx;
378 }
379 return 0;
380 }
381
381 *num_planes = fmt->memplanes;382 *num_planes = fmt->memplanes;
382 383
383 for (i = 0; i < fmt->memplanes; i++) {384 for (i = 0; i < fmt->memplanes; i++) {
384 unsigned int size = (wh * fmt->depth[i]) / 8;385 sizes[i] = (wh * fmt->depth[i]) / 8;
385 if (pixm)
386 sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
387 else
388 sizes[i] = size;
389 allocators[i] = fimc->alloc_ctx;386 allocators[i] = fimc->alloc_ctx;
390 }387 }
391 388
drivers/media/platform/exynos4-is/fimc-lite.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
23#include <media/v4l2-ctrls.h>23#include <media/v4l2-ctrls.h>
24#include <media/v4l2-device.h>24#include <media/v4l2-device.h>
25#include <media/v4l2-mediabus.h>25#include <media/v4l2-mediabus.h>
26#include <media/exynos-fimc.h>26#include <media/drv-intf/exynos-fimc.h>
27 27
28#define FIMC_LITE_DRV_NAME "exynos-fimc-lite"28#define FIMC_LITE_DRV_NAME "exynos-fimc-lite"
29#define FLITE_CLK_NAME "flite"29#define FLITE_CLK_NAME "flite"
drivers/media/platform/exynos4-is/fimc-m2m.c+2−2
@@ -132,7 +132,7 @@ static void fimc_device_run(void *priv) · 131 unmodified lines
132 if (ret)132 if (ret)
133 goto dma_unlock;133 goto dma_unlock;
134 134
135 dst_vb->timestamp = src_vb->timestamp;135 dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
136 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;136 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
137 dst_vb->flags |=137 dst_vb->flags |=
138 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;138 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
@@ -176,7 +176,7 @@ static void fimc_job_abort(void *priv) · 37 unmodified lines
176 fimc_m2m_shutdown(priv);176 fimc_m2m_shutdown(priv);
177}177}
178 178
179static int fimc_queue_setup(struct vb2_queue *vq, const void *parg,179static int fimc_queue_setup(struct vb2_queue *vq,
180 unsigned int *num_buffers, unsigned int *num_planes,180 unsigned int *num_buffers, unsigned int *num_planes,
181 unsigned int sizes[], void *allocators[])181 unsigned int sizes[], void *allocators[])
182{182{
drivers/media/platform/exynos4-is/fimc-reg.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13#include <linux/io.h>13#include <linux/io.h>
14#include <linux/regmap.h>14#include <linux/regmap.h>
15 15
16#include <media/exynos-fimc.h>16#include <media/drv-intf/exynos-fimc.h>
17#include "media-dev.h"17#include "media-dev.h"
18 18
19#include "fimc-reg.h"19#include "fimc-reg.h"
drivers/media/platform/exynos4-is/media-dev.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <media/v4l2-ctrls.h>31#include <media/v4l2-ctrls.h>
32#include <media/v4l2-of.h>32#include <media/v4l2-of.h>
33#include <media/media-device.h>33#include <media/media-device.h>
34#include <media/exynos-fimc.h>34#include <media/drv-intf/exynos-fimc.h>
35 35
36#include "media-dev.h"36#include "media-dev.h"
37#include "fimc-core.h"37#include "fimc-core.h"
drivers/media/platform/exynos4-is/media-dev.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19#include <media/media-entity.h>19#include <media/media-entity.h>
20#include <media/v4l2-device.h>20#include <media/v4l2-device.h>
21#include <media/v4l2-subdev.h>21#include <media/v4l2-subdev.h>
22#include <media/exynos-fimc.h>22#include <media/drv-intf/exynos-fimc.h>
23 23
24#include "fimc-core.h"24#include "fimc-core.h"
25#include "fimc-lite.h"25#include "fimc-lite.h"
drivers/media/platform/exynos4-is/mipi-csis.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include <linux/slab.h>29#include <linux/slab.h>
30#include <linux/spinlock.h>30#include <linux/spinlock.h>
31#include <linux/videodev2.h>31#include <linux/videodev2.h>
32#include <media/exynos-fimc.h>32#include <media/drv-intf/exynos-fimc.h>
33#include <media/v4l2-of.h>33#include <media/v4l2-of.h>
34#include <media/v4l2-subdev.h>34#include <media/v4l2-subdev.h>
35 35
drivers/media/platform/m2m-deinterlace.c+1−2
@@ -207,7 +207,7 @@ static void dma_callback(void *data) · 206 unmodified lines
207 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);207 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);
208 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);208 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);
209 209
210 dst_vb->timestamp = src_vb->timestamp;210 dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
211 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;211 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
212 dst_vb->flags |=212 dst_vb->flags |=
213 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;213 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
@@ -798,7 +798,6 @@ struct vb2_dc_conf { · 584 unmodified lines
798};798};
799 799
800static int deinterlace_queue_setup(struct vb2_queue *vq,800static int deinterlace_queue_setup(struct vb2_queue *vq,
801 const void *parg,
802 unsigned int *nbuffers, unsigned int *nplanes,801 unsigned int *nbuffers, unsigned int *nplanes,
803 unsigned int sizes[], void *alloc_ctxs[])802 unsigned int sizes[], void *alloc_ctxs[])
804{803{
drivers/media/platform/marvell-ccic/mcam-core.c+9−8
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include <media/v4l2-ioctl.h>25#include <media/v4l2-ioctl.h>
26#include <media/v4l2-ctrls.h>26#include <media/v4l2-ctrls.h>
27#include <media/v4l2-event.h>27#include <media/v4l2-event.h>
28#include <media/ov7670.h>28#include <media/i2c/ov7670.h>
29#include <media/videobuf2-vmalloc.h>29#include <media/videobuf2-vmalloc.h>
30#include <media/videobuf2-dma-contig.h>30#include <media/videobuf2-dma-contig.h>
31#include <media/videobuf2-dma-sg.h>31#include <media/videobuf2-dma-sg.h>
@@ -226,7 +226,7 @@ static void mcam_buffer_done(struct mcam_camera *cam, int frame, · 194 unmodified lines
226 vbuf->vb2_buf.planes[0].bytesused = cam->pix_format.sizeimage;226 vbuf->vb2_buf.planes[0].bytesused = cam->pix_format.sizeimage;
227 vbuf->sequence = cam->buf_seq[frame];227 vbuf->sequence = cam->buf_seq[frame];
228 vbuf->field = V4L2_FIELD_NONE;228 vbuf->field = V4L2_FIELD_NONE;
229 v4l2_get_timestamp(&vbuf->timestamp);229 vbuf->vb2_buf.timestamp = ktime_get_ns();
230 vb2_set_plane_payload(&vbuf->vb2_buf, 0, cam->pix_format.sizeimage);230 vb2_set_plane_payload(&vbuf->vb2_buf, 0, cam->pix_format.sizeimage);
231 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);231 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
232}232}
@@ -1049,24 +1049,25 @@ static int mcam_read_setup(struct mcam_camera *cam) · 816 unmodified lines
1049 */1049 */
1050 1050
1051static int mcam_vb_queue_setup(struct vb2_queue *vq,1051static int mcam_vb_queue_setup(struct vb2_queue *vq,
1052 const void *parg, unsigned int *nbufs,1052 unsigned int *nbufs,
1053 unsigned int *num_planes, unsigned int sizes[],1053 unsigned int *num_planes, unsigned int sizes[],
1054 void *alloc_ctxs[])1054 void *alloc_ctxs[])
1055{1055{
1056 const struct v4l2_format *fmt = parg;
1057 struct mcam_camera *cam = vb2_get_drv_priv(vq);1056 struct mcam_camera *cam = vb2_get_drv_priv(vq);
1058 int minbufs = (cam->buffer_mode == B_DMA_contig) ? 3 : 2;1057 int minbufs = (cam->buffer_mode == B_DMA_contig) ? 3 : 2;
1058 unsigned size = cam->pix_format.sizeimage;
1059 1059
1060 if (fmt && fmt->fmt.pix.sizeimage < cam->pix_format.sizeimage)
1061 return -EINVAL;
1062 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : cam->pix_format.sizeimage;
1063 *num_planes = 1; /* Someday we have to support planar formats... */
1064 if (*nbufs < minbufs)1060 if (*nbufs < minbufs)
1065 *nbufs = minbufs;1061 *nbufs = minbufs;
1066 if (cam->buffer_mode == B_DMA_contig)1062 if (cam->buffer_mode == B_DMA_contig)
1067 alloc_ctxs[0] = cam->vb_alloc_ctx;1063 alloc_ctxs[0] = cam->vb_alloc_ctx;
1068 else if (cam->buffer_mode == B_DMA_sg)1064 else if (cam->buffer_mode == B_DMA_sg)
1069 alloc_ctxs[0] = cam->vb_alloc_ctx_sg;1065 alloc_ctxs[0] = cam->vb_alloc_ctx_sg;
1066
1067 if (*num_planes)
1068 return sizes[0] < size ? -EINVAL : 0;
1069 sizes[0] = size;
1070 *num_planes = 1; /* Someday we have to support planar formats... */
1070 return 0;1071 return 0;
1071}1072}
1072 1073
drivers/media/platform/marvell-ccic/mmp-driver.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
18#include <linux/slab.h>18#include <linux/slab.h>
19#include <linux/videodev2.h>19#include <linux/videodev2.h>
20#include <media/v4l2-device.h>20#include <media/v4l2-device.h>
21#include <media/mmp-camera.h>21#include <linux/platform_data/media/mmp-camera.h>
22#include <linux/device.h>22#include <linux/device.h>
23#include <linux/platform_device.h>23#include <linux/platform_device.h>
24#include <linux/gpio.h>24#include <linux/gpio.h>
drivers/media/platform/mx2_emmaprp.c+1−2
@@ -375,7 +375,7 @@ static irqreturn_t emmaprp_irq(int irq_emma, void *data) · 374 unmodified lines
375 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);375 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);
376 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);376 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);
377 377
378 dst_vb->timestamp = src_vb->timestamp;378 dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
379 dst_vb->flags &=379 dst_vb->flags &=
380 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;380 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
381 dst_vb->flags |=381 dst_vb->flags |=
@@ -689,7 +689,6 @@ static const struct v4l2_ioctl_ops emmaprp_ioctl_ops = { · 307 unmodified lines
689 * Queue operations689 * Queue operations
690 */690 */
691static int emmaprp_queue_setup(struct vb2_queue *vq,691static int emmaprp_queue_setup(struct vb2_queue *vq,
692 const void *parg,
693 unsigned int *nbuffers, unsigned int *nplanes,692 unsigned int *nbuffers, unsigned int *nplanes,
694 unsigned int sizes[], void *alloc_ctxs[])693 unsigned int sizes[], void *alloc_ctxs[])
695{694{
drivers/media/platform/omap/omap_vout_vrfb.c+6−4
@@ -79,10 +79,12 @@ void omap_vout_free_vrfb_buffers(struct omap_vout_device *vout) · 78 unmodified lines
79 int j;79 int j;
80 80
81 for (j = 0; j < VRFB_NUM_BUFS; j++) {81 for (j = 0; j < VRFB_NUM_BUFS; j++) {
82 omap_vout_free_buffer(vout->smsshado_virt_addr[j],82 if (vout->smsshado_virt_addr[j]) {
83 vout->smsshado_size);83 omap_vout_free_buffer(vout->smsshado_virt_addr[j],
84 vout->smsshado_virt_addr[j] = 0;84 vout->smsshado_size);
85 vout->smsshado_phy_addr[j] = 0;85 vout->smsshado_virt_addr[j] = 0;
86 vout->smsshado_phy_addr[j] = 0;
87 }
86 }88 }
87}89}
88 90
drivers/media/platform/omap3isp/ispvideo.c+1−2
@@ -320,7 +320,6 @@ isp_video_check_format(struct isp_video *video, struct isp_video_fh *vfh) · 319 unmodified lines
320 */320 */
321 321
322static int isp_video_queue_setup(struct vb2_queue *queue,322static int isp_video_queue_setup(struct vb2_queue *queue,
323 const void *parg,
324 unsigned int *count, unsigned int *num_planes,323 unsigned int *count, unsigned int *num_planes,
325 unsigned int sizes[], void *alloc_ctxs[])324 unsigned int sizes[], void *alloc_ctxs[])
326{325{
@@ -467,7 +466,7 @@ struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video) · 140 unmodified lines
467 list_del(&buf->irqlist);466 list_del(&buf->irqlist);
468 spin_unlock_irqrestore(&video->irqlock, flags);467 spin_unlock_irqrestore(&video->irqlock, flags);
469 468
470 v4l2_get_timestamp(&buf->vb.timestamp);469 buf->vb.vb2_buf.timestamp = ktime_get_ns();
471 470
472 /* Do frame number propagation only if this is the output video node.471 /* Do frame number propagation only if this is the output video node.
473 * Frame number either comes from the CSI receivers or it gets472 * Frame number either comes from the CSI receivers or it gets
drivers/media/platform/rcar_jpu.c+21−19
@@ -1015,28 +1015,33 @@ error_free: · 1014 unmodified lines
1015 * ============================================================================1015 * ============================================================================
1016 */1016 */
1017static int jpu_queue_setup(struct vb2_queue *vq,1017static int jpu_queue_setup(struct vb2_queue *vq,
1018 const void *parg,
1019 unsigned int *nbuffers, unsigned int *nplanes,1018 unsigned int *nbuffers, unsigned int *nplanes,
1020 unsigned int sizes[], void *alloc_ctxs[])1019 unsigned int sizes[], void *alloc_ctxs[])
1021{1020{
1022 const struct v4l2_format *fmt = parg;
1023 struct jpu_ctx *ctx = vb2_get_drv_priv(vq);1021 struct jpu_ctx *ctx = vb2_get_drv_priv(vq);
1024 struct jpu_q_data *q_data;1022 struct jpu_q_data *q_data;
1025 unsigned int i;1023 unsigned int i;
1026 1024
1027 q_data = jpu_get_q_data(ctx, vq->type);1025 q_data = jpu_get_q_data(ctx, vq->type);
1028 1026
1029 *nplanes = q_data->format.num_planes;1027 if (*nplanes) {
1028 if (*nplanes != q_data->format.num_planes)
1029 return -EINVAL;
1030 1030
1031 for (i = 0; i < *nplanes; i++) {1031 for (i = 0; i < *nplanes; i++) {
1032 unsigned int q_size = q_data->format.plane_fmt[i].sizeimage;1032 unsigned int q_size = q_data->format.plane_fmt[i].sizeimage;
1033 unsigned int f_size = fmt ?
1034 fmt->fmt.pix_mp.plane_fmt[i].sizeimage : 0;
1035 1033
1036 if (fmt && f_size < q_size)1034 if (sizes[i] < q_size)
1037 return -EINVAL;1035 return -EINVAL;
1036 alloc_ctxs[i] = ctx->jpu->alloc_ctx;
1037 }
1038 return 0;
1039 }
1038 1040
1039 sizes[i] = fmt ? f_size : q_size;1041 *nplanes = q_data->format.num_planes;
1042
1043 for (i = 0; i < *nplanes; i++) {
1044 sizes[i] = q_data->format.plane_fmt[i].sizeimage;
1040 alloc_ctxs[i] = ctx->jpu->alloc_ctx;1045 alloc_ctxs[i] = ctx->jpu->alloc_ctx;
1041 }1046 }
1042 1047
@@ -1300,17 +1305,17 @@ static int jpu_release(struct file *file) · 257 unmodified lines
1300 struct jpu *jpu = video_drvdata(file);1305 struct jpu *jpu = video_drvdata(file);
1301 struct jpu_ctx *ctx = fh_to_ctx(file->private_data);1306 struct jpu_ctx *ctx = fh_to_ctx(file->private_data);
1302 1307
1303 mutex_lock(&jpu->mutex);
1304 if (--jpu->ref_count == 0)
1305 clk_disable_unprepare(jpu->clk);
1306 mutex_unlock(&jpu->mutex);
1307
1308 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);1308 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
1309 v4l2_ctrl_handler_free(&ctx->ctrl_handler);1309 v4l2_ctrl_handler_free(&ctx->ctrl_handler);
1310 v4l2_fh_del(&ctx->fh);1310 v4l2_fh_del(&ctx->fh);
1311 v4l2_fh_exit(&ctx->fh);1311 v4l2_fh_exit(&ctx->fh);
1312 kfree(ctx);1312 kfree(ctx);
1313 1313
1314 mutex_lock(&jpu->mutex);
1315 if (--jpu->ref_count == 0)
1316 clk_disable_unprepare(jpu->clk);
1317 mutex_unlock(&jpu->mutex);
1318
1314 return 0;1319 return 0;
1315}1320}
1316 1321
@@ -1560,12 +1565,9 @@ static irqreturn_t jpu_irq_handler(int irq, void *dev_id) · 243 unmodified lines
1560 }1565 }
1561 1566
1562 dst_buf->field = src_buf->field;1567 dst_buf->field = src_buf->field;
1563 dst_buf->timestamp = src_buf->timestamp;1568 dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
1564 if (src_buf->flags & V4L2_BUF_FLAG_TIMECODE)1569 if (src_buf->flags & V4L2_BUF_FLAG_TIMECODE)
1565 dst_buf->timecode = src_buf->timecode;1570 dst_buf->timecode = src_buf->timecode;
1566 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
1567 dst_buf->flags |= src_buf->flags &
1568 V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
1569 dst_buf->flags = src_buf->flags &1571 dst_buf->flags = src_buf->flags &
1570 (V4L2_BUF_FLAG_TIMECODE | V4L2_BUF_FLAG_KEYFRAME |1572 (V4L2_BUF_FLAG_TIMECODE | V4L2_BUF_FLAG_KEYFRAME |
1571 V4L2_BUF_FLAG_PFRAME | V4L2_BUF_FLAG_BFRAME |1573 V4L2_BUF_FLAG_PFRAME | V4L2_BUF_FLAG_BFRAME |
drivers/media/platform/s3c-camif/camif-capture.c+12−23
@@ -338,7 +338,7 @@ irqreturn_t s3c_camif_irq_handler(int irq, void *priv) · 337 unmodified lines
338 338
339 if (!WARN_ON(vbuf == NULL)) {339 if (!WARN_ON(vbuf == NULL)) {
340 /* Dequeue a filled buffer */340 /* Dequeue a filled buffer */
341 v4l2_get_timestamp(&vbuf->vb.timestamp);341 vbuf->vb.vb2_buf.timestamp = ktime_get_ns();
342 vbuf->vb.sequence = vp->frame_sequence++;342 vbuf->vb.sequence = vp->frame_sequence++;
343 vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);343 vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
344 344
@@ -435,39 +435,28 @@ static void stop_streaming(struct vb2_queue *vq) · 90 unmodified lines
435 camif_stop_capture(vp);435 camif_stop_capture(vp);
436}436}
437 437
438static int queue_setup(struct vb2_queue *vq, const void *parg,438static int queue_setup(struct vb2_queue *vq,
439 unsigned int *num_buffers, unsigned int *num_planes,439 unsigned int *num_buffers, unsigned int *num_planes,
440 unsigned int sizes[], void *allocators[])440 unsigned int sizes[], void *allocators[])
441{441{
442 const struct v4l2_format *pfmt = parg;
443 const struct v4l2_pix_format *pix = NULL;
444 struct camif_vp *vp = vb2_get_drv_priv(vq);442 struct camif_vp *vp = vb2_get_drv_priv(vq);
445 struct camif_dev *camif = vp->camif;443 struct camif_dev *camif = vp->camif;
446 struct camif_frame *frame = &vp->out_frame;444 struct camif_frame *frame = &vp->out_frame;
447 const struct camif_fmt *fmt;445 const struct camif_fmt *fmt = vp->out_fmt;
448 unsigned int size;446 unsigned int size;
449 447
450 if (pfmt) {448 if (fmt == NULL)
451 pix = &pfmt->fmt.pix;449 return -EINVAL;
452 fmt = s3c_camif_find_format(vp, &pix->pixelformat, -1);
453 if (fmt == NULL)
454 return -EINVAL;
455 size = (pix->width * pix->height * fmt->depth) / 8;
456 } else {
457 fmt = vp->out_fmt;
458 if (fmt == NULL)
459 return -EINVAL;
460 size = (frame->f_width * frame->f_height * fmt->depth) / 8;
461 }
462
463 *num_planes = 1;
464 450
465 if (pix)451 size = (frame->f_width * frame->f_height * fmt->depth) / 8;
466 sizes[0] = max(size, pix->sizeimage);
467 else
468 sizes[0] = size;
469 allocators[0] = camif->alloc_ctx;452 allocators[0] = camif->alloc_ctx;
470 453
454 if (*num_planes)
455 return sizes[0] < size ? -EINVAL : 0;
456
457 *num_planes = 1;
458 sizes[0] = size;
459
471 pr_debug("size: %u\n", sizes[0]);460 pr_debug("size: %u\n", sizes[0]);
472 return 0;461 return 0;
473}462}
drivers/media/platform/s3c-camif/camif-core.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include <media/v4l2-device.h>26#include <media/v4l2-device.h>
27#include <media/v4l2-mediabus.h>27#include <media/v4l2-mediabus.h>
28#include <media/videobuf2-v4l2.h>28#include <media/videobuf2-v4l2.h>
29#include <media/s3c_camif.h>29#include <media/drv-intf/s3c_camif.h>
30 30
31#define S3C_CAMIF_DRIVER_NAME "s3c-camif"31#define S3C_CAMIF_DRIVER_NAME "s3c-camif"
32#define CAMIF_REQ_BUFS_MIN 332#define CAMIF_REQ_BUFS_MIN 3
drivers/media/platform/s3c-camif/camif-regs.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13#define CAMIF_REGS_H_13#define CAMIF_REGS_H_
14 14
15#include "camif-core.h"15#include "camif-core.h"
16#include <media/s3c_camif.h>16#include <media/drv-intf/s3c_camif.h>
17 17
18/*18/*
19 * The id argument indicates the processing path:19 * The id argument indicates the processing path:
drivers/media/platform/s5p-g2d/g2d.c+2−2
@@ -101,7 +101,7 @@ static struct g2d_frame *get_frame(struct g2d_ctx *ctx, · 100 unmodified lines
101 }101 }
102}102}
103 103
104static int g2d_queue_setup(struct vb2_queue *vq, const void *parg,104static int g2d_queue_setup(struct vb2_queue *vq,
105 unsigned int *nbuffers, unsigned int *nplanes,105 unsigned int *nbuffers, unsigned int *nplanes,
106 unsigned int sizes[], void *alloc_ctxs[])106 unsigned int sizes[], void *alloc_ctxs[])
107{107{
@@ -552,7 +552,7 @@ static irqreturn_t g2d_isr(int irq, void *prv) · 444 unmodified lines
552 BUG_ON(dst == NULL);552 BUG_ON(dst == NULL);
553 553
554 dst->timecode = src->timecode;554 dst->timecode = src->timecode;
555 dst->timestamp = src->timestamp;555 dst->vb2_buf.timestamp = src->vb2_buf.timestamp;
556 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;556 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
557 dst->flags |=557 dst->flags |=
558 src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;558 src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
drivers/media/platform/s5p-jpeg/jpeg-core.c+2−3
@@ -2430,7 +2430,6 @@ static struct v4l2_m2m_ops exynos4_jpeg_m2m_ops = { · 2429 unmodified lines
2430 */2430 */
2431 2431
2432static int s5p_jpeg_queue_setup(struct vb2_queue *vq,2432static int s5p_jpeg_queue_setup(struct vb2_queue *vq,
2433 const void *parg,
2434 unsigned int *nbuffers, unsigned int *nplanes,2433 unsigned int *nbuffers, unsigned int *nplanes,
2435 unsigned int sizes[], void *alloc_ctxs[])2434 unsigned int sizes[], void *alloc_ctxs[])
2436{2435{
@@ -2621,7 +2620,7 @@ static irqreturn_t s5p_jpeg_irq(int irq, void *dev_id) · 184 unmodified lines
2621 }2620 }
2622 2621
2623 dst_buf->timecode = src_buf->timecode;2622 dst_buf->timecode = src_buf->timecode;
2624 dst_buf->timestamp = src_buf->timestamp;2623 dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
2625 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;2624 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
2626 dst_buf->flags |=2625 dst_buf->flags |=
2627 src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;2626 src_buf->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
@@ -2752,7 +2751,7 @@ static irqreturn_t exynos3250_jpeg_irq(int irq, void *dev_id) · 124 unmodified lines
2752 dst_buf = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx);2751 dst_buf = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx);
2753 2752
2754 dst_buf->timecode = src_buf->timecode;2753 dst_buf->timecode = src_buf->timecode;
2755 dst_buf->timestamp = src_buf->timestamp;2754 dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
2756 2755
2757 v4l2_m2m_buf_done(src_buf, state);2756 v4l2_m2m_buf_done(src_buf, state);
2758 if (curr_ctx->mode == S5P_JPEG_ENCODE)2757 if (curr_ctx->mode == S5P_JPEG_ENCODE)
drivers/media/platform/s5p-mfc/s5p_mfc.c+62−41
@@ -85,6 +85,26 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx) · 84 unmodified lines
85 spin_unlock_irqrestore(&dev->condlock, flags);85 spin_unlock_irqrestore(&dev->condlock, flags);
86}86}
87 87
88int s5p_mfc_get_new_ctx(struct s5p_mfc_dev *dev)
89{
90 unsigned long flags;
91 int ctx;
92
93 spin_lock_irqsave(&dev->condlock, flags);
94 ctx = dev->curr_ctx;
95 do {
96 ctx = (ctx + 1) % MFC_NUM_CONTEXTS;
97 if (ctx == dev->curr_ctx) {
98 if (!test_bit(ctx, &dev->ctx_work_bits))
99 ctx = -EAGAIN;
100 break;
101 }
102 } while (!test_bit(ctx, &dev->ctx_work_bits));
103 spin_unlock_irqrestore(&dev->condlock, flags);
104
105 return ctx;
106}
107
88/* Wake up context wait_queue */108/* Wake up context wait_queue */
89static void wake_up_ctx(struct s5p_mfc_ctx *ctx, unsigned int reason,109static void wake_up_ctx(struct s5p_mfc_ctx *ctx, unsigned int reason,
90 unsigned int err)110 unsigned int err)
@@ -105,6 +125,20 @@ static void wake_up_dev(struct s5p_mfc_dev *dev, unsigned int reason, · 14 unmodified lines
105 wake_up(&dev->queue);125 wake_up(&dev->queue);
106}126}
107 127
128void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq)
129{
130 struct s5p_mfc_buf *b;
131 int i;
132
133 while (!list_empty(lh)) {
134 b = list_entry(lh->next, struct s5p_mfc_buf, list);
135 for (i = 0; i < b->b->vb2_buf.num_planes; i++)
136 vb2_set_plane_payload(&b->b->vb2_buf, i, 0);
137 vb2_buffer_done(&b->b->vb2_buf, VB2_BUF_STATE_ERROR);
138 list_del(&b->list);
139 }
140}
141
108static void s5p_mfc_watchdog(unsigned long arg)142static void s5p_mfc_watchdog(unsigned long arg)
109{143{
110 struct s5p_mfc_dev *dev = (struct s5p_mfc_dev *)arg;144 struct s5p_mfc_dev *dev = (struct s5p_mfc_dev *)arg;
@@ -150,10 +184,8 @@ static void s5p_mfc_watchdog_worker(struct work_struct *work) · 39 unmodified lines
150 if (!ctx)184 if (!ctx)
151 continue;185 continue;
152 ctx->state = MFCINST_ERROR;186 ctx->state = MFCINST_ERROR;
153 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,187 s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
154 &ctx->dst_queue, &ctx->vq_dst);188 s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
155 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
156 &ctx->src_queue, &ctx->vq_src);
157 clear_work_bit(ctx);189 clear_work_bit(ctx);
158 wake_up_ctx(ctx, S5P_MFC_R2H_CMD_ERR_RET, 0);190 wake_up_ctx(ctx, S5P_MFC_R2H_CMD_ERR_RET, 0);
159 }191 }
@@ -233,8 +265,8 @@ static void s5p_mfc_handle_frame_copy_time(struct s5p_mfc_ctx *ctx) · 73 unmodified lines
233 == dec_y_addr) {265 == dec_y_addr) {
234 dst_buf->b->timecode =266 dst_buf->b->timecode =
235 src_buf->b->timecode;267 src_buf->b->timecode;
236 dst_buf->b->timestamp =268 dst_buf->b->vb2_buf.timestamp =
237 src_buf->b->timestamp;269 src_buf->b->vb2_buf.timestamp;
238 dst_buf->b->flags &=270 dst_buf->b->flags &=
239 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;271 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
240 dst_buf->b->flags |=272 dst_buf->b->flags |=
@@ -327,7 +359,6 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, · 86 unmodified lines
327 unsigned int dst_frame_status;359 unsigned int dst_frame_status;
328 unsigned int dec_frame_status;360 unsigned int dec_frame_status;
329 struct s5p_mfc_buf *src_buf;361 struct s5p_mfc_buf *src_buf;
330 unsigned long flags;
331 unsigned int res_change;362 unsigned int res_change;
332 363
333 dst_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev)364 dst_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev)
@@ -343,17 +374,16 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, · 9 unmodified lines
343 if (res_change == S5P_FIMV_RES_INCREASE ||374 if (res_change == S5P_FIMV_RES_INCREASE ||
344 res_change == S5P_FIMV_RES_DECREASE) {375 res_change == S5P_FIMV_RES_DECREASE) {
345 ctx->state = MFCINST_RES_CHANGE_INIT;376 ctx->state = MFCINST_RES_CHANGE_INIT;
346 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);377 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
347 wake_up_ctx(ctx, reason, err);378 wake_up_ctx(ctx, reason, err);
348 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);379 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
349 s5p_mfc_clock_off();380 s5p_mfc_clock_off();
350 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);381 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
351 return;382 return;
352 }383 }
353 if (ctx->dpb_flush_flag)384 if (ctx->dpb_flush_flag)
354 ctx->dpb_flush_flag = 0;385 ctx->dpb_flush_flag = 0;
355 386
356 spin_lock_irqsave(&dev->irqlock, flags);
357 /* All frames remaining in the buffer have been extracted */387 /* All frames remaining in the buffer have been extracted */
358 if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) {388 if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) {
359 if (ctx->state == MFCINST_RES_CHANGE_FLUSH) {389 if (ctx->state == MFCINST_RES_CHANGE_FLUSH) {
@@ -413,11 +443,10 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, · 53 unmodified lines
413 }443 }
414 }444 }
415leave_handle_frame:445leave_handle_frame:
416 spin_unlock_irqrestore(&dev->irqlock, flags);
417 if ((ctx->src_queue_cnt == 0 && ctx->state != MFCINST_FINISHING)446 if ((ctx->src_queue_cnt == 0 && ctx->state != MFCINST_FINISHING)
418 || ctx->dst_queue_cnt < ctx->pb_count)447 || ctx->dst_queue_cnt < ctx->pb_count)
419 clear_work_bit(ctx);448 clear_work_bit(ctx);
420 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);449 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
421 wake_up_ctx(ctx, reason, err);450 wake_up_ctx(ctx, reason, err);
422 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);451 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
423 s5p_mfc_clock_off();452 s5p_mfc_clock_off();
@@ -425,15 +454,13 @@ leave_handle_frame: · 1 unmodified line
425 if (test_bit(0, &dev->enter_suspend))454 if (test_bit(0, &dev->enter_suspend))
426 wake_up_dev(dev, reason, err);455 wake_up_dev(dev, reason, err);
427 else456 else
428 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);457 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
429}458}
430 459
431/* Error handling for interrupt */460/* Error handling for interrupt */
432static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev,461static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev,
433 struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err)462 struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err)
434{463{
435 unsigned long flags;
436
437 mfc_err("Interrupt Error: %08x\n", err);464 mfc_err("Interrupt Error: %08x\n", err);
438 465
439 if (ctx != NULL) {466 if (ctx != NULL) {
@@ -450,13 +477,9 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, · 10 unmodified lines
450 clear_work_bit(ctx);477 clear_work_bit(ctx);
451 ctx->state = MFCINST_ERROR;478 ctx->state = MFCINST_ERROR;
452 /* Mark all dst buffers as having an error */479 /* Mark all dst buffers as having an error */
453 spin_lock_irqsave(&dev->irqlock, flags);480 s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
454 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
455 &ctx->dst_queue, &ctx->vq_dst);
456 /* Mark all src buffers as having an error */481 /* Mark all src buffers as having an error */
457 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,482 s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
458 &ctx->src_queue, &ctx->vq_src);
459 spin_unlock_irqrestore(&dev->irqlock, flags);
460 wake_up_ctx(ctx, reason, err);483 wake_up_ctx(ctx, reason, err);
461 break;484 break;
462 default:485 default:
@@ -467,7 +490,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, · 4 unmodified lines
467 }490 }
468 }491 }
469 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);492 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
470 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);493 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
471 s5p_mfc_clock_off();494 s5p_mfc_clock_off();
472 wake_up_dev(dev, reason, err);495 wake_up_dev(dev, reason, err);
473 return;496 return;
@@ -491,7 +514,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx, · 17 unmodified lines
491 ctx->img_height = s5p_mfc_hw_call(dev->mfc_ops, get_img_height,514 ctx->img_height = s5p_mfc_hw_call(dev->mfc_ops, get_img_height,
492 dev);515 dev);
493 516
494 s5p_mfc_hw_call_void(dev->mfc_ops, dec_calc_dpb_size, ctx);517 s5p_mfc_hw_call(dev->mfc_ops, dec_calc_dpb_size, ctx);
495 518
496 ctx->pb_count = s5p_mfc_hw_call(dev->mfc_ops, get_dpb_count,519 ctx->pb_count = s5p_mfc_hw_call(dev->mfc_ops, get_dpb_count,
497 dev);520 dev);
@@ -518,11 +541,11 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx, · 20 unmodified lines
518 ctx->head_processed = 1;541 ctx->head_processed = 1;
519 }542 }
520 }543 }
521 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);544 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
522 clear_work_bit(ctx);545 clear_work_bit(ctx);
523 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);546 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
524 s5p_mfc_clock_off();547 s5p_mfc_clock_off();
525 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);548 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
526 wake_up_ctx(ctx, reason, err);549 wake_up_ctx(ctx, reason, err);
527}550}
528 551
@@ -532,12 +555,11 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 3 unmodified lines
532{555{
533 struct s5p_mfc_buf *src_buf;556 struct s5p_mfc_buf *src_buf;
534 struct s5p_mfc_dev *dev;557 struct s5p_mfc_dev *dev;
535 unsigned long flags;
536 558
537 if (ctx == NULL)559 if (ctx == NULL)
538 return;560 return;
539 dev = ctx->dev;561 dev = ctx->dev;
540 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);562 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
541 ctx->int_type = reason;563 ctx->int_type = reason;
542 ctx->int_err = err;564 ctx->int_err = err;
543 ctx->int_cond = 1;565 ctx->int_cond = 1;
@@ -545,7 +567,6 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 1 unmodified line
545 if (err == 0) {567 if (err == 0) {
546 ctx->state = MFCINST_RUNNING;568 ctx->state = MFCINST_RUNNING;
547 if (!ctx->dpb_flush_flag && ctx->head_processed) {569 if (!ctx->dpb_flush_flag && ctx->head_processed) {
548 spin_lock_irqsave(&dev->irqlock, flags);
549 if (!list_empty(&ctx->src_queue)) {570 if (!list_empty(&ctx->src_queue)) {
550 src_buf = list_entry(ctx->src_queue.next,571 src_buf = list_entry(ctx->src_queue.next,
551 struct s5p_mfc_buf, list);572 struct s5p_mfc_buf, list);
@@ -554,7 +575,6 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 2 unmodified lines
554 vb2_buffer_done(&src_buf->b->vb2_buf,575 vb2_buffer_done(&src_buf->b->vb2_buf,
555 VB2_BUF_STATE_DONE);576 VB2_BUF_STATE_DONE);
556 }577 }
557 spin_unlock_irqrestore(&dev->irqlock, flags);
558 } else {578 } else {
559 ctx->dpb_flush_flag = 0;579 ctx->dpb_flush_flag = 0;
560 }580 }
@@ -563,7 +583,7 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 2 unmodified lines
563 s5p_mfc_clock_off();583 s5p_mfc_clock_off();
564 584
565 wake_up(&ctx->queue);585 wake_up(&ctx->queue);
566 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);586 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
567 } else {587 } else {
568 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);588 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
569 589
@@ -582,7 +602,6 @@ static void s5p_mfc_handle_stream_complete(struct s5p_mfc_ctx *ctx) · 12 unmodified lines
582 602
583 ctx->state = MFCINST_FINISHED;603 ctx->state = MFCINST_FINISHED;
584 604
585 spin_lock(&dev->irqlock);
586 if (!list_empty(&ctx->dst_queue)) {605 if (!list_empty(&ctx->dst_queue)) {
587 mb_entry = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf,606 mb_entry = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf,
588 list);607 list);
@@ -591,7 +610,6 @@ static void s5p_mfc_handle_stream_complete(struct s5p_mfc_ctx *ctx) · 2 unmodified lines
591 vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, 0);610 vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, 0);
592 vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE);611 vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE);
593 }612 }
594 spin_unlock(&dev->irqlock);
595 613
596 clear_work_bit(ctx);614 clear_work_bit(ctx);
597 615
@@ -599,7 +617,7 @@ static void s5p_mfc_handle_stream_complete(struct s5p_mfc_ctx *ctx) · 1 unmodified line
599 617
600 s5p_mfc_clock_off();618 s5p_mfc_clock_off();
601 wake_up(&ctx->queue);619 wake_up(&ctx->queue);
602 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);620 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
603}621}
604 622
605/* Interrupt processing */623/* Interrupt processing */
@@ -613,6 +631,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 7 unmodified lines
613 mfc_debug_enter();631 mfc_debug_enter();
614 /* Reset the timeout watchdog */632 /* Reset the timeout watchdog */
615 atomic_set(&dev->watchdog_cnt, 0);633 atomic_set(&dev->watchdog_cnt, 0);
634 spin_lock(&dev->irqlock);
616 ctx = dev->ctx[dev->curr_ctx];635 ctx = dev->ctx[dev->curr_ctx];
617 /* Get the reason of interrupt and the error code */636 /* Get the reason of interrupt and the error code */
618 reason = s5p_mfc_hw_call(dev->mfc_ops, get_int_reason, dev);637 reason = s5p_mfc_hw_call(dev->mfc_ops, get_int_reason, dev);
@@ -639,15 +658,15 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 20 unmodified lines
639 658
640 if (ctx->state == MFCINST_FINISHING &&659 if (ctx->state == MFCINST_FINISHING &&
641 list_empty(&ctx->ref_queue)) {660 list_empty(&ctx->ref_queue)) {
642 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);661 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
643 s5p_mfc_handle_stream_complete(ctx);662 s5p_mfc_handle_stream_complete(ctx);
644 break;663 break;
645 }664 }
646 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);665 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
647 wake_up_ctx(ctx, reason, err);666 wake_up_ctx(ctx, reason, err);
648 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);667 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
649 s5p_mfc_clock_off();668 s5p_mfc_clock_off();
650 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);669 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
651 } else {670 } else {
652 s5p_mfc_handle_frame(ctx, reason, err);671 s5p_mfc_handle_frame(ctx, reason, err);
653 }672 }
@@ -677,7 +696,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 23 unmodified lines
677 case S5P_MFC_R2H_CMD_WAKEUP_RET:696 case S5P_MFC_R2H_CMD_WAKEUP_RET:
678 if (ctx)697 if (ctx)
679 clear_work_bit(ctx);698 clear_work_bit(ctx);
680 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);699 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
681 wake_up_dev(dev, reason, err);700 wake_up_dev(dev, reason, err);
682 clear_bit(0, &dev->hw_lock);701 clear_bit(0, &dev->hw_lock);
683 clear_bit(0, &dev->enter_suspend);702 clear_bit(0, &dev->enter_suspend);
@@ -688,7 +707,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 4 unmodified lines
688 break;707 break;
689 708
690 case S5P_MFC_R2H_CMD_COMPLETE_SEQ_RET:709 case S5P_MFC_R2H_CMD_COMPLETE_SEQ_RET:
691 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);710 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
692 ctx->int_type = reason;711 ctx->int_type = reason;
693 ctx->int_err = err;712 ctx->int_err = err;
694 s5p_mfc_handle_stream_complete(ctx);713 s5p_mfc_handle_stream_complete(ctx);
@@ -702,12 +721,13 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 7 unmodified lines
702 721
703 default:722 default:
704 mfc_debug(2, "Unknown int reason\n");723 mfc_debug(2, "Unknown int reason\n");
705 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);724 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
706 }725 }
726 spin_unlock(&dev->irqlock);
707 mfc_debug_leave();727 mfc_debug_leave();
708 return IRQ_HANDLED;728 return IRQ_HANDLED;
709irq_cleanup_hw:729irq_cleanup_hw:
710 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev);730 s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
711 ctx->int_type = reason;731 ctx->int_type = reason;
712 ctx->int_err = err;732 ctx->int_err = err;
713 ctx->int_cond = 1;733 ctx->int_cond = 1;
@@ -716,7 +736,8 @@ irq_cleanup_hw: · 2 unmodified lines
716 736
717 s5p_mfc_clock_off();737 s5p_mfc_clock_off();
718 738
719 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);739 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
740 spin_unlock(&dev->irqlock);
720 mfc_debug(2, "Exit via irq_cleanup_hw\n");741 mfc_debug(2, "Exit via irq_cleanup_hw\n");
721 return IRQ_HANDLED;742 return IRQ_HANDLED;
722}743}
drivers/media/platform/s5p-mfc/s5p_mfc_common.h+5−9
@@ -308,7 +308,7 @@ struct s5p_mfc_dev { · 307 unmodified lines
308 struct s5p_mfc_pm pm;308 struct s5p_mfc_pm pm;
309 struct s5p_mfc_variant *variant;309 struct s5p_mfc_variant *variant;
310 int num_inst;310 int num_inst;
311 spinlock_t irqlock; /* lock when operating on videobuf2 queues */311 spinlock_t irqlock; /* lock when operating on context */
312 spinlock_t condlock; /* lock when changing/checking if a context is312 spinlock_t condlock; /* lock when changing/checking if a context is
313 ready to be processed */313 ready to be processed */
314 struct mutex mfc_mutex; /* video_device lock */314 struct mutex mfc_mutex; /* video_device lock */
@@ -653,7 +653,7 @@ struct s5p_mfc_ctx { · 338 unmodified lines
653 unsigned int bits;653 unsigned int bits;
654 } slice_size;654 } slice_size;
655 655
656 struct s5p_mfc_codec_ops *c_ops;656 const struct s5p_mfc_codec_ops *c_ops;
657 657
658 struct v4l2_ctrl *ctrls[MFC_MAX_CTRLS];658 struct v4l2_ctrl *ctrls[MFC_MAX_CTRLS];
659 struct v4l2_ctrl_handler ctrl_handler;659 struct v4l2_ctrl_handler ctrl_handler;
@@ -694,13 +694,7 @@ struct mfc_control { · 34 unmodified lines
694 694
695/* Macro for making hardware specific calls */695/* Macro for making hardware specific calls */
696#define s5p_mfc_hw_call(f, op, args...) \696#define s5p_mfc_hw_call(f, op, args...) \
697 ((f && f->op) ? f->op(args) : -ENODEV)697 ((f && f->op) ? f->op(args) : (typeof(f->op(args)))(-ENODEV))
698
699#define s5p_mfc_hw_call_void(f, op, args...) \
700do { \
701 if (f && f->op) \
702 f->op(args); \
703} while (0)
704 698
705#define fh_to_ctx(__fh) container_of(__fh, struct s5p_mfc_ctx, fh)699#define fh_to_ctx(__fh) container_of(__fh, struct s5p_mfc_ctx, fh)
706#define ctrl_to_ctx(__ctrl) \700#define ctrl_to_ctx(__ctrl) \
@@ -710,6 +704,8 @@ void clear_work_bit(struct s5p_mfc_ctx *ctx); · 3 unmodified lines
710void set_work_bit(struct s5p_mfc_ctx *ctx);704void set_work_bit(struct s5p_mfc_ctx *ctx);
711void clear_work_bit_irqsave(struct s5p_mfc_ctx *ctx);705void clear_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
712void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);706void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
707int s5p_mfc_get_new_ctx(struct s5p_mfc_dev *dev);
708void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq);
713 709
714#define HAS_PORTNUM(dev) (dev ? (dev->variant ? \710#define HAS_PORTNUM(dev) (dev ? (dev->variant ? \
715 (dev->variant->port_num ? 1 : 0) : 0) : 0)711 (dev->variant->port_num ? 1 : 0) : 0) : 0)
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c+8−8
@@ -319,7 +319,7 @@ void s5p_mfc_deinit_hw(struct s5p_mfc_dev *dev) · 318 unmodified lines
319 s5p_mfc_clock_on();319 s5p_mfc_clock_on();
320 320
321 s5p_mfc_reset(dev);321 s5p_mfc_reset(dev);
322 s5p_mfc_hw_call_void(dev->mfc_ops, release_dev_context_buffer, dev);322 s5p_mfc_hw_call(dev->mfc_ops, release_dev_context_buffer, dev);
323 323
324 s5p_mfc_clock_off();324 s5p_mfc_clock_off();
325}325}
@@ -468,7 +468,7 @@ int s5p_mfc_open_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) · 142 unmodified lines
468 }468 }
469 469
470 set_work_bit_irqsave(ctx);470 set_work_bit_irqsave(ctx);
471 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);471 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
472 if (s5p_mfc_wait_for_done_ctx(ctx,472 if (s5p_mfc_wait_for_done_ctx(ctx,
473 S5P_MFC_R2H_CMD_OPEN_INSTANCE_RET, 0)) {473 S5P_MFC_R2H_CMD_OPEN_INSTANCE_RET, 0)) {
474 /* Error or timeout */474 /* Error or timeout */
@@ -482,9 +482,9 @@ int s5p_mfc_open_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) · 7 unmodified lines
482 482
483err_free_desc_buf:483err_free_desc_buf:
484 if (ctx->type == MFCINST_DECODER)484 if (ctx->type == MFCINST_DECODER)
485 s5p_mfc_hw_call_void(dev->mfc_ops, release_dec_desc_buffer, ctx);485 s5p_mfc_hw_call(dev->mfc_ops, release_dec_desc_buffer, ctx);
486err_free_inst_buf:486err_free_inst_buf:
487 s5p_mfc_hw_call_void(dev->mfc_ops, release_instance_buffer, ctx);487 s5p_mfc_hw_call(dev->mfc_ops, release_instance_buffer, ctx);
488err:488err:
489 return ret;489 return ret;
490}490}
@@ -493,17 +493,17 @@ void s5p_mfc_close_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) · 2 unmodified lines
493{493{
494 ctx->state = MFCINST_RETURN_INST;494 ctx->state = MFCINST_RETURN_INST;
495 set_work_bit_irqsave(ctx);495 set_work_bit_irqsave(ctx);
496 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);496 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
497 /* Wait until instance is returned or timeout occurred */497 /* Wait until instance is returned or timeout occurred */
498 if (s5p_mfc_wait_for_done_ctx(ctx,498 if (s5p_mfc_wait_for_done_ctx(ctx,
499 S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0))499 S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0))
500 mfc_err("Err returning instance\n");500 mfc_err("Err returning instance\n");
501 501
502 /* Free resources */502 /* Free resources */
503 s5p_mfc_hw_call_void(dev->mfc_ops, release_codec_buffers, ctx);503 s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers, ctx);
504 s5p_mfc_hw_call_void(dev->mfc_ops, release_instance_buffer, ctx);504 s5p_mfc_hw_call(dev->mfc_ops, release_instance_buffer, ctx);
505 if (ctx->type == MFCINST_DECODER)505 if (ctx->type == MFCINST_DECODER)
506 s5p_mfc_hw_call_void(dev->mfc_ops, release_dec_desc_buffer, ctx);506 s5p_mfc_hw_call(dev->mfc_ops, release_dec_desc_buffer, ctx);
507 507
508 ctx->inst_no = MFC_NO_INSTANCE_SET;508 ctx->inst_no = MFC_NO_INSTANCE_SET;
509 ctx->state = MFCINST_FREE;509 ctx->state = MFCINST_FREE;
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c+19−20
@@ -252,7 +252,7 @@ static int s5p_mfc_ctx_ready(struct s5p_mfc_ctx *ctx) · 251 unmodified lines
252 return 0;252 return 0;
253}253}
254 254
255static struct s5p_mfc_codec_ops decoder_codec_ops = {255static const struct s5p_mfc_codec_ops decoder_codec_ops = {
256 .pre_seq_start = NULL,256 .pre_seq_start = NULL,
257 .post_seq_start = NULL,257 .post_seq_start = NULL,
258 .pre_frame_start = NULL,258 .pre_frame_start = NULL,
@@ -523,7 +523,7 @@ static int reqbufs_capture(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx, · 264 unmodified lines
523 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs);523 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs);
524 if (ret)524 if (ret)
525 goto out;525 goto out;
526 s5p_mfc_hw_call_void(dev->mfc_ops, release_codec_buffers, ctx);526 s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers, ctx);
527 ctx->dst_bufs_cnt = 0;527 ctx->dst_bufs_cnt = 0;
528 } else if (ctx->capture_state == QUEUE_FREE) {528 } else if (ctx->capture_state == QUEUE_FREE) {
529 WARN_ON(ctx->dst_bufs_cnt != 0);529 WARN_ON(ctx->dst_bufs_cnt != 0);
@@ -551,7 +551,7 @@ static int reqbufs_capture(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx, · 21 unmodified lines
551 551
552 if (s5p_mfc_ctx_ready(ctx))552 if (s5p_mfc_ctx_ready(ctx))
553 set_work_bit_irqsave(ctx);553 set_work_bit_irqsave(ctx);
554 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);554 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
555 s5p_mfc_wait_for_done_ctx(ctx, S5P_MFC_R2H_CMD_INIT_BUFFERS_RET,555 s5p_mfc_wait_for_done_ctx(ctx, S5P_MFC_R2H_CMD_INIT_BUFFERS_RET,
556 0);556 0);
557 } else {557 } else {
@@ -831,7 +831,7 @@ static int vidioc_decoder_cmd(struct file *file, void *priv, · 273 unmodified lines
831 if (s5p_mfc_ctx_ready(ctx))831 if (s5p_mfc_ctx_ready(ctx))
832 set_work_bit_irqsave(ctx);832 set_work_bit_irqsave(ctx);
833 spin_unlock_irqrestore(&dev->irqlock, flags);833 spin_unlock_irqrestore(&dev->irqlock, flags);
834 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);834 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
835 } else {835 } else {
836 mfc_err("EOS: marking last buffer of stream");836 mfc_err("EOS: marking last buffer of stream");
837 buf = list_entry(ctx->src_queue.prev,837 buf = list_entry(ctx->src_queue.prev,
@@ -888,7 +888,7 @@ static const struct v4l2_ioctl_ops s5p_mfc_dec_ioctl_ops = { · 50 unmodified lines
888};888};
889 889
890static int s5p_mfc_queue_setup(struct vb2_queue *vq,890static int s5p_mfc_queue_setup(struct vb2_queue *vq,
891 const void *parg, unsigned int *buf_count,891 unsigned int *buf_count,
892 unsigned int *plane_count, unsigned int psize[],892 unsigned int *plane_count, unsigned int psize[],
893 void *allocators[])893 void *allocators[])
894{894{
@@ -1012,7 +1012,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count) · 117 unmodified lines
1012 /* If context is ready then dev = work->data;schedule it to run */1012 /* If context is ready then dev = work->data;schedule it to run */
1013 if (s5p_mfc_ctx_ready(ctx))1013 if (s5p_mfc_ctx_ready(ctx))
1014 set_work_bit_irqsave(ctx);1014 set_work_bit_irqsave(ctx);
1015 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);1015 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
1016 return 0;1016 return 0;
1017}1017}
1018 1018
@@ -1023,42 +1023,41 @@ static void s5p_mfc_stop_streaming(struct vb2_queue *q) · 4 unmodified lines
1023 struct s5p_mfc_dev *dev = ctx->dev;1023 struct s5p_mfc_dev *dev = ctx->dev;
1024 int aborted = 0;1024 int aborted = 0;
1025 1025
1026 spin_lock_irqsave(&dev->irqlock, flags);
1026 if ((ctx->state == MFCINST_FINISHING ||1027 if ((ctx->state == MFCINST_FINISHING ||
1027 ctx->state == MFCINST_RUNNING) &&1028 ctx->state == MFCINST_RUNNING) &&
1028 dev->curr_ctx == ctx->num && dev->hw_lock) {1029 dev->curr_ctx == ctx->num && dev->hw_lock) {
1029 ctx->state = MFCINST_ABORT;1030 ctx->state = MFCINST_ABORT;
1031 spin_unlock_irqrestore(&dev->irqlock, flags);
1030 s5p_mfc_wait_for_done_ctx(ctx,1032 s5p_mfc_wait_for_done_ctx(ctx,
1031 S5P_MFC_R2H_CMD_FRAME_DONE_RET, 0);1033 S5P_MFC_R2H_CMD_FRAME_DONE_RET, 0);
1032 aborted = 1;1034 aborted = 1;
1035 spin_lock_irqsave(&dev->irqlock, flags);
1033 }1036 }
1034 if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {1037 if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
1035 spin_lock_irqsave(&dev->irqlock, flags);1038 s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
1036 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
1037 &ctx->dst_queue, &ctx->vq_dst);
1038 INIT_LIST_HEAD(&ctx->dst_queue);1039 INIT_LIST_HEAD(&ctx->dst_queue);
1039 ctx->dst_queue_cnt = 0;1040 ctx->dst_queue_cnt = 0;
1040 ctx->dpb_flush_flag = 1;1041 ctx->dpb_flush_flag = 1;
1041 ctx->dec_dst_flag = 0;1042 ctx->dec_dst_flag = 0;
1042 spin_unlock_irqrestore(&dev->irqlock, flags);
1043 if (IS_MFCV6_PLUS(dev) && (ctx->state == MFCINST_RUNNING)) {1043 if (IS_MFCV6_PLUS(dev) && (ctx->state == MFCINST_RUNNING)) {
1044 ctx->state = MFCINST_FLUSH;1044 ctx->state = MFCINST_FLUSH;
1045 set_work_bit_irqsave(ctx);1045 set_work_bit_irqsave(ctx);
1046 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);1046 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
1047 spin_unlock_irqrestore(&dev->irqlock, flags);
1047 if (s5p_mfc_wait_for_done_ctx(ctx,1048 if (s5p_mfc_wait_for_done_ctx(ctx,
1048 S5P_MFC_R2H_CMD_DPB_FLUSH_RET, 0))1049 S5P_MFC_R2H_CMD_DPB_FLUSH_RET, 0))
1049 mfc_err("Err flushing buffers\n");1050 mfc_err("Err flushing buffers\n");
1051 spin_lock_irqsave(&dev->irqlock, flags);
1050 }1052 }
1051 }1053 } else if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
1052 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {1054 s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
1053 spin_lock_irqsave(&dev->irqlock, flags);
1054 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
1055 &ctx->src_queue, &ctx->vq_src);
1056 INIT_LIST_HEAD(&ctx->src_queue);1055 INIT_LIST_HEAD(&ctx->src_queue);
1057 ctx->src_queue_cnt = 0;1056 ctx->src_queue_cnt = 0;
1058 spin_unlock_irqrestore(&dev->irqlock, flags);
1059 }1057 }
1060 if (aborted)1058 if (aborted)
1061 ctx->state = MFCINST_RUNNING;1059 ctx->state = MFCINST_RUNNING;
1060 spin_unlock_irqrestore(&dev->irqlock, flags);
1062}1061}
1063 1062
1064 1063
@@ -1091,7 +1090,7 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) · 26 unmodified lines
1091 }1090 }
1092 if (s5p_mfc_ctx_ready(ctx))1091 if (s5p_mfc_ctx_ready(ctx))
1093 set_work_bit_irqsave(ctx);1092 set_work_bit_irqsave(ctx);
1094 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);1093 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
1095}1094}
1096 1095
1097static struct vb2_ops s5p_mfc_dec_qops = {1096static struct vb2_ops s5p_mfc_dec_qops = {
@@ -1104,7 +1103,7 @@ static struct vb2_ops s5p_mfc_dec_qops = { · 6 unmodified lines
1104 .buf_queue = s5p_mfc_buf_queue,1103 .buf_queue = s5p_mfc_buf_queue,
1105};1104};
1106 1105
1107struct s5p_mfc_codec_ops *get_dec_codec_ops(void)1106const struct s5p_mfc_codec_ops *get_dec_codec_ops(void)
1108{1107{
1109 return &decoder_codec_ops;1108 return &decoder_codec_ops;
1110}1109}
@@ -1119,7 +1118,7 @@ const struct v4l2_ioctl_ops *get_dec_v4l2_ioctl_ops(void) · 8 unmodified lines
1119 return &s5p_mfc_dec_ioctl_ops;1118 return &s5p_mfc_dec_ioctl_ops;
1120}1119}
1121 1120
1122#define IS_MFC51_PRIV(x) ((V4L2_CTRL_ID2CLASS(x) == V4L2_CTRL_CLASS_MPEG) \1121#define IS_MFC51_PRIV(x) ((V4L2_CTRL_ID2WHICH(x) == V4L2_CTRL_CLASS_MPEG) \
1123 && V4L2_CTRL_DRIVER_PRIV(x))1122 && V4L2_CTRL_DRIVER_PRIV(x))
1124 1123
1125int s5p_mfc_dec_ctrls_setup(struct s5p_mfc_ctx *ctx)1124int s5p_mfc_dec_ctrls_setup(struct s5p_mfc_ctx *ctx)
drivers/media/platform/s5p-mfc/s5p_mfc_dec.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13#ifndef S5P_MFC_DEC_H_13#ifndef S5P_MFC_DEC_H_
14#define S5P_MFC_DEC_H_14#define S5P_MFC_DEC_H_
15 15
16struct s5p_mfc_codec_ops *get_dec_codec_ops(void);16const struct s5p_mfc_codec_ops *get_dec_codec_ops(void);
17struct vb2_ops *get_dec_queue_ops(void);17struct vb2_ops *get_dec_queue_ops(void);
18const struct v4l2_ioctl_ops *get_dec_v4l2_ioctl_ops(void);18const struct v4l2_ioctl_ops *get_dec_v4l2_ioctl_ops(void);
19struct s5p_mfc_fmt *get_dec_def_fmt(bool src);19struct s5p_mfc_fmt *get_dec_def_fmt(bool src);
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c+15−32
@@ -769,15 +769,12 @@ static int enc_pre_seq_start(struct s5p_mfc_ctx *ctx) · 768 unmodified lines
769 struct s5p_mfc_buf *dst_mb;769 struct s5p_mfc_buf *dst_mb;
770 unsigned long dst_addr;770 unsigned long dst_addr;
771 unsigned int dst_size;771 unsigned int dst_size;
772 unsigned long flags;
773 772
774 spin_lock_irqsave(&dev->irqlock, flags);
775 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);773 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
776 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);774 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
777 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);775 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
778 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_stream_buffer, ctx, dst_addr,776 s5p_mfc_hw_call(dev->mfc_ops, set_enc_stream_buffer, ctx, dst_addr,
779 dst_size);777 dst_size);
780 spin_unlock_irqrestore(&dev->irqlock, flags);
781 return 0;778 return 0;
782}779}
783 780
@@ -786,11 +783,9 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx) · 2 unmodified lines
786 struct s5p_mfc_dev *dev = ctx->dev;783 struct s5p_mfc_dev *dev = ctx->dev;
787 struct s5p_mfc_enc_params *p = &ctx->enc_params;784 struct s5p_mfc_enc_params *p = &ctx->enc_params;
788 struct s5p_mfc_buf *dst_mb;785 struct s5p_mfc_buf *dst_mb;
789 unsigned long flags;
790 unsigned int enc_pb_count;786 unsigned int enc_pb_count;
791 787
792 if (p->seq_hdr_mode == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) {788 if (p->seq_hdr_mode == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) {
793 spin_lock_irqsave(&dev->irqlock, flags);
794 if (!list_empty(&ctx->dst_queue)) {789 if (!list_empty(&ctx->dst_queue)) {
795 dst_mb = list_entry(ctx->dst_queue.next,790 dst_mb = list_entry(ctx->dst_queue.next,
796 struct s5p_mfc_buf, list);791 struct s5p_mfc_buf, list);
@@ -802,14 +797,13 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx) · 5 unmodified lines
802 vb2_buffer_done(&dst_mb->b->vb2_buf,797 vb2_buffer_done(&dst_mb->b->vb2_buf,
803 VB2_BUF_STATE_DONE);798 VB2_BUF_STATE_DONE);
804 }799 }
805 spin_unlock_irqrestore(&dev->irqlock, flags);
806 }800 }
807 801
808 if (!IS_MFCV6_PLUS(dev)) {802 if (!IS_MFCV6_PLUS(dev)) {
809 ctx->state = MFCINST_RUNNING;803 ctx->state = MFCINST_RUNNING;
810 if (s5p_mfc_ctx_ready(ctx))804 if (s5p_mfc_ctx_ready(ctx))
811 set_work_bit_irqsave(ctx);805 set_work_bit_irqsave(ctx);
812 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);806 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
813 } else {807 } else {
814 enc_pb_count = s5p_mfc_hw_call(dev->mfc_ops,808 enc_pb_count = s5p_mfc_hw_call(dev->mfc_ops,
815 get_enc_dpb_count, dev);809 get_enc_dpb_count, dev);
@@ -826,25 +820,20 @@ static int enc_pre_frame_start(struct s5p_mfc_ctx *ctx) · 10 unmodified lines
826 struct s5p_mfc_dev *dev = ctx->dev;820 struct s5p_mfc_dev *dev = ctx->dev;
827 struct s5p_mfc_buf *dst_mb;821 struct s5p_mfc_buf *dst_mb;
828 struct s5p_mfc_buf *src_mb;822 struct s5p_mfc_buf *src_mb;
829 unsigned long flags;
830 unsigned long src_y_addr, src_c_addr, dst_addr;823 unsigned long src_y_addr, src_c_addr, dst_addr;
831 unsigned int dst_size;824 unsigned int dst_size;
832 825
833 spin_lock_irqsave(&dev->irqlock, flags);
834 src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);826 src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
835 src_y_addr = vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 0);827 src_y_addr = vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 0);
836 src_c_addr = vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 1);828 src_c_addr = vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 1);
837 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_frame_buffer, ctx,829 s5p_mfc_hw_call(dev->mfc_ops, set_enc_frame_buffer, ctx,
838 src_y_addr, src_c_addr);830 src_y_addr, src_c_addr);
839 spin_unlock_irqrestore(&dev->irqlock, flags);
840 831
841 spin_lock_irqsave(&dev->irqlock, flags);
842 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);832 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
843 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);833 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
844 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);834 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
845 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_stream_buffer, ctx, dst_addr,835 s5p_mfc_hw_call(dev->mfc_ops, set_enc_stream_buffer, ctx, dst_addr,
846 dst_size);836 dst_size);
847 spin_unlock_irqrestore(&dev->irqlock, flags);
848 837
849 return 0;838 return 0;
850}839}
@@ -857,7 +846,6 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) · 6 unmodified lines
857 unsigned long mb_y_addr, mb_c_addr;846 unsigned long mb_y_addr, mb_c_addr;
858 int slice_type;847 int slice_type;
859 unsigned int strm_size;848 unsigned int strm_size;
860 unsigned long flags;
861 849
862 slice_type = s5p_mfc_hw_call(dev->mfc_ops, get_enc_slice_type, dev);850 slice_type = s5p_mfc_hw_call(dev->mfc_ops, get_enc_slice_type, dev);
863 strm_size = s5p_mfc_hw_call(dev->mfc_ops, get_enc_strm_size, dev);851 strm_size = s5p_mfc_hw_call(dev->mfc_ops, get_enc_strm_size, dev);
@@ -865,9 +853,8 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) · 1 unmodified line
865 mfc_debug(2, "Encoded stream size: %d\n", strm_size);853 mfc_debug(2, "Encoded stream size: %d\n", strm_size);
866 mfc_debug(2, "Display order: %d\n",854 mfc_debug(2, "Display order: %d\n",
867 mfc_read(dev, S5P_FIMV_ENC_SI_PIC_CNT));855 mfc_read(dev, S5P_FIMV_ENC_SI_PIC_CNT));
868 spin_lock_irqsave(&dev->irqlock, flags);
869 if (slice_type >= 0) {856 if (slice_type >= 0) {
870 s5p_mfc_hw_call_void(dev->mfc_ops, get_enc_frame_buffer, ctx,857 s5p_mfc_hw_call(dev->mfc_ops, get_enc_frame_buffer, ctx,
871 &enc_y_addr, &enc_c_addr);858 &enc_y_addr, &enc_c_addr);
872 list_for_each_entry(mb_entry, &ctx->src_queue, list) {859 list_for_each_entry(mb_entry, &ctx->src_queue, list) {
873 mb_y_addr = vb2_dma_contig_plane_dma_addr(860 mb_y_addr = vb2_dma_contig_plane_dma_addr(
@@ -929,14 +916,13 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) · 55 unmodified lines
929 vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, strm_size);916 vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, strm_size);
930 vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE);917 vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE);
931 }918 }
932 spin_unlock_irqrestore(&dev->irqlock, flags);
933 if ((ctx->src_queue_cnt == 0) || (ctx->dst_queue_cnt == 0))919 if ((ctx->src_queue_cnt == 0) || (ctx->dst_queue_cnt == 0))
934 clear_work_bit(ctx);920 clear_work_bit(ctx);
935 921
936 return 0;922 return 0;
937}923}
938 924
939static struct s5p_mfc_codec_ops encoder_codec_ops = {925static const struct s5p_mfc_codec_ops encoder_codec_ops = {
940 .pre_seq_start = enc_pre_seq_start,926 .pre_seq_start = enc_pre_seq_start,
941 .post_seq_start = enc_post_seq_start,927 .post_seq_start = enc_post_seq_start,
942 .pre_frame_start = enc_pre_frame_start,928 .pre_frame_start = enc_pre_frame_start,
@@ -1120,7 +1106,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f) · 177 unmodified lines
1120 pix_fmt_mp->width, pix_fmt_mp->height,1106 pix_fmt_mp->width, pix_fmt_mp->height,
1121 ctx->img_width, ctx->img_height);1107 ctx->img_width, ctx->img_height);
1122 1108
1123 s5p_mfc_hw_call_void(dev->mfc_ops, enc_calc_src_size, ctx);1109 s5p_mfc_hw_call(dev->mfc_ops, enc_calc_src_size, ctx);
1124 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size;1110 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size;
1125 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width;1111 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width;
1126 pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size;1112 pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size;
@@ -1178,7 +1164,7 @@ static int vidioc_reqbufs(struct file *file, void *priv, · 51 unmodified lines
1178 if (reqbufs->count == 0) {1164 if (reqbufs->count == 0) {
1179 mfc_debug(2, "Freeing buffers\n");1165 mfc_debug(2, "Freeing buffers\n");
1180 ret = vb2_reqbufs(&ctx->vq_src, reqbufs);1166 ret = vb2_reqbufs(&ctx->vq_src, reqbufs);
1181 s5p_mfc_hw_call_void(dev->mfc_ops, release_codec_buffers,1167 s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers,
1182 ctx);1168 ctx);
1183 ctx->output_state = QUEUE_FREE;1169 ctx->output_state = QUEUE_FREE;
1184 return ret;1170 return ret;
@@ -1741,7 +1727,7 @@ static int vidioc_encoder_cmd(struct file *file, void *priv, · 556 unmodified lines
1741 if (s5p_mfc_ctx_ready(ctx))1727 if (s5p_mfc_ctx_ready(ctx))
1742 set_work_bit_irqsave(ctx);1728 set_work_bit_irqsave(ctx);
1743 spin_unlock_irqrestore(&dev->irqlock, flags);1729 spin_unlock_irqrestore(&dev->irqlock, flags);
1744 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);1730 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
1745 } else {1731 } else {
1746 mfc_debug(2, "EOS: marking last buffer of stream\n");1732 mfc_debug(2, "EOS: marking last buffer of stream\n");
1747 buf = list_entry(ctx->src_queue.prev,1733 buf = list_entry(ctx->src_queue.prev,
@@ -1818,7 +1804,6 @@ static int check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb) · 70 unmodified lines
1818}1804}
1819 1805
1820static int s5p_mfc_queue_setup(struct vb2_queue *vq,1806static int s5p_mfc_queue_setup(struct vb2_queue *vq,
1821 const void *parg,
1822 unsigned int *buf_count, unsigned int *plane_count,1807 unsigned int *buf_count, unsigned int *plane_count,
1823 unsigned int psize[], void *allocators[])1808 unsigned int psize[], void *allocators[])
1824{1809{
@@ -1969,7 +1954,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count) · 144 unmodified lines
1969 /* If context is ready then dev = work->data;schedule it to run */1954 /* If context is ready then dev = work->data;schedule it to run */
1970 if (s5p_mfc_ctx_ready(ctx))1955 if (s5p_mfc_ctx_ready(ctx))
1971 set_work_bit_irqsave(ctx);1956 set_work_bit_irqsave(ctx);
1972 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);1957 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
1973 1958
1974 return 0;1959 return 0;
1975}1960}
@@ -1990,15 +1975,13 @@ static void s5p_mfc_stop_streaming(struct vb2_queue *q) · 14 unmodified lines
1990 ctx->state = MFCINST_FINISHED;1975 ctx->state = MFCINST_FINISHED;
1991 spin_lock_irqsave(&dev->irqlock, flags);1976 spin_lock_irqsave(&dev->irqlock, flags);
1992 if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {1977 if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
1993 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,1978 s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
1994 &ctx->dst_queue, &ctx->vq_dst);
1995 INIT_LIST_HEAD(&ctx->dst_queue);1979 INIT_LIST_HEAD(&ctx->dst_queue);
1996 ctx->dst_queue_cnt = 0;1980 ctx->dst_queue_cnt = 0;
1997 }1981 }
1998 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {1982 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
1999 cleanup_ref_queue(ctx);1983 cleanup_ref_queue(ctx);
2000 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, &ctx->src_queue,1984 s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
2001 &ctx->vq_src);
2002 INIT_LIST_HEAD(&ctx->src_queue);1985 INIT_LIST_HEAD(&ctx->src_queue);
2003 ctx->src_queue_cnt = 0;1986 ctx->src_queue_cnt = 0;
2004 }1987 }
@@ -2038,7 +2021,7 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) · 33 unmodified lines
2038 }2021 }
2039 if (s5p_mfc_ctx_ready(ctx))2022 if (s5p_mfc_ctx_ready(ctx))
2040 set_work_bit_irqsave(ctx);2023 set_work_bit_irqsave(ctx);
2041 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);2024 s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
2042}2025}
2043 2026
2044static struct vb2_ops s5p_mfc_enc_qops = {2027static struct vb2_ops s5p_mfc_enc_qops = {
@@ -2052,7 +2035,7 @@ static struct vb2_ops s5p_mfc_enc_qops = { · 7 unmodified lines
2052 .buf_queue = s5p_mfc_buf_queue,2035 .buf_queue = s5p_mfc_buf_queue,
2053};2036};
2054 2037
2055struct s5p_mfc_codec_ops *get_enc_codec_ops(void)2038const struct s5p_mfc_codec_ops *get_enc_codec_ops(void)
2056{2039{
2057 return &encoder_codec_ops;2040 return &encoder_codec_ops;
2058}2041}
@@ -2067,7 +2050,7 @@ const struct v4l2_ioctl_ops *get_enc_v4l2_ioctl_ops(void) · 8 unmodified lines
2067 return &s5p_mfc_enc_ioctl_ops;2050 return &s5p_mfc_enc_ioctl_ops;
2068}2051}
2069 2052
2070#define IS_MFC51_PRIV(x) ((V4L2_CTRL_ID2CLASS(x) == V4L2_CTRL_CLASS_MPEG) \2053#define IS_MFC51_PRIV(x) ((V4L2_CTRL_ID2WHICH(x) == V4L2_CTRL_CLASS_MPEG) \
2071 && V4L2_CTRL_DRIVER_PRIV(x))2054 && V4L2_CTRL_DRIVER_PRIV(x))
2072 2055
2073int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx)2056int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx)
drivers/media/platform/s5p-mfc/s5p_mfc_enc.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13#ifndef S5P_MFC_ENC_H_13#ifndef S5P_MFC_ENC_H_
14#define S5P_MFC_ENC_H_14#define S5P_MFC_ENC_H_
15 15
16struct s5p_mfc_codec_ops *get_enc_codec_ops(void);16const struct s5p_mfc_codec_ops *get_enc_codec_ops(void);
17struct vb2_ops *get_enc_queue_ops(void);17struct vb2_ops *get_enc_queue_ops(void);
18const struct v4l2_ioctl_ops *get_enc_v4l2_ioctl_ops(void);18const struct v4l2_ioctl_ops *get_enc_v4l2_ioctl_ops(void);
19struct s5p_mfc_fmt *get_enc_def_fmt(bool src);19struct s5p_mfc_fmt *get_enc_def_fmt(bool src);
drivers/media/platform/s5p-mfc/s5p_mfc_opr.h+244−263
@@ -20,254 +20,254 @@ · 19 unmodified lines
20struct s5p_mfc_regs {20struct s5p_mfc_regs {
21 21
22 /* codec common registers */22 /* codec common registers */
23 volatile void __iomem *risc_on;23 void __iomem *risc_on;
24 volatile void __iomem *risc2host_int;24 void __iomem *risc2host_int;
25 volatile void __iomem *host2risc_int;25 void __iomem *host2risc_int;
26 volatile void __iomem *risc_base_address;26 void __iomem *risc_base_address;
27 volatile void __iomem *mfc_reset;27 void __iomem *mfc_reset;
28 volatile void __iomem *host2risc_command;28 void __iomem *host2risc_command;
29 volatile void __iomem *risc2host_command;29 void __iomem *risc2host_command;
30 volatile void __iomem *mfc_bus_reset_ctrl;30 void __iomem *mfc_bus_reset_ctrl;
31 volatile void __iomem *firmware_version;31 void __iomem *firmware_version;
32 volatile void __iomem *instance_id;32 void __iomem *instance_id;
33 volatile void __iomem *codec_type;33 void __iomem *codec_type;
34 volatile void __iomem *context_mem_addr;34 void __iomem *context_mem_addr;
35 volatile void __iomem *context_mem_size;35 void __iomem *context_mem_size;
36 volatile void __iomem *pixel_format;36 void __iomem *pixel_format;
37 volatile void __iomem *metadata_enable;37 void __iomem *metadata_enable;
38 volatile void __iomem *mfc_version;38 void __iomem *mfc_version;
39 volatile void __iomem *dbg_info_enable;39 void __iomem *dbg_info_enable;
40 volatile void __iomem *dbg_buffer_addr;40 void __iomem *dbg_buffer_addr;
41 volatile void __iomem *dbg_buffer_size;41 void __iomem *dbg_buffer_size;
42 volatile void __iomem *hed_control;42 void __iomem *hed_control;
43 volatile void __iomem *mfc_timeout_value;43 void __iomem *mfc_timeout_value;
44 volatile void __iomem *hed_shared_mem_addr;44 void __iomem *hed_shared_mem_addr;
45 volatile void __iomem *dis_shared_mem_addr;/* only v7 */45 void __iomem *dis_shared_mem_addr;/* only v7 */
46 volatile void __iomem *ret_instance_id;46 void __iomem *ret_instance_id;
47 volatile void __iomem *error_code;47 void __iomem *error_code;
48 volatile void __iomem *dbg_buffer_output_size;48 void __iomem *dbg_buffer_output_size;
49 volatile void __iomem *metadata_status;49 void __iomem *metadata_status;
50 volatile void __iomem *metadata_addr_mb_info;50 void __iomem *metadata_addr_mb_info;
51 volatile void __iomem *metadata_size_mb_info;51 void __iomem *metadata_size_mb_info;
52 volatile void __iomem *dbg_info_stage_counter;52 void __iomem *dbg_info_stage_counter;
53 53
54 /* decoder registers */54 /* decoder registers */
55 volatile void __iomem *d_crc_ctrl;55 void __iomem *d_crc_ctrl;
56 volatile void __iomem *d_dec_options;56 void __iomem *d_dec_options;
57 volatile void __iomem *d_display_delay;57 void __iomem *d_display_delay;
58 volatile void __iomem *d_set_frame_width;58 void __iomem *d_set_frame_width;
59 volatile void __iomem *d_set_frame_height;59 void __iomem *d_set_frame_height;
60 volatile void __iomem *d_sei_enable;60 void __iomem *d_sei_enable;
61 volatile void __iomem *d_min_num_dpb;61 void __iomem *d_min_num_dpb;
62 volatile void __iomem *d_min_first_plane_dpb_size;62 void __iomem *d_min_first_plane_dpb_size;
63 volatile void __iomem *d_min_second_plane_dpb_size;63 void __iomem *d_min_second_plane_dpb_size;
64 volatile void __iomem *d_min_third_plane_dpb_size;/* only v8 */64 void __iomem *d_min_third_plane_dpb_size;/* only v8 */
65 volatile void __iomem *d_min_num_mv;65 void __iomem *d_min_num_mv;
66 volatile void __iomem *d_mvc_num_views;66 void __iomem *d_mvc_num_views;
67 volatile void __iomem *d_min_num_dis;/* only v7 */67 void __iomem *d_min_num_dis;/* only v7 */
68 volatile void __iomem *d_min_first_dis_size;/* only v7 */68 void __iomem *d_min_first_dis_size;/* only v7 */
69 volatile void __iomem *d_min_second_dis_size;/* only v7 */69 void __iomem *d_min_second_dis_size;/* only v7 */
70 volatile void __iomem *d_min_third_dis_size;/* only v7 */70 void __iomem *d_min_third_dis_size;/* only v7 */
71 volatile void __iomem *d_post_filter_luma_dpb0;/* v7 and v8 */71 void __iomem *d_post_filter_luma_dpb0;/* v7 and v8 */
72 volatile void __iomem *d_post_filter_luma_dpb1;/* v7 and v8 */72 void __iomem *d_post_filter_luma_dpb1;/* v7 and v8 */
73 volatile void __iomem *d_post_filter_luma_dpb2;/* only v7 */73 void __iomem *d_post_filter_luma_dpb2;/* only v7 */
74 volatile void __iomem *d_post_filter_chroma_dpb0;/* v7 and v8 */74 void __iomem *d_post_filter_chroma_dpb0;/* v7 and v8 */
75 volatile void __iomem *d_post_filter_chroma_dpb1;/* v7 and v8 */75 void __iomem *d_post_filter_chroma_dpb1;/* v7 and v8 */
76 volatile void __iomem *d_post_filter_chroma_dpb2;/* only v7 */76 void __iomem *d_post_filter_chroma_dpb2;/* only v7 */
77 volatile void __iomem *d_num_dpb;77 void __iomem *d_num_dpb;
78 volatile void __iomem *d_num_mv;78 void __iomem *d_num_mv;
79 volatile void __iomem *d_init_buffer_options;79 void __iomem *d_init_buffer_options;
80 volatile void __iomem *d_first_plane_dpb_stride_size;/* only v8 */80 void __iomem *d_first_plane_dpb_stride_size;/* only v8 */
81 volatile void __iomem *d_second_plane_dpb_stride_size;/* only v8 */81 void __iomem *d_second_plane_dpb_stride_size;/* only v8 */
82 volatile void __iomem *d_third_plane_dpb_stride_size;/* only v8 */82 void __iomem *d_third_plane_dpb_stride_size;/* only v8 */
83 volatile void __iomem *d_first_plane_dpb_size;83 void __iomem *d_first_plane_dpb_size;
84 volatile void __iomem *d_second_plane_dpb_size;84 void __iomem *d_second_plane_dpb_size;
85 volatile void __iomem *d_third_plane_dpb_size;/* only v8 */85 void __iomem *d_third_plane_dpb_size;/* only v8 */
86 volatile void __iomem *d_mv_buffer_size;86 void __iomem *d_mv_buffer_size;
87 volatile void __iomem *d_first_plane_dpb;87 void __iomem *d_first_plane_dpb;
88 volatile void __iomem *d_second_plane_dpb;88 void __iomem *d_second_plane_dpb;
89 volatile void __iomem *d_third_plane_dpb;89 void __iomem *d_third_plane_dpb;
90 volatile void __iomem *d_mv_buffer;90 void __iomem *d_mv_buffer;
91 volatile void __iomem *d_scratch_buffer_addr;91 void __iomem *d_scratch_buffer_addr;
92 volatile void __iomem *d_scratch_buffer_size;92 void __iomem *d_scratch_buffer_size;
93 volatile void __iomem *d_metadata_buffer_addr;93 void __iomem *d_metadata_buffer_addr;
94 volatile void __iomem *d_metadata_buffer_size;94 void __iomem *d_metadata_buffer_size;
95 volatile void __iomem *d_nal_start_options;/* v7 and v8 */95 void __iomem *d_nal_start_options;/* v7 and v8 */
96 volatile void __iomem *d_cpb_buffer_addr;96 void __iomem *d_cpb_buffer_addr;
97 volatile void __iomem *d_cpb_buffer_size;97 void __iomem *d_cpb_buffer_size;
98 volatile void __iomem *d_available_dpb_flag_upper;98 void __iomem *d_available_dpb_flag_upper;
99 volatile void __iomem *d_available_dpb_flag_lower;99 void __iomem *d_available_dpb_flag_lower;
100 volatile void __iomem *d_cpb_buffer_offset;100 void __iomem *d_cpb_buffer_offset;
101 volatile void __iomem *d_slice_if_enable;101 void __iomem *d_slice_if_enable;
102 volatile void __iomem *d_picture_tag;102 void __iomem *d_picture_tag;
103 volatile void __iomem *d_stream_data_size;103 void __iomem *d_stream_data_size;
104 volatile void __iomem *d_dynamic_dpb_flag_upper;/* v7 and v8 */104 void __iomem *d_dynamic_dpb_flag_upper;/* v7 and v8 */
105 volatile void __iomem *d_dynamic_dpb_flag_lower;/* v7 and v8 */105 void __iomem *d_dynamic_dpb_flag_lower;/* v7 and v8 */
106 volatile void __iomem *d_display_frame_width;106 void __iomem *d_display_frame_width;
107 volatile void __iomem *d_display_frame_height;107 void __iomem *d_display_frame_height;
108 volatile void __iomem *d_display_status;108 void __iomem *d_display_status;
109 volatile void __iomem *d_display_first_plane_addr;109 void __iomem *d_display_first_plane_addr;
110 volatile void __iomem *d_display_second_plane_addr;110 void __iomem *d_display_second_plane_addr;
111 volatile void __iomem *d_display_third_plane_addr;/* only v8 */111 void __iomem *d_display_third_plane_addr;/* only v8 */
112 volatile void __iomem *d_display_frame_type;112 void __iomem *d_display_frame_type;
113 volatile void __iomem *d_display_crop_info1;113 void __iomem *d_display_crop_info1;
114 volatile void __iomem *d_display_crop_info2;114 void __iomem *d_display_crop_info2;
115 volatile void __iomem *d_display_picture_profile;115 void __iomem *d_display_picture_profile;
116 volatile void __iomem *d_display_luma_crc;/* v7 and v8 */116 void __iomem *d_display_luma_crc;/* v7 and v8 */
117 volatile void __iomem *d_display_chroma0_crc;/* v7 and v8 */117 void __iomem *d_display_chroma0_crc;/* v7 and v8 */
118 volatile void __iomem *d_display_chroma1_crc;/* only v8 */118 void __iomem *d_display_chroma1_crc;/* only v8 */
119 volatile void __iomem *d_display_luma_crc_top;/* only v6 */119 void __iomem *d_display_luma_crc_top;/* only v6 */
120 volatile void __iomem *d_display_chroma_crc_top;/* only v6 */120 void __iomem *d_display_chroma_crc_top;/* only v6 */
121 volatile void __iomem *d_display_luma_crc_bot;/* only v6 */121 void __iomem *d_display_luma_crc_bot;/* only v6 */
122 volatile void __iomem *d_display_chroma_crc_bot;/* only v6 */122 void __iomem *d_display_chroma_crc_bot;/* only v6 */
123 volatile void __iomem *d_display_aspect_ratio;123 void __iomem *d_display_aspect_ratio;
124 volatile void __iomem *d_display_extended_ar;124 void __iomem *d_display_extended_ar;
125 volatile void __iomem *d_decoded_frame_width;125 void __iomem *d_decoded_frame_width;
126 volatile void __iomem *d_decoded_frame_height;126 void __iomem *d_decoded_frame_height;
127 volatile void __iomem *d_decoded_status;127 void __iomem *d_decoded_status;
128 volatile void __iomem *d_decoded_first_plane_addr;128 void __iomem *d_decoded_first_plane_addr;
129 volatile void __iomem *d_decoded_second_plane_addr;129 void __iomem *d_decoded_second_plane_addr;
130 volatile void __iomem *d_decoded_third_plane_addr;/* only v8 */130 void __iomem *d_decoded_third_plane_addr;/* only v8 */
131 volatile void __iomem *d_decoded_frame_type;131 void __iomem *d_decoded_frame_type;
132 volatile void __iomem *d_decoded_crop_info1;132 void __iomem *d_decoded_crop_info1;
133 volatile void __iomem *d_decoded_crop_info2;133 void __iomem *d_decoded_crop_info2;
134 volatile void __iomem *d_decoded_picture_profile;134 void __iomem *d_decoded_picture_profile;
135 volatile void __iomem *d_decoded_nal_size;135 void __iomem *d_decoded_nal_size;
136 volatile void __iomem *d_decoded_luma_crc;136 void __iomem *d_decoded_luma_crc;
137 volatile void __iomem *d_decoded_chroma0_crc;137 void __iomem *d_decoded_chroma0_crc;
138 volatile void __iomem *d_decoded_chroma1_crc;/* only v8 */138 void __iomem *d_decoded_chroma1_crc;/* only v8 */
139 volatile void __iomem *d_ret_picture_tag_top;139 void __iomem *d_ret_picture_tag_top;
140 volatile void __iomem *d_ret_picture_tag_bot;140 void __iomem *d_ret_picture_tag_bot;
141 volatile void __iomem *d_ret_picture_time_top;141 void __iomem *d_ret_picture_time_top;
142 volatile void __iomem *d_ret_picture_time_bot;142 void __iomem *d_ret_picture_time_bot;
143 volatile void __iomem *d_chroma_format;143 void __iomem *d_chroma_format;
144 volatile void __iomem *d_vc1_info;/* v7 and v8 */144 void __iomem *d_vc1_info;/* v7 and v8 */
145 volatile void __iomem *d_mpeg4_info;145 void __iomem *d_mpeg4_info;
146 volatile void __iomem *d_h264_info;146 void __iomem *d_h264_info;
147 volatile void __iomem *d_metadata_addr_concealed_mb;147 void __iomem *d_metadata_addr_concealed_mb;
148 volatile void __iomem *d_metadata_size_concealed_mb;148 void __iomem *d_metadata_size_concealed_mb;
149 volatile void __iomem *d_metadata_addr_vc1_param;149 void __iomem *d_metadata_addr_vc1_param;
150 volatile void __iomem *d_metadata_size_vc1_param;150 void __iomem *d_metadata_size_vc1_param;
151 volatile void __iomem *d_metadata_addr_sei_nal;151 void __iomem *d_metadata_addr_sei_nal;
152 volatile void __iomem *d_metadata_size_sei_nal;152 void __iomem *d_metadata_size_sei_nal;
153 volatile void __iomem *d_metadata_addr_vui;153 void __iomem *d_metadata_addr_vui;
154 volatile void __iomem *d_metadata_size_vui;154 void __iomem *d_metadata_size_vui;
155 volatile void __iomem *d_metadata_addr_mvcvui;/* v7 and v8 */155 void __iomem *d_metadata_addr_mvcvui;/* v7 and v8 */
156 volatile void __iomem *d_metadata_size_mvcvui;/* v7 and v8 */156 void __iomem *d_metadata_size_mvcvui;/* v7 and v8 */
157 volatile void __iomem *d_mvc_view_id;157 void __iomem *d_mvc_view_id;
158 volatile void __iomem *d_frame_pack_sei_avail;158 void __iomem *d_frame_pack_sei_avail;
159 volatile void __iomem *d_frame_pack_arrgment_id;159 void __iomem *d_frame_pack_arrgment_id;
160 volatile void __iomem *d_frame_pack_sei_info;160 void __iomem *d_frame_pack_sei_info;
161 volatile void __iomem *d_frame_pack_grid_pos;161 void __iomem *d_frame_pack_grid_pos;
162 volatile void __iomem *d_display_recovery_sei_info;/* v7 and v8 */162 void __iomem *d_display_recovery_sei_info;/* v7 and v8 */
163 volatile void __iomem *d_decoded_recovery_sei_info;/* v7 and v8 */163 void __iomem *d_decoded_recovery_sei_info;/* v7 and v8 */
164 volatile void __iomem *d_display_first_addr;/* only v7 */164 void __iomem *d_display_first_addr;/* only v7 */
165 volatile void __iomem *d_display_second_addr;/* only v7 */165 void __iomem *d_display_second_addr;/* only v7 */
166 volatile void __iomem *d_display_third_addr;/* only v7 */166 void __iomem *d_display_third_addr;/* only v7 */
167 volatile void __iomem *d_decoded_first_addr;/* only v7 */167 void __iomem *d_decoded_first_addr;/* only v7 */
168 volatile void __iomem *d_decoded_second_addr;/* only v7 */168 void __iomem *d_decoded_second_addr;/* only v7 */
169 volatile void __iomem *d_decoded_third_addr;/* only v7 */169 void __iomem *d_decoded_third_addr;/* only v7 */
170 volatile void __iomem *d_used_dpb_flag_upper;/* v7 and v8 */170 void __iomem *d_used_dpb_flag_upper;/* v7 and v8 */
171 volatile void __iomem *d_used_dpb_flag_lower;/* v7 and v8 */171 void __iomem *d_used_dpb_flag_lower;/* v7 and v8 */
172 172
173 /* encoder registers */173 /* encoder registers */
174 volatile void __iomem *e_frame_width;174 void __iomem *e_frame_width;
175 volatile void __iomem *e_frame_height;175 void __iomem *e_frame_height;
176 volatile void __iomem *e_cropped_frame_width;176 void __iomem *e_cropped_frame_width;
177 volatile void __iomem *e_cropped_frame_height;177 void __iomem *e_cropped_frame_height;
178 volatile void __iomem *e_frame_crop_offset;178 void __iomem *e_frame_crop_offset;
179 volatile void __iomem *e_enc_options;179 void __iomem *e_enc_options;
180 volatile void __iomem *e_picture_profile;180 void __iomem *e_picture_profile;
181 volatile void __iomem *e_vbv_buffer_size;181 void __iomem *e_vbv_buffer_size;
182 volatile void __iomem *e_vbv_init_delay;182 void __iomem *e_vbv_init_delay;
183 volatile void __iomem *e_fixed_picture_qp;183 void __iomem *e_fixed_picture_qp;
184 volatile void __iomem *e_rc_config;184 void __iomem *e_rc_config;
185 volatile void __iomem *e_rc_qp_bound;185 void __iomem *e_rc_qp_bound;
186 volatile void __iomem *e_rc_qp_bound_pb;/* v7 and v8 */186 void __iomem *e_rc_qp_bound_pb;/* v7 and v8 */
187 volatile void __iomem *e_rc_mode;187 void __iomem *e_rc_mode;
188 volatile void __iomem *e_mb_rc_config;188 void __iomem *e_mb_rc_config;
189 volatile void __iomem *e_padding_ctrl;189 void __iomem *e_padding_ctrl;
190 volatile void __iomem *e_air_threshold;190 void __iomem *e_air_threshold;
191 volatile void __iomem *e_mv_hor_range;191 void __iomem *e_mv_hor_range;
192 volatile void __iomem *e_mv_ver_range;192 void __iomem *e_mv_ver_range;
193 volatile void __iomem *e_num_dpb;193 void __iomem *e_num_dpb;
194 volatile void __iomem *e_luma_dpb;194 void __iomem *e_luma_dpb;
195 volatile void __iomem *e_chroma_dpb;195 void __iomem *e_chroma_dpb;
196 volatile void __iomem *e_me_buffer;196 void __iomem *e_me_buffer;
197 volatile void __iomem *e_scratch_buffer_addr;197 void __iomem *e_scratch_buffer_addr;
198 volatile void __iomem *e_scratch_buffer_size;198 void __iomem *e_scratch_buffer_size;
199 volatile void __iomem *e_tmv_buffer0;199 void __iomem *e_tmv_buffer0;
200 volatile void __iomem *e_tmv_buffer1;200 void __iomem *e_tmv_buffer1;
201 volatile void __iomem *e_ir_buffer_addr;/* v7 and v8 */201 void __iomem *e_ir_buffer_addr;/* v7 and v8 */
202 volatile void __iomem *e_source_first_plane_addr;202 void __iomem *e_source_first_plane_addr;
203 volatile void __iomem *e_source_second_plane_addr;203 void __iomem *e_source_second_plane_addr;
204 volatile void __iomem *e_source_third_plane_addr;/* v7 and v8 */204 void __iomem *e_source_third_plane_addr;/* v7 and v8 */
205 volatile void __iomem *e_source_first_plane_stride;/* v7 and v8 */205 void __iomem *e_source_first_plane_stride;/* v7 and v8 */
206 volatile void __iomem *e_source_second_plane_stride;/* v7 and v8 */206 void __iomem *e_source_second_plane_stride;/* v7 and v8 */
207 volatile void __iomem *e_source_third_plane_stride;/* v7 and v8 */207 void __iomem *e_source_third_plane_stride;/* v7 and v8 */
208 volatile void __iomem *e_stream_buffer_addr;208 void __iomem *e_stream_buffer_addr;
209 volatile void __iomem *e_stream_buffer_size;209 void __iomem *e_stream_buffer_size;
210 volatile void __iomem *e_roi_buffer_addr;210 void __iomem *e_roi_buffer_addr;
211 volatile void __iomem *e_param_change;211 void __iomem *e_param_change;
212 volatile void __iomem *e_ir_size;212 void __iomem *e_ir_size;
213 volatile void __iomem *e_gop_config;213 void __iomem *e_gop_config;
214 volatile void __iomem *e_mslice_mode;214 void __iomem *e_mslice_mode;
215 volatile void __iomem *e_mslice_size_mb;215 void __iomem *e_mslice_size_mb;
216 volatile void __iomem *e_mslice_size_bits;216 void __iomem *e_mslice_size_bits;
217 volatile void __iomem *e_frame_insertion;217 void __iomem *e_frame_insertion;
218 volatile void __iomem *e_rc_frame_rate;218 void __iomem *e_rc_frame_rate;
219 volatile void __iomem *e_rc_bit_rate;219 void __iomem *e_rc_bit_rate;
220 volatile void __iomem *e_rc_roi_ctrl;220 void __iomem *e_rc_roi_ctrl;
221 volatile void __iomem *e_picture_tag;221 void __iomem *e_picture_tag;
222 volatile void __iomem *e_bit_count_enable;222 void __iomem *e_bit_count_enable;
223 volatile void __iomem *e_max_bit_count;223 void __iomem *e_max_bit_count;
224 volatile void __iomem *e_min_bit_count;224 void __iomem *e_min_bit_count;
225 volatile void __iomem *e_metadata_buffer_addr;225 void __iomem *e_metadata_buffer_addr;
226 volatile void __iomem *e_metadata_buffer_size;226 void __iomem *e_metadata_buffer_size;
227 volatile void __iomem *e_encoded_source_first_plane_addr;227 void __iomem *e_encoded_source_first_plane_addr;
228 volatile void __iomem *e_encoded_source_second_plane_addr;228 void __iomem *e_encoded_source_second_plane_addr;
229 volatile void __iomem *e_encoded_source_third_plane_addr;/* v7 and v8 */229 void __iomem *e_encoded_source_third_plane_addr;/* v7 and v8 */
230 volatile void __iomem *e_stream_size;230 void __iomem *e_stream_size;
231 volatile void __iomem *e_slice_type;231 void __iomem *e_slice_type;
232 volatile void __iomem *e_picture_count;232 void __iomem *e_picture_count;
233 volatile void __iomem *e_ret_picture_tag;233 void __iomem *e_ret_picture_tag;
234 volatile void __iomem *e_stream_buffer_write_pointer; /* only v6 */234 void __iomem *e_stream_buffer_write_pointer; /* only v6 */
235 volatile void __iomem *e_recon_luma_dpb_addr;235 void __iomem *e_recon_luma_dpb_addr;
236 volatile void __iomem *e_recon_chroma_dpb_addr;236 void __iomem *e_recon_chroma_dpb_addr;
237 volatile void __iomem *e_metadata_addr_enc_slice;237 void __iomem *e_metadata_addr_enc_slice;
238 volatile void __iomem *e_metadata_size_enc_slice;238 void __iomem *e_metadata_size_enc_slice;
239 volatile void __iomem *e_mpeg4_options;239 void __iomem *e_mpeg4_options;
240 volatile void __iomem *e_mpeg4_hec_period;240 void __iomem *e_mpeg4_hec_period;
241 volatile void __iomem *e_aspect_ratio;241 void __iomem *e_aspect_ratio;
242 volatile void __iomem *e_extended_sar;242 void __iomem *e_extended_sar;
243 volatile void __iomem *e_h264_options;243 void __iomem *e_h264_options;
244 volatile void __iomem *e_h264_options_2;/* v7 and v8 */244 void __iomem *e_h264_options_2;/* v7 and v8 */
245 volatile void __iomem *e_h264_lf_alpha_offset;245 void __iomem *e_h264_lf_alpha_offset;
246 volatile void __iomem *e_h264_lf_beta_offset;246 void __iomem *e_h264_lf_beta_offset;
247 volatile void __iomem *e_h264_i_period;247 void __iomem *e_h264_i_period;
248 volatile void __iomem *e_h264_fmo_slice_grp_map_type;248 void __iomem *e_h264_fmo_slice_grp_map_type;
249 volatile void __iomem *e_h264_fmo_num_slice_grp_minus1;249 void __iomem *e_h264_fmo_num_slice_grp_minus1;
250 volatile void __iomem *e_h264_fmo_slice_grp_change_dir;250 void __iomem *e_h264_fmo_slice_grp_change_dir;
251 volatile void __iomem *e_h264_fmo_slice_grp_change_rate_minus1;251 void __iomem *e_h264_fmo_slice_grp_change_rate_minus1;
252 volatile void __iomem *e_h264_fmo_run_length_minus1_0;252 void __iomem *e_h264_fmo_run_length_minus1_0;
253 volatile void __iomem *e_h264_aso_slice_order_0;253 void __iomem *e_h264_aso_slice_order_0;
254 volatile void __iomem *e_h264_chroma_qp_offset;254 void __iomem *e_h264_chroma_qp_offset;
255 volatile void __iomem *e_h264_num_t_layer;255 void __iomem *e_h264_num_t_layer;
256 volatile void __iomem *e_h264_hierarchical_qp_layer0;256 void __iomem *e_h264_hierarchical_qp_layer0;
257 volatile void __iomem *e_h264_frame_packing_sei_info;257 void __iomem *e_h264_frame_packing_sei_info;
258 volatile void __iomem *e_h264_nal_control;/* v7 and v8 */258 void __iomem *e_h264_nal_control;/* v7 and v8 */
259 volatile void __iomem *e_mvc_frame_qp_view1;259 void __iomem *e_mvc_frame_qp_view1;
260 volatile void __iomem *e_mvc_rc_bit_rate_view1;260 void __iomem *e_mvc_rc_bit_rate_view1;
261 volatile void __iomem *e_mvc_rc_qbound_view1;261 void __iomem *e_mvc_rc_qbound_view1;
262 volatile void __iomem *e_mvc_rc_mode_view1;262 void __iomem *e_mvc_rc_mode_view1;
263 volatile void __iomem *e_mvc_inter_view_prediction_on;263 void __iomem *e_mvc_inter_view_prediction_on;
264 volatile void __iomem *e_vp8_options;/* v7 and v8 */264 void __iomem *e_vp8_options;/* v7 and v8 */
265 volatile void __iomem *e_vp8_filter_options;/* v7 and v8 */265 void __iomem *e_vp8_filter_options;/* v7 and v8 */
266 volatile void __iomem *e_vp8_golden_frame_option;/* v7 and v8 */266 void __iomem *e_vp8_golden_frame_option;/* v7 and v8 */
267 volatile void __iomem *e_vp8_num_t_layer;/* v7 and v8 */267 void __iomem *e_vp8_num_t_layer;/* v7 and v8 */
268 volatile void __iomem *e_vp8_hierarchical_qp_layer0;/* v7 and v8 */268 void __iomem *e_vp8_hierarchical_qp_layer0;/* v7 and v8 */
269 volatile void __iomem *e_vp8_hierarchical_qp_layer1;/* v7 and v8 */269 void __iomem *e_vp8_hierarchical_qp_layer1;/* v7 and v8 */
270 volatile void __iomem *e_vp8_hierarchical_qp_layer2;/* v7 and v8 */270 void __iomem *e_vp8_hierarchical_qp_layer2;/* v7 and v8 */
271};271};
272 272
273struct s5p_mfc_hw_ops {273struct s5p_mfc_hw_ops {
@@ -281,28 +281,14 @@ struct s5p_mfc_hw_ops { · 7 unmodified lines
281 void (*release_dev_context_buffer)(struct s5p_mfc_dev *dev);281 void (*release_dev_context_buffer)(struct s5p_mfc_dev *dev);
282 void (*dec_calc_dpb_size)(struct s5p_mfc_ctx *ctx);282 void (*dec_calc_dpb_size)(struct s5p_mfc_ctx *ctx);
283 void (*enc_calc_src_size)(struct s5p_mfc_ctx *ctx);283 void (*enc_calc_src_size)(struct s5p_mfc_ctx *ctx);
284 int (*set_dec_stream_buffer)(struct s5p_mfc_ctx *ctx,
285 int buf_addr, unsigned int start_num_byte,
286 unsigned int buf_size);
287 int (*set_dec_frame_buffer)(struct s5p_mfc_ctx *ctx);
288 int (*set_enc_stream_buffer)(struct s5p_mfc_ctx *ctx,284 int (*set_enc_stream_buffer)(struct s5p_mfc_ctx *ctx,
289 unsigned long addr, unsigned int size);285 unsigned long addr, unsigned int size);
290 void (*set_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,286 void (*set_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
291 unsigned long y_addr, unsigned long c_addr);287 unsigned long y_addr, unsigned long c_addr);
292 void (*get_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,288 void (*get_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
293 unsigned long *y_addr, unsigned long *c_addr);289 unsigned long *y_addr, unsigned long *c_addr);
294 int (*set_enc_ref_buffer)(struct s5p_mfc_ctx *ctx);
295 int (*init_decode)(struct s5p_mfc_ctx *ctx);
296 int (*init_encode)(struct s5p_mfc_ctx *ctx);
297 int (*encode_one_frame)(struct s5p_mfc_ctx *ctx);
298 void (*try_run)(struct s5p_mfc_dev *dev);290 void (*try_run)(struct s5p_mfc_dev *dev);
299 void (*cleanup_queue)(struct list_head *lh,
300 struct vb2_queue *vq);
301 void (*clear_int_flags)(struct s5p_mfc_dev *dev);291 void (*clear_int_flags)(struct s5p_mfc_dev *dev);
302 void (*write_info)(struct s5p_mfc_ctx *ctx, unsigned int data,
303 unsigned int ofs);
304 unsigned int (*read_info)(struct s5p_mfc_ctx *ctx,
305 unsigned long ofs);
306 int (*get_dspl_y_adr)(struct s5p_mfc_dev *dev);292 int (*get_dspl_y_adr)(struct s5p_mfc_dev *dev);
307 int (*get_dec_y_adr)(struct s5p_mfc_dev *dev);293 int (*get_dec_y_adr)(struct s5p_mfc_dev *dev);
308 int (*get_dspl_status)(struct s5p_mfc_dev *dev);294 int (*get_dspl_status)(struct s5p_mfc_dev *dev);
@@ -313,7 +299,6 @@ struct s5p_mfc_hw_ops { · 4 unmodified lines
313 int (*get_int_reason)(struct s5p_mfc_dev *dev);299 int (*get_int_reason)(struct s5p_mfc_dev *dev);
314 int (*get_int_err)(struct s5p_mfc_dev *dev);300 int (*get_int_err)(struct s5p_mfc_dev *dev);
315 int (*err_dec)(unsigned int err);301 int (*err_dec)(unsigned int err);
316 int (*err_dspl)(unsigned int err);
317 int (*get_img_width)(struct s5p_mfc_dev *dev);302 int (*get_img_width)(struct s5p_mfc_dev *dev);
318 int (*get_img_height)(struct s5p_mfc_dev *dev);303 int (*get_img_height)(struct s5p_mfc_dev *dev);
319 int (*get_dpb_count)(struct s5p_mfc_dev *dev);304 int (*get_dpb_count)(struct s5p_mfc_dev *dev);
@@ -322,10 +307,6 @@ struct s5p_mfc_hw_ops { · 2 unmodified lines
322 int (*get_enc_strm_size)(struct s5p_mfc_dev *dev);307 int (*get_enc_strm_size)(struct s5p_mfc_dev *dev);
323 int (*get_enc_slice_type)(struct s5p_mfc_dev *dev);308 int (*get_enc_slice_type)(struct s5p_mfc_dev *dev);
324 int (*get_enc_dpb_count)(struct s5p_mfc_dev *dev);309 int (*get_enc_dpb_count)(struct s5p_mfc_dev *dev);
325 int (*get_enc_pic_count)(struct s5p_mfc_dev *dev);
326 int (*get_sei_avail_status)(struct s5p_mfc_ctx *ctx);
327 int (*get_mvc_num_views)(struct s5p_mfc_dev *dev);
328 int (*get_mvc_view_id)(struct s5p_mfc_dev *dev);
329 unsigned int (*get_pic_type_top)(struct s5p_mfc_ctx *ctx);310 unsigned int (*get_pic_type_top)(struct s5p_mfc_ctx *ctx);
330 unsigned int (*get_pic_type_bot)(struct s5p_mfc_ctx *ctx);311 unsigned int (*get_pic_type_bot)(struct s5p_mfc_ctx *ctx);
331 unsigned int (*get_crop_info_h)(struct s5p_mfc_ctx *ctx);312 unsigned int (*get_crop_info_h)(struct s5p_mfc_ctx *ctx);
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c+0−94
@@ -1153,27 +1153,6 @@ static int s5p_mfc_encode_one_frame_v5(struct s5p_mfc_ctx *ctx) · 1152 unmodified lines
1153 return 0;1153 return 0;
1154}1154}
1155 1155
1156static int s5p_mfc_get_new_ctx(struct s5p_mfc_dev *dev)
1157{
1158 unsigned long flags;
1159 int new_ctx;
1160 int cnt;
1161
1162 spin_lock_irqsave(&dev->condlock, flags);
1163 new_ctx = (dev->curr_ctx + 1) % MFC_NUM_CONTEXTS;
1164 cnt = 0;
1165 while (!test_bit(new_ctx, &dev->ctx_work_bits)) {
1166 new_ctx = (new_ctx + 1) % MFC_NUM_CONTEXTS;
1167 if (++cnt > MFC_NUM_CONTEXTS) {
1168 /* No contexts to run */
1169 spin_unlock_irqrestore(&dev->condlock, flags);
1170 return -EAGAIN;
1171 }
1172 }
1173 spin_unlock_irqrestore(&dev->condlock, flags);
1174 return new_ctx;
1175}
1176
1177static void s5p_mfc_run_res_change(struct s5p_mfc_ctx *ctx)1156static void s5p_mfc_run_res_change(struct s5p_mfc_ctx *ctx)
1178{1157{
1179 struct s5p_mfc_dev *dev = ctx->dev;1158 struct s5p_mfc_dev *dev = ctx->dev;
@@ -1187,7 +1166,6 @@ static int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx, int last_frame) · 7 unmodified lines
1187{1166{
1188 struct s5p_mfc_dev *dev = ctx->dev;1167 struct s5p_mfc_dev *dev = ctx->dev;
1189 struct s5p_mfc_buf *temp_vb;1168 struct s5p_mfc_buf *temp_vb;
1190 unsigned long flags;
1191 1169
1192 if (ctx->state == MFCINST_FINISHING) {1170 if (ctx->state == MFCINST_FINISHING) {
1193 last_frame = MFC_DEC_LAST_FRAME;1171 last_frame = MFC_DEC_LAST_FRAME;
@@ -1197,11 +1175,9 @@ static int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx, int last_frame) · 3 unmodified lines
1197 return 0;1175 return 0;
1198 }1176 }
1199 1177
1200 spin_lock_irqsave(&dev->irqlock, flags);
1201 /* Frames are being decoded */1178 /* Frames are being decoded */
1202 if (list_empty(&ctx->src_queue)) {1179 if (list_empty(&ctx->src_queue)) {
1203 mfc_debug(2, "No src buffers\n");1180 mfc_debug(2, "No src buffers\n");
1204 spin_unlock_irqrestore(&dev->irqlock, flags);
1205 return -EAGAIN;1181 return -EAGAIN;
1206 }1182 }
1207 /* Get the next source buffer */1183 /* Get the next source buffer */
@@ -1210,7 +1186,6 @@ static int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx, int last_frame) · 2 unmodified lines
1210 s5p_mfc_set_dec_stream_buffer_v5(ctx,1186 s5p_mfc_set_dec_stream_buffer_v5(ctx,
1211 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),1187 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
1212 ctx->consumed_stream, temp_vb->b->vb2_buf.planes[0].bytesused);1188 ctx->consumed_stream, temp_vb->b->vb2_buf.planes[0].bytesused);
1213 spin_unlock_irqrestore(&dev->irqlock, flags);
1214 dev->curr_ctx = ctx->num;1189 dev->curr_ctx = ctx->num;
1215 if (temp_vb->b->vb2_buf.planes[0].bytesused == 0) {1190 if (temp_vb->b->vb2_buf.planes[0].bytesused == 0) {
1216 last_frame = MFC_DEC_LAST_FRAME;1191 last_frame = MFC_DEC_LAST_FRAME;
@@ -1224,21 +1199,17 @@ static int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx, int last_frame) · 7 unmodified lines
1224static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx)1199static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx)
1225{1200{
1226 struct s5p_mfc_dev *dev = ctx->dev;1201 struct s5p_mfc_dev *dev = ctx->dev;
1227 unsigned long flags;
1228 struct s5p_mfc_buf *dst_mb;1202 struct s5p_mfc_buf *dst_mb;
1229 struct s5p_mfc_buf *src_mb;1203 struct s5p_mfc_buf *src_mb;
1230 unsigned long src_y_addr, src_c_addr, dst_addr;1204 unsigned long src_y_addr, src_c_addr, dst_addr;
1231 unsigned int dst_size;1205 unsigned int dst_size;
1232 1206
1233 spin_lock_irqsave(&dev->irqlock, flags);
1234 if (list_empty(&ctx->src_queue) && ctx->state != MFCINST_FINISHING) {1207 if (list_empty(&ctx->src_queue) && ctx->state != MFCINST_FINISHING) {
1235 mfc_debug(2, "no src buffers\n");1208 mfc_debug(2, "no src buffers\n");
1236 spin_unlock_irqrestore(&dev->irqlock, flags);
1237 return -EAGAIN;1209 return -EAGAIN;
1238 }1210 }
1239 if (list_empty(&ctx->dst_queue)) {1211 if (list_empty(&ctx->dst_queue)) {
1240 mfc_debug(2, "no dst buffers\n");1212 mfc_debug(2, "no dst buffers\n");
1241 spin_unlock_irqrestore(&dev->irqlock, flags);
1242 return -EAGAIN;1213 return -EAGAIN;
1243 }1214 }
1244 if (list_empty(&ctx->src_queue)) {1215 if (list_empty(&ctx->src_queue)) {
@@ -1270,7 +1241,6 @@ static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) · 25 unmodified lines
1270 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);1241 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
1271 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);1242 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
1272 s5p_mfc_set_enc_stream_buffer_v5(ctx, dst_addr, dst_size);1243 s5p_mfc_set_enc_stream_buffer_v5(ctx, dst_addr, dst_size);
1273 spin_unlock_irqrestore(&dev->irqlock, flags);
1274 dev->curr_ctx = ctx->num;1244 dev->curr_ctx = ctx->num;
1275 mfc_debug(2, "encoding buffer with index=%d state=%d\n",1245 mfc_debug(2, "encoding buffer with index=%d state=%d\n",
1276 src_mb ? src_mb->b->vb2_buf.index : -1, ctx->state);1246 src_mb ? src_mb->b->vb2_buf.index : -1, ctx->state);
@@ -1281,11 +1251,9 @@ static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) · 4 unmodified lines
1281static void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx)1251static void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx)
1282{1252{
1283 struct s5p_mfc_dev *dev = ctx->dev;1253 struct s5p_mfc_dev *dev = ctx->dev;
1284 unsigned long flags;
1285 struct s5p_mfc_buf *temp_vb;1254 struct s5p_mfc_buf *temp_vb;
1286 1255
1287 /* Initializing decoding - parsing header */1256 /* Initializing decoding - parsing header */
1288 spin_lock_irqsave(&dev->irqlock, flags);
1289 mfc_debug(2, "Preparing to init decoding\n");1257 mfc_debug(2, "Preparing to init decoding\n");
1290 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);1258 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
1291 s5p_mfc_set_dec_desc_buffer(ctx);1259 s5p_mfc_set_dec_desc_buffer(ctx);
@@ -1294,7 +1262,6 @@ static void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx) · 2 unmodified lines
1294 s5p_mfc_set_dec_stream_buffer_v5(ctx,1262 s5p_mfc_set_dec_stream_buffer_v5(ctx,
1295 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),1263 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
1296 0, temp_vb->b->vb2_buf.planes[0].bytesused);1264 0, temp_vb->b->vb2_buf.planes[0].bytesused);
1297 spin_unlock_irqrestore(&dev->irqlock, flags);
1298 dev->curr_ctx = ctx->num;1265 dev->curr_ctx = ctx->num;
1299 s5p_mfc_init_decode_v5(ctx);1266 s5p_mfc_init_decode_v5(ctx);
1300}1267}
@@ -1302,18 +1269,15 @@ static void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx) · 1 unmodified line
1302static void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx)1269static void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx)
1303{1270{
1304 struct s5p_mfc_dev *dev = ctx->dev;1271 struct s5p_mfc_dev *dev = ctx->dev;
1305 unsigned long flags;
1306 struct s5p_mfc_buf *dst_mb;1272 struct s5p_mfc_buf *dst_mb;
1307 unsigned long dst_addr;1273 unsigned long dst_addr;
1308 unsigned int dst_size;1274 unsigned int dst_size;
1309 1275
1310 s5p_mfc_set_enc_ref_buffer_v5(ctx);1276 s5p_mfc_set_enc_ref_buffer_v5(ctx);
1311 spin_lock_irqsave(&dev->irqlock, flags);
1312 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);1277 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
1313 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);1278 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
1314 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);1279 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
1315 s5p_mfc_set_enc_stream_buffer_v5(ctx, dst_addr, dst_size);1280 s5p_mfc_set_enc_stream_buffer_v5(ctx, dst_addr, dst_size);
1316 spin_unlock_irqrestore(&dev->irqlock, flags);
1317 dev->curr_ctx = ctx->num;1281 dev->curr_ctx = ctx->num;
1318 s5p_mfc_init_encode_v5(ctx);1282 s5p_mfc_init_encode_v5(ctx);
1319}1283}
@@ -1321,7 +1285,6 @@ static void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx) · 1 unmodified line
1321static int s5p_mfc_run_init_dec_buffers(struct s5p_mfc_ctx *ctx)1285static int s5p_mfc_run_init_dec_buffers(struct s5p_mfc_ctx *ctx)
1322{1286{
1323 struct s5p_mfc_dev *dev = ctx->dev;1287 struct s5p_mfc_dev *dev = ctx->dev;
1324 unsigned long flags;
1325 struct s5p_mfc_buf *temp_vb;1288 struct s5p_mfc_buf *temp_vb;
1326 int ret;1289 int ret;
1327 1290
@@ -1335,11 +1298,9 @@ static int s5p_mfc_run_init_dec_buffers(struct s5p_mfc_ctx *ctx) · 7 unmodified lines
1335 "before starting processing\n");1298 "before starting processing\n");
1336 return -EAGAIN;1299 return -EAGAIN;
1337 }1300 }
1338 spin_lock_irqsave(&dev->irqlock, flags);
1339 if (list_empty(&ctx->src_queue)) {1301 if (list_empty(&ctx->src_queue)) {
1340 mfc_err("Header has been deallocated in the middle of"1302 mfc_err("Header has been deallocated in the middle of"
1341 " initialization\n");1303 " initialization\n");
1342 spin_unlock_irqrestore(&dev->irqlock, flags);
1343 return -EIO;1304 return -EIO;
1344 }1305 }
1345 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);1306 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
@@ -1348,7 +1309,6 @@ static int s5p_mfc_run_init_dec_buffers(struct s5p_mfc_ctx *ctx) · 2 unmodified lines
1348 s5p_mfc_set_dec_stream_buffer_v5(ctx,1309 s5p_mfc_set_dec_stream_buffer_v5(ctx,
1349 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),1310 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
1350 0, temp_vb->b->vb2_buf.planes[0].bytesused);1311 0, temp_vb->b->vb2_buf.planes[0].bytesused);
1351 spin_unlock_irqrestore(&dev->irqlock, flags);
1352 dev->curr_ctx = ctx->num;1312 dev->curr_ctx = ctx->num;
1353 ret = s5p_mfc_set_dec_frame_buffer_v5(ctx);1313 ret = s5p_mfc_set_dec_frame_buffer_v5(ctx);
1354 if (ret) {1314 if (ret) {
@@ -1472,21 +1432,6 @@ static void s5p_mfc_try_run_v5(struct s5p_mfc_dev *dev) · 117 unmodified lines
1472 }1432 }
1473}1433}
1474 1434
1475
1476static void s5p_mfc_cleanup_queue_v5(struct list_head *lh, struct vb2_queue *vq)
1477{
1478 struct s5p_mfc_buf *b;
1479 int i;
1480
1481 while (!list_empty(lh)) {
1482 b = list_entry(lh->next, struct s5p_mfc_buf, list);
1483 for (i = 0; i < b->b->vb2_buf.num_planes; i++)
1484 vb2_set_plane_payload(&b->b->vb2_buf, i, 0);
1485 vb2_buffer_done(&b->b->vb2_buf, VB2_BUF_STATE_ERROR);
1486 list_del(&b->list);
1487 }
1488}
1489
1490static void s5p_mfc_clear_int_flags_v5(struct s5p_mfc_dev *dev)1435static void s5p_mfc_clear_int_flags_v5(struct s5p_mfc_dev *dev)
1491{1436{
1492 mfc_write(dev, 0, S5P_FIMV_RISC_HOST_INT);1437 mfc_write(dev, 0, S5P_FIMV_RISC_HOST_INT);
@@ -1590,11 +1535,6 @@ static int s5p_mfc_err_dec_v5(unsigned int err) · 97 unmodified lines
1590 return (err & S5P_FIMV_ERR_DEC_MASK) >> S5P_FIMV_ERR_DEC_SHIFT;1535 return (err & S5P_FIMV_ERR_DEC_MASK) >> S5P_FIMV_ERR_DEC_SHIFT;
1591}1536}
1592 1537
1593static int s5p_mfc_err_dspl_v5(unsigned int err)
1594{
1595 return (err & S5P_FIMV_ERR_DSPL_MASK) >> S5P_FIMV_ERR_DSPL_SHIFT;
1596}
1597
1598static int s5p_mfc_get_img_width_v5(struct s5p_mfc_dev *dev)1538static int s5p_mfc_get_img_width_v5(struct s5p_mfc_dev *dev)
1599{1539{
1600 return mfc_read(dev, S5P_FIMV_SI_HRESOL);1540 return mfc_read(dev, S5P_FIMV_SI_HRESOL);
@@ -1636,26 +1576,6 @@ static int s5p_mfc_get_enc_dpb_count_v5(struct s5p_mfc_dev *dev) · 35 unmodified lines
1636 return -1;1576 return -1;
1637}1577}
1638 1578
1639static int s5p_mfc_get_enc_pic_count_v5(struct s5p_mfc_dev *dev)
1640{
1641 return mfc_read(dev, S5P_FIMV_ENC_SI_PIC_CNT);
1642}
1643
1644static int s5p_mfc_get_sei_avail_status_v5(struct s5p_mfc_ctx *ctx)
1645{
1646 return s5p_mfc_read_info_v5(ctx, FRAME_PACK_SEI_AVAIL);
1647}
1648
1649static int s5p_mfc_get_mvc_num_views_v5(struct s5p_mfc_dev *dev)
1650{
1651 return -1;
1652}
1653
1654static int s5p_mfc_get_mvc_view_id_v5(struct s5p_mfc_dev *dev)
1655{
1656 return -1;
1657}
1658
1659static unsigned int s5p_mfc_get_pic_type_top_v5(struct s5p_mfc_ctx *ctx)1579static unsigned int s5p_mfc_get_pic_type_top_v5(struct s5p_mfc_ctx *ctx)
1660{1580{
1661 return s5p_mfc_read_info_v5(ctx, PIC_TIME_TOP);1581 return s5p_mfc_read_info_v5(ctx, PIC_TIME_TOP);
@@ -1688,20 +1608,11 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = { · 26 unmodified lines
1688 .release_dev_context_buffer = s5p_mfc_release_dev_context_buffer_v5,1608 .release_dev_context_buffer = s5p_mfc_release_dev_context_buffer_v5,
1689 .dec_calc_dpb_size = s5p_mfc_dec_calc_dpb_size_v5,1609 .dec_calc_dpb_size = s5p_mfc_dec_calc_dpb_size_v5,
1690 .enc_calc_src_size = s5p_mfc_enc_calc_src_size_v5,1610 .enc_calc_src_size = s5p_mfc_enc_calc_src_size_v5,
1691 .set_dec_stream_buffer = s5p_mfc_set_dec_stream_buffer_v5,
1692 .set_dec_frame_buffer = s5p_mfc_set_dec_frame_buffer_v5,
1693 .set_enc_stream_buffer = s5p_mfc_set_enc_stream_buffer_v5,1611 .set_enc_stream_buffer = s5p_mfc_set_enc_stream_buffer_v5,
1694 .set_enc_frame_buffer = s5p_mfc_set_enc_frame_buffer_v5,1612 .set_enc_frame_buffer = s5p_mfc_set_enc_frame_buffer_v5,
1695 .get_enc_frame_buffer = s5p_mfc_get_enc_frame_buffer_v5,1613 .get_enc_frame_buffer = s5p_mfc_get_enc_frame_buffer_v5,
1696 .set_enc_ref_buffer = s5p_mfc_set_enc_ref_buffer_v5,
1697 .init_decode = s5p_mfc_init_decode_v5,
1698 .init_encode = s5p_mfc_init_encode_v5,
1699 .encode_one_frame = s5p_mfc_encode_one_frame_v5,
1700 .try_run = s5p_mfc_try_run_v5,1614 .try_run = s5p_mfc_try_run_v5,
1701 .cleanup_queue = s5p_mfc_cleanup_queue_v5,
1702 .clear_int_flags = s5p_mfc_clear_int_flags_v5,1615 .clear_int_flags = s5p_mfc_clear_int_flags_v5,
1703 .write_info = s5p_mfc_write_info_v5,
1704 .read_info = s5p_mfc_read_info_v5,
1705 .get_dspl_y_adr = s5p_mfc_get_dspl_y_adr_v5,1616 .get_dspl_y_adr = s5p_mfc_get_dspl_y_adr_v5,
1706 .get_dec_y_adr = s5p_mfc_get_dec_y_adr_v5,1617 .get_dec_y_adr = s5p_mfc_get_dec_y_adr_v5,
1707 .get_dspl_status = s5p_mfc_get_dspl_status_v5,1618 .get_dspl_status = s5p_mfc_get_dspl_status_v5,
@@ -1712,7 +1623,6 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = { · 4 unmodified lines
1712 .get_int_reason = s5p_mfc_get_int_reason_v5,1623 .get_int_reason = s5p_mfc_get_int_reason_v5,
1713 .get_int_err = s5p_mfc_get_int_err_v5,1624 .get_int_err = s5p_mfc_get_int_err_v5,
1714 .err_dec = s5p_mfc_err_dec_v5,1625 .err_dec = s5p_mfc_err_dec_v5,
1715 .err_dspl = s5p_mfc_err_dspl_v5,
1716 .get_img_width = s5p_mfc_get_img_width_v5,1626 .get_img_width = s5p_mfc_get_img_width_v5,
1717 .get_img_height = s5p_mfc_get_img_height_v5,1627 .get_img_height = s5p_mfc_get_img_height_v5,
1718 .get_dpb_count = s5p_mfc_get_dpb_count_v5,1628 .get_dpb_count = s5p_mfc_get_dpb_count_v5,
@@ -1721,10 +1631,6 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v5 = { · 2 unmodified lines
1721 .get_enc_strm_size = s5p_mfc_get_enc_strm_size_v5,1631 .get_enc_strm_size = s5p_mfc_get_enc_strm_size_v5,
1722 .get_enc_slice_type = s5p_mfc_get_enc_slice_type_v5,1632 .get_enc_slice_type = s5p_mfc_get_enc_slice_type_v5,
1723 .get_enc_dpb_count = s5p_mfc_get_enc_dpb_count_v5,1633 .get_enc_dpb_count = s5p_mfc_get_enc_dpb_count_v5,
1724 .get_enc_pic_count = s5p_mfc_get_enc_pic_count_v5,
1725 .get_sei_avail_status = s5p_mfc_get_sei_avail_status_v5,
1726 .get_mvc_num_views = s5p_mfc_get_mvc_num_views_v5,
1727 .get_mvc_view_id = s5p_mfc_get_mvc_view_id_v5,
1728 .get_pic_type_top = s5p_mfc_get_pic_type_top_v5,1634 .get_pic_type_top = s5p_mfc_get_pic_type_top_v5,
1729 .get_pic_type_bot = s5p_mfc_get_pic_type_bot_v5,1635 .get_pic_type_bot = s5p_mfc_get_pic_type_bot_v5,
1730 .get_crop_info_h = s5p_mfc_get_crop_info_h_v5,1636 .get_crop_info_h = s5p_mfc_get_crop_info_h_v5,
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c+8−113
@@ -505,7 +505,7 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx) · 504 unmodified lines
505 }505 }
506 506
507 writel(ctx->inst_no, mfc_regs->instance_id);507 writel(ctx->inst_no, mfc_regs->instance_id);
508 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev,508 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev,
509 S5P_FIMV_CH_INIT_BUFS_V6, NULL);509 S5P_FIMV_CH_INIT_BUFS_V6, NULL);
510 510
511 mfc_debug(2, "After setting buffers.\n");511 mfc_debug(2, "After setting buffers.\n");
@@ -603,7 +603,7 @@ static int s5p_mfc_set_enc_ref_buffer_v6(struct s5p_mfc_ctx *ctx) · 91 unmodified lines
603 }603 }
604 604
605 writel(ctx->inst_no, mfc_regs->instance_id);605 writel(ctx->inst_no, mfc_regs->instance_id);
606 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev,606 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev,
607 S5P_FIMV_CH_INIT_BUFS_V6, NULL);607 S5P_FIMV_CH_INIT_BUFS_V6, NULL);
608 608
609 mfc_debug_leave();609 mfc_debug_leave();
@@ -1378,7 +1378,7 @@ static int s5p_mfc_init_decode_v6(struct s5p_mfc_ctx *ctx) · 768 unmodified lines
1378 writel(ctx->sei_fp_parse & 0x1, mfc_regs->d_sei_enable);1378 writel(ctx->sei_fp_parse & 0x1, mfc_regs->d_sei_enable);
1379 1379
1380 writel(ctx->inst_no, mfc_regs->instance_id);1380 writel(ctx->inst_no, mfc_regs->instance_id);
1381 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev,1381 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev,
1382 S5P_FIMV_CH_SEQ_HEADER_V6, NULL);1382 S5P_FIMV_CH_SEQ_HEADER_V6, NULL);
1383 1383
1384 mfc_debug_leave();1384 mfc_debug_leave();
@@ -1393,7 +1393,7 @@ static inline void s5p_mfc_set_flush(struct s5p_mfc_ctx *ctx, int flush) · 8 unmodified lines
1393 if (flush) {1393 if (flush) {
1394 dev->curr_ctx = ctx->num;1394 dev->curr_ctx = ctx->num;
1395 writel(ctx->inst_no, mfc_regs->instance_id);1395 writel(ctx->inst_no, mfc_regs->instance_id);
1396 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev,1396 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev,
1397 S5P_FIMV_H2R_CMD_FLUSH_V6, NULL);1397 S5P_FIMV_H2R_CMD_FLUSH_V6, NULL);
1398 }1398 }
1399}1399}
@@ -1413,11 +1413,11 @@ static int s5p_mfc_decode_one_frame_v6(struct s5p_mfc_ctx *ctx, · 13 unmodified lines
1413 * is the last frame or not. */1413 * is the last frame or not. */
1414 switch (last_frame) {1414 switch (last_frame) {
1415 case 0:1415 case 0:
1416 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev,1416 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev,
1417 S5P_FIMV_CH_FRAME_START_V6, NULL);1417 S5P_FIMV_CH_FRAME_START_V6, NULL);
1418 break;1418 break;
1419 case 1:1419 case 1:
1420 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev,1420 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev,
1421 S5P_FIMV_CH_LAST_FRAME_V6, NULL);1421 S5P_FIMV_CH_LAST_FRAME_V6, NULL);
1422 break;1422 break;
1423 default:1423 default:
@@ -1455,7 +1455,7 @@ static int s5p_mfc_init_encode_v6(struct s5p_mfc_ctx *ctx) · 31 unmodified lines
1455 }1455 }
1456 1456
1457 writel(ctx->inst_no, mfc_regs->instance_id);1457 writel(ctx->inst_no, mfc_regs->instance_id);
1458 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev,1458 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev,
1459 S5P_FIMV_CH_SEQ_HEADER_V6, NULL);1459 S5P_FIMV_CH_SEQ_HEADER_V6, NULL);
1460 1460
1461 return 0;1461 return 0;
@@ -1500,37 +1500,13 @@ static int s5p_mfc_encode_one_frame_v6(struct s5p_mfc_ctx *ctx) · 38 unmodified lines
1500 cmd = S5P_FIMV_CH_LAST_FRAME_V6;1500 cmd = S5P_FIMV_CH_LAST_FRAME_V6;
1501 1501
1502 writel(ctx->inst_no, mfc_regs->instance_id);1502 writel(ctx->inst_no, mfc_regs->instance_id);
1503 s5p_mfc_hw_call_void(dev->mfc_cmds, cmd_host2risc, dev, cmd, NULL);1503 s5p_mfc_hw_call(dev->mfc_cmds, cmd_host2risc, dev, cmd, NULL);
1504 1504
1505 mfc_debug(2, "--\n");1505 mfc_debug(2, "--\n");
1506 1506
1507 return 0;1507 return 0;
1508}1508}
1509 1509
1510static inline int s5p_mfc_get_new_ctx(struct s5p_mfc_dev *dev)
1511{
1512 unsigned long flags;
1513 int new_ctx;
1514 int cnt;
1515
1516 spin_lock_irqsave(&dev->condlock, flags);
1517 mfc_debug(2, "Previous context: %d (bits %08lx)\n", dev->curr_ctx,
1518 dev->ctx_work_bits);
1519 new_ctx = (dev->curr_ctx + 1) % MFC_NUM_CONTEXTS;
1520 cnt = 0;
1521 while (!test_bit(new_ctx, &dev->ctx_work_bits)) {
1522 new_ctx = (new_ctx + 1) % MFC_NUM_CONTEXTS;
1523 cnt++;
1524 if (cnt > MFC_NUM_CONTEXTS) {
1525 /* No contexts to run */
1526 spin_unlock_irqrestore(&dev->condlock, flags);
1527 return -EAGAIN;
1528 }
1529 }
1530 spin_unlock_irqrestore(&dev->condlock, flags);
1531 return new_ctx;
1532}
1533
1534static inline void s5p_mfc_run_dec_last_frames(struct s5p_mfc_ctx *ctx)1510static inline void s5p_mfc_run_dec_last_frames(struct s5p_mfc_ctx *ctx)
1535{1511{
1536 struct s5p_mfc_dev *dev = ctx->dev;1512 struct s5p_mfc_dev *dev = ctx->dev;
@@ -1544,7 +1520,6 @@ static inline int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx) · 7 unmodified lines
1544{1520{
1545 struct s5p_mfc_dev *dev = ctx->dev;1521 struct s5p_mfc_dev *dev = ctx->dev;
1546 struct s5p_mfc_buf *temp_vb;1522 struct s5p_mfc_buf *temp_vb;
1547 unsigned long flags;
1548 int last_frame = 0;1523 int last_frame = 0;
1549 1524
1550 if (ctx->state == MFCINST_FINISHING) {1525 if (ctx->state == MFCINST_FINISHING) {
@@ -1556,11 +1531,9 @@ static inline int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx) · 5 unmodified lines
1556 return 0;1531 return 0;
1557 }1532 }
1558 1533
1559 spin_lock_irqsave(&dev->irqlock, flags);
1560 /* Frames are being decoded */1534 /* Frames are being decoded */
1561 if (list_empty(&ctx->src_queue)) {1535 if (list_empty(&ctx->src_queue)) {
1562 mfc_debug(2, "No src buffers.\n");1536 mfc_debug(2, "No src buffers.\n");
1563 spin_unlock_irqrestore(&dev->irqlock, flags);
1564 return -EAGAIN;1537 return -EAGAIN;
1565 }1538 }
1566 /* Get the next source buffer */1539 /* Get the next source buffer */
@@ -1570,7 +1543,6 @@ static inline int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx) · 3 unmodified lines
1570 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),1543 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
1571 ctx->consumed_stream,1544 ctx->consumed_stream,
1572 temp_vb->b->vb2_buf.planes[0].bytesused);1545 temp_vb->b->vb2_buf.planes[0].bytesused);
1573 spin_unlock_irqrestore(&dev->irqlock, flags);
1574 1546
1575 dev->curr_ctx = ctx->num;1547 dev->curr_ctx = ctx->num;
1576 if (temp_vb->b->vb2_buf.planes[0].bytesused == 0) {1548 if (temp_vb->b->vb2_buf.planes[0].bytesused == 0) {
@@ -1586,7 +1558,6 @@ static inline int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx) · 9 unmodified lines
1586static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx)1558static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx)
1587{1559{
1588 struct s5p_mfc_dev *dev = ctx->dev;1560 struct s5p_mfc_dev *dev = ctx->dev;
1589 unsigned long flags;
1590 struct s5p_mfc_buf *dst_mb;1561 struct s5p_mfc_buf *dst_mb;
1591 struct s5p_mfc_buf *src_mb;1562 struct s5p_mfc_buf *src_mb;
1592 unsigned long src_y_addr, src_c_addr, dst_addr;1563 unsigned long src_y_addr, src_c_addr, dst_addr;
@@ -1595,17 +1566,13 @@ static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) · 2 unmodified lines
1595 */1566 */
1596 unsigned int dst_size;1567 unsigned int dst_size;
1597 1568
1598 spin_lock_irqsave(&dev->irqlock, flags);
1599
1600 if (list_empty(&ctx->src_queue) && ctx->state != MFCINST_FINISHING) {1569 if (list_empty(&ctx->src_queue) && ctx->state != MFCINST_FINISHING) {
1601 mfc_debug(2, "no src buffers.\n");1570 mfc_debug(2, "no src buffers.\n");
1602 spin_unlock_irqrestore(&dev->irqlock, flags);
1603 return -EAGAIN;1571 return -EAGAIN;
1604 }1572 }
1605 1573
1606 if (list_empty(&ctx->dst_queue)) {1574 if (list_empty(&ctx->dst_queue)) {
1607 mfc_debug(2, "no dst buffers.\n");1575 mfc_debug(2, "no dst buffers.\n");
1608 spin_unlock_irqrestore(&dev->irqlock, flags);
1609 return -EAGAIN;1576 return -EAGAIN;
1610 }1577 }
1611 1578
@@ -1639,8 +1606,6 @@ static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) · 27 unmodified lines
1639 1606
1640 s5p_mfc_set_enc_stream_buffer_v6(ctx, dst_addr, dst_size);1607 s5p_mfc_set_enc_stream_buffer_v6(ctx, dst_addr, dst_size);
1641 1608
1642 spin_unlock_irqrestore(&dev->irqlock, flags);
1643
1644 dev->curr_ctx = ctx->num;1609 dev->curr_ctx = ctx->num;
1645 s5p_mfc_encode_one_frame_v6(ctx);1610 s5p_mfc_encode_one_frame_v6(ctx);
1646 1611
@@ -1650,18 +1615,15 @@ static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) · 3 unmodified lines
1650static inline void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx)1615static inline void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx)
1651{1616{
1652 struct s5p_mfc_dev *dev = ctx->dev;1617 struct s5p_mfc_dev *dev = ctx->dev;
1653 unsigned long flags;
1654 struct s5p_mfc_buf *temp_vb;1618 struct s5p_mfc_buf *temp_vb;
1655 1619
1656 /* Initializing decoding - parsing header */1620 /* Initializing decoding - parsing header */
1657 spin_lock_irqsave(&dev->irqlock, flags);
1658 mfc_debug(2, "Preparing to init decoding.\n");1621 mfc_debug(2, "Preparing to init decoding.\n");
1659 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);1622 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
1660 mfc_debug(2, "Header size: %d\n", temp_vb->b->vb2_buf.planes[0].bytesused);1623 mfc_debug(2, "Header size: %d\n", temp_vb->b->vb2_buf.planes[0].bytesused);
1661 s5p_mfc_set_dec_stream_buffer_v6(ctx,1624 s5p_mfc_set_dec_stream_buffer_v6(ctx,
1662 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0), 0,1625 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0), 0,
1663 temp_vb->b->vb2_buf.planes[0].bytesused);1626 temp_vb->b->vb2_buf.planes[0].bytesused);
1664 spin_unlock_irqrestore(&dev->irqlock, flags);
1665 dev->curr_ctx = ctx->num;1627 dev->curr_ctx = ctx->num;
1666 s5p_mfc_init_decode_v6(ctx);1628 s5p_mfc_init_decode_v6(ctx);
1667}1629}
@@ -1669,18 +1631,14 @@ static inline void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx) · 1 unmodified line
1669static inline void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx)1631static inline void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx)
1670{1632{
1671 struct s5p_mfc_dev *dev = ctx->dev;1633 struct s5p_mfc_dev *dev = ctx->dev;
1672 unsigned long flags;
1673 struct s5p_mfc_buf *dst_mb;1634 struct s5p_mfc_buf *dst_mb;
1674 unsigned long dst_addr;1635 unsigned long dst_addr;
1675 unsigned int dst_size;1636 unsigned int dst_size;
1676 1637
1677 spin_lock_irqsave(&dev->irqlock, flags);
1678
1679 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);1638 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
1680 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);1639 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
1681 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);1640 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
1682 s5p_mfc_set_enc_stream_buffer_v6(ctx, dst_addr, dst_size);1641 s5p_mfc_set_enc_stream_buffer_v6(ctx, dst_addr, dst_size);
1683 spin_unlock_irqrestore(&dev->irqlock, flags);
1684 dev->curr_ctx = ctx->num;1642 dev->curr_ctx = ctx->num;
1685 s5p_mfc_init_encode_v6(ctx);1643 s5p_mfc_init_encode_v6(ctx);
1686}1644}
@@ -1846,21 +1804,6 @@ static void s5p_mfc_try_run_v6(struct s5p_mfc_dev *dev) · 159 unmodified lines
1846 }1804 }
1847}1805}
1848 1806
1849
1850static void s5p_mfc_cleanup_queue_v6(struct list_head *lh, struct vb2_queue *vq)
1851{
1852 struct s5p_mfc_buf *b;
1853 int i;
1854
1855 while (!list_empty(lh)) {
1856 b = list_entry(lh->next, struct s5p_mfc_buf, list);
1857 for (i = 0; i < b->b->vb2_buf.num_planes; i++)
1858 vb2_set_plane_payload(&b->b->vb2_buf, i, 0);
1859 vb2_buffer_done(&b->b->vb2_buf, VB2_BUF_STATE_ERROR);
1860 list_del(&b->list);
1861 }
1862}
1863
1864static void s5p_mfc_clear_int_flags_v6(struct s5p_mfc_dev *dev)1807static void s5p_mfc_clear_int_flags_v6(struct s5p_mfc_dev *dev)
1865{1808{
1866 const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs;1809 const struct s5p_mfc_regs *mfc_regs = dev->mfc_regs;
@@ -1868,14 +1811,6 @@ static void s5p_mfc_clear_int_flags_v6(struct s5p_mfc_dev *dev) · 1 unmodified line
1868 writel(0, mfc_regs->risc2host_int);1811 writel(0, mfc_regs->risc2host_int);
1869}1812}
1870 1813
1871static void s5p_mfc_write_info_v6(struct s5p_mfc_ctx *ctx, unsigned int data,
1872 unsigned int ofs)
1873{
1874 s5p_mfc_clock_on();
1875 writel(data, (void __iomem *)((unsigned long)ofs));
1876 s5p_mfc_clock_off();
1877}
1878
1879static unsigned int1814static unsigned int
1880s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned long ofs)1815s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned long ofs)
1881{1816{
@@ -1942,11 +1877,6 @@ static int s5p_mfc_err_dec_v6(unsigned int err) · 60 unmodified lines
1942 return (err & S5P_FIMV_ERR_DEC_MASK_V6) >> S5P_FIMV_ERR_DEC_SHIFT_V6;1877 return (err & S5P_FIMV_ERR_DEC_MASK_V6) >> S5P_FIMV_ERR_DEC_SHIFT_V6;
1943}1878}
1944 1879
1945static int s5p_mfc_err_dspl_v6(unsigned int err)
1946{
1947 return (err & S5P_FIMV_ERR_DSPL_MASK_V6) >> S5P_FIMV_ERR_DSPL_SHIFT_V6;
1948}
1949
1950static int s5p_mfc_get_img_width_v6(struct s5p_mfc_dev *dev)1880static int s5p_mfc_get_img_width_v6(struct s5p_mfc_dev *dev)
1951{1881{
1952 return readl(dev->mfc_regs->d_display_frame_width);1882 return readl(dev->mfc_regs->d_display_frame_width);
@@ -1987,27 +1917,6 @@ static int s5p_mfc_get_enc_slice_type_v6(struct s5p_mfc_dev *dev) · 34 unmodified lines
1987 return readl(dev->mfc_regs->e_slice_type);1917 return readl(dev->mfc_regs->e_slice_type);
1988}1918}
1989 1919
1990static int s5p_mfc_get_enc_pic_count_v6(struct s5p_mfc_dev *dev)
1991{
1992 return readl(dev->mfc_regs->e_picture_count);
1993}
1994
1995static int s5p_mfc_get_sei_avail_status_v6(struct s5p_mfc_ctx *ctx)
1996{
1997 struct s5p_mfc_dev *dev = ctx->dev;
1998 return readl(dev->mfc_regs->d_frame_pack_sei_avail);
1999}
2000
2001static int s5p_mfc_get_mvc_num_views_v6(struct s5p_mfc_dev *dev)
2002{
2003 return readl(dev->mfc_regs->d_mvc_num_views);
2004}
2005
2006static int s5p_mfc_get_mvc_view_id_v6(struct s5p_mfc_dev *dev)
2007{
2008 return readl(dev->mfc_regs->d_mvc_view_id);
2009}
2010
2011static unsigned int s5p_mfc_get_pic_type_top_v6(struct s5p_mfc_ctx *ctx)1920static unsigned int s5p_mfc_get_pic_type_top_v6(struct s5p_mfc_ctx *ctx)
2012{1921{
2013 return s5p_mfc_read_info_v6(ctx,1922 return s5p_mfc_read_info_v6(ctx,
@@ -2282,20 +2191,11 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = { · 268 unmodified lines
2282 s5p_mfc_release_dev_context_buffer_v6,2191 s5p_mfc_release_dev_context_buffer_v6,
2283 .dec_calc_dpb_size = s5p_mfc_dec_calc_dpb_size_v6,2192 .dec_calc_dpb_size = s5p_mfc_dec_calc_dpb_size_v6,
2284 .enc_calc_src_size = s5p_mfc_enc_calc_src_size_v6,2193 .enc_calc_src_size = s5p_mfc_enc_calc_src_size_v6,
2285 .set_dec_stream_buffer = s5p_mfc_set_dec_stream_buffer_v6,
2286 .set_dec_frame_buffer = s5p_mfc_set_dec_frame_buffer_v6,
2287 .set_enc_stream_buffer = s5p_mfc_set_enc_stream_buffer_v6,2194 .set_enc_stream_buffer = s5p_mfc_set_enc_stream_buffer_v6,
2288 .set_enc_frame_buffer = s5p_mfc_set_enc_frame_buffer_v6,2195 .set_enc_frame_buffer = s5p_mfc_set_enc_frame_buffer_v6,
2289 .get_enc_frame_buffer = s5p_mfc_get_enc_frame_buffer_v6,2196 .get_enc_frame_buffer = s5p_mfc_get_enc_frame_buffer_v6,
2290 .set_enc_ref_buffer = s5p_mfc_set_enc_ref_buffer_v6,
2291 .init_decode = s5p_mfc_init_decode_v6,
2292 .init_encode = s5p_mfc_init_encode_v6,
2293 .encode_one_frame = s5p_mfc_encode_one_frame_v6,
2294 .try_run = s5p_mfc_try_run_v6,2197 .try_run = s5p_mfc_try_run_v6,
2295 .cleanup_queue = s5p_mfc_cleanup_queue_v6,
2296 .clear_int_flags = s5p_mfc_clear_int_flags_v6,2198 .clear_int_flags = s5p_mfc_clear_int_flags_v6,
2297 .write_info = s5p_mfc_write_info_v6,
2298 .read_info = s5p_mfc_read_info_v6,
2299 .get_dspl_y_adr = s5p_mfc_get_dspl_y_adr_v6,2199 .get_dspl_y_adr = s5p_mfc_get_dspl_y_adr_v6,
2300 .get_dec_y_adr = s5p_mfc_get_dec_y_adr_v6,2200 .get_dec_y_adr = s5p_mfc_get_dec_y_adr_v6,
2301 .get_dspl_status = s5p_mfc_get_dspl_status_v6,2201 .get_dspl_status = s5p_mfc_get_dspl_status_v6,
@@ -2306,7 +2206,6 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = { · 4 unmodified lines
2306 .get_int_reason = s5p_mfc_get_int_reason_v6,2206 .get_int_reason = s5p_mfc_get_int_reason_v6,
2307 .get_int_err = s5p_mfc_get_int_err_v6,2207 .get_int_err = s5p_mfc_get_int_err_v6,
2308 .err_dec = s5p_mfc_err_dec_v6,2208 .err_dec = s5p_mfc_err_dec_v6,
2309 .err_dspl = s5p_mfc_err_dspl_v6,
2310 .get_img_width = s5p_mfc_get_img_width_v6,2209 .get_img_width = s5p_mfc_get_img_width_v6,
2311 .get_img_height = s5p_mfc_get_img_height_v6,2210 .get_img_height = s5p_mfc_get_img_height_v6,
2312 .get_dpb_count = s5p_mfc_get_dpb_count_v6,2211 .get_dpb_count = s5p_mfc_get_dpb_count_v6,
@@ -2315,10 +2214,6 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = { · 2 unmodified lines
2315 .get_enc_strm_size = s5p_mfc_get_enc_strm_size_v6,2214 .get_enc_strm_size = s5p_mfc_get_enc_strm_size_v6,
2316 .get_enc_slice_type = s5p_mfc_get_enc_slice_type_v6,2215 .get_enc_slice_type = s5p_mfc_get_enc_slice_type_v6,
2317 .get_enc_dpb_count = s5p_mfc_get_enc_dpb_count_v6,2216 .get_enc_dpb_count = s5p_mfc_get_enc_dpb_count_v6,
2318 .get_enc_pic_count = s5p_mfc_get_enc_pic_count_v6,
2319 .get_sei_avail_status = s5p_mfc_get_sei_avail_status_v6,
2320 .get_mvc_num_views = s5p_mfc_get_mvc_num_views_v6,
2321 .get_mvc_view_id = s5p_mfc_get_mvc_view_id_v6,
2322 .get_pic_type_top = s5p_mfc_get_pic_type_top_v6,2217 .get_pic_type_top = s5p_mfc_get_pic_type_top_v6,
2323 .get_pic_type_bot = s5p_mfc_get_pic_type_bot_v6,2218 .get_pic_type_bot = s5p_mfc_get_pic_type_bot_v6,
2324 .get_crop_info_h = s5p_mfc_get_crop_info_h_v6,2219 .get_crop_info_h = s5p_mfc_get_crop_info_h_v6,
drivers/media/platform/s5p-tv/hdmi_drv.c+2−2
@@ -33,7 +33,7 @@ · 32 unmodified lines
33#include <linux/regulator/consumer.h>33#include <linux/regulator/consumer.h>
34#include <linux/v4l2-dv-timings.h>34#include <linux/v4l2-dv-timings.h>
35 35
36#include <media/s5p_hdmi.h>36#include <linux/platform_data/media/s5p_hdmi.h>
37#include <media/v4l2-common.h>37#include <media/v4l2-common.h>
38#include <media/v4l2-dev.h>38#include <media/v4l2-dev.h>
39#include <media/v4l2-device.h>39#include <media/v4l2-device.h>
@@ -627,7 +627,7 @@ static int hdmi_s_dv_timings(struct v4l2_subdev *sd, · 587 unmodified lines
627 627
628 for (i = 0; i < ARRAY_SIZE(hdmi_timings); i++)628 for (i = 0; i < ARRAY_SIZE(hdmi_timings); i++)
629 if (v4l2_match_dv_timings(&hdmi_timings[i].dv_timings,629 if (v4l2_match_dv_timings(&hdmi_timings[i].dv_timings,
630 timings, 0))630 timings, 0, false))
631 break;631 break;
632 if (i == ARRAY_SIZE(hdmi_timings)) {632 if (i == ARRAY_SIZE(hdmi_timings)) {
633 dev_err(dev, "timings not supported\n");633 dev_err(dev, "timings not supported\n");
drivers/media/platform/s5p-tv/mixer_video.c+1−1
@@ -881,7 +881,7 @@ static const struct v4l2_file_operations mxr_fops = { · 880 unmodified lines
881 .unlocked_ioctl = video_ioctl2,881 .unlocked_ioctl = video_ioctl2,
882};882};
883 883
884static int queue_setup(struct vb2_queue *vq, const void *parg,884static int queue_setup(struct vb2_queue *vq,
885 unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[],885 unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[],
886 void *alloc_ctxs[])886 void *alloc_ctxs[])
887{887{
drivers/media/platform/s5p-tv/sii9234_drv.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
23#include <linux/regulator/machine.h>23#include <linux/regulator/machine.h>
24#include <linux/slab.h>24#include <linux/slab.h>
25 25
26#include <media/sii9234.h>26#include <linux/platform_data/media/sii9234.h>
27#include <media/v4l2-subdev.h>27#include <media/v4l2-subdev.h>
28 28
29MODULE_AUTHOR("Tomasz Stanislawski <t.stanislaws@samsung.com>");29MODULE_AUTHOR("Tomasz Stanislawski <t.stanislaws@samsung.com>");
drivers/media/platform/sh_veu.c+10−23
@@ -865,32 +865,14 @@ static const struct v4l2_ioctl_ops sh_veu_ioctl_ops = { · 864 unmodified lines
865 /* ========== Queue operations ========== */865 /* ========== Queue operations ========== */
866 866
867static int sh_veu_queue_setup(struct vb2_queue *vq,867static int sh_veu_queue_setup(struct vb2_queue *vq,
868 const void *parg,
869 unsigned int *nbuffers, unsigned int *nplanes,868 unsigned int *nbuffers, unsigned int *nplanes,
870 unsigned int sizes[], void *alloc_ctxs[])869 unsigned int sizes[], void *alloc_ctxs[])
871{870{
872 const struct v4l2_format *f = parg;
873 struct sh_veu_dev *veu = vb2_get_drv_priv(vq);871 struct sh_veu_dev *veu = vb2_get_drv_priv(vq);
874 struct sh_veu_vfmt *vfmt;872 struct sh_veu_vfmt *vfmt = sh_veu_get_vfmt(veu, vq->type);
875 unsigned int size, count = *nbuffers;873 unsigned int count = *nbuffers;
876 874 unsigned int size = vfmt->bytesperline * vfmt->frame.height *
877 if (f) {875 vfmt->fmt->depth / vfmt->fmt->ydepth;
878 const struct v4l2_pix_format *pix = &f->fmt.pix;
879 const struct sh_veu_format *fmt = sh_veu_find_fmt(f);
880 struct v4l2_format ftmp = *f;
881
882 if (fmt->fourcc != pix->pixelformat)
883 return -EINVAL;
884 sh_veu_try_fmt(&ftmp, fmt);
885 if (ftmp.fmt.pix.width != pix->width ||
886 ftmp.fmt.pix.height != pix->height)
887 return -EINVAL;
888 size = pix->bytesperline ? pix->bytesperline * pix->height * fmt->depth / fmt->ydepth :
889 pix->width * pix->height * fmt->depth / fmt->ydepth;
890 } else {
891 vfmt = sh_veu_get_vfmt(veu, vq->type);
892 size = vfmt->bytesperline * vfmt->frame.height * vfmt->fmt->depth / vfmt->fmt->ydepth;
893 }
894 876
895 if (count < 2)877 if (count < 2)
896 *nbuffers = count = 2;878 *nbuffers = count = 2;
@@ -900,6 +882,11 @@ static int sh_veu_queue_setup(struct vb2_queue *vq, · 3 unmodified lines
900 *nbuffers = count;882 *nbuffers = count;
901 }883 }
902 884
885 if (*nplanes) {
886 alloc_ctxs[0] = veu->alloc_ctx;
887 return sizes[0] < size ? -EINVAL : 0;
888 }
889
903 *nplanes = 1;890 *nplanes = 1;
904 sizes[0] = size;891 sizes[0] = size;
905 alloc_ctxs[0] = veu->alloc_ctx;892 alloc_ctxs[0] = veu->alloc_ctx;
@@ -1107,7 +1094,7 @@ static irqreturn_t sh_veu_isr(int irq, void *dev_id) · 201 unmodified lines
1107 if (!src || !dst)1094 if (!src || !dst)
1108 return IRQ_NONE;1095 return IRQ_NONE;
1109 1096
1110 dst->timestamp = src->timestamp;1097 dst->vb2_buf.timestamp = src->vb2_buf.timestamp;
1111 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;1098 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
1112 dst->flags |=1099 dst->flags |=
1113 src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;1100 src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
drivers/media/platform/sh_vou.c+7−8
@@ -22,7 +22,7 @@ · 21 unmodified lines
22#include <linux/videodev2.h>22#include <linux/videodev2.h>
23#include <linux/module.h>23#include <linux/module.h>
24 24
25#include <media/sh_vou.h>25#include <media/drv-intf/sh_vou.h>
26#include <media/v4l2-common.h>26#include <media/v4l2-common.h>
27#include <media/v4l2-device.h>27#include <media/v4l2-device.h>
28#include <media/v4l2-ioctl.h>28#include <media/v4l2-ioctl.h>
@@ -243,22 +243,21 @@ static void sh_vou_stream_config(struct sh_vou_device *vou_dev) · 214 unmodified lines
243}243}
244 244
245/* Locking: caller holds fop_lock mutex */245/* Locking: caller holds fop_lock mutex */
246static int sh_vou_queue_setup(struct vb2_queue *vq, const void *parg,246static int sh_vou_queue_setup(struct vb2_queue *vq,
247 unsigned int *nbuffers, unsigned int *nplanes,247 unsigned int *nbuffers, unsigned int *nplanes,
248 unsigned int sizes[], void *alloc_ctxs[])248 unsigned int sizes[], void *alloc_ctxs[])
249{249{
250 const struct v4l2_format *fmt = parg;
251 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq);250 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq);
252 struct v4l2_pix_format *pix = &vou_dev->pix;251 struct v4l2_pix_format *pix = &vou_dev->pix;
253 int bytes_per_line = vou_fmt[vou_dev->pix_idx].bpp * pix->width / 8;252 int bytes_per_line = vou_fmt[vou_dev->pix_idx].bpp * pix->width / 8;
254 253
255 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);254 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);
256 255
257 if (fmt && fmt->fmt.pix.sizeimage < pix->height * bytes_per_line)
258 return -EINVAL;
259 *nplanes = 1;
260 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : pix->height * bytes_per_line;
261 alloc_ctxs[0] = vou_dev->alloc_ctx;256 alloc_ctxs[0] = vou_dev->alloc_ctx;
257 if (*nplanes)
258 return sizes[0] < pix->height * bytes_per_line ? -EINVAL : 0;
259 *nplanes = 1;
260 sizes[0] = pix->height * bytes_per_line;
262 return 0;261 return 0;
263}262}
264 263
@@ -1071,7 +1070,7 @@ static irqreturn_t sh_vou_isr(int irq, void *dev_id) · 806 unmodified lines
1071 1070
1072 list_del(&vb->list);1071 list_del(&vb->list);
1073 1072
1074 v4l2_get_timestamp(&vb->vb.timestamp);1073 vb->vb.vb2_buf.timestamp = ktime_get_ns();
1075 vb->vb.sequence = vou_dev->sequence++;1074 vb->vb.sequence = vou_dev->sequence++;
1076 vb->vb.field = V4L2_FIELD_INTERLACED;1075 vb->vb.field = V4L2_FIELD_INTERLACED;
1077 vb2_buffer_done(&vb->vb.vb2_buf, VB2_BUF_STATE_DONE);1076 vb2_buffer_done(&vb->vb.vb2_buf, VB2_BUF_STATE_DONE);
drivers/media/platform/soc_camera/atmel-isi.c+125−43
@@ -24,7 +24,7 @@ · 23 unmodified lines
24#include <linux/slab.h>24#include <linux/slab.h>
25 25
26#include <media/soc_camera.h>26#include <media/soc_camera.h>
27#include <media/soc_mediabus.h>27#include <media/drv-intf/soc_mediabus.h>
28#include <media/v4l2-of.h>28#include <media/v4l2-of.h>
29#include <media/videobuf2-dma-contig.h>29#include <media/videobuf2-dma-contig.h>
30 30
@@ -79,6 +79,7 @@ struct atmel_isi { · 48 unmodified lines
79 dma_addr_t fb_descriptors_phys;79 dma_addr_t fb_descriptors_phys;
80 struct list_head dma_desc_head;80 struct list_head dma_desc_head;
81 struct isi_dma_desc dma_desc[MAX_BUFFER_NUM];81 struct isi_dma_desc dma_desc[MAX_BUFFER_NUM];
82 bool enable_preview_path;
82 83
83 struct completion complete;84 struct completion complete;
84 /* ISI peripherial clock */85 /* ISI peripherial clock */
@@ -103,13 +104,55 @@ static u32 isi_readl(struct atmel_isi *isi, u32 reg) · 18 unmodified lines
103 return readl(isi->regs + reg);104 return readl(isi->regs + reg);
104}105}
105 106
107static u32 setup_cfg2_yuv_swap(struct atmel_isi *isi,
108 const struct soc_camera_format_xlate *xlate)
109{
110 if (xlate->host_fmt->fourcc == V4L2_PIX_FMT_YUYV) {
111 /* all convert to YUYV */
112 switch (xlate->code) {
113 case MEDIA_BUS_FMT_VYUY8_2X8:
114 return ISI_CFG2_YCC_SWAP_MODE_3;
115 case MEDIA_BUS_FMT_UYVY8_2X8:
116 return ISI_CFG2_YCC_SWAP_MODE_2;
117 case MEDIA_BUS_FMT_YVYU8_2X8:
118 return ISI_CFG2_YCC_SWAP_MODE_1;
119 }
120 } else if (xlate->host_fmt->fourcc == V4L2_PIX_FMT_RGB565) {
121 /*
122 * Preview path is enabled, it will convert UYVY to RGB format.
123 * But if sensor output format is not UYVY, we need to set
124 * YCC_SWAP_MODE to convert it as UYVY.
125 */
126 switch (xlate->code) {
127 case MEDIA_BUS_FMT_VYUY8_2X8:
128 return ISI_CFG2_YCC_SWAP_MODE_1;
129 case MEDIA_BUS_FMT_YUYV8_2X8:
130 return ISI_CFG2_YCC_SWAP_MODE_2;
131 case MEDIA_BUS_FMT_YVYU8_2X8:
132 return ISI_CFG2_YCC_SWAP_MODE_3;
133 }
134 }
135
136 /*
137 * By default, no swap for the codec path of Atmel ISI. So codec
138 * output is same as sensor's output.
139 * For instance, if sensor's output is YUYV, then codec outputs YUYV.
140 * And if sensor's output is UYVY, then codec outputs UYVY.
141 */
142 return ISI_CFG2_YCC_SWAP_DEFAULT;
143}
144
106static void configure_geometry(struct atmel_isi *isi, u32 width,145static void configure_geometry(struct atmel_isi *isi, u32 width,
107 u32 height, u32 code)146 u32 height, const struct soc_camera_format_xlate *xlate)
108{147{
109 u32 cfg2;148 u32 cfg2, psize;
149 u32 fourcc = xlate->host_fmt->fourcc;
150
151 isi->enable_preview_path = fourcc == V4L2_PIX_FMT_RGB565 ||
152 fourcc == V4L2_PIX_FMT_RGB32;
110 153
111 /* According to sensor's output format to set cfg2 */154 /* According to sensor's output format to set cfg2 */
112 switch (code) {155 switch (xlate->code) {
113 default:156 default:
114 /* Grey */157 /* Grey */
115 case MEDIA_BUS_FMT_Y8_1X8:158 case MEDIA_BUS_FMT_Y8_1X8:
@@ -117,16 +160,11 @@ static void configure_geometry(struct atmel_isi *isi, u32 width, · 1 unmodified line
117 break;160 break;
118 /* YUV */161 /* YUV */
119 case MEDIA_BUS_FMT_VYUY8_2X8:162 case MEDIA_BUS_FMT_VYUY8_2X8:
120 cfg2 = ISI_CFG2_YCC_SWAP_MODE_3 | ISI_CFG2_COL_SPACE_YCbCr;
121 break;
122 case MEDIA_BUS_FMT_UYVY8_2X8:163 case MEDIA_BUS_FMT_UYVY8_2X8:
123 cfg2 = ISI_CFG2_YCC_SWAP_MODE_2 | ISI_CFG2_COL_SPACE_YCbCr;
124 break;
125 case MEDIA_BUS_FMT_YVYU8_2X8:164 case MEDIA_BUS_FMT_YVYU8_2X8:
126 cfg2 = ISI_CFG2_YCC_SWAP_MODE_1 | ISI_CFG2_COL_SPACE_YCbCr;
127 break;
128 case MEDIA_BUS_FMT_YUYV8_2X8:165 case MEDIA_BUS_FMT_YUYV8_2X8:
129 cfg2 = ISI_CFG2_YCC_SWAP_DEFAULT | ISI_CFG2_COL_SPACE_YCbCr;166 cfg2 = ISI_CFG2_COL_SPACE_YCbCr |
167 setup_cfg2_yuv_swap(isi, xlate);
130 break;168 break;
131 /* RGB, TODO */169 /* RGB, TODO */
132 }170 }
@@ -139,6 +177,16 @@ static void configure_geometry(struct atmel_isi *isi, u32 width, · 6 unmodified lines
139 cfg2 |= ((height - 1) << ISI_CFG2_IM_VSIZE_OFFSET)177 cfg2 |= ((height - 1) << ISI_CFG2_IM_VSIZE_OFFSET)
140 & ISI_CFG2_IM_VSIZE_MASK;178 & ISI_CFG2_IM_VSIZE_MASK;
141 isi_writel(isi, ISI_CFG2, cfg2);179 isi_writel(isi, ISI_CFG2, cfg2);
180
181 /* No down sampling, preview size equal to sensor output size */
182 psize = ((width - 1) << ISI_PSIZE_PREV_HSIZE_OFFSET) &
183 ISI_PSIZE_PREV_HSIZE_MASK;
184 psize |= ((height - 1) << ISI_PSIZE_PREV_VSIZE_OFFSET) &
185 ISI_PSIZE_PREV_VSIZE_MASK;
186 isi_writel(isi, ISI_PSIZE, psize);
187 isi_writel(isi, ISI_PDECF, ISI_PDECF_NO_SAMPLING);
188
189 return;
142}190}
143 191
144static bool is_supported(struct soc_camera_device *icd,192static bool is_supported(struct soc_camera_device *icd,
@@ -151,8 +199,9 @@ static bool is_supported(struct soc_camera_device *icd, · 6 unmodified lines
151 case V4L2_PIX_FMT_UYVY:199 case V4L2_PIX_FMT_UYVY:
152 case V4L2_PIX_FMT_YVYU:200 case V4L2_PIX_FMT_YVYU:
153 case V4L2_PIX_FMT_VYUY:201 case V4L2_PIX_FMT_VYUY:
202 /* RGB */
203 case V4L2_PIX_FMT_RGB565:
154 return true;204 return true;
155 /* RGB, TODO */
156 default:205 default:
157 return false;206 return false;
158 }207 }
@@ -165,7 +214,7 @@ static irqreturn_t atmel_isi_handle_streaming(struct atmel_isi *isi) · 6 unmodified lines
165 struct frame_buffer *buf = isi->active;214 struct frame_buffer *buf = isi->active;
166 215
167 list_del_init(&buf->list);216 list_del_init(&buf->list);
168 v4l2_get_timestamp(&vbuf->timestamp);217 vbuf->vb2_buf.timestamp = ktime_get_ns();
169 vbuf->sequence = isi->sequence++;218 vbuf->sequence = isi->sequence++;
170 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);219 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
171 }220 }
@@ -176,11 +225,19 @@ static irqreturn_t atmel_isi_handle_streaming(struct atmel_isi *isi) · 4 unmodified lines
176 /* start next dma frame. */225 /* start next dma frame. */
177 isi->active = list_entry(isi->video_buffer_list.next,226 isi->active = list_entry(isi->video_buffer_list.next,
178 struct frame_buffer, list);227 struct frame_buffer, list);
179 isi_writel(isi, ISI_DMA_C_DSCR,228 if (!isi->enable_preview_path) {
180 (u32)isi->active->p_dma_desc->fbd_phys);229 isi_writel(isi, ISI_DMA_C_DSCR,
181 isi_writel(isi, ISI_DMA_C_CTRL,230 (u32)isi->active->p_dma_desc->fbd_phys);
182 ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);231 isi_writel(isi, ISI_DMA_C_CTRL,
183 isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH);232 ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);
233 isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH);
234 } else {
235 isi_writel(isi, ISI_DMA_P_DSCR,
236 (u32)isi->active->p_dma_desc->fbd_phys);
237 isi_writel(isi, ISI_DMA_P_CTRL,
238 ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);
239 isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_P_CH);
240 }
184 }241 }
185 return IRQ_HANDLED;242 return IRQ_HANDLED;
186}243}
@@ -207,7 +264,8 @@ static irqreturn_t isi_interrupt(int irq, void *dev_id) · 20 unmodified lines
207 isi_writel(isi, ISI_INTDIS, ISI_CTRL_DIS);264 isi_writel(isi, ISI_INTDIS, ISI_CTRL_DIS);
208 ret = IRQ_HANDLED;265 ret = IRQ_HANDLED;
209 } else {266 } else {
210 if (likely(pending & ISI_SR_CXFR_DONE))267 if (likely(pending & ISI_SR_CXFR_DONE) ||
268 likely(pending & ISI_SR_PXFR_DONE))
211 ret = atmel_isi_handle_streaming(isi);269 ret = atmel_isi_handle_streaming(isi);
212 }270 }
213 271
@@ -245,7 +303,7 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset) · 31 unmodified lines
245/* ------------------------------------------------------------------303/* ------------------------------------------------------------------
246 Videobuf operations304 Videobuf operations
247 ------------------------------------------------------------------*/305 ------------------------------------------------------------------*/
248static int queue_setup(struct vb2_queue *vq, const void *parg,306static int queue_setup(struct vb2_queue *vq,
249 unsigned int *nbuffers, unsigned int *nplanes,307 unsigned int *nbuffers, unsigned int *nplanes,
250 unsigned int sizes[], void *alloc_ctxs[])308 unsigned int sizes[], void *alloc_ctxs[])
251{309{
@@ -352,21 +410,35 @@ static void start_dma(struct atmel_isi *isi, struct frame_buffer *buffer) · 100 unmodified lines
352 ISI_SR_CXFR_DONE | ISI_SR_PXFR_DONE);410 ISI_SR_CXFR_DONE | ISI_SR_PXFR_DONE);
353 411
354 /* Check if already in a frame */412 /* Check if already in a frame */
355 if (isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) {413 if (!isi->enable_preview_path) {
356 dev_err(isi->soc_host.icd->parent, "Already in frame handling.\n");414 if (isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) {
357 return;415 dev_err(isi->soc_host.icd->parent, "Already in frame handling.\n");
358 }416 return;
417 }
359 418
360 isi_writel(isi, ISI_DMA_C_DSCR, (u32)buffer->p_dma_desc->fbd_phys);419 isi_writel(isi, ISI_DMA_C_DSCR,
361 isi_writel(isi, ISI_DMA_C_CTRL, ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);420 (u32)buffer->p_dma_desc->fbd_phys);
362 isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH);421 isi_writel(isi, ISI_DMA_C_CTRL,
422 ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);
423 isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH);
424 } else {
425 isi_writel(isi, ISI_DMA_P_DSCR,
426 (u32)buffer->p_dma_desc->fbd_phys);
427 isi_writel(isi, ISI_DMA_P_CTRL,
428 ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);
429 isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_P_CH);
430 }
363 431
364 cfg1 &= ~ISI_CFG1_FRATE_DIV_MASK;432 cfg1 &= ~ISI_CFG1_FRATE_DIV_MASK;
365 /* Enable linked list */433 /* Enable linked list */
366 cfg1 |= isi->pdata.frate | ISI_CFG1_DISCR;434 cfg1 |= isi->pdata.frate | ISI_CFG1_DISCR;
367 435
368 /* Enable codec path and ISI */436 /* Enable ISI */
369 ctrl = ISI_CTRL_CDC | ISI_CTRL_EN;437 ctrl = ISI_CTRL_EN;
438
439 if (!isi->enable_preview_path)
440 ctrl |= ISI_CTRL_CDC;
441
370 isi_writel(isi, ISI_CTRL, ctrl);442 isi_writel(isi, ISI_CTRL, ctrl);
371 isi_writel(isi, ISI_CFG1, cfg1);443 isi_writel(isi, ISI_CFG1, cfg1);
372}444}
@@ -411,7 +483,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) · 38 unmodified lines
411 isi_writel(isi, ISI_INTDIS, (u32)~0UL);483 isi_writel(isi, ISI_INTDIS, (u32)~0UL);
412 484
413 configure_geometry(isi, icd->user_width, icd->user_height,485 configure_geometry(isi, icd->user_width, icd->user_height,
414 icd->current_fmt->code);486 icd->current_fmt);
415 487
416 spin_lock_irq(&isi->lock);488 spin_lock_irq(&isi->lock);
417 /* Clear any pending interrupt */489 /* Clear any pending interrupt */
@@ -443,15 +515,17 @@ static void stop_streaming(struct vb2_queue *vq) · 25 unmodified lines
443 }515 }
444 spin_unlock_irq(&isi->lock);516 spin_unlock_irq(&isi->lock);
445 517
446 timeout = jiffies + FRAME_INTERVAL_MILLI_SEC * HZ;518 if (!isi->enable_preview_path) {
447 /* Wait until the end of the current frame. */519 timeout = jiffies + FRAME_INTERVAL_MILLI_SEC * HZ;
448 while ((isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) &&520 /* Wait until the end of the current frame. */
449 time_before(jiffies, timeout))521 while ((isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) &&
450 msleep(1);522 time_before(jiffies, timeout))
523 msleep(1);
451 524
452 if (time_after(jiffies, timeout))525 if (time_after(jiffies, timeout))
453 dev_err(icd->parent,526 dev_err(icd->parent,
454 "Timeout waiting for finishing codec request\n");527 "Timeout waiting for finishing codec request\n");
528 }
455 529
456 /* Disable interrupts */530 /* Disable interrupts */
457 isi_writel(isi, ISI_INTDIS,531 isi_writel(isi, ISI_INTDIS,
@@ -617,6 +691,14 @@ static const struct soc_mbus_pixelfmt isi_camera_formats[] = { · 159 unmodified lines
617 .order = SOC_MBUS_ORDER_LE,691 .order = SOC_MBUS_ORDER_LE,
618 .layout = SOC_MBUS_LAYOUT_PACKED,692 .layout = SOC_MBUS_LAYOUT_PACKED,
619 },693 },
694 {
695 .fourcc = V4L2_PIX_FMT_RGB565,
696 .name = "RGB565",
697 .bits_per_sample = 8,
698 .packing = SOC_MBUS_PACKING_2X8_PADHI,
699 .order = SOC_MBUS_ORDER_LE,
700 .layout = SOC_MBUS_LAYOUT_PACKED,
701 },
620};702};
621 703
622/* This will be corrected as we get more formats */704/* This will be corrected as we get more formats */
@@ -673,7 +755,7 @@ static int isi_camera_get_formats(struct soc_camera_device *icd, · 50 unmodified lines
673 struct soc_camera_format_xlate *xlate)755 struct soc_camera_format_xlate *xlate)
674{756{
675 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);757 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
676 int formats = 0, ret;758 int formats = 0, ret, i, n;
677 /* sensor format */759 /* sensor format */
678 struct v4l2_subdev_mbus_code_enum code = {760 struct v4l2_subdev_mbus_code_enum code = {
679 .which = V4L2_SUBDEV_FORMAT_ACTIVE,761 .which = V4L2_SUBDEV_FORMAT_ACTIVE,
@@ -707,11 +789,11 @@ static int isi_camera_get_formats(struct soc_camera_device *icd, · 27 unmodified lines
707 case MEDIA_BUS_FMT_VYUY8_2X8:789 case MEDIA_BUS_FMT_VYUY8_2X8:
708 case MEDIA_BUS_FMT_YUYV8_2X8:790 case MEDIA_BUS_FMT_YUYV8_2X8:
709 case MEDIA_BUS_FMT_YVYU8_2X8:791 case MEDIA_BUS_FMT_YVYU8_2X8:
710 formats++;792 n = ARRAY_SIZE(isi_camera_formats);
711 if (xlate) {793 formats += n;
712 xlate->host_fmt = &isi_camera_formats[0];794 for (i = 0; xlate && i < n; i++, xlate++) {
795 xlate->host_fmt = &isi_camera_formats[i];
713 xlate->code = code.code;796 xlate->code = code.code;
714 xlate++;
715 dev_dbg(icd->parent, "Providing format %s using code %d\n",797 dev_dbg(icd->parent, "Providing format %s using code %d\n",
716 isi_camera_formats[0].name, code.code);798 isi_camera_formats[0].name, code.code);
717 }799 }
drivers/media/platform/soc_camera/atmel-isi.h+10−0
@@ -79,6 +79,16 @@ · 78 unmodified lines
79#define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET)79#define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET)
80#define ISI_CFG2_IM_HSIZE_MASK (0x7FF << ISI_CFG2_IM_HSIZE_OFFSET)80#define ISI_CFG2_IM_HSIZE_MASK (0x7FF << ISI_CFG2_IM_HSIZE_OFFSET)
81 81
82/* Bitfields in PSIZE */
83#define ISI_PSIZE_PREV_VSIZE_OFFSET 0
84#define ISI_PSIZE_PREV_HSIZE_OFFSET 16
85#define ISI_PSIZE_PREV_VSIZE_MASK (0x3FF << ISI_PSIZE_PREV_VSIZE_OFFSET)
86#define ISI_PSIZE_PREV_HSIZE_MASK (0x3FF << ISI_PSIZE_PREV_HSIZE_OFFSET)
87
88/* Bitfields in PDECF */
89#define ISI_PDECF_DEC_FACTOR_MASK (0xFF << 0)
90#define ISI_PDECF_NO_SAMPLING (16)
91
82/* Bitfields in CTRL */92/* Bitfields in CTRL */
83/* Also using in SR(ISI_V2) */93/* Also using in SR(ISI_V2) */
84#define ISI_CTRL_EN (1 << 0)94#define ISI_CTRL_EN (1 << 0)
drivers/media/platform/soc_camera/mx2_camera.c+3−9
@@ -35,11 +35,11 @@ · 34 unmodified lines
35#include <media/videobuf2-v4l2.h>35#include <media/videobuf2-v4l2.h>
36#include <media/videobuf2-dma-contig.h>36#include <media/videobuf2-dma-contig.h>
37#include <media/soc_camera.h>37#include <media/soc_camera.h>
38#include <media/soc_mediabus.h>38#include <media/drv-intf/soc_mediabus.h>
39 39
40#include <linux/videodev2.h>40#include <linux/videodev2.h>
41 41
42#include <linux/platform_data/camera-mx2.h>42#include <linux/platform_data/media/camera-mx2.h>
43 43
44#include <asm/dma.h>44#include <asm/dma.h>
45 45
@@ -469,21 +469,15 @@ static void mx2_camera_clock_stop(struct soc_camera_host *ici) · 423 unmodified lines
469 * Videobuf operations469 * Videobuf operations
470 */470 */
471static int mx2_videobuf_setup(struct vb2_queue *vq,471static int mx2_videobuf_setup(struct vb2_queue *vq,
472 const void *parg,
473 unsigned int *count, unsigned int *num_planes,472 unsigned int *count, unsigned int *num_planes,
474 unsigned int sizes[], void *alloc_ctxs[])473 unsigned int sizes[], void *alloc_ctxs[])
475{474{
476 const struct v4l2_format *fmt = parg;
477 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);475 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
478 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);476 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
479 struct mx2_camera_dev *pcdev = ici->priv;477 struct mx2_camera_dev *pcdev = ici->priv;
480 478
481 dev_dbg(icd->parent, "count=%d, size=%d\n", *count, sizes[0]);479 dev_dbg(icd->parent, "count=%d, size=%d\n", *count, sizes[0]);
482 480
483 /* TODO: support for VIDIOC_CREATE_BUFS not ready */
484 if (fmt != NULL)
485 return -ENOTTY;
486
487 alloc_ctxs[0] = pcdev->alloc_ctx;481 alloc_ctxs[0] = pcdev->alloc_ctx;
488 482
489 sizes[0] = icd->sizeimage;483 sizes[0] = icd->sizeimage;
@@ -1351,7 +1345,7 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev, · 861 unmodified lines
1351 vb2_get_plane_payload(vb, 0));1345 vb2_get_plane_payload(vb, 0));
1352 1346
1353 list_del_init(&buf->internal.queue);1347 list_del_init(&buf->internal.queue);
1354 v4l2_get_timestamp(&vbuf->timestamp);1348 vb->timestamp = ktime_get_ns();
1355 vbuf->sequence = pcdev->frame_count;1349 vbuf->sequence = pcdev->frame_count;
1356 if (err)1350 if (err)
1357 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);1351 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
drivers/media/platform/soc_camera/mx3_camera.c+10−34
@@ -23,9 +23,9 @@ · 22 unmodified lines
23#include <media/v4l2-dev.h>23#include <media/v4l2-dev.h>
24#include <media/videobuf2-dma-contig.h>24#include <media/videobuf2-dma-contig.h>
25#include <media/soc_camera.h>25#include <media/soc_camera.h>
26#include <media/soc_mediabus.h>26#include <media/drv-intf/soc_mediabus.h>
27 27
28#include <linux/platform_data/camera-mx3.h>28#include <linux/platform_data/media/camera-mx3.h>
29#include <linux/platform_data/dma-imx.h>29#include <linux/platform_data/dma-imx.h>
30 30
31#define MX3_CAM_DRV_NAME "mx3-camera"31#define MX3_CAM_DRV_NAME "mx3-camera"
@@ -155,7 +155,7 @@ static void mx3_cam_dma_done(void *arg) · 123 unmodified lines
155 struct mx3_camera_buffer *buf = to_mx3_vb(vb);155 struct mx3_camera_buffer *buf = to_mx3_vb(vb);
156 156
157 list_del_init(&buf->queue);157 list_del_init(&buf->queue);
158 v4l2_get_timestamp(&vb->timestamp);158 vb->vb2_buf.timestamp = ktime_get_ns();
159 vb->field = mx3_cam->field;159 vb->field = mx3_cam->field;
160 vb->sequence = mx3_cam->sequence++;160 vb->sequence = mx3_cam->sequence++;
161 vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE);161 vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE);
@@ -185,11 +185,9 @@ static void mx3_cam_dma_done(void *arg) · 23 unmodified lines
185 * Calculate the __buffer__ (not data) size and number of buffers.185 * Calculate the __buffer__ (not data) size and number of buffers.
186 */186 */
187static int mx3_videobuf_setup(struct vb2_queue *vq,187static int mx3_videobuf_setup(struct vb2_queue *vq,
188 const void *parg,
189 unsigned int *count, unsigned int *num_planes,188 unsigned int *count, unsigned int *num_planes,
190 unsigned int sizes[], void *alloc_ctxs[])189 unsigned int sizes[], void *alloc_ctxs[])
191{190{
192 const struct v4l2_format *fmt = parg;
193 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);191 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
194 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);192 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
195 struct mx3_camera_dev *mx3_cam = ici->priv;193 struct mx3_camera_dev *mx3_cam = ici->priv;
@@ -197,33 +195,6 @@ static int mx3_videobuf_setup(struct vb2_queue *vq, · 1 unmodified line
197 if (!mx3_cam->idmac_channel[0])195 if (!mx3_cam->idmac_channel[0])
198 return -EINVAL;196 return -EINVAL;
199 197
200 if (fmt) {
201 const struct soc_camera_format_xlate *xlate = soc_camera_xlate_by_fourcc(icd,
202 fmt->fmt.pix.pixelformat);
203 unsigned int bytes_per_line;
204 int ret;
205
206 if (!xlate)
207 return -EINVAL;
208
209 ret = soc_mbus_bytes_per_line(fmt->fmt.pix.width,
210 xlate->host_fmt);
211 if (ret < 0)
212 return ret;
213
214 bytes_per_line = max_t(u32, fmt->fmt.pix.bytesperline, ret);
215
216 ret = soc_mbus_image_size(xlate->host_fmt, bytes_per_line,
217 fmt->fmt.pix.height);
218 if (ret < 0)
219 return ret;
220
221 sizes[0] = max_t(u32, fmt->fmt.pix.sizeimage, ret);
222 } else {
223 /* Called from VIDIOC_REQBUFS or in compatibility mode */
224 sizes[0] = icd->sizeimage;
225 }
226
227 alloc_ctxs[0] = mx3_cam->alloc_ctx;198 alloc_ctxs[0] = mx3_cam->alloc_ctx;
228 199
229 if (!vq->num_buffers)200 if (!vq->num_buffers)
@@ -232,9 +203,14 @@ static int mx3_videobuf_setup(struct vb2_queue *vq, · 2 unmodified lines
232 if (!*count)203 if (!*count)
233 *count = 2;204 *count = 2;
234 205
206 /* Called from VIDIOC_REQBUFS or in compatibility mode */
207 if (!*num_planes)
208 sizes[0] = icd->sizeimage;
209 else if (sizes[0] < icd->sizeimage)
210 return -EINVAL;
211
235 /* If *num_planes != 0, we have already verified *count. */212 /* If *num_planes != 0, we have already verified *count. */
236 if (!*num_planes &&213 if (sizes[0] * *count + mx3_cam->buf_total > MAX_VIDEO_MEM * 1024 * 1024)
237 sizes[0] * *count + mx3_cam->buf_total > MAX_VIDEO_MEM * 1024 * 1024)
238 *count = (MAX_VIDEO_MEM * 1024 * 1024 - mx3_cam->buf_total) /214 *count = (MAX_VIDEO_MEM * 1024 * 1024 - mx3_cam->buf_total) /
239 sizes[0];215 sizes[0];
240 216
drivers/media/platform/soc_camera/omap1_camera.c+2−2
@@ -28,9 +28,9 @@ · 27 unmodified lines
28#include <linux/platform_device.h>28#include <linux/platform_device.h>
29#include <linux/slab.h>29#include <linux/slab.h>
30 30
31#include <media/omap1_camera.h>31#include <linux/platform_data/media/omap1_camera.h>
32#include <media/soc_camera.h>32#include <media/soc_camera.h>
33#include <media/soc_mediabus.h>33#include <media/drv-intf/soc_mediabus.h>
34#include <media/videobuf-dma-contig.h>34#include <media/videobuf-dma-contig.h>
35#include <media/videobuf-dma-sg.h>35#include <media/videobuf-dma-sg.h>
36 36
drivers/media/platform/soc_camera/pxa_camera.c+2−2
@@ -33,13 +33,13 @@ · 32 unmodified lines
33#include <media/v4l2-dev.h>33#include <media/v4l2-dev.h>
34#include <media/videobuf-dma-sg.h>34#include <media/videobuf-dma-sg.h>
35#include <media/soc_camera.h>35#include <media/soc_camera.h>
36#include <media/soc_mediabus.h>36#include <media/drv-intf/soc_mediabus.h>
37#include <media/v4l2-of.h>37#include <media/v4l2-of.h>
38 38
39#include <linux/videodev2.h>39#include <linux/videodev2.h>
40 40
41#include <mach/dma.h>41#include <mach/dma.h>
42#include <linux/platform_data/camera-pxa.h>42#include <linux/platform_data/media/camera-pxa.h>
43 43
44#define PXA_CAM_VERSION "0.0.6"44#define PXA_CAM_VERSION "0.0.6"
45#define PXA_CAM_DRV_NAME "pxa27x-camera"45#define PXA_CAM_DRV_NAME "pxa27x-camera"
drivers/media/platform/soc_camera/rcar_vin.c+37−82
@@ -21,14 +21,13 @@ · 20 unmodified lines
21#include <linux/module.h>21#include <linux/module.h>
22#include <linux/of.h>22#include <linux/of.h>
23#include <linux/of_device.h>23#include <linux/of_device.h>
24#include <linux/platform_data/camera-rcar.h>
25#include <linux/platform_device.h>24#include <linux/platform_device.h>
26#include <linux/pm_runtime.h>25#include <linux/pm_runtime.h>
27#include <linux/slab.h>26#include <linux/slab.h>
28#include <linux/videodev2.h>27#include <linux/videodev2.h>
29 28
30#include <media/soc_camera.h>29#include <media/soc_camera.h>
31#include <media/soc_mediabus.h>30#include <media/drv-intf/soc_mediabus.h>
32#include <media/v4l2-common.h>31#include <media/v4l2-common.h>
33#include <media/v4l2-dev.h>32#include <media/v4l2-dev.h>
34#include <media/v4l2-device.h>33#include <media/v4l2-device.h>
@@ -138,6 +137,11 @@ · 103 unmodified lines
138 137
139#define TIMEOUT_MS 100138#define TIMEOUT_MS 100
140 139
140#define RCAR_VIN_HSYNC_ACTIVE_LOW (1 << 0)
141#define RCAR_VIN_VSYNC_ACTIVE_LOW (1 << 1)
142#define RCAR_VIN_BT601 (1 << 2)
143#define RCAR_VIN_BT656 (1 << 3)
144
141enum chip_id {145enum chip_id {
142 RCAR_GEN2,146 RCAR_GEN2,
143 RCAR_H1,147 RCAR_H1,
@@ -527,46 +531,14 @@ struct rcar_vin_cam { · 383 unmodified lines
527 * required531 * required
528 */532 */
529static int rcar_vin_videobuf_setup(struct vb2_queue *vq,533static int rcar_vin_videobuf_setup(struct vb2_queue *vq,
530 const void *parg,
531 unsigned int *count,534 unsigned int *count,
532 unsigned int *num_planes,535 unsigned int *num_planes,
533 unsigned int sizes[], void *alloc_ctxs[])536 unsigned int sizes[], void *alloc_ctxs[])
534{537{
535 const struct v4l2_format *fmt = parg;
536 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);538 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
537 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);539 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
538 struct rcar_vin_priv *priv = ici->priv;540 struct rcar_vin_priv *priv = ici->priv;
539 541
540 if (fmt) {
541 const struct soc_camera_format_xlate *xlate;
542 unsigned int bytes_per_line;
543 int ret;
544
545 if (fmt->fmt.pix.sizeimage < icd->sizeimage)
546 return -EINVAL;
547
548 xlate = soc_camera_xlate_by_fourcc(icd,
549 fmt->fmt.pix.pixelformat);
550 if (!xlate)
551 return -EINVAL;
552 ret = soc_mbus_bytes_per_line(fmt->fmt.pix.width,
553 xlate->host_fmt);
554 if (ret < 0)
555 return ret;
556
557 bytes_per_line = max_t(u32, fmt->fmt.pix.bytesperline, ret);
558
559 ret = soc_mbus_image_size(xlate->host_fmt, bytes_per_line,
560 fmt->fmt.pix.height);
561 if (ret < 0)
562 return ret;
563
564 sizes[0] = max_t(u32, fmt->fmt.pix.sizeimage, ret);
565 } else {
566 /* Called from VIDIOC_REQBUFS or in compatibility mode */
567 sizes[0] = icd->sizeimage;
568 }
569
570 alloc_ctxs[0] = priv->alloc_ctx;542 alloc_ctxs[0] = priv->alloc_ctx;
571 543
572 if (!vq->num_buffers)544 if (!vq->num_buffers)
@@ -576,14 +548,18 @@ static int rcar_vin_videobuf_setup(struct vb2_queue *vq, · 3 unmodified lines
576 *count = 2;548 *count = 2;
577 priv->vb_count = *count;549 priv->vb_count = *count;
578 550
579 *num_planes = 1;
580
581 /* Number of hardware slots */551 /* Number of hardware slots */
582 if (is_continuous_transfer(priv))552 if (is_continuous_transfer(priv))
583 priv->nr_hw_slots = MAX_BUFFER_NUM;553 priv->nr_hw_slots = MAX_BUFFER_NUM;
584 else554 else
585 priv->nr_hw_slots = 1;555 priv->nr_hw_slots = 1;
586 556
557 if (*num_planes)
558 return sizes[0] < icd->sizeimage ? -EINVAL : 0;
559
560 sizes[0] = icd->sizeimage;
561 *num_planes = 1;
562
587 dev_dbg(icd->parent, "count=%d, size=%u\n", *count, sizes[0]);563 dev_dbg(icd->parent, "count=%d, size=%u\n", *count, sizes[0]);
588 564
589 return 0;565 return 0;
@@ -912,7 +888,7 @@ static irqreturn_t rcar_vin_irq(int irq, void *data) · 322 unmodified lines
912 888
913 priv->queue_buf[slot]->field = priv->field;889 priv->queue_buf[slot]->field = priv->field;
914 priv->queue_buf[slot]->sequence = priv->sequence++;890 priv->queue_buf[slot]->sequence = priv->sequence++;
915 v4l2_get_timestamp(&priv->queue_buf[slot]->timestamp);891 priv->queue_buf[slot]->vb2_buf.timestamp = ktime_get_ns();
916 vb2_buffer_done(&priv->queue_buf[slot]->vb2_buf,892 vb2_buffer_done(&priv->queue_buf[slot]->vb2_buf,
917 VB2_BUF_STATE_DONE);893 VB2_BUF_STATE_DONE);
918 priv->queue_buf[slot] = NULL;894 priv->queue_buf[slot] = NULL;
@@ -1853,63 +1829,43 @@ static const struct of_device_id rcar_vin_of_table[] = { · 934 unmodified lines
1853MODULE_DEVICE_TABLE(of, rcar_vin_of_table);1829MODULE_DEVICE_TABLE(of, rcar_vin_of_table);
1854#endif1830#endif
1855 1831
1856static struct platform_device_id rcar_vin_id_table[] = {
1857 { "r8a7779-vin", RCAR_H1 },
1858 { "r8a7778-vin", RCAR_M1 },
1859 { "uPD35004-vin", RCAR_E1 },
1860 {},
1861};
1862MODULE_DEVICE_TABLE(platform, rcar_vin_id_table);
1863
1864static int rcar_vin_probe(struct platform_device *pdev)1832static int rcar_vin_probe(struct platform_device *pdev)
1865{1833{
1866 const struct of_device_id *match = NULL;1834 const struct of_device_id *match = NULL;
1867 struct rcar_vin_priv *priv;1835 struct rcar_vin_priv *priv;
1836 struct v4l2_of_endpoint ep;
1837 struct device_node *np;
1868 struct resource *mem;1838 struct resource *mem;
1869 struct rcar_vin_platform_data *pdata;
1870 unsigned int pdata_flags;1839 unsigned int pdata_flags;
1871 int irq, ret;1840 int irq, ret;
1872 1841
1873 if (pdev->dev.of_node) {1842 match = of_match_device(of_match_ptr(rcar_vin_of_table), &pdev->dev);
1874 struct v4l2_of_endpoint ep;
1875 struct device_node *np;
1876 1843
1877 match = of_match_device(of_match_ptr(rcar_vin_of_table),1844 np = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
1878 &pdev->dev);1845 if (!np) {
1879 1846 dev_err(&pdev->dev, "could not find endpoint\n");
1880 np = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);1847 return -EINVAL;
1881 if (!np) {1848 }
1882 dev_err(&pdev->dev, "could not find endpoint\n");
1883 return -EINVAL;
1884 }
1885 1849
1886 ret = v4l2_of_parse_endpoint(np, &ep);1850 ret = v4l2_of_parse_endpoint(np, &ep);
1887 if (ret) {1851 if (ret) {
1888 dev_err(&pdev->dev, "could not parse endpoint\n");1852 dev_err(&pdev->dev, "could not parse endpoint\n");
1889 return ret;1853 return ret;
1890 }1854 }
1891 1855
1892 if (ep.bus_type == V4L2_MBUS_BT656)1856 if (ep.bus_type == V4L2_MBUS_BT656)
1893 pdata_flags = RCAR_VIN_BT656;1857 pdata_flags = RCAR_VIN_BT656;
1894 else {1858 else {
1895 pdata_flags = 0;1859 pdata_flags = 0;
1896 if (ep.bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)1860 if (ep.bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
1897 pdata_flags |= RCAR_VIN_HSYNC_ACTIVE_LOW;1861 pdata_flags |= RCAR_VIN_HSYNC_ACTIVE_LOW;
1898 if (ep.bus.parallel.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)1862 if (ep.bus.parallel.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
1899 pdata_flags |= RCAR_VIN_VSYNC_ACTIVE_LOW;1863 pdata_flags |= RCAR_VIN_VSYNC_ACTIVE_LOW;
1900 }1864 }
1901 1865
1902 of_node_put(np);1866 of_node_put(np);
1903 1867
1904 dev_dbg(&pdev->dev, "pdata_flags = %08x\n", pdata_flags);1868 dev_dbg(&pdev->dev, "pdata_flags = %08x\n", pdata_flags);
1905 } else {
1906 pdata = pdev->dev.platform_data;
1907 if (!pdata || !pdata->flags) {
1908 dev_err(&pdev->dev, "platform data not set\n");
1909 return -EINVAL;
1910 }
1911 pdata_flags = pdata->flags;
1912 }
1913 1869
1914 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);1870 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1915 if (mem == NULL)1871 if (mem == NULL)
@@ -1992,7 +1948,6 @@ static struct platform_driver rcar_vin_driver = { · 76 unmodified lines
1992 .name = DRV_NAME,1948 .name = DRV_NAME,
1993 .of_match_table = of_match_ptr(rcar_vin_of_table),1949 .of_match_table = of_match_ptr(rcar_vin_of_table),
1994 },1950 },
1995 .id_table = rcar_vin_id_table,
1996};1951};
1997 1952
1998module_platform_driver(rcar_vin_driver);1953module_platform_driver(rcar_vin_driver);
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c+11−34
@@ -40,11 +40,11 @@ · 39 unmodified lines
40#include <media/v4l2-common.h>40#include <media/v4l2-common.h>
41#include <media/v4l2-dev.h>41#include <media/v4l2-dev.h>
42#include <media/soc_camera.h>42#include <media/soc_camera.h>
43#include <media/sh_mobile_ceu.h>43#include <media/drv-intf/sh_mobile_ceu.h>
44#include <media/sh_mobile_csi2.h>44#include <media/drv-intf/sh_mobile_csi2.h>
45#include <media/videobuf2-dma-contig.h>45#include <media/videobuf2-dma-contig.h>
46#include <media/v4l2-mediabus.h>46#include <media/v4l2-mediabus.h>
47#include <media/soc_mediabus.h>47#include <media/drv-intf/soc_mediabus.h>
48 48
49#include "soc_scale_crop.h"49#include "soc_scale_crop.h"
50 50
@@ -210,43 +210,14 @@ static int sh_mobile_ceu_soft_reset(struct sh_mobile_ceu_dev *pcdev) · 159 unmodified lines
210 * for the current frame format if required210 * for the current frame format if required
211 */211 */
212static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq,212static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq,
213 const void *parg,
214 unsigned int *count, unsigned int *num_planes,213 unsigned int *count, unsigned int *num_planes,
215 unsigned int sizes[], void *alloc_ctxs[])214 unsigned int sizes[], void *alloc_ctxs[])
216{215{
217 const struct v4l2_format *fmt = parg;
218 struct soc_camera_device *icd = container_of(vq,216 struct soc_camera_device *icd = container_of(vq,
219 struct soc_camera_device, vb2_vidq);217 struct soc_camera_device, vb2_vidq);
220 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);218 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
221 struct sh_mobile_ceu_dev *pcdev = ici->priv;219 struct sh_mobile_ceu_dev *pcdev = ici->priv;
222 220
223 if (fmt) {
224 const struct soc_camera_format_xlate *xlate = soc_camera_xlate_by_fourcc(icd,
225 fmt->fmt.pix.pixelformat);
226 unsigned int bytes_per_line;
227 int ret;
228
229 if (!xlate)
230 return -EINVAL;
231
232 ret = soc_mbus_bytes_per_line(fmt->fmt.pix.width,
233 xlate->host_fmt);
234 if (ret < 0)
235 return ret;
236
237 bytes_per_line = max_t(u32, fmt->fmt.pix.bytesperline, ret);
238
239 ret = soc_mbus_image_size(xlate->host_fmt, bytes_per_line,
240 fmt->fmt.pix.height);
241 if (ret < 0)
242 return ret;
243
244 sizes[0] = max_t(u32, fmt->fmt.pix.sizeimage, ret);
245 } else {
246 /* Called from VIDIOC_REQBUFS or in compatibility mode */
247 sizes[0] = icd->sizeimage;
248 }
249
250 alloc_ctxs[0] = pcdev->alloc_ctx;221 alloc_ctxs[0] = pcdev->alloc_ctx;
251 222
252 if (!vq->num_buffers)223 if (!vq->num_buffers)
@@ -255,8 +226,14 @@ static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq, · 2 unmodified lines
255 if (!*count)226 if (!*count)
256 *count = 2;227 *count = 2;
257 228
229 /* Called from VIDIOC_REQBUFS or in compatibility mode */
230 if (!*num_planes)
231 sizes[0] = icd->sizeimage;
232 else if (sizes[0] < icd->sizeimage)
233 return -EINVAL;
234
258 /* If *num_planes != 0, we have already verified *count. */235 /* If *num_planes != 0, we have already verified *count. */
259 if (pcdev->video_limit && !*num_planes) {236 if (pcdev->video_limit) {
260 size_t size = PAGE_ALIGN(sizes[0]) * *count;237 size_t size = PAGE_ALIGN(sizes[0]) * *count;
261 238
262 if (size + pcdev->buf_total > pcdev->video_limit)239 if (size + pcdev->buf_total > pcdev->video_limit)
@@ -533,7 +510,7 @@ static irqreturn_t sh_mobile_ceu_irq(int irq, void *data) · 270 unmodified lines
533 pcdev->active = NULL;510 pcdev->active = NULL;
534 511
535 ret = sh_mobile_ceu_capture(pcdev);512 ret = sh_mobile_ceu_capture(pcdev);
536 v4l2_get_timestamp(&vbuf->timestamp);513 vbuf->vb2_buf.timestamp = ktime_get_ns();
537 if (!ret) {514 if (!ret) {
538 vbuf->field = pcdev->field;515 vbuf->field = pcdev->field;
539 vbuf->sequence = pcdev->sequence++;516 vbuf->sequence = pcdev->sequence++;
drivers/media/platform/soc_camera/sh_mobile_csi2.c+3−3
@@ -18,10 +18,10 @@ · 17 unmodified lines
18#include <linux/videodev2.h>18#include <linux/videodev2.h>
19#include <linux/module.h>19#include <linux/module.h>
20 20
21#include <media/sh_mobile_ceu.h>21#include <media/drv-intf/sh_mobile_ceu.h>
22#include <media/sh_mobile_csi2.h>22#include <media/drv-intf/sh_mobile_csi2.h>
23#include <media/soc_camera.h>23#include <media/soc_camera.h>
24#include <media/soc_mediabus.h>24#include <media/drv-intf/soc_mediabus.h>
25#include <media/v4l2-common.h>25#include <media/v4l2-common.h>
26#include <media/v4l2-dev.h>26#include <media/v4l2-dev.h>
27#include <media/v4l2-device.h>27#include <media/v4l2-device.h>
drivers/media/platform/soc_camera/soc_camera.c+13−12
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <linux/vmalloc.h>30#include <linux/vmalloc.h>
31 31
32#include <media/soc_camera.h>32#include <media/soc_camera.h>
33#include <media/soc_mediabus.h>33#include <media/drv-intf/soc_mediabus.h>
34#include <media/v4l2-async.h>34#include <media/v4l2-async.h>
35#include <media/v4l2-clk.h>35#include <media/v4l2-clk.h>
36#include <media/v4l2-common.h>36#include <media/v4l2-common.h>
@@ -1360,7 +1360,7 @@ static int soc_camera_i2c_init(struct soc_camera_device *icd, · 1323 unmodified lines
1360 struct soc_camera_host_desc *shd = &sdesc->host_desc;1360 struct soc_camera_host_desc *shd = &sdesc->host_desc;
1361 struct i2c_adapter *adap;1361 struct i2c_adapter *adap;
1362 struct v4l2_subdev *subdev;1362 struct v4l2_subdev *subdev;
1363 char clk_name[V4L2_SUBDEV_NAME_SIZE];1363 char clk_name[V4L2_CLK_NAME_SIZE];
1364 int ret;1364 int ret;
1365 1365
1366 /* First find out how we link the main client */1366 /* First find out how we link the main client */
@@ -1391,8 +1391,8 @@ static int soc_camera_i2c_init(struct soc_camera_device *icd, · 24 unmodified lines
1391 ssdd->sd_pdata.regulators = NULL;1391 ssdd->sd_pdata.regulators = NULL;
1392 shd->board_info->platform_data = ssdd;1392 shd->board_info->platform_data = ssdd;
1393 1393
1394 snprintf(clk_name, sizeof(clk_name), "%d-%04x",1394 v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
1395 shd->i2c_adapter_id, shd->board_info->addr);1395 shd->i2c_adapter_id, shd->board_info->addr);
1396 1396
1397 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);1397 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);
1398 if (IS_ERR(icd->clk)) {1398 if (IS_ERR(icd->clk)) {
@@ -1526,7 +1526,7 @@ static int scan_async_group(struct soc_camera_host *ici, · 127 unmodified lines
1526 struct soc_camera_async_client *sasc;1526 struct soc_camera_async_client *sasc;
1527 struct soc_camera_device *icd;1527 struct soc_camera_device *icd;
1528 struct soc_camera_desc sdesc = {.host_desc.bus_id = ici->nr,};1528 struct soc_camera_desc sdesc = {.host_desc.bus_id = ici->nr,};
1529 char clk_name[V4L2_SUBDEV_NAME_SIZE];1529 char clk_name[V4L2_CLK_NAME_SIZE];
1530 unsigned int i;1530 unsigned int i;
1531 int ret;1531 int ret;
1532 1532
@@ -1572,8 +1572,9 @@ static int scan_async_group(struct soc_camera_host *ici, · 39 unmodified lines
1572 icd->sasc = sasc;1572 icd->sasc = sasc;
1573 icd->parent = ici->v4l2_dev.dev;1573 icd->parent = ici->v4l2_dev.dev;
1574 1574
1575 snprintf(clk_name, sizeof(clk_name), "%d-%04x",1575 v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
1576 sasd->asd.match.i2c.adapter_id, sasd->asd.match.i2c.address);1576 sasd->asd.match.i2c.adapter_id,
1577 sasd->asd.match.i2c.address);
1577 1578
1578 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);1579 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);
1579 if (IS_ERR(icd->clk)) {1580 if (IS_ERR(icd->clk)) {
@@ -1631,7 +1632,7 @@ static int soc_of_bind(struct soc_camera_host *ici, · 51 unmodified lines
1631 struct soc_camera_async_client *sasc;1632 struct soc_camera_async_client *sasc;
1632 struct soc_of_info *info;1633 struct soc_of_info *info;
1633 struct i2c_client *client;1634 struct i2c_client *client;
1634 char clk_name[V4L2_SUBDEV_NAME_SIZE + 32];1635 char clk_name[V4L2_CLK_NAME_SIZE];
1635 int ret;1636 int ret;
1636 1637
1637 /* allocate a new subdev and add match info to it */1638 /* allocate a new subdev and add match info to it */
@@ -1674,11 +1675,11 @@ static int soc_of_bind(struct soc_camera_host *ici, · 36 unmodified lines
1674 client = of_find_i2c_device_by_node(remote);1675 client = of_find_i2c_device_by_node(remote);
1675 1676
1676 if (client)1677 if (client)
1677 snprintf(clk_name, sizeof(clk_name), "%d-%04x",1678 v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
1678 client->adapter->nr, client->addr);1679 client->adapter->nr, client->addr);
1679 else1680 else
1680 snprintf(clk_name, sizeof(clk_name), "of-%s",1681 v4l2_clk_name_of(clk_name, sizeof(clk_name),
1681 of_node_full_name(remote));1682 of_node_full_name(remote));
1682 1683
1683 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);1684 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);
1684 if (IS_ERR(icd->clk)) {1685 if (IS_ERR(icd->clk)) {
drivers/media/platform/soc_camera/soc_camera_platform.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
18#include <linux/videodev2.h>18#include <linux/videodev2.h>
19#include <media/v4l2-subdev.h>19#include <media/v4l2-subdev.h>
20#include <media/soc_camera.h>20#include <media/soc_camera.h>
21#include <media/soc_camera_platform.h>21#include <linux/platform_data/media/soc_camera_platform.h>
22 22
23struct soc_camera_platform_priv {23struct soc_camera_platform_priv {
24 struct v4l2_subdev subdev;24 struct v4l2_subdev subdev;
drivers/media/platform/soc_camera/soc_mediabus.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13 13
14#include <media/v4l2-device.h>14#include <media/v4l2-device.h>
15#include <media/v4l2-mediabus.h>15#include <media/v4l2-mediabus.h>
16#include <media/soc_mediabus.h>16#include <media/drv-intf/soc_mediabus.h>
17 17
18static const struct soc_mbus_lookup mbus_fmt[] = {18static const struct soc_mbus_lookup mbus_fmt[] = {
19{19{
drivers/media/platform/sti/bdisp/bdisp-v4l2.c+6−8
@@ -191,7 +191,7 @@ static void bdisp_job_finish(struct bdisp_ctx *ctx, int vb_state) · 190 unmodified lines
191 dst_vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);191 dst_vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
192 192
193 if (src_vb && dst_vb) {193 if (src_vb && dst_vb) {
194 dst_vb->timestamp = src_vb->timestamp;194 dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
195 dst_vb->timecode = src_vb->timecode;195 dst_vb->timecode = src_vb->timecode;
196 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;196 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
197 dst_vb->flags |= src_vb->flags &197 dst_vb->flags |= src_vb->flags &
@@ -297,7 +297,7 @@ static int bdisp_get_bufs(struct bdisp_ctx *ctx) · 99 unmodified lines
297 if (ret)297 if (ret)
298 return ret;298 return ret;
299 299
300 dst_vb->timestamp = src_vb->timestamp;300 dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
301 301
302 return 0;302 return 0;
303}303}
@@ -438,11 +438,9 @@ static void bdisp_ctrls_delete(struct bdisp_ctx *ctx) · 134 unmodified lines
438}438}
439 439
440static int bdisp_queue_setup(struct vb2_queue *vq,440static int bdisp_queue_setup(struct vb2_queue *vq,
441 const void *parg,
442 unsigned int *nb_buf, unsigned int *nb_planes,441 unsigned int *nb_buf, unsigned int *nb_planes,
443 unsigned int sizes[], void *allocators[])442 unsigned int sizes[], void *allocators[])
444{443{
445 const struct v4l2_format *fmt = parg;
446 struct bdisp_ctx *ctx = vb2_get_drv_priv(vq);444 struct bdisp_ctx *ctx = vb2_get_drv_priv(vq);
447 struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type);445 struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type);
448 446
@@ -455,13 +453,13 @@ static int bdisp_queue_setup(struct vb2_queue *vq, · 6 unmodified lines
455 dev_err(ctx->bdisp_dev->dev, "Invalid format\n");453 dev_err(ctx->bdisp_dev->dev, "Invalid format\n");
456 return -EINVAL;454 return -EINVAL;
457 }455 }
456 allocators[0] = ctx->bdisp_dev->alloc_ctx;
458 457
459 if (fmt && fmt->fmt.pix.sizeimage < frame->sizeimage)458 if (*nb_planes)
460 return -EINVAL;459 return sizes[0] < frame->sizeimage ? -EINVAL : 0;
461 460
462 *nb_planes = 1;461 *nb_planes = 1;
463 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : frame->sizeimage;462 sizes[0] = frame->sizeimage;
464 allocators[0] = ctx->bdisp_dev->alloc_ctx;
465 463
466 return 0;464 return 0;
467}465}
drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c+8−8
@@ -209,18 +209,18 @@ void c8sectpfe_tuner_unregister_frontend(struct c8sectpfe *c8sectpfe, · 208 unmodified lines
209 209
210 tsin = fei->channel_data[n];210 tsin = fei->channel_data[n];
211 211
212 if (tsin && tsin->frontend) {212 if (tsin) {
213 dvb_unregister_frontend(tsin->frontend);213 if (tsin->frontend) {
214 dvb_frontend_detach(tsin->frontend);214 dvb_unregister_frontend(tsin->frontend);
215 }215 dvb_frontend_detach(tsin->frontend);
216 }
216 217
217 if (tsin && tsin->i2c_adapter)
218 i2c_put_adapter(tsin->i2c_adapter);218 i2c_put_adapter(tsin->i2c_adapter);
219 219
220 if (tsin && tsin->i2c_client) {220 if (tsin->i2c_client) {
221 if (tsin->i2c_client->dev.driver->owner)
222 module_put(tsin->i2c_client->dev.driver->owner);221 module_put(tsin->i2c_client->dev.driver->owner);
223 i2c_unregister_device(tsin->i2c_client);222 i2c_unregister_device(tsin->i2c_client);
223 }
224 }224 }
225 }225 }
226 226
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c+1−1
@@ -823,7 +823,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) · 822 unmodified lines
823 }823 }
824 of_node_put(i2c_bus);824 of_node_put(i2c_bus);
825 825
826 tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0);826 tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0);
827 827
828 ret = gpio_is_valid(tsin->rst_gpio);828 ret = gpio_is_valid(tsin->rst_gpio);
829 if (!ret) {829 if (!ret) {
drivers/media/platform/ti-vpe/vpe.c+1−2
@@ -1288,7 +1288,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data) · 1287 unmodified lines
1288 d_vb = ctx->dst_vb;1288 d_vb = ctx->dst_vb;
1289 1289
1290 d_vb->flags = s_vb->flags;1290 d_vb->flags = s_vb->flags;
1291 d_vb->timestamp = s_vb->timestamp;1291 d_vb->vb2_buf.timestamp = s_vb->vb2_buf.timestamp;
1292 1292
1293 if (s_vb->flags & V4L2_BUF_FLAG_TIMECODE)1293 if (s_vb->flags & V4L2_BUF_FLAG_TIMECODE)
1294 d_vb->timecode = s_vb->timecode;1294 d_vb->timecode = s_vb->timecode;
@@ -1796,7 +1796,6 @@ static const struct v4l2_ioctl_ops vpe_ioctl_ops = { · 501 unmodified lines
1796 * Queue operations1796 * Queue operations
1797 */1797 */
1798static int vpe_queue_setup(struct vb2_queue *vq,1798static int vpe_queue_setup(struct vb2_queue *vq,
1799 const void *parg,
1800 unsigned int *nbuffers, unsigned int *nplanes,1799 unsigned int *nbuffers, unsigned int *nplanes,
1801 unsigned int sizes[], void *alloc_ctxs[])1800 unsigned int sizes[], void *alloc_ctxs[])
1802{1801{
drivers/media/platform/timblogiw.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <media/v4l2-ioctl.h>31#include <media/v4l2-ioctl.h>
32#include <media/v4l2-device.h>32#include <media/v4l2-device.h>
33#include <media/videobuf-dma-contig.h>33#include <media/videobuf-dma-contig.h>
34#include <media/timb_video.h>34#include <linux/platform_data/media/timb_video.h>
35 35
36#define DRIVER_NAME "timb-video"36#define DRIVER_NAME "timb-video"
37 37
drivers/media/platform/via-camera.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
19#include <media/v4l2-ioctl.h>19#include <media/v4l2-ioctl.h>
20#include <media/v4l2-ctrls.h>20#include <media/v4l2-ctrls.h>
21#include <media/v4l2-image-sizes.h>21#include <media/v4l2-image-sizes.h>
22#include <media/ov7670.h>22#include <media/i2c/ov7670.h>
23#include <media/videobuf-dma-sg.h>23#include <media/videobuf-dma-sg.h>
24#include <linux/delay.h>24#include <linux/delay.h>
25#include <linux/dma-mapping.h>25#include <linux/dma-mapping.h>
drivers/media/platform/vim2m.c+5−10
@@ -235,7 +235,7 @@ static int device_process(struct vim2m_ctx *ctx, · 234 unmodified lines
235 out_vb->sequence =235 out_vb->sequence =
236 get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)->sequence++;236 get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)->sequence++;
237 in_vb->sequence = q_data->sequence++;237 in_vb->sequence = q_data->sequence++;
238 out_vb->timestamp = in_vb->timestamp;238 out_vb->vb2_buf.timestamp = in_vb->vb2_buf.timestamp;
239 239
240 if (in_vb->flags & V4L2_BUF_FLAG_TIMECODE)240 if (in_vb->flags & V4L2_BUF_FLAG_TIMECODE)
241 out_vb->timecode = in_vb->timecode;241 out_vb->timecode = in_vb->timecode;
@@ -710,11 +710,9 @@ static const struct v4l2_ioctl_ops vim2m_ioctl_ops = { · 468 unmodified lines
710 */710 */
711 711
712static int vim2m_queue_setup(struct vb2_queue *vq,712static int vim2m_queue_setup(struct vb2_queue *vq,
713 const void *parg,
714 unsigned int *nbuffers, unsigned int *nplanes,713 unsigned int *nbuffers, unsigned int *nplanes,
715 unsigned int sizes[], void *alloc_ctxs[])714 unsigned int sizes[], void *alloc_ctxs[])
716{715{
717 const struct v4l2_format *fmt = parg;
718 struct vim2m_ctx *ctx = vb2_get_drv_priv(vq);716 struct vim2m_ctx *ctx = vb2_get_drv_priv(vq);
719 struct vim2m_q_data *q_data;717 struct vim2m_q_data *q_data;
720 unsigned int size, count = *nbuffers;718 unsigned int size, count = *nbuffers;
@@ -723,17 +721,14 @@ static int vim2m_queue_setup(struct vb2_queue *vq, · 2 unmodified lines
723 721
724 size = q_data->width * q_data->height * q_data->fmt->depth >> 3;722 size = q_data->width * q_data->height * q_data->fmt->depth >> 3;
725 723
726 if (fmt) {
727 if (fmt->fmt.pix.sizeimage < size)
728 return -EINVAL;
729 size = fmt->fmt.pix.sizeimage;
730 }
731
732 while (size * count > MEM2MEM_VID_MEM_LIMIT)724 while (size * count > MEM2MEM_VID_MEM_LIMIT)
733 (count)--;725 (count)--;
726 *nbuffers = count;
727
728 if (*nplanes)
729 return sizes[0] < size ? -EINVAL : 0;
734 730
735 *nplanes = 1;731 *nplanes = 1;
736 *nbuffers = count;
737 sizes[0] = size;732 sizes[0] = size;
738 733
739 /*734 /*
drivers/media/platform/vivid/vivid-core.h+2−1
@@ -264,6 +264,7 @@ struct vivid_dev { · 263 unmodified lines
264 bool vflip;264 bool vflip;
265 bool vbi_cap_interlaced;265 bool vbi_cap_interlaced;
266 bool loop_video;266 bool loop_video;
267 bool reduced_fps;
267 268
268 /* Framebuffer */269 /* Framebuffer */
269 unsigned long video_pbase;270 unsigned long video_pbase;
@@ -285,7 +286,7 @@ struct vivid_dev { · 15 unmodified lines
285 bool dqbuf_error;286 bool dqbuf_error;
286 bool seq_wrap;287 bool seq_wrap;
287 bool time_wrap;288 bool time_wrap;
288 __kernel_time_t time_wrap_offset;289 u64 time_wrap_offset;
289 unsigned perc_dropped_buffers;290 unsigned perc_dropped_buffers;
290 enum vivid_signal_mode std_signal_mode;291 enum vivid_signal_mode std_signal_mode;
291 unsigned query_std_last;292 unsigned query_std_last;
drivers/media/platform/vivid/vivid-ctrls.c+30−5
@@ -78,6 +78,7 @@ · 77 unmodified lines
78#define VIVID_CID_TIME_WRAP (VIVID_CID_VIVID_BASE + 39)78#define VIVID_CID_TIME_WRAP (VIVID_CID_VIVID_BASE + 39)
79#define VIVID_CID_MAX_EDID_BLOCKS (VIVID_CID_VIVID_BASE + 40)79#define VIVID_CID_MAX_EDID_BLOCKS (VIVID_CID_VIVID_BASE + 40)
80#define VIVID_CID_PERCENTAGE_FILL (VIVID_CID_VIVID_BASE + 41)80#define VIVID_CID_PERCENTAGE_FILL (VIVID_CID_VIVID_BASE + 41)
81#define VIVID_CID_REDUCED_FPS (VIVID_CID_VIVID_BASE + 42)
81 82
82#define VIVID_CID_STD_SIGNAL_MODE (VIVID_CID_VIVID_BASE + 60)83#define VIVID_CID_STD_SIGNAL_MODE (VIVID_CID_VIVID_BASE + 60)
83#define VIVID_CID_STANDARD (VIVID_CID_VIVID_BASE + 61)84#define VIVID_CID_STANDARD (VIVID_CID_VIVID_BASE + 61)
@@ -424,6 +425,10 @@ static int vivid_vid_cap_s_ctrl(struct v4l2_ctrl *ctrl) · 340 unmodified lines
424 dev->sensor_vflip = ctrl->val;425 dev->sensor_vflip = ctrl->val;
425 tpg_s_vflip(&dev->tpg, dev->sensor_vflip ^ dev->vflip);426 tpg_s_vflip(&dev->tpg, dev->sensor_vflip ^ dev->vflip);
426 break;427 break;
428 case VIVID_CID_REDUCED_FPS:
429 dev->reduced_fps = ctrl->val;
430 vivid_update_format_cap(dev, true);
431 break;
427 case VIVID_CID_HAS_CROP_CAP:432 case VIVID_CID_HAS_CROP_CAP:
428 dev->has_crop_cap = ctrl->val;433 dev->has_crop_cap = ctrl->val;
429 vivid_update_format_cap(dev, true);434 vivid_update_format_cap(dev, true);
@@ -601,6 +606,15 @@ static const struct v4l2_ctrl_config vivid_ctrl_vflip = { · 171 unmodified lines
601 .step = 1,606 .step = 1,
602};607};
603 608
609static const struct v4l2_ctrl_config vivid_ctrl_reduced_fps = {
610 .ops = &vivid_vid_cap_ctrl_ops,
611 .id = VIVID_CID_REDUCED_FPS,
612 .name = "Reduced Framerate",
613 .type = V4L2_CTRL_TYPE_BOOLEAN,
614 .max = 1,
615 .step = 1,
616};
617
604static const struct v4l2_ctrl_config vivid_ctrl_has_crop_cap = {618static const struct v4l2_ctrl_config vivid_ctrl_has_crop_cap = {
605 .ops = &vivid_vid_cap_ctrl_ops,619 .ops = &vivid_vid_cap_ctrl_ops,
606 .id = VIVID_CID_HAS_CROP_CAP,620 .id = VIVID_CID_HAS_CROP_CAP,
@@ -940,7 +954,7 @@ static const struct v4l2_ctrl_config vivid_ctrl_has_scaler_out = { · 333 unmodified lines
940static int vivid_streaming_s_ctrl(struct v4l2_ctrl *ctrl)954static int vivid_streaming_s_ctrl(struct v4l2_ctrl *ctrl)
941{955{
942 struct vivid_dev *dev = container_of(ctrl->handler, struct vivid_dev, ctrl_hdl_streaming);956 struct vivid_dev *dev = container_of(ctrl->handler, struct vivid_dev, ctrl_hdl_streaming);
943 struct timeval tv;957 u64 rem;
944 958
945 switch (ctrl->id) {959 switch (ctrl->id) {
946 case VIVID_CID_DQBUF_ERROR:960 case VIVID_CID_DQBUF_ERROR:
@@ -979,8 +993,16 @@ static int vivid_streaming_s_ctrl(struct v4l2_ctrl *ctrl) · 32 unmodified lines
979 dev->time_wrap_offset = 0;993 dev->time_wrap_offset = 0;
980 break;994 break;
981 }995 }
982 v4l2_get_timestamp(&tv);996 /*
983 dev->time_wrap_offset = -tv.tv_sec - 16;997 * We want to set the time 16 seconds before the 32 bit tv_sec
998 * value of struct timeval would wrap around. So first we
999 * calculate ktime_get_ns() % ((1 << 32) * NSEC_PER_SEC), and
1000 * then we set the offset to ((1 << 32) - 16) * NSEC_PER_SEC).
1001 */
1002 div64_u64_rem(ktime_get_ns(),
1003 0x100000000ULL * NSEC_PER_SEC, &rem);
1004 dev->time_wrap_offset =
1005 (0x100000000ULL - 16) * NSEC_PER_SEC - rem;
984 break;1006 break;
985 }1007 }
986 return 0;1008 return 0;
@@ -1340,11 +1362,13 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap, · 353 unmodified lines
1340 v4l2_ctrl_handler_init(hdl_vid_cap, 55);1362 v4l2_ctrl_handler_init(hdl_vid_cap, 55);
1341 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_class, NULL);1363 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_class, NULL);
1342 v4l2_ctrl_handler_init(hdl_vid_out, 26);1364 v4l2_ctrl_handler_init(hdl_vid_out, 26);
1343 v4l2_ctrl_new_custom(hdl_vid_out, &vivid_ctrl_class, NULL);1365 if (!no_error_inj)
1366 v4l2_ctrl_new_custom(hdl_vid_out, &vivid_ctrl_class, NULL);
1344 v4l2_ctrl_handler_init(hdl_vbi_cap, 21);1367 v4l2_ctrl_handler_init(hdl_vbi_cap, 21);
1345 v4l2_ctrl_new_custom(hdl_vbi_cap, &vivid_ctrl_class, NULL);1368 v4l2_ctrl_new_custom(hdl_vbi_cap, &vivid_ctrl_class, NULL);
1346 v4l2_ctrl_handler_init(hdl_vbi_out, 19);1369 v4l2_ctrl_handler_init(hdl_vbi_out, 19);
1347 v4l2_ctrl_new_custom(hdl_vbi_out, &vivid_ctrl_class, NULL);1370 if (!no_error_inj)
1371 v4l2_ctrl_new_custom(hdl_vbi_out, &vivid_ctrl_class, NULL);
1348 v4l2_ctrl_handler_init(hdl_radio_rx, 17);1372 v4l2_ctrl_handler_init(hdl_radio_rx, 17);
1349 v4l2_ctrl_new_custom(hdl_radio_rx, &vivid_ctrl_class, NULL);1373 v4l2_ctrl_new_custom(hdl_radio_rx, &vivid_ctrl_class, NULL);
1350 v4l2_ctrl_handler_init(hdl_radio_tx, 17);1374 v4l2_ctrl_handler_init(hdl_radio_tx, 17);
@@ -1414,6 +1438,7 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap, · 63 unmodified lines
1414 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_vflip, NULL);1438 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_vflip, NULL);
1415 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_sav, NULL);1439 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_sav, NULL);
1416 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_eav, NULL);1440 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_eav, NULL);
1441 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_reduced_fps, NULL);
1417 if (show_ccs_cap) {1442 if (show_ccs_cap) {
1418 dev->ctrl_has_crop_cap = v4l2_ctrl_new_custom(hdl_vid_cap,1443 dev->ctrl_has_crop_cap = v4l2_ctrl_new_custom(hdl_vid_cap,
1419 &vivid_ctrl_has_crop_cap, NULL);1444 &vivid_ctrl_has_crop_cap, NULL);
drivers/media/platform/vivid/vivid-kthread-cap.c+3−3
@@ -441,7 +441,7 @@ static void vivid_fillbuff(struct vivid_dev *dev, struct vivid_buffer *buf) · 440 unmodified lines
441 * "Start of Exposure".441 * "Start of Exposure".
442 */442 */
443 if (dev->tstamp_src_is_soe)443 if (dev->tstamp_src_is_soe)
444 v4l2_get_timestamp(&buf->vb.timestamp);444 buf->vb.vb2_buf.timestamp = ktime_get_ns();
445 if (dev->field_cap == V4L2_FIELD_ALTERNATE) {445 if (dev->field_cap == V4L2_FIELD_ALTERNATE) {
446 /*446 /*
447 * 60 Hz standards start with the bottom field, 50 Hz standards447 * 60 Hz standards start with the bottom field, 50 Hz standards
@@ -558,8 +558,8 @@ static void vivid_fillbuff(struct vivid_dev *dev, struct vivid_buffer *buf) · 110 unmodified lines
558 * the timestamp now.558 * the timestamp now.
559 */559 */
560 if (!dev->tstamp_src_is_soe)560 if (!dev->tstamp_src_is_soe)
561 v4l2_get_timestamp(&buf->vb.timestamp);561 buf->vb.vb2_buf.timestamp = ktime_get_ns();
562 buf->vb.timestamp.tv_sec += dev->time_wrap_offset;562 buf->vb.vb2_buf.timestamp += dev->time_wrap_offset;
563}563}
564 564
565/*565/*
drivers/media/platform/vivid/vivid-kthread-out.c+4−4
@@ -95,8 +95,8 @@ static void vivid_thread_vid_out_tick(struct vivid_dev *dev) · 94 unmodified lines
95 */95 */
96 vid_out_buf->vb.sequence /= 2;96 vid_out_buf->vb.sequence /= 2;
97 }97 }
98 v4l2_get_timestamp(&vid_out_buf->vb.timestamp);98 vid_out_buf->vb.vb2_buf.timestamp =
99 vid_out_buf->vb.timestamp.tv_sec += dev->time_wrap_offset;99 ktime_get_ns() + dev->time_wrap_offset;
100 vb2_buffer_done(&vid_out_buf->vb.vb2_buf, dev->dqbuf_error ?100 vb2_buffer_done(&vid_out_buf->vb.vb2_buf, dev->dqbuf_error ?
101 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);101 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
102 dprintk(dev, 2, "vid_out buffer %d done\n",102 dprintk(dev, 2, "vid_out buffer %d done\n",
@@ -108,8 +108,8 @@ static void vivid_thread_vid_out_tick(struct vivid_dev *dev) · 5 unmodified lines
108 vivid_sliced_vbi_out_process(dev, vbi_out_buf);108 vivid_sliced_vbi_out_process(dev, vbi_out_buf);
109 109
110 vbi_out_buf->vb.sequence = dev->vbi_out_seq_count;110 vbi_out_buf->vb.sequence = dev->vbi_out_seq_count;
111 v4l2_get_timestamp(&vbi_out_buf->vb.timestamp);111 vbi_out_buf->vb.vb2_buf.timestamp =
112 vbi_out_buf->vb.timestamp.tv_sec += dev->time_wrap_offset;112 ktime_get_ns() + dev->time_wrap_offset;
113 vb2_buffer_done(&vbi_out_buf->vb.vb2_buf, dev->dqbuf_error ?113 vb2_buffer_done(&vbi_out_buf->vb.vb2_buf, dev->dqbuf_error ?
114 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);114 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
115 dprintk(dev, 2, "vbi_out buffer %d done\n",115 dprintk(dev, 2, "vbi_out buffer %d done\n",
drivers/media/platform/vivid/vivid-sdr-cap.c+3−3
@@ -117,8 +117,8 @@ static void vivid_thread_sdr_cap_tick(struct vivid_dev *dev) · 116 unmodified lines
117 if (sdr_cap_buf) {117 if (sdr_cap_buf) {
118 sdr_cap_buf->vb.sequence = dev->sdr_cap_seq_count;118 sdr_cap_buf->vb.sequence = dev->sdr_cap_seq_count;
119 vivid_sdr_cap_process(dev, sdr_cap_buf);119 vivid_sdr_cap_process(dev, sdr_cap_buf);
120 v4l2_get_timestamp(&sdr_cap_buf->vb.timestamp);120 sdr_cap_buf->vb.vb2_buf.timestamp =
121 sdr_cap_buf->vb.timestamp.tv_sec += dev->time_wrap_offset;121 ktime_get_ns() + dev->time_wrap_offset;
122 vb2_buffer_done(&sdr_cap_buf->vb.vb2_buf, dev->dqbuf_error ?122 vb2_buffer_done(&sdr_cap_buf->vb.vb2_buf, dev->dqbuf_error ?
123 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);123 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
124 dev->dqbuf_error = false;124 dev->dqbuf_error = false;
@@ -213,7 +213,7 @@ static int vivid_thread_sdr_cap(void *data) · 88 unmodified lines
213 return 0;213 return 0;
214}214}
215 215
216static int sdr_cap_queue_setup(struct vb2_queue *vq, const void *parg,216static int sdr_cap_queue_setup(struct vb2_queue *vq,
217 unsigned *nbuffers, unsigned *nplanes,217 unsigned *nbuffers, unsigned *nplanes,
218 unsigned sizes[], void *alloc_ctxs[])218 unsigned sizes[], void *alloc_ctxs[])
219{219{
drivers/media/platform/vivid/vivid-vbi-cap.c+3−5
@@ -108,8 +108,7 @@ void vivid_raw_vbi_cap_process(struct vivid_dev *dev, struct vivid_buffer *buf) · 107 unmodified lines
108 if (!VIVID_INVALID_SIGNAL(dev->std_signal_mode))108 if (!VIVID_INVALID_SIGNAL(dev->std_signal_mode))
109 vivid_vbi_gen_raw(&dev->vbi_gen, &vbi, vbuf);109 vivid_vbi_gen_raw(&dev->vbi_gen, &vbi, vbuf);
110 110
111 v4l2_get_timestamp(&buf->vb.timestamp);111 buf->vb.vb2_buf.timestamp = ktime_get_ns() + dev->time_wrap_offset;
112 buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
113}112}
114 113
115 114
@@ -133,11 +132,10 @@ void vivid_sliced_vbi_cap_process(struct vivid_dev *dev, · 17 unmodified lines
133 vbuf[i] = dev->vbi_gen.data[i];132 vbuf[i] = dev->vbi_gen.data[i];
134 }133 }
135 134
136 v4l2_get_timestamp(&buf->vb.timestamp);135 buf->vb.vb2_buf.timestamp = ktime_get_ns() + dev->time_wrap_offset;
137 buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
138}136}
139 137
140static int vbi_cap_queue_setup(struct vb2_queue *vq, const void *parg,138static int vbi_cap_queue_setup(struct vb2_queue *vq,
141 unsigned *nbuffers, unsigned *nplanes,139 unsigned *nbuffers, unsigned *nplanes,
142 unsigned sizes[], void *alloc_ctxs[])140 unsigned sizes[], void *alloc_ctxs[])
143{141{
drivers/media/platform/vivid/vivid-vbi-out.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include "vivid-vbi-out.h"27#include "vivid-vbi-out.h"
28#include "vivid-vbi-cap.h"28#include "vivid-vbi-cap.h"
29 29
30static int vbi_out_queue_setup(struct vb2_queue *vq, const void *parg,30static int vbi_out_queue_setup(struct vb2_queue *vq,
31 unsigned *nbuffers, unsigned *nplanes,31 unsigned *nbuffers, unsigned *nplanes,
32 unsigned sizes[], void *alloc_ctxs[])32 unsigned sizes[], void *alloc_ctxs[])
33{33{
drivers/media/platform/vivid/vivid-vid-cap.c+15−19
@@ -95,11 +95,10 @@ static const struct v4l2_discrete_probe webcam_probe = { · 94 unmodified lines
95 VIVID_WEBCAM_SIZES95 VIVID_WEBCAM_SIZES
96};96};
97 97
98static int vid_cap_queue_setup(struct vb2_queue *vq, const void *parg,98static int vid_cap_queue_setup(struct vb2_queue *vq,
99 unsigned *nbuffers, unsigned *nplanes,99 unsigned *nbuffers, unsigned *nplanes,
100 unsigned sizes[], void *alloc_ctxs[])100 unsigned sizes[], void *alloc_ctxs[])
101{101{
102 const struct v4l2_format *fmt = parg;
103 struct vivid_dev *dev = vb2_get_drv_priv(vq);102 struct vivid_dev *dev = vb2_get_drv_priv(vq);
104 unsigned buffers = tpg_g_buffers(&dev->tpg);103 unsigned buffers = tpg_g_buffers(&dev->tpg);
105 unsigned h = dev->fmt_cap_rect.height;104 unsigned h = dev->fmt_cap_rect.height;
@@ -122,27 +121,16 @@ static int vid_cap_queue_setup(struct vb2_queue *vq, const void *parg, · 16 unmodified lines
122 dev->queue_setup_error = false;121 dev->queue_setup_error = false;
123 return -EINVAL;122 return -EINVAL;
124 }123 }
125 if (fmt) {124 if (*nplanes) {
126 const struct v4l2_pix_format_mplane *mp;
127 struct v4l2_format mp_fmt;
128 const struct vivid_fmt *vfmt;
129
130 if (!V4L2_TYPE_IS_MULTIPLANAR(fmt->type)) {
131 fmt_sp2mp(fmt, &mp_fmt);
132 fmt = &mp_fmt;
133 }
134 mp = &fmt->fmt.pix_mp;
135 /*125 /*
136 * Check if the number of planes in the specified format match126 * Check if the number of requested planes match
137 * the number of buffers in the current format. You can't mix that.127 * the number of buffers in the current format. You can't mix that.
138 */128 */
139 if (mp->num_planes != buffers)129 if (*nplanes != buffers)
140 return -EINVAL;130 return -EINVAL;
141 vfmt = vivid_get_format(dev, mp->pixelformat);
142 for (p = 0; p < buffers; p++) {131 for (p = 0; p < buffers; p++) {
143 sizes[p] = mp->plane_fmt[p].sizeimage;
144 if (sizes[p] < tpg_g_line_width(&dev->tpg, p) * h +132 if (sizes[p] < tpg_g_line_width(&dev->tpg, p) * h +
145 vfmt->data_offset[p])133 dev->fmt_cap->data_offset[p])
146 return -EINVAL;134 return -EINVAL;
147 }135 }
148 } else {136 } else {
@@ -405,6 +393,7 @@ void vivid_update_format_cap(struct vivid_dev *dev, bool keep_controls) · 256 unmodified lines
405{393{
406 struct v4l2_bt_timings *bt = &dev->dv_timings_cap.bt;394 struct v4l2_bt_timings *bt = &dev->dv_timings_cap.bt;
407 unsigned size;395 unsigned size;
396 u64 pixelclock;
408 397
409 switch (dev->input_type[dev->input]) {398 switch (dev->input_type[dev->input]) {
410 case WEBCAM:399 case WEBCAM:
@@ -434,8 +423,15 @@ void vivid_update_format_cap(struct vivid_dev *dev, bool keep_controls) · 23 unmodified lines
434 dev->src_rect.width = bt->width;423 dev->src_rect.width = bt->width;
435 dev->src_rect.height = bt->height;424 dev->src_rect.height = bt->height;
436 size = V4L2_DV_BT_FRAME_WIDTH(bt) * V4L2_DV_BT_FRAME_HEIGHT(bt);425 size = V4L2_DV_BT_FRAME_WIDTH(bt) * V4L2_DV_BT_FRAME_HEIGHT(bt);
426 if (dev->reduced_fps && can_reduce_fps(bt)) {
427 pixelclock = div_u64(bt->pixelclock * 1000, 1001);
428 bt->flags |= V4L2_DV_FL_REDUCED_FPS;
429 } else {
430 pixelclock = bt->pixelclock;
431 bt->flags &= ~V4L2_DV_FL_REDUCED_FPS;
432 }
437 dev->timeperframe_vid_cap = (struct v4l2_fract) {433 dev->timeperframe_vid_cap = (struct v4l2_fract) {
438 size / 100, (u32)bt->pixelclock / 100434 size / 100, (u32)pixelclock / 100
439 };435 };
440 if (bt->interlaced)436 if (bt->interlaced)
441 dev->field_cap = V4L2_FIELD_ALTERNATE;437 dev->field_cap = V4L2_FIELD_ALTERNATE;
@@ -1662,7 +1658,7 @@ int vivid_vid_cap_s_dv_timings(struct file *file, void *_fh, · 1220 unmodified lines
1662 !valid_cvt_gtf_timings(timings))1658 !valid_cvt_gtf_timings(timings))
1663 return -EINVAL;1659 return -EINVAL;
1664 1660
1665 if (v4l2_match_dv_timings(timings, &dev->dv_timings_cap, 0))1661 if (v4l2_match_dv_timings(timings, &dev->dv_timings_cap, 0, false))
1666 return 0;1662 return 0;
1667 if (vb2_is_busy(&dev->vb_vid_cap_q))1663 if (vb2_is_busy(&dev->vb_vid_cap_q))
1668 return -EBUSY;1664 return -EBUSY;
drivers/media/platform/vivid/vivid-vid-out.c+13−17
@@ -31,11 +31,10 @@ · 30 unmodified lines
31#include "vivid-kthread-out.h"31#include "vivid-kthread-out.h"
32#include "vivid-vid-out.h"32#include "vivid-vid-out.h"
33 33
34static int vid_out_queue_setup(struct vb2_queue *vq, const void *parg,34static int vid_out_queue_setup(struct vb2_queue *vq,
35 unsigned *nbuffers, unsigned *nplanes,35 unsigned *nbuffers, unsigned *nplanes,
36 unsigned sizes[], void *alloc_ctxs[])36 unsigned sizes[], void *alloc_ctxs[])
37{37{
38 const struct v4l2_format *fmt = parg;
39 struct vivid_dev *dev = vb2_get_drv_priv(vq);38 struct vivid_dev *dev = vb2_get_drv_priv(vq);
40 const struct vivid_fmt *vfmt = dev->fmt_out;39 const struct vivid_fmt *vfmt = dev->fmt_out;
41 unsigned planes = vfmt->buffers;40 unsigned planes = vfmt->buffers;
@@ -64,26 +63,16 @@ static int vid_out_queue_setup(struct vb2_queue *vq, const void *parg, · 22 unmodified lines
64 return -EINVAL;63 return -EINVAL;
65 }64 }
66 65
67 if (fmt) {66 if (*nplanes) {
68 const struct v4l2_pix_format_mplane *mp;
69 struct v4l2_format mp_fmt;
70
71 if (!V4L2_TYPE_IS_MULTIPLANAR(fmt->type)) {
72 fmt_sp2mp(fmt, &mp_fmt);
73 fmt = &mp_fmt;
74 }
75 mp = &fmt->fmt.pix_mp;
76 /*67 /*
77 * Check if the number of planes in the specified format match68 * Check if the number of requested planes match
78 * the number of planes in the current format. You can't mix that.69 * the number of planes in the current format. You can't mix that.
79 */70 */
80 if (mp->num_planes != planes)71 if (*nplanes != planes)
81 return -EINVAL;72 return -EINVAL;
82 sizes[0] = mp->plane_fmt[0].sizeimage;
83 if (sizes[0] < size)73 if (sizes[0] < size)
84 return -EINVAL;74 return -EINVAL;
85 for (p = 1; p < planes; p++) {75 for (p = 1; p < planes; p++) {
86 sizes[p] = mp->plane_fmt[p].sizeimage;
87 if (sizes[p] < dev->bytesperline_out[p] * h)76 if (sizes[p] < dev->bytesperline_out[p] * h)
88 return -EINVAL;77 return -EINVAL;
89 }78 }
@@ -224,6 +213,7 @@ void vivid_update_format_out(struct vivid_dev *dev) · 134 unmodified lines
224{213{
225 struct v4l2_bt_timings *bt = &dev->dv_timings_out.bt;214 struct v4l2_bt_timings *bt = &dev->dv_timings_out.bt;
226 unsigned size, p;215 unsigned size, p;
216 u64 pixelclock;
227 217
228 switch (dev->output_type[dev->output]) {218 switch (dev->output_type[dev->output]) {
229 case SVID:219 case SVID:
@@ -245,8 +235,14 @@ void vivid_update_format_out(struct vivid_dev *dev) · 15 unmodified lines
245 dev->sink_rect.width = bt->width;235 dev->sink_rect.width = bt->width;
246 dev->sink_rect.height = bt->height;236 dev->sink_rect.height = bt->height;
247 size = V4L2_DV_BT_FRAME_WIDTH(bt) * V4L2_DV_BT_FRAME_HEIGHT(bt);237 size = V4L2_DV_BT_FRAME_WIDTH(bt) * V4L2_DV_BT_FRAME_HEIGHT(bt);
238
239 if (can_reduce_fps(bt) && (bt->flags & V4L2_DV_FL_REDUCED_FPS))
240 pixelclock = div_u64(bt->pixelclock * 1000, 1001);
241 else
242 pixelclock = bt->pixelclock;
243
248 dev->timeperframe_vid_out = (struct v4l2_fract) {244 dev->timeperframe_vid_out = (struct v4l2_fract) {
249 size / 100, (u32)bt->pixelclock / 100245 size / 100, (u32)pixelclock / 100
250 };246 };
251 if (bt->interlaced)247 if (bt->interlaced)
252 dev->field_out = V4L2_FIELD_ALTERNATE;248 dev->field_out = V4L2_FIELD_ALTERNATE;
@@ -1149,7 +1145,7 @@ int vivid_vid_out_s_dv_timings(struct file *file, void *_fh, · 896 unmodified lines
1149 0, NULL, NULL) &&1145 0, NULL, NULL) &&
1150 !valid_cvt_gtf_timings(timings))1146 !valid_cvt_gtf_timings(timings))
1151 return -EINVAL;1147 return -EINVAL;
1152 if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0))1148 if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0, true))
1153 return 0;1149 return 0;
1154 if (vb2_is_busy(&dev->vb_vid_out_q))1150 if (vb2_is_busy(&dev->vb_vid_out_q))
1155 return -EBUSY;1151 return -EBUSY;
drivers/media/platform/vsp1/vsp1_video.c+11−42
@@ -274,35 +274,6 @@ static int __vsp1_video_try_format(struct vsp1_video *video, · 273 unmodified lines
274 return 0;274 return 0;
275}275}
276 276
277static bool
278vsp1_video_format_adjust(struct vsp1_video *video,
279 const struct v4l2_pix_format_mplane *format,
280 struct v4l2_pix_format_mplane *adjust)
281{
282 unsigned int i;
283
284 *adjust = *format;
285 __vsp1_video_try_format(video, adjust, NULL);
286
287 if (format->width != adjust->width ||
288 format->height != adjust->height ||
289 format->pixelformat != adjust->pixelformat ||
290 format->num_planes != adjust->num_planes)
291 return false;
292
293 for (i = 0; i < format->num_planes; ++i) {
294 if (format->plane_fmt[i].bytesperline !=
295 adjust->plane_fmt[i].bytesperline)
296 return false;
297
298 adjust->plane_fmt[i].sizeimage =
299 max(adjust->plane_fmt[i].sizeimage,
300 format->plane_fmt[i].sizeimage);
301 }
302
303 return true;
304}
305
306/* -----------------------------------------------------------------------------277/* -----------------------------------------------------------------------------
307 * Pipeline Management278 * Pipeline Management
308 */279 */
@@ -611,7 +582,7 @@ vsp1_video_complete_buffer(struct vsp1_video *video) · 302 unmodified lines
611 spin_unlock_irqrestore(&video->irqlock, flags);582 spin_unlock_irqrestore(&video->irqlock, flags);
612 583
613 done->buf.sequence = video->sequence++;584 done->buf.sequence = video->sequence++;
614 v4l2_get_timestamp(&done->buf.timestamp);585 done->buf.vb2_buf.timestamp = ktime_get_ns();
615 for (i = 0; i < done->buf.vb2_buf.num_planes; ++i)586 for (i = 0; i < done->buf.vb2_buf.num_planes; ++i)
616 vb2_set_plane_payload(&done->buf.vb2_buf, i, done->length[i]);587 vb2_set_plane_payload(&done->buf.vb2_buf, i, done->length[i]);
617 vb2_buffer_done(&done->buf.vb2_buf, VB2_BUF_STATE_DONE);588 vb2_buffer_done(&done->buf.vb2_buf, VB2_BUF_STATE_DONE);
@@ -787,26 +758,24 @@ void vsp1_pipelines_resume(struct vsp1_device *vsp1) · 169 unmodified lines
787 */758 */
788 759
789static int760static int
790vsp1_video_queue_setup(struct vb2_queue *vq, const void *parg,761vsp1_video_queue_setup(struct vb2_queue *vq,
791 unsigned int *nbuffers, unsigned int *nplanes,762 unsigned int *nbuffers, unsigned int *nplanes,
792 unsigned int sizes[], void *alloc_ctxs[])763 unsigned int sizes[], void *alloc_ctxs[])
793{764{
794 const struct v4l2_format *fmt = parg;
795 struct vsp1_video *video = vb2_get_drv_priv(vq);765 struct vsp1_video *video = vb2_get_drv_priv(vq);
796 const struct v4l2_pix_format_mplane *format;766 const struct v4l2_pix_format_mplane *format = &video->format;
797 struct v4l2_pix_format_mplane pix_mp;
798 unsigned int i;767 unsigned int i;
799 768
800 if (fmt) {769 if (*nplanes) {
801 /* Make sure the format is valid and adjust the sizeimage field770 if (*nplanes != format->num_planes)
802 * if needed.
803 */
804 if (!vsp1_video_format_adjust(video, &fmt->fmt.pix_mp, &pix_mp))
805 return -EINVAL;771 return -EINVAL;
806 772
807 format = &pix_mp;773 for (i = 0; i < *nplanes; i++) {
808 } else {774 if (sizes[i] < format->plane_fmt[i].sizeimage)
809 format = &video->format;775 return -EINVAL;
776 alloc_ctxs[i] = video->alloc_ctx;
777 }
778 return 0;
810 }779 }
811 780
812 *nplanes = format->num_planes;781 *nplanes = format->num_planes;
drivers/media/platform/xilinx/xilinx-dma.c+6−8
@@ -303,27 +303,25 @@ static void xvip_dma_complete(void *param) · 302 unmodified lines
303 303
304 buf->buf.field = V4L2_FIELD_NONE;304 buf->buf.field = V4L2_FIELD_NONE;
305 buf->buf.sequence = dma->sequence++;305 buf->buf.sequence = dma->sequence++;
306 v4l2_get_timestamp(&buf->buf.timestamp);306 buf->buf.vb2_buf.timestamp = ktime_get_ns();
307 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, dma->format.sizeimage);307 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, dma->format.sizeimage);
308 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);308 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);
309}309}
310 310
311static int311static int
312xvip_dma_queue_setup(struct vb2_queue *vq, const void *parg,312xvip_dma_queue_setup(struct vb2_queue *vq,
313 unsigned int *nbuffers, unsigned int *nplanes,313 unsigned int *nbuffers, unsigned int *nplanes,
314 unsigned int sizes[], void *alloc_ctxs[])314 unsigned int sizes[], void *alloc_ctxs[])
315{315{
316 const struct v4l2_format *fmt = parg;
317 struct xvip_dma *dma = vb2_get_drv_priv(vq);316 struct xvip_dma *dma = vb2_get_drv_priv(vq);
318 317
318 alloc_ctxs[0] = dma->alloc_ctx;
319 /* Make sure the image size is large enough. */319 /* Make sure the image size is large enough. */
320 if (fmt && fmt->fmt.pix.sizeimage < dma->format.sizeimage)320 if (*nplanes)
321 return -EINVAL;321 return sizes[0] < dma->format.sizeimage ? -EINVAL : 0;
322 322
323 *nplanes = 1;323 *nplanes = 1;
324 324 sizes[0] = dma->format.sizeimage;
325 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : dma->format.sizeimage;
326 alloc_ctxs[0] = dma->alloc_ctx;
327 325
328 return 0;326 return 0;
329}327}
drivers/media/platform/xilinx/xilinx-tpg.c+2−0
@@ -731,6 +731,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) · 730 unmodified lines
731 format = xvip_of_get_format(port);731 format = xvip_of_get_format(port);
732 if (IS_ERR(format)) {732 if (IS_ERR(format)) {
733 dev_err(dev, "invalid format in DT");733 dev_err(dev, "invalid format in DT");
734 of_node_put(port);
734 return PTR_ERR(format);735 return PTR_ERR(format);
735 }736 }
736 737
@@ -739,6 +740,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) · 2 unmodified lines
739 xtpg->vip_format = format;740 xtpg->vip_format = format;
740 } else if (xtpg->vip_format != format) {741 } else if (xtpg->vip_format != format) {
741 dev_err(dev, "in/out format mismatch in DT");742 dev_err(dev, "in/out format mismatch in DT");
743 of_node_put(port);
742 return -EINVAL;744 return -EINVAL;
743 }745 }
744 746
drivers/media/platform/xilinx/xilinx-vipp.c+3−1
@@ -476,8 +476,10 @@ static int xvip_graph_dma_init(struct xvip_composite_device *xdev) · 475 unmodified lines
476 476
477 for_each_child_of_node(ports, port) {477 for_each_child_of_node(ports, port) {
478 ret = xvip_graph_dma_init_one(xdev, port);478 ret = xvip_graph_dma_init_one(xdev, port);
479 if (ret < 0)479 if (ret < 0) {
480 of_node_put(port);
480 return ret;481 return ret;
482 }
481 }483 }
482 484
483 return 0;485 return 0;
drivers/media/radio/radio-maxiradio.c+2−2
@@ -42,7 +42,7 @@ · 41 unmodified lines
42#include <linux/videodev2.h>42#include <linux/videodev2.h>
43#include <linux/io.h>43#include <linux/io.h>
44#include <linux/slab.h>44#include <linux/slab.h>
45#include <media/tea575x.h>45#include <media/drv-intf/tea575x.h>
46#include <media/v4l2-device.h>46#include <media/v4l2-device.h>
47#include <media/v4l2-ioctl.h>47#include <media/v4l2-ioctl.h>
48#include <media/v4l2-fh.h>48#include <media/v4l2-fh.h>
@@ -108,7 +108,7 @@ static void maxiradio_tea575x_set_direction(struct snd_tea575x *tea, bool output · 59 unmodified lines
108{108{
109}109}
110 110
111static struct snd_tea575x_ops maxiradio_tea_ops = {111static const struct snd_tea575x_ops maxiradio_tea_ops = {
112 .set_pins = maxiradio_tea575x_set_pins,112 .set_pins = maxiradio_tea575x_set_pins,
113 .get_pins = maxiradio_tea575x_get_pins,113 .get_pins = maxiradio_tea575x_get_pins,
114 .set_direction = maxiradio_tea575x_set_direction,114 .set_direction = maxiradio_tea575x_set_direction,
drivers/media/radio/radio-sf16fmr2.c+2−2
@@ -14,7 +14,7 @@ · 13 unmodified lines
14#include <linux/io.h> /* outb, outb_p */14#include <linux/io.h> /* outb, outb_p */
15#include <linux/isa.h>15#include <linux/isa.h>
16#include <linux/pnp.h>16#include <linux/pnp.h>
17#include <media/tea575x.h>17#include <media/drv-intf/tea575x.h>
18 18
19MODULE_AUTHOR("Ondrej Zary");19MODULE_AUTHOR("Ondrej Zary");
20MODULE_DESCRIPTION("MediaForte SF16-FMR2 and SF16-FMD2 FM radio card driver");20MODULE_DESCRIPTION("MediaForte SF16-FMR2 and SF16-FMD2 FM radio card driver");
@@ -82,7 +82,7 @@ static void fmr2_tea575x_set_direction(struct snd_tea575x *tea, bool output) · 61 unmodified lines
82{82{
83}83}
84 84
85static struct snd_tea575x_ops fmr2_tea_ops = {85static const struct snd_tea575x_ops fmr2_tea_ops = {
86 .set_pins = fmr2_tea575x_set_pins,86 .set_pins = fmr2_tea575x_set_pins,
87 .get_pins = fmr2_tea575x_get_pins,87 .get_pins = fmr2_tea575x_get_pins,
88 .set_direction = fmr2_tea575x_set_direction,88 .set_direction = fmr2_tea575x_set_direction,
drivers/media/radio/radio-shark.c+2−2
@@ -33,7 +33,7 @@ · 32 unmodified lines
33#include <linux/usb.h>33#include <linux/usb.h>
34#include <linux/workqueue.h>34#include <linux/workqueue.h>
35#include <media/v4l2-device.h>35#include <media/v4l2-device.h>
36#include <media/tea575x.h>36#include <media/drv-intf/tea575x.h>
37 37
38#if defined(CONFIG_LEDS_CLASS) || \38#if defined(CONFIG_LEDS_CLASS) || \
39 (defined(CONFIG_LEDS_CLASS_MODULE) && defined(CONFIG_RADIO_SHARK_MODULE))39 (defined(CONFIG_LEDS_CLASS_MODULE) && defined(CONFIG_RADIO_SHARK_MODULE))
@@ -150,7 +150,7 @@ static u32 shark_read_val(struct snd_tea575x *tea) · 110 unmodified lines
150 return val;150 return val;
151}151}
152 152
153static struct snd_tea575x_ops shark_tea_ops = {153static const struct snd_tea575x_ops shark_tea_ops = {
154 .write_val = shark_write_val,154 .write_val = shark_write_val,
155 .read_val = shark_read_val,155 .read_val = shark_read_val,
156};156};
drivers/media/radio/radio-shark2.c+1−1
@@ -137,7 +137,7 @@ static int shark_read_reg(struct radio_tea5777 *tea, u32 *reg_ret) · 136 unmodified lines
137 return 0;137 return 0;
138}138}
139 139
140static struct radio_tea5777_ops shark_tea_ops = {140static const struct radio_tea5777_ops shark_tea_ops = {
141 .write_reg = shark_write_reg,141 .write_reg = shark_write_reg,
142 .read_reg = shark_read_reg,142 .read_reg = shark_read_reg,
143};143};
drivers/media/radio/radio-si476x.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <media/v4l2-event.h>31#include <media/v4l2-event.h>
32#include <media/v4l2-device.h>32#include <media/v4l2-device.h>
33 33
34#include <media/si476x.h>34#include <media/drv-intf/si476x.h>
35#include <linux/mfd/si476x-core.h>35#include <linux/mfd/si476x-core.h>
36 36
37#define FM_FREQ_RANGE_LOW 6400000037#define FM_FREQ_RANGE_LOW 64000000
drivers/media/radio/radio-tea5777.h+1−1
@@ -76,7 +76,7 @@ struct radio_tea5777 { · 75 unmodified lines
76 u32 read_reg;76 u32 read_reg;
77 u64 write_reg;77 u64 write_reg;
78 struct mutex mutex;78 struct mutex mutex;
79 struct radio_tea5777_ops *ops;79 const struct radio_tea5777_ops *ops;
80 void *private_data;80 void *private_data;
81 u8 card[32];81 u8 card[32];
82 u8 bus_info[32];82 u8 bus_info[32];
drivers/media/radio/radio-timb.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include <linux/slab.h>26#include <linux/slab.h>
27#include <linux/i2c.h>27#include <linux/i2c.h>
28#include <linux/module.h>28#include <linux/module.h>
29#include <media/timb_radio.h>29#include <linux/platform_data/media/timb_radio.h>
30 30
31#define DRIVER_NAME "timb-radio"31#define DRIVER_NAME "timb-radio"
32 32
drivers/media/radio/si4713/radio-usb-si4713.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <media/v4l2-device.h>31#include <media/v4l2-device.h>
32#include <media/v4l2-ioctl.h>32#include <media/v4l2-ioctl.h>
33#include <media/v4l2-event.h>33#include <media/v4l2-event.h>
34#include <media/si4713.h>34#include <linux/platform_data/media/si4713.h>
35 35
36#include "si4713.h"36#include "si4713.h"
37 37
drivers/media/radio/si4713/si4713.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
20#include <linux/gpio/consumer.h>20#include <linux/gpio/consumer.h>
21#include <media/v4l2-subdev.h>21#include <media/v4l2-subdev.h>
22#include <media/v4l2-ctrls.h>22#include <media/v4l2-ctrls.h>
23#include <media/si4713.h>23#include <linux/platform_data/media/si4713.h>
24 24
25#define SI4713_PRODUCT_NUMBER 0x0D25#define SI4713_PRODUCT_NUMBER 0x0D
26 26
drivers/media/radio/tea575x.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <media/v4l2-fh.h>31#include <media/v4l2-fh.h>
32#include <media/v4l2-ioctl.h>32#include <media/v4l2-ioctl.h>
33#include <media/v4l2-event.h>33#include <media/v4l2-event.h>
34#include <media/tea575x.h>34#include <media/drv-intf/tea575x.h>
35 35
36MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");36MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
37MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips");37MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips");
drivers/media/rc/Kconfig+2−1
@@ -101,7 +101,8 @@ config IR_SHARP_DECODER · 100 unmodified lines
101 101
102 ---help---102 ---help---
103 Enable this option if you have an infrared remote control which103 Enable this option if you have an infrared remote control which
104 uses the Sharp protocol, and you need software decoding support.104 uses the Sharp protocol (Sharp, Denon), and you need software
105 decoding support.
105 106
106config IR_MCE_KBD_DECODER107config IR_MCE_KBD_DECODER
107 tristate "Enable IR raw decoder for the MCE keyboard/mouse protocol"108 tristate "Enable IR raw decoder for the MCE keyboard/mouse protocol"
drivers/media/rc/gpio-ir-recv.c+23−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21#include <linux/platform_device.h>21#include <linux/platform_device.h>
22#include <linux/irq.h>22#include <linux/irq.h>
23#include <media/rc-core.h>23#include <media/rc-core.h>
24#include <media/gpio-ir-recv.h>24#include <linux/platform_data/media/gpio-ir-recv.h>
25 25
26#define GPIO_IR_DRIVER_NAME "gpio-rc-recv"26#define GPIO_IR_DRIVER_NAME "gpio-rc-recv"
27#define GPIO_IR_DEVICE_NAME "gpio_ir_recv"27#define GPIO_IR_DEVICE_NAME "gpio_ir_recv"
@@ -30,6 +30,7 @@ struct gpio_rc_dev { · 2 unmodified lines
30 struct rc_dev *rcdev;30 struct rc_dev *rcdev;
31 int gpio_nr;31 int gpio_nr;
32 bool active_low;32 bool active_low;
33 struct timer_list flush_timer;
33};34};
34 35
35#ifdef CONFIG_OF36#ifdef CONFIG_OF
@@ -93,12 +94,26 @@ static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) · 57 unmodified lines
93 if (rc < 0)94 if (rc < 0)
94 goto err_get_value;95 goto err_get_value;
95 96
97 mod_timer(&gpio_dev->flush_timer,
98 jiffies + nsecs_to_jiffies(gpio_dev->rcdev->timeout));
99
96 ir_raw_event_handle(gpio_dev->rcdev);100 ir_raw_event_handle(gpio_dev->rcdev);
97 101
98err_get_value:102err_get_value:
99 return IRQ_HANDLED;103 return IRQ_HANDLED;
100}104}
101 105
106static void flush_timer(unsigned long arg)
107{
108 struct gpio_rc_dev *gpio_dev = (struct gpio_rc_dev *)arg;
109 DEFINE_IR_RAW_EVENT(ev);
110
111 ev.timeout = true;
112 ev.duration = gpio_dev->rcdev->timeout;
113 ir_raw_event_store(gpio_dev->rcdev, &ev);
114 ir_raw_event_handle(gpio_dev->rcdev);
115}
116
102static int gpio_ir_recv_probe(struct platform_device *pdev)117static int gpio_ir_recv_probe(struct platform_device *pdev)
103{118{
104 struct gpio_rc_dev *gpio_dev;119 struct gpio_rc_dev *gpio_dev;
@@ -144,6 +159,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) · 39 unmodified lines
144 rcdev->input_id.version = 0x0100;159 rcdev->input_id.version = 0x0100;
145 rcdev->dev.parent = &pdev->dev;160 rcdev->dev.parent = &pdev->dev;
146 rcdev->driver_name = GPIO_IR_DRIVER_NAME;161 rcdev->driver_name = GPIO_IR_DRIVER_NAME;
162 rcdev->min_timeout = 0;
163 rcdev->timeout = IR_DEFAULT_TIMEOUT;
164 rcdev->max_timeout = 10 * IR_DEFAULT_TIMEOUT;
147 if (pdata->allowed_protos)165 if (pdata->allowed_protos)
148 rcdev->allowed_protocols = pdata->allowed_protos;166 rcdev->allowed_protocols = pdata->allowed_protos;
149 else167 else
@@ -154,6 +172,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) · 4 unmodified lines
154 gpio_dev->gpio_nr = pdata->gpio_nr;172 gpio_dev->gpio_nr = pdata->gpio_nr;
155 gpio_dev->active_low = pdata->active_low;173 gpio_dev->active_low = pdata->active_low;
156 174
175 setup_timer(&gpio_dev->flush_timer, flush_timer,
176 (unsigned long)gpio_dev);
177
157 rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv");178 rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv");
158 if (rc < 0)179 if (rc < 0)
159 goto err_gpio_request;180 goto err_gpio_request;
@@ -196,6 +217,7 @@ static int gpio_ir_recv_remove(struct platform_device *pdev) · 36 unmodified lines
196 struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);217 struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
197 218
198 free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev);219 free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev);
220 del_timer_sync(&gpio_dev->flush_timer);
199 rc_unregister_device(gpio_dev->rcdev);221 rc_unregister_device(gpio_dev->rcdev);
200 gpio_free(gpio_dev->gpio_nr);222 gpio_free(gpio_dev->gpio_nr);
201 kfree(gpio_dev);223 kfree(gpio_dev);
drivers/media/rc/ir-jvc-decoder.c+0−3
@@ -47,9 +47,6 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev) · 46 unmodified lines
47{47{
48 struct jvc_dec *data = &dev->raw->jvc;48 struct jvc_dec *data = &dev->raw->jvc;
49 49
50 if (!(dev->enabled_protocols & RC_BIT_JVC))
51 return 0;
52
53 if (!is_timing_event(ev)) {50 if (!is_timing_event(ev)) {
54 if (ev.reset)51 if (ev.reset)
55 data->state = STATE_INACTIVE;52 data->state = STATE_INACTIVE;
drivers/media/rc/ir-lirc-codec.c+1−0
@@ -415,6 +415,7 @@ static int ir_lirc_unregister(struct rc_dev *dev) · 414 unmodified lines
415 415
416 lirc_unregister_driver(lirc->drv->minor);416 lirc_unregister_driver(lirc->drv->minor);
417 lirc_buffer_free(lirc->drv->rbuf);417 lirc_buffer_free(lirc->drv->rbuf);
418 kfree(lirc->drv->rbuf);
418 kfree(lirc->drv);419 kfree(lirc->drv);
419 420
420 return 0;421 return 0;
drivers/media/rc/ir-mce_kbd-decoder.c+0−3
@@ -216,9 +216,6 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev) · 215 unmodified lines
216 u32 scancode;216 u32 scancode;
217 unsigned long delay;217 unsigned long delay;
218 218
219 if (!(dev->enabled_protocols & RC_BIT_MCE_KBD))
220 return 0;
221
222 if (!is_timing_event(ev)) {219 if (!is_timing_event(ev)) {
223 if (ev.reset)220 if (ev.reset)
224 data->state = STATE_INACTIVE;221 data->state = STATE_INACTIVE;
drivers/media/rc/ir-nec-decoder.c+0−3
@@ -52,9 +52,6 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) · 51 unmodified lines
52 u8 address, not_address, command, not_command;52 u8 address, not_address, command, not_command;
53 bool send_32bits = false;53 bool send_32bits = false;
54 54
55 if (!(dev->enabled_protocols & RC_BIT_NEC))
56 return 0;
57
58 if (!is_timing_event(ev)) {55 if (!is_timing_event(ev)) {
59 if (ev.reset)56 if (ev.reset)
60 data->state = STATE_INACTIVE;57 data->state = STATE_INACTIVE;
drivers/media/rc/ir-rc5-decoder.c+0−3
@@ -53,9 +53,6 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) · 52 unmodified lines
53 u32 scancode;53 u32 scancode;
54 enum rc_type protocol;54 enum rc_type protocol;
55 55
56 if (!(dev->enabled_protocols & (RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ)))
57 return 0;
58
59 if (!is_timing_event(ev)) {56 if (!is_timing_event(ev)) {
60 if (ev.reset)57 if (ev.reset)
61 data->state = STATE_INACTIVE;58 data->state = STATE_INACTIVE;
drivers/media/rc/ir-rc6-decoder.c+0−5
@@ -90,11 +90,6 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) · 89 unmodified lines
90 u8 toggle;90 u8 toggle;
91 enum rc_type protocol;91 enum rc_type protocol;
92 92
93 if (!(dev->enabled_protocols &
94 (RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 |
95 RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE)))
96 return 0;
97
98 if (!is_timing_event(ev)) {93 if (!is_timing_event(ev)) {
99 if (ev.reset)94 if (ev.reset)
100 data->state = STATE_INACTIVE;95 data->state = STATE_INACTIVE;
drivers/media/rc/ir-rx51.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 31
32#include <media/lirc.h>32#include <media/lirc.h>
33#include <media/lirc_dev.h>33#include <media/lirc_dev.h>
34#include <media/ir-rx51.h>34#include <linux/platform_data/media/ir-rx51.h>
35 35
36#define LIRC_RX51_DRIVER_FEATURES (LIRC_CAN_SET_SEND_DUTY_CYCLE | \36#define LIRC_RX51_DRIVER_FEATURES (LIRC_CAN_SET_SEND_DUTY_CYCLE | \
37 LIRC_CAN_SET_SEND_CARRIER | \37 LIRC_CAN_SET_SEND_CARRIER | \
drivers/media/rc/ir-sanyo-decoder.c+0−3
@@ -58,9 +58,6 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev) · 57 unmodified lines
58 u32 scancode;58 u32 scancode;
59 u8 address, command, not_command;59 u8 address, command, not_command;
60 60
61 if (!(dev->enabled_protocols & RC_BIT_SANYO))
62 return 0;
63
64 if (!is_timing_event(ev)) {61 if (!is_timing_event(ev)) {
65 if (ev.reset) {62 if (ev.reset) {
66 IR_dprintk(1, "SANYO event reset received. reset to state 0\n");63 IR_dprintk(1, "SANYO event reset received. reset to state 0\n");
drivers/media/rc/ir-sharp-decoder.c+3−4
@@ -48,9 +48,6 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev) · 47 unmodified lines
48 struct sharp_dec *data = &dev->raw->sharp;48 struct sharp_dec *data = &dev->raw->sharp;
49 u32 msg, echo, address, command, scancode;49 u32 msg, echo, address, command, scancode;
50 50
51 if (!(dev->enabled_protocols & RC_BIT_SHARP))
52 return 0;
53
54 if (!is_timing_event(ev)) {51 if (!is_timing_event(ev)) {
55 if (ev.reset)52 if (ev.reset)
56 data->state = STATE_INACTIVE;53 data->state = STATE_INACTIVE;
@@ -118,7 +115,9 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev) · 61 unmodified lines
118 115
119 if (data->count == SHARP_NBITS) {116 if (data->count == SHARP_NBITS) {
120 /* exp,chk bits should be 1,0 */117 /* exp,chk bits should be 1,0 */
121 if ((data->bits & 0x3) != 0x2)118 if ((data->bits & 0x3) != 0x2 &&
119 /* DENON variant, both chk bits 0 */
120 (data->bits & 0x3) != 0x0)
122 break;121 break;
123 data->state = STATE_ECHO_SPACE;122 data->state = STATE_ECHO_SPACE;
124 } else {123 } else {
drivers/media/rc/ir-sony-decoder.c+0−4
@@ -46,10 +46,6 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) · 45 unmodified lines
46 u32 scancode;46 u32 scancode;
47 u8 device, subdevice, function;47 u8 device, subdevice, function;
48 48
49 if (!(dev->enabled_protocols &
50 (RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20)))
51 return 0;
52
53 if (!is_timing_event(ev)) {49 if (!is_timing_event(ev)) {
54 if (ev.reset)50 if (ev.reset)
55 data->state = STATE_INACTIVE;51 data->state = STATE_INACTIVE;
drivers/media/rc/ir-xmp-decoder.c+0−3
@@ -43,9 +43,6 @@ static int ir_xmp_decode(struct rc_dev *dev, struct ir_raw_event ev) · 42 unmodified lines
43{43{
44 struct xmp_dec *data = &dev->raw->xmp;44 struct xmp_dec *data = &dev->raw->xmp;
45 45
46 if (!(dev->enabled_protocols & RC_BIT_XMP))
47 return 0;
48
49 if (!is_timing_event(ev)) {46 if (!is_timing_event(ev)) {
50 if (ev.reset)47 if (ev.reset)
51 data->state = STATE_INACTIVE;48 data->state = STATE_INACTIVE;
drivers/media/rc/nuvoton-cir.c+69−87
@@ -39,6 +39,18 @@ · 38 unmodified lines
39 39
40#include "nuvoton-cir.h"40#include "nuvoton-cir.h"
41 41
42static const struct nvt_chip nvt_chips[] = {
43 { "w83667hg", NVT_W83667HG },
44 { "NCT6775F", NVT_6775F },
45 { "NCT6776F", NVT_6776F },
46 { "NCT6779D", NVT_6779D },
47};
48
49static inline bool is_w83667hg(struct nvt_dev *nvt)
50{
51 return nvt->chip_ver == NVT_W83667HG;
52}
53
42/* write val to config reg */54/* write val to config reg */
43static inline void nvt_cr_write(struct nvt_dev *nvt, u8 val, u8 reg)55static inline void nvt_cr_write(struct nvt_dev *nvt, u8 val, u8 reg)
44{56{
@@ -224,74 +236,60 @@ static void cir_wake_dump_regs(struct nvt_dev *nvt) · 179 unmodified lines
224 pr_cont("\n");236 pr_cont("\n");
225}237}
226 238
239static inline const char *nvt_find_chip(struct nvt_dev *nvt, int id)
240{
241 int i;
242
243 for (i = 0; i < ARRAY_SIZE(nvt_chips); i++)
244 if ((id & SIO_ID_MASK) == nvt_chips[i].chip_ver) {
245 nvt->chip_ver = nvt_chips[i].chip_ver;
246 return nvt_chips[i].name;
247 }
248
249 return NULL;
250}
251
252
227/* detect hardware features */253/* detect hardware features */
228static int nvt_hw_detect(struct nvt_dev *nvt)254static void nvt_hw_detect(struct nvt_dev *nvt)
229{255{
230 unsigned long flags;256 const char *chip_name;
231 u8 chip_major, chip_minor;257 int chip_id;
232 char chip_id[12];
233 bool chip_unknown = false;
234 258
235 nvt_efm_enable(nvt);259 nvt_efm_enable(nvt);
236 260
237 /* Check if we're wired for the alternate EFER setup */261 /* Check if we're wired for the alternate EFER setup */
238 chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI);262 nvt->chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI);
239 if (chip_major == 0xff) {263 if (nvt->chip_major == 0xff) {
240 nvt->cr_efir = CR_EFIR2;264 nvt->cr_efir = CR_EFIR2;
241 nvt->cr_efdr = CR_EFDR2;265 nvt->cr_efdr = CR_EFDR2;
242 nvt_efm_enable(nvt);266 nvt_efm_enable(nvt);
243 chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI);267 nvt->chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI);
244 }268 }
245 269
246 chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO);270 nvt->chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO);
247 271
248 /* these are the known working chip revisions... */272 chip_id = nvt->chip_major << 8 | nvt->chip_minor;
249 switch (chip_major) {273 chip_name = nvt_find_chip(nvt, chip_id);
250 case CHIP_ID_HIGH_667:
251 strcpy(chip_id, "w83667hg\0");
252 if (chip_minor != CHIP_ID_LOW_667)
253 chip_unknown = true;
254 break;
255 case CHIP_ID_HIGH_677B:
256 strcpy(chip_id, "w83677hg\0");
257 if (chip_minor != CHIP_ID_LOW_677B2 &&
258 chip_minor != CHIP_ID_LOW_677B3)
259 chip_unknown = true;
260 break;
261 case CHIP_ID_HIGH_677C:
262 strcpy(chip_id, "w83677hg-c\0");
263 if (chip_minor != CHIP_ID_LOW_677C)
264 chip_unknown = true;
265 break;
266 default:
267 strcpy(chip_id, "w836x7hg\0");
268 chip_unknown = true;
269 break;
270 }
271 274
272 /* warn, but still let the driver load, if we don't know this chip */275 /* warn, but still let the driver load, if we don't know this chip */
273 if (chip_unknown)276 if (!chip_name)
274 nvt_pr(KERN_WARNING, "%s: unknown chip, id: 0x%02x 0x%02x, "277 dev_warn(&nvt->pdev->dev,
275 "it may not work...", chip_id, chip_major, chip_minor);278 "unknown chip, id: 0x%02x 0x%02x, it may not work...",
279 nvt->chip_major, nvt->chip_minor);
276 else280 else
277 nvt_dbg("%s: chip id: 0x%02x 0x%02x",281 dev_info(&nvt->pdev->dev,
278 chip_id, chip_major, chip_minor);282 "found %s or compatible: chip id: 0x%02x 0x%02x",
283 chip_name, nvt->chip_major, nvt->chip_minor);
279 284
280 nvt_efm_disable(nvt);285 nvt_efm_disable(nvt);
281
282 spin_lock_irqsave(&nvt->nvt_lock, flags);
283 nvt->chip_major = chip_major;
284 nvt->chip_minor = chip_minor;
285 spin_unlock_irqrestore(&nvt->nvt_lock, flags);
286
287 return 0;
288}286}
289 287
290static void nvt_cir_ldev_init(struct nvt_dev *nvt)288static void nvt_cir_ldev_init(struct nvt_dev *nvt)
291{289{
292 u8 val, psreg, psmask, psval;290 u8 val, psreg, psmask, psval;
293 291
294 if (nvt->chip_major == CHIP_ID_HIGH_667) {292 if (is_w83667hg(nvt)) {
295 psreg = CR_MULTIFUNC_PIN_SEL;293 psreg = CR_MULTIFUNC_PIN_SEL;
296 psmask = MULTIFUNC_PIN_SEL_MASK;294 psmask = MULTIFUNC_PIN_SEL_MASK;
297 psval = MULTIFUNC_ENABLE_CIR | MULTIFUNC_ENABLE_CIRWB;295 psval = MULTIFUNC_ENABLE_CIR | MULTIFUNC_ENABLE_CIRWB;
@@ -485,8 +483,9 @@ static u32 nvt_rx_carrier_detect(struct nvt_dev *nvt) · 187 unmodified lines
485 duration *= SAMPLE_PERIOD;483 duration *= SAMPLE_PERIOD;
486 484
487 if (!count || !duration) {485 if (!count || !duration) {
488 nvt_pr(KERN_NOTICE, "Unable to determine carrier! (c:%u, d:%u)",486 dev_notice(&nvt->pdev->dev,
489 count, duration);487 "Unable to determine carrier! (c:%u, d:%u)",
488 count, duration);
490 return 0;489 return 0;
491 }490 }
492 491
@@ -661,7 +660,7 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) · 168 unmodified lines
661 660
662static void nvt_handle_rx_fifo_overrun(struct nvt_dev *nvt)661static void nvt_handle_rx_fifo_overrun(struct nvt_dev *nvt)
663{662{
664 nvt_pr(KERN_WARNING, "RX FIFO overrun detected, flushing data!");663 dev_warn(&nvt->pdev->dev, "RX FIFO overrun detected, flushing data!");
665 664
666 nvt->pkts = 0;665 nvt->pkts = 0;
667 nvt_clear_cir_fifo(nvt);666 nvt_clear_cir_fifo(nvt);
@@ -719,7 +718,7 @@ static void nvt_get_rx_ir_data(struct nvt_dev *nvt) · 51 unmodified lines
719 718
720static void nvt_cir_log_irqs(u8 status, u8 iren)719static void nvt_cir_log_irqs(u8 status, u8 iren)
721{720{
722 nvt_pr(KERN_INFO, "IRQ 0x%02x (IREN 0x%02x) :%s%s%s%s%s%s%s%s%s",721 nvt_dbg("IRQ 0x%02x (IREN 0x%02x) :%s%s%s%s%s%s%s%s%s",
723 status, iren,722 status, iren,
724 status & CIR_IRSTS_RDR ? " RDR" : "",723 status & CIR_IRSTS_RDR ? " RDR" : "",
725 status & CIR_IRSTS_RTR ? " RTR" : "",724 status & CIR_IRSTS_RTR ? " RTR" : "",
@@ -779,7 +778,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) · 53 unmodified lines
779 if (!status) {778 if (!status) {
780 nvt_dbg_verbose("%s exiting, IRSTS 0x0", __func__);779 nvt_dbg_verbose("%s exiting, IRSTS 0x0", __func__);
781 nvt_cir_reg_write(nvt, 0xff, CIR_IRSTS);780 nvt_cir_reg_write(nvt, 0xff, CIR_IRSTS);
782 return IRQ_RETVAL(IRQ_NONE);781 return IRQ_NONE;
783 }782 }
784 783
785 /* ack/clear all irq flags we've got */784 /* ack/clear all irq flags we've got */
@@ -790,11 +789,10 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) · 4 unmodified lines
790 iren = nvt_cir_reg_read(nvt, CIR_IREN);789 iren = nvt_cir_reg_read(nvt, CIR_IREN);
791 if (!iren) {790 if (!iren) {
792 nvt_dbg_verbose("%s exiting, CIR not enabled", __func__);791 nvt_dbg_verbose("%s exiting, CIR not enabled", __func__);
793 return IRQ_RETVAL(IRQ_NONE);792 return IRQ_NONE;
794 }793 }
795 794
796 if (debug)795 nvt_cir_log_irqs(status, iren);
797 nvt_cir_log_irqs(status, iren);
798 796
799 if (status & CIR_IRSTS_RTR) {797 if (status & CIR_IRSTS_RTR) {
800 /* FIXME: add code for study/learn mode */798 /* FIXME: add code for study/learn mode */
@@ -853,7 +851,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) · 52 unmodified lines
853 }851 }
854 852
855 nvt_dbg_verbose("%s done", __func__);853 nvt_dbg_verbose("%s done", __func__);
856 return IRQ_RETVAL(IRQ_HANDLED);854 return IRQ_HANDLED;
857}855}
858 856
859/* Interrupt service routine for CIR Wake */857/* Interrupt service routine for CIR Wake */
@@ -867,7 +865,7 @@ static irqreturn_t nvt_cir_wake_isr(int irq, void *data) · 7 unmodified lines
867 865
868 status = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRSTS);866 status = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRSTS);
869 if (!status)867 if (!status)
870 return IRQ_RETVAL(IRQ_NONE);868 return IRQ_NONE;
871 869
872 if (status & CIR_WAKE_IRSTS_IR_PENDING)870 if (status & CIR_WAKE_IRSTS_IR_PENDING)
873 nvt_clear_cir_wake_fifo(nvt);871 nvt_clear_cir_wake_fifo(nvt);
@@ -879,7 +877,7 @@ static irqreturn_t nvt_cir_wake_isr(int irq, void *data) · 5 unmodified lines
879 iren = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IREN);877 iren = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IREN);
880 if (!iren) {878 if (!iren) {
881 nvt_dbg_wake("%s exiting, wake not enabled", __func__);879 nvt_dbg_wake("%s exiting, wake not enabled", __func__);
882 return IRQ_RETVAL(IRQ_HANDLED);880 return IRQ_HANDLED;
883 }881 }
884 882
885 if ((status & CIR_WAKE_IRSTS_PE) &&883 if ((status & CIR_WAKE_IRSTS_PE) &&
@@ -896,7 +894,7 @@ static irqreturn_t nvt_cir_wake_isr(int irq, void *data) · 10 unmodified lines
896 }894 }
897 895
898 nvt_dbg_wake("%s done", __func__);896 nvt_dbg_wake("%s done", __func__);
899 return IRQ_RETVAL(IRQ_HANDLED);897 return IRQ_HANDLED;
900}898}
901 899
902static void nvt_enable_cir(struct nvt_dev *nvt)900static void nvt_enable_cir(struct nvt_dev *nvt)
@@ -974,7 +972,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) · 71 unmodified lines
974 struct rc_dev *rdev;972 struct rc_dev *rdev;
975 int ret = -ENOMEM;973 int ret = -ENOMEM;
976 974
977 nvt = kzalloc(sizeof(struct nvt_dev), GFP_KERNEL);975 nvt = devm_kzalloc(&pdev->dev, sizeof(struct nvt_dev), GFP_KERNEL);
978 if (!nvt)976 if (!nvt)
979 return ret;977 return ret;
980 978
@@ -1026,9 +1024,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) · 45 unmodified lines
1026 1024
1027 init_waitqueue_head(&nvt->tx.queue);1025 init_waitqueue_head(&nvt->tx.queue);
1028 1026
1029 ret = nvt_hw_detect(nvt);1027 nvt_hw_detect(nvt);
1030 if (ret)
1031 goto exit_free_dev_rdev;
1032 1028
1033 /* Initialize CIR & CIR Wake Logical Devices */1029 /* Initialize CIR & CIR Wake Logical Devices */
1034 nvt_efm_enable(nvt);1030 nvt_efm_enable(nvt);
@@ -1074,25 +1070,26 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) · 39 unmodified lines
1074 1070
1075 ret = -EBUSY;1071 ret = -EBUSY;
1076 /* now claim resources */1072 /* now claim resources */
1077 if (!request_region(nvt->cir_addr,1073 if (!devm_request_region(&pdev->dev, nvt->cir_addr,
1078 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))1074 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1079 goto exit_unregister_device;1075 goto exit_unregister_device;
1080 1076
1081 if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,1077 if (devm_request_irq(&pdev->dev, nvt->cir_irq, nvt_cir_isr,
1082 NVT_DRIVER_NAME, (void *)nvt))1078 IRQF_SHARED, NVT_DRIVER_NAME, (void *)nvt))
1083 goto exit_release_cir_addr;1079 goto exit_unregister_device;
1084 1080
1085 if (!request_region(nvt->cir_wake_addr,1081 if (!devm_request_region(&pdev->dev, nvt->cir_wake_addr,
1086 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))1082 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1087 goto exit_free_irq;1083 goto exit_unregister_device;
1088 1084
1089 if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,1085 if (devm_request_irq(&pdev->dev, nvt->cir_wake_irq,
1090 NVT_DRIVER_NAME, (void *)nvt))1086 nvt_cir_wake_isr, IRQF_SHARED,
1091 goto exit_release_cir_wake_addr;1087 NVT_DRIVER_NAME, (void *)nvt))
1088 goto exit_unregister_device;
1092 1089
1093 device_init_wakeup(&pdev->dev, true);1090 device_init_wakeup(&pdev->dev, true);
1094 1091
1095 nvt_pr(KERN_NOTICE, "driver has been successfully loaded\n");1092 dev_notice(&pdev->dev, "driver has been successfully loaded\n");
1096 if (debug) {1093 if (debug) {
1097 cir_dump_regs(nvt);1094 cir_dump_regs(nvt);
1098 cir_wake_dump_regs(nvt);1095 cir_wake_dump_regs(nvt);
@@ -1100,18 +1097,11 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) · 1 unmodified line
1100 1097
1101 return 0;1098 return 0;
1102 1099
1103exit_release_cir_wake_addr:
1104 release_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH);
1105exit_free_irq:
1106 free_irq(nvt->cir_irq, nvt);
1107exit_release_cir_addr:
1108 release_region(nvt->cir_addr, CIR_IOREG_LENGTH);
1109exit_unregister_device:1100exit_unregister_device:
1110 rc_unregister_device(rdev);1101 rc_unregister_device(rdev);
1111 rdev = NULL;1102 rdev = NULL;
1112exit_free_dev_rdev:1103exit_free_dev_rdev:
1113 rc_free_device(rdev);1104 rc_free_device(rdev);
1114 kfree(nvt);
1115 1105
1116 return ret;1106 return ret;
1117}1107}
@@ -1129,15 +1119,7 @@ static void nvt_remove(struct pnp_dev *pdev) · 11 unmodified lines
1129 nvt_enable_wake(nvt);1119 nvt_enable_wake(nvt);
1130 spin_unlock_irqrestore(&nvt->nvt_lock, flags);1120 spin_unlock_irqrestore(&nvt->nvt_lock, flags);
1131 1121
1132 /* free resources */
1133 free_irq(nvt->cir_irq, nvt);
1134 free_irq(nvt->cir_wake_irq, nvt);
1135 release_region(nvt->cir_addr, CIR_IOREG_LENGTH);
1136 release_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH);
1137
1138 rc_unregister_device(nvt->rdev);1122 rc_unregister_device(nvt->rdev);
1139
1140 kfree(nvt);
1141}1123}
1142 1124
1143static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state)1125static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state)
drivers/media/rc/nuvoton-cir.h+16−12
@@ -35,9 +35,6 @@ · 34 unmodified lines
35static int debug;35static int debug;
36 36
37 37
38#define nvt_pr(level, text, ...) \
39 printk(level KBUILD_MODNAME ": " text, ## __VA_ARGS__)
40
41#define nvt_dbg(text, ...) \38#define nvt_dbg(text, ...) \
42 if (debug) \39 if (debug) \
43 printk(KERN_DEBUG \40 printk(KERN_DEBUG \
@@ -64,6 +61,21 @@ static int debug; · 20 unmodified lines
64#define TX_BUF_LEN 25661#define TX_BUF_LEN 256
65#define RX_BUF_LEN 3262#define RX_BUF_LEN 32
66 63
64#define SIO_ID_MASK 0xfff0
65
66enum nvt_chip_ver {
67 NVT_UNKNOWN = 0,
68 NVT_W83667HG = 0xa510,
69 NVT_6775F = 0xb470,
70 NVT_6776F = 0xc330,
71 NVT_6779D = 0xc560
72};
73
74struct nvt_chip {
75 const char *name;
76 enum nvt_chip_ver chip_ver;
77};
78
67struct nvt_dev {79struct nvt_dev {
68 struct pnp_dev *pdev;80 struct pnp_dev *pdev;
69 struct rc_dev *rdev;81 struct rc_dev *rdev;
@@ -93,6 +105,7 @@ struct nvt_dev { · 23 unmodified lines
93 int cir_irq;105 int cir_irq;
94 int cir_wake_irq;106 int cir_wake_irq;
95 107
108 enum nvt_chip_ver chip_ver;
96 /* hardware id */109 /* hardware id */
97 u8 chip_major;110 u8 chip_major;
98 u8 chip_minor;111 u8 chip_minor;
@@ -326,15 +339,6 @@ struct nvt_dev { · 227 unmodified lines
326#define EFER_EFM_ENABLE 0x87339#define EFER_EFM_ENABLE 0x87
327#define EFER_EFM_DISABLE 0xaa340#define EFER_EFM_DISABLE 0xaa
328 341
329/* Chip IDs found in CR_CHIP_ID_{HI,LO} */
330#define CHIP_ID_HIGH_667 0xa5
331#define CHIP_ID_HIGH_677B 0xb4
332#define CHIP_ID_HIGH_677C 0xc3
333#define CHIP_ID_LOW_667 0x13
334#define CHIP_ID_LOW_677B2 0x72
335#define CHIP_ID_LOW_677B3 0x73
336#define CHIP_ID_LOW_677C 0x33
337
338/* Config regs we need to care about */342/* Config regs we need to care about */
339#define CR_SOFTWARE_RESET 0x02343#define CR_SOFTWARE_RESET 0x02
340#define CR_LOGICAL_DEV_SEL 0x07344#define CR_LOGICAL_DEV_SEL 0x07
drivers/media/rc/rc-core-priv.h+0−71
@@ -167,75 +167,4 @@ void ir_raw_init(void); · 166 unmodified lines
167 * loads the compiled decoders for their usage with IR raw events167 * loads the compiled decoders for their usage with IR raw events
168 */168 */
169 169
170/* from ir-nec-decoder.c */
171#ifdef CONFIG_IR_NEC_DECODER_MODULE
172#define load_nec_decode() request_module_nowait("ir-nec-decoder")
173#else
174static inline void load_nec_decode(void) { }
175#endif
176
177/* from ir-rc5-decoder.c */
178#ifdef CONFIG_IR_RC5_DECODER_MODULE
179#define load_rc5_decode() request_module_nowait("ir-rc5-decoder")
180#else
181static inline void load_rc5_decode(void) { }
182#endif
183
184/* from ir-rc6-decoder.c */
185#ifdef CONFIG_IR_RC6_DECODER_MODULE
186#define load_rc6_decode() request_module_nowait("ir-rc6-decoder")
187#else
188static inline void load_rc6_decode(void) { }
189#endif
190
191/* from ir-jvc-decoder.c */
192#ifdef CONFIG_IR_JVC_DECODER_MODULE
193#define load_jvc_decode() request_module_nowait("ir-jvc-decoder")
194#else
195static inline void load_jvc_decode(void) { }
196#endif
197
198/* from ir-sony-decoder.c */
199#ifdef CONFIG_IR_SONY_DECODER_MODULE
200#define load_sony_decode() request_module_nowait("ir-sony-decoder")
201#else
202static inline void load_sony_decode(void) { }
203#endif
204
205/* from ir-sanyo-decoder.c */
206#ifdef CONFIG_IR_SANYO_DECODER_MODULE
207#define load_sanyo_decode() request_module_nowait("ir-sanyo-decoder")
208#else
209static inline void load_sanyo_decode(void) { }
210#endif
211
212/* from ir-sharp-decoder.c */
213#ifdef CONFIG_IR_SHARP_DECODER_MODULE
214#define load_sharp_decode() request_module_nowait("ir-sharp-decoder")
215#else
216static inline void load_sharp_decode(void) { }
217#endif
218
219/* from ir-mce_kbd-decoder.c */
220#ifdef CONFIG_IR_MCE_KBD_DECODER_MODULE
221#define load_mce_kbd_decode() request_module_nowait("ir-mce_kbd-decoder")
222#else
223static inline void load_mce_kbd_decode(void) { }
224#endif
225
226/* from ir-lirc-codec.c */
227#ifdef CONFIG_IR_LIRC_CODEC_MODULE
228#define load_lirc_codec() request_module_nowait("ir-lirc-codec")
229#else
230static inline void load_lirc_codec(void) { }
231#endif
232
233/* from ir-xmp-decoder.c */
234#ifdef CONFIG_IR_XMP_DECODER_MODULE
235#define load_xmp_decode() request_module_nowait("ir-xmp-decoder")
236#else
237static inline void load_xmp_decode(void) { }
238#endif
239
240
241#endif /* _RC_CORE_PRIV */170#endif /* _RC_CORE_PRIV */
drivers/media/rc/rc-ir-raw.c+17−24
@@ -59,7 +59,9 @@ static int ir_raw_event_thread(void *data) · 58 unmodified lines
59 59
60 mutex_lock(&ir_raw_handler_lock);60 mutex_lock(&ir_raw_handler_lock);
61 list_for_each_entry(handler, &ir_raw_handler_list, list)61 list_for_each_entry(handler, &ir_raw_handler_list, list)
62 handler->decode(raw->dev, ev);62 if (raw->dev->enabled_protocols & handler->protocols ||
63 !handler->protocols)
64 handler->decode(raw->dev, ev);
63 raw->prev_ev = ev;65 raw->prev_ev = ev;
64 mutex_unlock(&ir_raw_handler_lock);66 mutex_unlock(&ir_raw_handler_lock);
65 }67 }
@@ -246,6 +248,14 @@ static int change_protocol(struct rc_dev *dev, u64 *rc_type) · 180 unmodified lines
246 return 0;248 return 0;
247}249}
248 250
251static void ir_raw_disable_protocols(struct rc_dev *dev, u64 protocols)
252{
253 mutex_lock(&dev->lock);
254 dev->enabled_protocols &= ~protocols;
255 dev->enabled_wakeup_protocols &= ~protocols;
256 mutex_unlock(&dev->lock);
257}
258
249/*259/*
250 * Used to (un)register raw event clients260 * Used to (un)register raw event clients
251 */261 */
@@ -337,33 +347,16 @@ EXPORT_SYMBOL(ir_raw_handler_register); · 85 unmodified lines
337void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler)347void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler)
338{348{
339 struct ir_raw_event_ctrl *raw;349 struct ir_raw_event_ctrl *raw;
350 u64 protocols = ir_raw_handler->protocols;
340 351
341 mutex_lock(&ir_raw_handler_lock);352 mutex_lock(&ir_raw_handler_lock);
342 list_del(&ir_raw_handler->list);353 list_del(&ir_raw_handler->list);
343 if (ir_raw_handler->raw_unregister)354 list_for_each_entry(raw, &ir_raw_client_list, list) {
344 list_for_each_entry(raw, &ir_raw_client_list, list)355 ir_raw_disable_protocols(raw->dev, protocols);
356 if (ir_raw_handler->raw_unregister)
345 ir_raw_handler->raw_unregister(raw->dev);357 ir_raw_handler->raw_unregister(raw->dev);
346 available_protocols &= ~ir_raw_handler->protocols;358 }
359 available_protocols &= ~protocols;
347 mutex_unlock(&ir_raw_handler_lock);360 mutex_unlock(&ir_raw_handler_lock);
348}361}
349EXPORT_SYMBOL(ir_raw_handler_unregister);362EXPORT_SYMBOL(ir_raw_handler_unregister);
350
351void ir_raw_init(void)
352{
353 /* Load the decoder modules */
354
355 load_nec_decode();
356 load_rc5_decode();
357 load_rc6_decode();
358 load_jvc_decode();
359 load_sony_decode();
360 load_sanyo_decode();
361 load_sharp_decode();
362 load_mce_kbd_decode();
363 load_lirc_codec();
364 load_xmp_decode();
365
366 /* If needed, we may later add some init code. In this case,
367 it is needed to change the CONFIG_MODULE test at rc-core.h
368 */
369}
drivers/media/rc/rc-main.c+65−23
@@ -61,7 +61,7 @@ struct rc_map *rc_map_get(const char *name) · 60 unmodified lines
61 struct rc_map_list *map;61 struct rc_map_list *map;
62 62
63 map = seek_rc_map(name);63 map = seek_rc_map(name);
64#ifdef MODULE64#ifdef CONFIG_MODULES
65 if (!map) {65 if (!map) {
66 int rc = request_module("%s", name);66 int rc = request_module("%s", name);
67 if (rc < 0) {67 if (rc < 0) {
@@ -777,30 +777,31 @@ static struct class rc_class = { · 709 unmodified lines
777 * used by the sysfs protocols file. Note that the order777 * used by the sysfs protocols file. Note that the order
778 * of the entries is relevant.778 * of the entries is relevant.
779 */779 */
780static struct {780static const struct {
781 u64 type;781 u64 type;
782 char *name;782 const char *name;
783 const char *module_name;
783} proto_names[] = {784} proto_names[] = {
784 { RC_BIT_NONE, "none" },785 { RC_BIT_NONE, "none", NULL },
785 { RC_BIT_OTHER, "other" },786 { RC_BIT_OTHER, "other", NULL },
786 { RC_BIT_UNKNOWN, "unknown" },787 { RC_BIT_UNKNOWN, "unknown", NULL },
787 { RC_BIT_RC5 |788 { RC_BIT_RC5 |
788 RC_BIT_RC5X, "rc-5" },789 RC_BIT_RC5X, "rc-5", "ir-rc5-decoder" },
789 { RC_BIT_NEC, "nec" },790 { RC_BIT_NEC, "nec", "ir-nec-decoder" },
790 { RC_BIT_RC6_0 |791 { RC_BIT_RC6_0 |
791 RC_BIT_RC6_6A_20 |792 RC_BIT_RC6_6A_20 |
792 RC_BIT_RC6_6A_24 |793 RC_BIT_RC6_6A_24 |
793 RC_BIT_RC6_6A_32 |794 RC_BIT_RC6_6A_32 |
794 RC_BIT_RC6_MCE, "rc-6" },795 RC_BIT_RC6_MCE, "rc-6", "ir-rc6-decoder" },
795 { RC_BIT_JVC, "jvc" },796 { RC_BIT_JVC, "jvc", "ir-jvc-decoder" },
796 { RC_BIT_SONY12 |797 { RC_BIT_SONY12 |
797 RC_BIT_SONY15 |798 RC_BIT_SONY15 |
798 RC_BIT_SONY20, "sony" },799 RC_BIT_SONY20, "sony", "ir-sony-decoder" },
799 { RC_BIT_RC5_SZ, "rc-5-sz" },800 { RC_BIT_RC5_SZ, "rc-5-sz", "ir-rc5-decoder" },
800 { RC_BIT_SANYO, "sanyo" },801 { RC_BIT_SANYO, "sanyo", "ir-sanyo-decoder" },
801 { RC_BIT_SHARP, "sharp" },802 { RC_BIT_SHARP, "sharp", "ir-sharp-decoder" },
802 { RC_BIT_MCE_KBD, "mce_kbd" },803 { RC_BIT_MCE_KBD, "mce_kbd", "ir-mce_kbd-decoder" },
803 { RC_BIT_XMP, "xmp" },804 { RC_BIT_XMP, "xmp", "ir-xmp-decoder" },
804};805};
805 806
806/**807/**
@@ -979,6 +980,48 @@ static int parse_protocol_change(u64 *protocols, const char *buf) · 172 unmodified lines
979 return count;980 return count;
980}981}
981 982
983static void ir_raw_load_modules(u64 *protocols)
984
985{
986 u64 available;
987 int i, ret;
988
989 for (i = 0; i < ARRAY_SIZE(proto_names); i++) {
990 if (proto_names[i].type == RC_BIT_NONE ||
991 proto_names[i].type & (RC_BIT_OTHER | RC_BIT_UNKNOWN))
992 continue;
993
994 available = ir_raw_get_allowed_protocols();
995 if (!(*protocols & proto_names[i].type & ~available))
996 continue;
997
998 if (!proto_names[i].module_name) {
999 pr_err("Can't enable IR protocol %s\n",
1000 proto_names[i].name);
1001 *protocols &= ~proto_names[i].type;
1002 continue;
1003 }
1004
1005 ret = request_module("%s", proto_names[i].module_name);
1006 if (ret < 0) {
1007 pr_err("Couldn't load IR protocol module %s\n",
1008 proto_names[i].module_name);
1009 *protocols &= ~proto_names[i].type;
1010 continue;
1011 }
1012 msleep(20);
1013 available = ir_raw_get_allowed_protocols();
1014 if (!(*protocols & proto_names[i].type & ~available))
1015 continue;
1016
1017 pr_err("Loaded IR protocol module %s, \
1018 but protocol %s still not available\n",
1019 proto_names[i].module_name,
1020 proto_names[i].name);
1021 *protocols &= ~proto_names[i].type;
1022 }
1023}
1024
982/**1025/**
983 * store_protocols() - changes the current/wakeup IR protocol(s)1026 * store_protocols() - changes the current/wakeup IR protocol(s)
984 * @device: the device descriptor1027 * @device: the device descriptor
@@ -1045,6 +1088,9 @@ static ssize_t store_protocols(struct device *device, · 60 unmodified lines
1045 goto out;1088 goto out;
1046 }1089 }
1047 1090
1091 if (dev->driver_type == RC_DRIVER_IR_RAW)
1092 ir_raw_load_modules(&new_protocols);
1093
1048 if (new_protocols != old_protocols) {1094 if (new_protocols != old_protocols) {
1049 *current_protocols = new_protocols;1095 *current_protocols = new_protocols;
1050 IR_dprintk(1, "Protocols changed to 0x%llx\n",1096 IR_dprintk(1, "Protocols changed to 0x%llx\n",
@@ -1420,17 +1466,13 @@ int rc_register_device(struct rc_dev *dev) · 369 unmodified lines
1420 dev->input_dev->rep[REP_PERIOD] = 125;1466 dev->input_dev->rep[REP_PERIOD] = 125;
1421 1467
1422 path = kobject_get_path(&dev->dev.kobj, GFP_KERNEL);1468 path = kobject_get_path(&dev->dev.kobj, GFP_KERNEL);
1423 printk(KERN_INFO "%s: %s as %s\n",1469 dev_info(&dev->dev, "%s as %s\n",
1424 dev_name(&dev->dev),1470 dev->input_name ?: "Unspecified device", path ?: "N/A");
1425 dev->input_name ? dev->input_name : "Unspecified device",
1426 path ? path : "N/A");
1427 kfree(path);1471 kfree(path);
1428 1472
1429 if (dev->driver_type == RC_DRIVER_IR_RAW) {1473 if (dev->driver_type == RC_DRIVER_IR_RAW) {
1430 /* Load raw decoders, if they aren't already */
1431 if (!raw_init) {1474 if (!raw_init) {
1432 IR_dprintk(1, "Loading raw decoders\n");1475 request_module_nowait("ir-lirc-codec");
1433 ir_raw_init();
1434 raw_init = true;1476 raw_init = true;
1435 }1477 }
1436 /* calls ir_register_device so unlock mutex here*/1478 /* calls ir_register_device so unlock mutex here*/
drivers/media/rc/st_rc.c+9−5
@@ -16,6 +16,7 @@ · 15 unmodified lines
16#include <linux/reset.h>16#include <linux/reset.h>
17#include <media/rc-core.h>17#include <media/rc-core.h>
18#include <linux/pinctrl/consumer.h>18#include <linux/pinctrl/consumer.h>
19#include <linux/pm_wakeirq.h>
19 20
20struct st_rc_device {21struct st_rc_device {
21 struct device *dev;22 struct device *dev;
@@ -190,6 +191,9 @@ static void st_rc_hardware_init(struct st_rc_device *dev) · 168 unmodified lines
190static int st_rc_remove(struct platform_device *pdev)191static int st_rc_remove(struct platform_device *pdev)
191{192{
192 struct st_rc_device *rc_dev = platform_get_drvdata(pdev);193 struct st_rc_device *rc_dev = platform_get_drvdata(pdev);
194
195 dev_pm_clear_wake_irq(&pdev->dev);
196 device_init_wakeup(&pdev->dev, false);
193 clk_disable_unprepare(rc_dev->sys_clock);197 clk_disable_unprepare(rc_dev->sys_clock);
194 rc_unregister_device(rc_dev->rdev);198 rc_unregister_device(rc_dev->rdev);
195 return 0;199 return 0;
@@ -298,22 +302,22 @@ static int st_rc_probe(struct platform_device *pdev) · 102 unmodified lines
298 rdev->map_name = RC_MAP_LIRC;302 rdev->map_name = RC_MAP_LIRC;
299 rdev->input_name = "ST Remote Control Receiver";303 rdev->input_name = "ST Remote Control Receiver";
300 304
301 /* enable wake via this device */
302 device_set_wakeup_capable(dev, true);
303 device_set_wakeup_enable(dev, true);
304
305 ret = rc_register_device(rdev);305 ret = rc_register_device(rdev);
306 if (ret < 0)306 if (ret < 0)
307 goto clkerr;307 goto clkerr;
308 308
309 rc_dev->rdev = rdev;309 rc_dev->rdev = rdev;
310 if (devm_request_irq(dev, rc_dev->irq, st_rc_rx_interrupt,310 if (devm_request_irq(dev, rc_dev->irq, st_rc_rx_interrupt,
311 IRQF_NO_SUSPEND, IR_ST_NAME, rc_dev) < 0) {311 0, IR_ST_NAME, rc_dev) < 0) {
312 dev_err(dev, "IRQ %d register failed\n", rc_dev->irq);312 dev_err(dev, "IRQ %d register failed\n", rc_dev->irq);
313 ret = -EINVAL;313 ret = -EINVAL;
314 goto rcerr;314 goto rcerr;
315 }315 }
316 316
317 /* enable wake via this device */
318 device_init_wakeup(dev, true);
319 dev_pm_set_wake_irq(dev, rc_dev->irq);
320
317 /**321 /**
318 * for LIRC_MODE_MODE2 or LIRC_MODE_PULSE or LIRC_MODE_RAW322 * for LIRC_MODE_MODE2 or LIRC_MODE_PULSE or LIRC_MODE_RAW
319 * lircd expects a long space first before a signal train to sync.323 * lircd expects a long space first before a signal train to sync.
drivers/media/rc/streamzap.c+9−10
@@ -34,6 +34,7 @@ · 33 unmodified lines
34#include <linux/device.h>34#include <linux/device.h>
35#include <linux/module.h>35#include <linux/module.h>
36#include <linux/slab.h>36#include <linux/slab.h>
37#include <linux/ktime.h>
37#include <linux/usb.h>38#include <linux/usb.h>
38#include <linux/usb/input.h>39#include <linux/usb/input.h>
39#include <media/rc-core.h>40#include <media/rc-core.h>
@@ -96,8 +97,8 @@ struct streamzap_ir { · 56 unmodified lines
96 /* sum of signal lengths received since signal start */97 /* sum of signal lengths received since signal start */
97 unsigned long sum;98 unsigned long sum;
98 /* start time of signal; necessary for gap tracking */99 /* start time of signal; necessary for gap tracking */
99 struct timeval signal_last;100 ktime_t signal_last;
100 struct timeval signal_start;101 ktime_t signal_start;
101 bool timeout_enabled;102 bool timeout_enabled;
102 103
103 char name[128];104 char name[128];
@@ -136,20 +137,18 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, · 32 unmodified lines
136 DEFINE_IR_RAW_EVENT(rawir);137 DEFINE_IR_RAW_EVENT(rawir);
137 138
138 if (sz->idle) {139 if (sz->idle) {
139 long deltv;140 int delta;
140 141
141 sz->signal_last = sz->signal_start;142 sz->signal_last = sz->signal_start;
142 do_gettimeofday(&sz->signal_start);143 sz->signal_start = ktime_get_real();
143 144
144 deltv = sz->signal_start.tv_sec - sz->signal_last.tv_sec;145 delta = ktime_us_delta(sz->signal_start, sz->signal_last);
145 rawir.pulse = false;146 rawir.pulse = false;
146 if (deltv > 15) {147 if (delta > (15 * USEC_PER_SEC)) {
147 /* really long time */148 /* really long time */
148 rawir.duration = IR_MAX_DURATION;149 rawir.duration = IR_MAX_DURATION;
149 } else {150 } else {
150 rawir.duration = (int)(deltv * 1000000 +151 rawir.duration = delta;
151 sz->signal_start.tv_usec -
152 sz->signal_last.tv_usec);
153 rawir.duration -= sz->sum;152 rawir.duration -= sz->sum;
154 rawir.duration = US_TO_NS(rawir.duration);153 rawir.duration = US_TO_NS(rawir.duration);
155 rawir.duration = (rawir.duration > IR_MAX_DURATION) ?154 rawir.duration = (rawir.duration > IR_MAX_DURATION) ?
@@ -428,7 +427,7 @@ static int streamzap_probe(struct usb_interface *intf, · 272 unmodified lines
428 sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION);427 sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION);
429 #endif428 #endif
430 429
431 do_gettimeofday(&sz->signal_start);430 sz->signal_start = ktime_get_real();
432 431
433 /* Complete final initialisations */432 /* Complete final initialisations */
434 usb_fill_int_urb(sz->urb_in, usbdev, pipe, sz->buf_in,433 usb_fill_int_urb(sz->urb_in, usbdev, pipe, sz->buf_in,
drivers/media/rc/sunxi-cir.c+2−0
@@ -153,6 +153,8 @@ static int sunxi_ir_probe(struct platform_device *pdev) · 152 unmodified lines
153 if (!ir)153 if (!ir)
154 return -ENOMEM;154 return -ENOMEM;
155 155
156 spin_lock_init(&ir->ir_lock);
157
156 if (of_device_is_compatible(dn, "allwinner,sun5i-a13-ir"))158 if (of_device_is_compatible(dn, "allwinner,sun5i-a13-ir"))
157 ir->fifo_size = 64;159 ir->fifo_size = 64;
158 else160 else
drivers/media/tuners/max2165.c+1−1
@@ -385,7 +385,7 @@ static const struct dvb_tuner_ops max2165_tuner_ops = { · 384 unmodified lines
385 .info = {385 .info = {
386 .name = "Maxim MAX2165",386 .name = "Maxim MAX2165",
387 .frequency_min = 470000000,387 .frequency_min = 470000000,
388 .frequency_max = 780000000,388 .frequency_max = 862000000,
389 .frequency_step = 50000,389 .frequency_step = 50000,
390 },390 },
391 391
drivers/media/tuners/mt2063.c+0−1
@@ -225,7 +225,6 @@ struct mt2063_state { · 224 unmodified lines
225 const struct mt2063_config *config;225 const struct mt2063_config *config;
226 struct dvb_tuner_ops ops;226 struct dvb_tuner_ops ops;
227 struct dvb_frontend *frontend;227 struct dvb_frontend *frontend;
228 struct tuner_state status;
229 228
230 u32 frequency;229 u32 frequency;
231 u32 srate;230 u32 srate;
drivers/media/tuners/si2157.c+1−0
@@ -168,6 +168,7 @@ static int si2157_init(struct dvb_frontend *fe) · 167 unmodified lines
168 len = fw->data[fw->size - remaining];168 len = fw->data[fw->size - remaining];
169 if (len > SI2157_ARGLEN) {169 if (len > SI2157_ARGLEN) {
170 dev_err(&client->dev, "Bad firmware length\n");170 dev_err(&client->dev, "Bad firmware length\n");
171 ret = -EINVAL;
171 goto err_release_firmware;172 goto err_release_firmware;
172 }173 }
173 memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);174 memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);
drivers/media/usb/airspy/airspy.c+2−2
@@ -316,7 +316,7 @@ static void airspy_urb_complete(struct urb *urb) · 315 unmodified lines
316 len = airspy_convert_stream(s, ptr, urb->transfer_buffer,316 len = airspy_convert_stream(s, ptr, urb->transfer_buffer,
317 urb->actual_length);317 urb->actual_length);
318 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len);318 vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len);
319 v4l2_get_timestamp(&fbuf->vb.timestamp);319 fbuf->vb.vb2_buf.timestamp = ktime_get_ns();
320 fbuf->vb.sequence = s->sequence++;320 fbuf->vb.sequence = s->sequence++;
321 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);321 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
322 }322 }
@@ -488,7 +488,7 @@ static void airspy_disconnect(struct usb_interface *intf) · 165 unmodified lines
488 488
489/* Videobuf2 operations */489/* Videobuf2 operations */
490static int airspy_queue_setup(struct vb2_queue *vq,490static int airspy_queue_setup(struct vb2_queue *vq,
491 const void *parg, unsigned int *nbuffers,491 unsigned int *nbuffers,
492 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])492 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
493{493{
494 struct airspy *s = vb2_get_drv_priv(vq);494 struct airspy *s = vb2_get_drv_priv(vq);
drivers/media/usb/as102/as102_fw.c+1−0
@@ -198,6 +198,7 @@ int as102_fw_upload(struct as10x_bus_adapter_t *bus_adap) · 197 unmodified lines
198 pr_info("%s: firmware: %s loaded with success\n",198 pr_info("%s: firmware: %s loaded with success\n",
199 DRIVER_NAME, fw1);199 DRIVER_NAME, fw1);
200 release_firmware(firmware);200 release_firmware(firmware);
201 firmware = NULL;
201 202
202 /* wait for boot to complete */203 /* wait for boot to complete */
203 mdelay(100);204 mdelay(100);
drivers/media/usb/au0828/au0828-vbi.c+4−10
@@ -30,23 +30,17 @@ · 29 unmodified lines
30 30
31/* ------------------------------------------------------------------ */31/* ------------------------------------------------------------------ */
32 32
33static int vbi_queue_setup(struct vb2_queue *vq, const void *parg,33static int vbi_queue_setup(struct vb2_queue *vq,
34 unsigned int *nbuffers, unsigned int *nplanes,34 unsigned int *nbuffers, unsigned int *nplanes,
35 unsigned int sizes[], void *alloc_ctxs[])35 unsigned int sizes[], void *alloc_ctxs[])
36{36{
37 const struct v4l2_format *fmt = parg;
38 struct au0828_dev *dev = vb2_get_drv_priv(vq);37 struct au0828_dev *dev = vb2_get_drv_priv(vq);
39 unsigned long img_size = dev->vbi_width * dev->vbi_height * 2;38 unsigned long size = dev->vbi_width * dev->vbi_height * 2;
40 unsigned long size;
41
42 size = fmt ? (fmt->fmt.vbi.samples_per_line *
43 (fmt->fmt.vbi.count[0] + fmt->fmt.vbi.count[1])) : img_size;
44 if (size < img_size)
45 return -EINVAL;
46 39
40 if (*nplanes)
41 return sizes[0] < size ? -EINVAL : 0;
47 *nplanes = 1;42 *nplanes = 1;
48 sizes[0] = size;43 sizes[0] = size;
49
50 return 0;44 return 0;
51}45}
52 46
drivers/media/usb/au0828/au0828-video.c+5−9
@@ -314,7 +314,7 @@ static inline void buffer_filled(struct au0828_dev *dev, · 313 unmodified lines
314 vb->sequence = dev->vbi_frame_count++;314 vb->sequence = dev->vbi_frame_count++;
315 315
316 vb->field = V4L2_FIELD_INTERLACED;316 vb->field = V4L2_FIELD_INTERLACED;
317 v4l2_get_timestamp(&vb->timestamp);317 vb->vb2_buf.timestamp = ktime_get_ns();
318 vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE);318 vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE);
319}319}
320 320
@@ -638,19 +638,15 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb) · 317 unmodified lines
638 return rc;638 return rc;
639}639}
640 640
641static int queue_setup(struct vb2_queue *vq, const void *parg,641static int queue_setup(struct vb2_queue *vq,
642 unsigned int *nbuffers, unsigned int *nplanes,642 unsigned int *nbuffers, unsigned int *nplanes,
643 unsigned int sizes[], void *alloc_ctxs[])643 unsigned int sizes[], void *alloc_ctxs[])
644{644{
645 const struct v4l2_format *fmt = parg;
646 struct au0828_dev *dev = vb2_get_drv_priv(vq);645 struct au0828_dev *dev = vb2_get_drv_priv(vq);
647 unsigned long img_size = dev->height * dev->bytesperline;646 unsigned long size = dev->height * dev->bytesperline;
648 unsigned long size;
649
650 size = fmt ? fmt->fmt.pix.sizeimage : img_size;
651 if (size < img_size)
652 return -EINVAL;
653 647
648 if (*nplanes)
649 return sizes[0] < size ? -EINVAL : 0;
654 *nplanes = 1;650 *nplanes = 1;
655 sizes[0] = size;651 sizes[0] = size;
656 652
drivers/media/usb/cpia2/cpia2_usb.c+1−2
@@ -890,8 +890,7 @@ static void cpia2_usb_disconnect(struct usb_interface *intf) · 889 unmodified lines
890 DBG("Wakeup waiting processes\n");890 DBG("Wakeup waiting processes\n");
891 cam->curbuff->status = FRAME_READY;891 cam->curbuff->status = FRAME_READY;
892 cam->curbuff->length = 0;892 cam->curbuff->length = 0;
893 if (waitqueue_active(&cam->wq_stream))893 wake_up_interruptible(&cam->wq_stream);
894 wake_up_interruptible(&cam->wq_stream);
895 }894 }
896 895
897 DBG("Releasing interface\n");896 DBG("Releasing interface\n");
drivers/media/usb/cx231xx/cx231xx-417.c+24−2
@@ -37,7 +37,7 @@ · 36 unmodified lines
37#include <media/v4l2-common.h>37#include <media/v4l2-common.h>
38#include <media/v4l2-ioctl.h>38#include <media/v4l2-ioctl.h>
39#include <media/v4l2-event.h>39#include <media/v4l2-event.h>
40#include <media/cx2341x.h>40#include <media/drv-intf/cx2341x.h>
41#include <media/tuner.h>41#include <media/tuner.h>
42 42
43#define CX231xx_FIRM_IMAGE_SIZE 37683643#define CX231xx_FIRM_IMAGE_SIZE 376836
@@ -1492,6 +1492,27 @@ static struct videobuf_queue_ops cx231xx_qops = { · 1448 unmodified lines
1492 1492
1493/* ------------------------------------------------------------------ */1493/* ------------------------------------------------------------------ */
1494 1494
1495static int vidioc_cropcap(struct file *file, void *priv,
1496 struct v4l2_cropcap *cc)
1497{
1498 struct cx231xx_fh *fh = priv;
1499 struct cx231xx *dev = fh->dev;
1500 bool is_50hz = dev->encodernorm.id & V4L2_STD_625_50;
1501
1502 if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1503 return -EINVAL;
1504
1505 cc->bounds.left = 0;
1506 cc->bounds.top = 0;
1507 cc->bounds.width = dev->ts1.width;
1508 cc->bounds.height = dev->ts1.height;
1509 cc->defrect = cc->bounds;
1510 cc->pixelaspect.numerator = is_50hz ? 54 : 11;
1511 cc->pixelaspect.denominator = is_50hz ? 59 : 10;
1512
1513 return 0;
1514}
1515
1495static int vidioc_g_std(struct file *file, void *fh0, v4l2_std_id *norm)1516static int vidioc_g_std(struct file *file, void *fh0, v4l2_std_id *norm)
1496{1517{
1497 struct cx231xx_fh *fh = file->private_data;1518 struct cx231xx_fh *fh = file->private_data;
@@ -1834,6 +1855,7 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { · 336 unmodified lines
1834 .vidioc_g_input = cx231xx_g_input,1855 .vidioc_g_input = cx231xx_g_input,
1835 .vidioc_s_input = cx231xx_s_input,1856 .vidioc_s_input = cx231xx_s_input,
1836 .vidioc_s_ctrl = vidioc_s_ctrl,1857 .vidioc_s_ctrl = vidioc_s_ctrl,
1858 .vidioc_cropcap = vidioc_cropcap,
1837 .vidioc_querycap = cx231xx_querycap,1859 .vidioc_querycap = cx231xx_querycap,
1838 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,1860 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
1839 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,1861 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
@@ -1901,7 +1923,7 @@ static int cx231xx_s_audio_sampling_freq(struct cx2341x_handler *cxhdl, u32 idx) · 61 unmodified lines
1901 return 0;1923 return 0;
1902}1924}
1903 1925
1904static struct cx2341x_handler_ops cx231xx_ops = {1926static const struct cx2341x_handler_ops cx231xx_ops = {
1905 /* needed for the video clock freq */1927 /* needed for the video clock freq */
1906 .s_audio_sampling_freq = cx231xx_s_audio_sampling_freq,1928 .s_audio_sampling_freq = cx231xx_s_audio_sampling_freq,
1907 /* needed for setting up the video resolution */1929 /* needed for setting up the video resolution */
drivers/media/usb/cx231xx/cx231xx-cards.c+5−5
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <media/tveeprom.h>30#include <media/tveeprom.h>
31#include <media/v4l2-common.h>31#include <media/v4l2-common.h>
32 32
33#include <media/cx25840.h>33#include <media/drv-intf/cx25840.h>
34#include "dvb-usb-ids.h"34#include "dvb-usb-ids.h"
35#include "xc5000.h"35#include "xc5000.h"
36#include "tda18271.h"36#include "tda18271.h"
@@ -352,7 +352,7 @@ struct cx231xx_board cx231xx_boards[] = { · 315 unmodified lines
352 .agc_analog_digital_select_gpio = 0x0c,352 .agc_analog_digital_select_gpio = 0x0c,
353 .gpio_pin_status_mask = 0x4001000,353 .gpio_pin_status_mask = 0x4001000,
354 .tuner_i2c_master = I2C_1_MUX_1,354 .tuner_i2c_master = I2C_1_MUX_1,
355 .demod_i2c_master = I2C_2,355 .demod_i2c_master = I2C_1_MUX_1,
356 .has_dvb = 1,356 .has_dvb = 1,
357 .demod_addr = 0x0e,357 .demod_addr = 0x0e,
358 .norm = V4L2_STD_NTSC,358 .norm = V4L2_STD_NTSC,
@@ -713,7 +713,7 @@ struct cx231xx_board cx231xx_boards[] = { · 354 unmodified lines
713 .agc_analog_digital_select_gpio = 0x0c,713 .agc_analog_digital_select_gpio = 0x0c,
714 .gpio_pin_status_mask = 0x4001000,714 .gpio_pin_status_mask = 0x4001000,
715 .tuner_i2c_master = I2C_1_MUX_3,715 .tuner_i2c_master = I2C_1_MUX_3,
716 .demod_i2c_master = I2C_2,716 .demod_i2c_master = I2C_1_MUX_3,
717 .has_dvb = 1,717 .has_dvb = 1,
718 .demod_addr = 0x0e,718 .demod_addr = 0x0e,
719 .norm = V4L2_STD_PAL,719 .norm = V4L2_STD_PAL,
@@ -752,7 +752,7 @@ struct cx231xx_board cx231xx_boards[] = { · 32 unmodified lines
752 .agc_analog_digital_select_gpio = 0x0c,752 .agc_analog_digital_select_gpio = 0x0c,
753 .gpio_pin_status_mask = 0x4001000,753 .gpio_pin_status_mask = 0x4001000,
754 .tuner_i2c_master = I2C_1_MUX_3,754 .tuner_i2c_master = I2C_1_MUX_3,
755 .demod_i2c_master = I2C_2,755 .demod_i2c_master = I2C_1_MUX_3,
756 .has_dvb = 1,756 .has_dvb = 1,
757 .demod_addr = 0x0e,757 .demod_addr = 0x0e,
758 .norm = V4L2_STD_PAL,758 .norm = V4L2_STD_PAL,
@@ -791,7 +791,7 @@ struct cx231xx_board cx231xx_boards[] = { · 32 unmodified lines
791 .agc_analog_digital_select_gpio = 0x0c,791 .agc_analog_digital_select_gpio = 0x0c,
792 .gpio_pin_status_mask = 0x4001000,792 .gpio_pin_status_mask = 0x4001000,
793 .tuner_i2c_master = I2C_1_MUX_3,793 .tuner_i2c_master = I2C_1_MUX_3,
794 .demod_i2c_master = I2C_2,794 .demod_i2c_master = I2C_1_MUX_3,
795 .has_dvb = 1,795 .has_dvb = 1,
796 .demod_addr = 0x0e,796 .demod_addr = 0x0e,
797 .norm = V4L2_STD_NTSC,797 .norm = V4L2_STD_NTSC,
drivers/media/usb/cx231xx/cx231xx-core.c+14−1
@@ -914,6 +914,7 @@ EXPORT_SYMBOL_GPL(cx231xx_uninit_isoc); · 913 unmodified lines
914 */914 */
915void cx231xx_uninit_bulk(struct cx231xx *dev)915void cx231xx_uninit_bulk(struct cx231xx *dev)
916{916{
917 struct cx231xx_dmaqueue *dma_q = &dev->video_mode.vidq;
917 struct urb *urb;918 struct urb *urb;
918 int i;919 int i;
919 920
@@ -931,7 +932,7 @@ void cx231xx_uninit_bulk(struct cx231xx *dev) · 11 unmodified lines
931 if (dev->video_mode.bulk_ctl.transfer_buffer[i]) {932 if (dev->video_mode.bulk_ctl.transfer_buffer[i]) {
932 usb_free_coherent(dev->udev,933 usb_free_coherent(dev->udev,
933 urb->transfer_buffer_length,934 urb->transfer_buffer_length,
934 dev->video_mode.isoc_ctl.935 dev->video_mode.bulk_ctl.
935 transfer_buffer[i],936 transfer_buffer[i],
936 urb->transfer_dma);937 urb->transfer_dma);
937 }938 }
@@ -943,10 +944,12 @@ void cx231xx_uninit_bulk(struct cx231xx *dev) · 5 unmodified lines
943 944
944 kfree(dev->video_mode.bulk_ctl.urb);945 kfree(dev->video_mode.bulk_ctl.urb);
945 kfree(dev->video_mode.bulk_ctl.transfer_buffer);946 kfree(dev->video_mode.bulk_ctl.transfer_buffer);
947 kfree(dma_q->p_left_data);
946 948
947 dev->video_mode.bulk_ctl.urb = NULL;949 dev->video_mode.bulk_ctl.urb = NULL;
948 dev->video_mode.bulk_ctl.transfer_buffer = NULL;950 dev->video_mode.bulk_ctl.transfer_buffer = NULL;
949 dev->video_mode.bulk_ctl.num_bufs = 0;951 dev->video_mode.bulk_ctl.num_bufs = 0;
952 dma_q->p_left_data = NULL;
950 953
951 if (dev->mode_tv == 0)954 if (dev->mode_tv == 0)
952 cx231xx_capture_start(dev, 0, Raw_Video);955 cx231xx_capture_start(dev, 0, Raw_Video);
@@ -1196,6 +1199,16 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets, · 243 unmodified lines
1196 sb_size, cx231xx_bulk_irq_callback, dma_q);1199 sb_size, cx231xx_bulk_irq_callback, dma_q);
1197 }1200 }
1198 1201
1202 /* clear halt */
1203 rc = usb_clear_halt(dev->udev, dev->video_mode.bulk_ctl.urb[0]->pipe);
1204 if (rc < 0) {
1205 dev_err(dev->dev,
1206 "failed to clear USB bulk endpoint stall/halt condition (error=%i)\n",
1207 rc);
1208 cx231xx_uninit_bulk(dev);
1209 return rc;
1210 }
1211
1199 init_waitqueue_head(&dma_q->wq);1212 init_waitqueue_head(&dma_q->wq);
1200 1213
1201 /* submit urbs and enables IRQ */1214 /* submit urbs and enables IRQ */
drivers/media/usb/cx231xx/cx231xx-dvb.c+4−4
@@ -725,7 +725,7 @@ static int dvb_init(struct cx231xx *dev) · 724 unmodified lines
725 725
726 dev->dvb->frontend = dvb_attach(lgdt3305_attach,726 dev->dvb->frontend = dvb_attach(lgdt3305_attach,
727 &hcw_lgdt3305_config,727 &hcw_lgdt3305_config,
728 tuner_i2c);728 demod_i2c);
729 729
730 if (dev->dvb->frontend == NULL) {730 if (dev->dvb->frontend == NULL) {
731 dev_err(dev->dev,731 dev_err(dev->dev,
@@ -746,7 +746,7 @@ static int dvb_init(struct cx231xx *dev) · 14 unmodified lines
746 746
747 dev->dvb->frontend = dvb_attach(si2165_attach,747 dev->dvb->frontend = dvb_attach(si2165_attach,
748 &hauppauge_930C_HD_1113xx_si2165_config,748 &hauppauge_930C_HD_1113xx_si2165_config,
749 tuner_i2c749 demod_i2c
750 );750 );
751 751
752 if (dev->dvb->frontend == NULL) {752 if (dev->dvb->frontend == NULL) {
@@ -779,7 +779,7 @@ static int dvb_init(struct cx231xx *dev) · 26 unmodified lines
779 779
780 dev->dvb->frontend = dvb_attach(si2165_attach,780 dev->dvb->frontend = dvb_attach(si2165_attach,
781 &pctv_quatro_stick_1114xx_si2165_config,781 &pctv_quatro_stick_1114xx_si2165_config,
782 tuner_i2c782 demod_i2c
783 );783 );
784 784
785 if (dev->dvb->frontend == NULL) {785 if (dev->dvb->frontend == NULL) {
@@ -835,7 +835,7 @@ static int dvb_init(struct cx231xx *dev) · 49 unmodified lines
835 835
836 dev->dvb->frontend = dvb_attach(lgdt3306a_attach,836 dev->dvb->frontend = dvb_attach(lgdt3306a_attach,
837 &hauppauge_955q_lgdt3306a_config,837 &hauppauge_955q_lgdt3306a_config,
838 tuner_i2c838 demod_i2c
839 );839 );
840 840
841 if (dev->dvb->frontend == NULL) {841 if (dev->dvb->frontend == NULL) {
drivers/media/usb/cx231xx/cx231xx-vbi.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
32 32
33#include <media/v4l2-common.h>33#include <media/v4l2-common.h>
34#include <media/v4l2-ioctl.h>34#include <media/v4l2-ioctl.h>
35#include <media/msp3400.h>35#include <media/drv-intf/msp3400.h>
36#include <media/tuner.h>36#include <media/tuner.h>
37 37
38#include "cx231xx-vbi.h"38#include "cx231xx-vbi.h"
drivers/media/usb/cx231xx/cx231xx-video.c+4−3
@@ -36,7 +36,7 @@ · 35 unmodified lines
36#include <media/v4l2-common.h>36#include <media/v4l2-common.h>
37#include <media/v4l2-ioctl.h>37#include <media/v4l2-ioctl.h>
38#include <media/v4l2-event.h>38#include <media/v4l2-event.h>
39#include <media/msp3400.h>39#include <media/drv-intf/msp3400.h>
40#include <media/tuner.h>40#include <media/tuner.h>
41 41
42#include "dvb_frontend.h"42#include "dvb_frontend.h"
@@ -1444,6 +1444,7 @@ static int vidioc_cropcap(struct file *file, void *priv, · 1401 unmodified lines
1444{1444{
1445 struct cx231xx_fh *fh = priv;1445 struct cx231xx_fh *fh = priv;
1446 struct cx231xx *dev = fh->dev;1446 struct cx231xx *dev = fh->dev;
1447 bool is_50hz = dev->norm & V4L2_STD_625_50;
1447 1448
1448 if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)1449 if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1449 return -EINVAL;1450 return -EINVAL;
@@ -1453,8 +1454,8 @@ static int vidioc_cropcap(struct file *file, void *priv, · 3 unmodified lines
1453 cc->bounds.width = dev->width;1454 cc->bounds.width = dev->width;
1454 cc->bounds.height = dev->height;1455 cc->bounds.height = dev->height;
1455 cc->defrect = cc->bounds;1456 cc->defrect = cc->bounds;
1456 cc->pixelaspect.numerator = 54; /* 4:3 FIXME: remove magic numbers */1457 cc->pixelaspect.numerator = is_50hz ? 54 : 11;
1457 cc->pixelaspect.denominator = 59;1458 cc->pixelaspect.denominator = is_50hz ? 59 : 10;
1458 1459
1459 return 0;1460 return 0;
1460}1461}
drivers/media/usb/cx231xx/cx231xx.h+2−2
@@ -30,14 +30,14 @@ · 29 unmodified lines
30#include <linux/mutex.h>30#include <linux/mutex.h>
31#include <linux/usb.h>31#include <linux/usb.h>
32 32
33#include <media/cx2341x.h>33#include <media/drv-intf/cx2341x.h>
34 34
35#include <media/videobuf-vmalloc.h>35#include <media/videobuf-vmalloc.h>
36#include <media/v4l2-device.h>36#include <media/v4l2-device.h>
37#include <media/v4l2-ctrls.h>37#include <media/v4l2-ctrls.h>
38#include <media/v4l2-fh.h>38#include <media/v4l2-fh.h>
39#include <media/rc-core.h>39#include <media/rc-core.h>
40#include <media/ir-kbd-i2c.h>40#include <media/i2c/ir-kbd-i2c.h>
41#include <media/videobuf-dvb.h>41#include <media/videobuf-dvb.h>
42 42
43#include "cx231xx-reg.h"43#include "cx231xx-reg.h"
drivers/media/usb/dvb-usb-v2/Kconfig+1−1
@@ -9,7 +9,7 @@ config DVB_USB_V2 · 8 unmodified lines
9 <file:Documentation/dvb/README.dvb-usb>.9 <file:Documentation/dvb/README.dvb-usb>.
10 10
11 For a complete list of supported USB devices see the LinuxTV DVB Wiki:11 For a complete list of supported USB devices see the LinuxTV DVB Wiki:
12 <http://www.linuxtv.org/wiki/index.php/DVB_USB>12 <https://linuxtv.org/wiki/index.php/DVB_USB>
13 13
14 Say Y if you own a USB DVB device.14 Say Y if you own a USB DVB device.
15 15
drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c+2−2
@@ -35,7 +35,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))."); · 34 unmodified lines
35struct mxl111sf_demod_state {35struct mxl111sf_demod_state {
36 struct mxl111sf_state *mxl_state;36 struct mxl111sf_state *mxl_state;
37 37
38 struct mxl111sf_demod_config *cfg;38 const struct mxl111sf_demod_config *cfg;
39 39
40 struct dvb_frontend fe;40 struct dvb_frontend fe;
41};41};
@@ -579,7 +579,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = { · 537 unmodified lines
579};579};
580 580
581struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,581struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
582 struct mxl111sf_demod_config *cfg)582 const struct mxl111sf_demod_config *cfg)
583{583{
584 struct mxl111sf_demod_state *state = NULL;584 struct mxl111sf_demod_state *state = NULL;
585 585
drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h+2−2
@@ -35,11 +35,11 @@ struct mxl111sf_demod_config { · 34 unmodified lines
35#if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)35#if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
36extern36extern
37struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,37struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
38 struct mxl111sf_demod_config *cfg);38 const struct mxl111sf_demod_config *cfg);
39#else39#else
40static inline40static inline
41struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,41struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
42 struct mxl111sf_demod_config *cfg)42 const struct mxl111sf_demod_config *cfg)
43{43{
44 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);44 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
45 return NULL;45 return NULL;
drivers/media/usb/dvb-usb-v2/mxl111sf.c+3−3
@@ -288,9 +288,9 @@ static int mxl111sf_adap_fe_init(struct dvb_frontend *fe) · 287 unmodified lines
288 err = mxl1x1sf_set_device_mode(state, adap_state->device_mode);288 err = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
289 289
290 mxl_fail(err);290 mxl_fail(err);
291 mxl111sf_enable_usb_output(state);291 err = mxl111sf_enable_usb_output(state);
292 mxl_fail(err);292 mxl_fail(err);
293 mxl1x1sf_top_master_ctrl(state, 1);293 err = mxl1x1sf_top_master_ctrl(state, 1);
294 mxl_fail(err);294 mxl_fail(err);
295 295
296 if ((MXL111SF_GPIO_MOD_DVBT != adap_state->gpio_mode) &&296 if ((MXL111SF_GPIO_MOD_DVBT != adap_state->gpio_mode) &&
@@ -731,7 +731,7 @@ fail: · 434 unmodified lines
731 return ret;731 return ret;
732}732}
733 733
734static struct mxl111sf_demod_config mxl_demod_config = {734static const struct mxl111sf_demod_config mxl_demod_config = {
735 .read_reg = mxl111sf_read_reg,735 .read_reg = mxl111sf_read_reg,
736 .write_reg = mxl111sf_write_reg,736 .write_reg = mxl111sf_write_reg,
737 .program_regs = mxl111sf_ctrl_program_regs,737 .program_regs = mxl111sf_ctrl_program_regs,
drivers/media/usb/dvb-usb-v2/rtl28xxu.c+11−5
@@ -181,11 +181,17 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], · 180 unmodified lines
181 goto err_mutex_unlock;181 goto err_mutex_unlock;
182 } else if (msg[0].addr == 0x10) {182 } else if (msg[0].addr == 0x10) {
183 /* method 1 - integrated demod */183 /* method 1 - integrated demod */
184 req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);184 if (msg[0].buf[0] == 0x00) {
185 req.index = CMD_DEMOD_RD | dev->page;185 /* return demod page from driver cache */
186 req.size = msg[1].len;186 msg[1].buf[0] = dev->page;
187 req.data = &msg[1].buf[0];187 ret = 0;
188 ret = rtl28xxu_ctrl_msg(d, &req);188 } else {
189 req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);
190 req.index = CMD_DEMOD_RD | dev->page;
191 req.size = msg[1].len;
192 req.data = &msg[1].buf[0];
193 ret = rtl28xxu_ctrl_msg(d, &req);
194 }
189 } else if (msg[0].len < 2) {195 } else if (msg[0].len < 2) {
190 /* method 2 - old I2C */196 /* method 2 - old I2C */
191 req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);197 req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);
drivers/media/usb/dvb-usb/Kconfig+1−1
@@ -9,7 +9,7 @@ config DVB_USB · 8 unmodified lines
9 <file:Documentation/dvb/README.dvb-usb>.9 <file:Documentation/dvb/README.dvb-usb>.
10 10
11 For a complete list of supported USB devices see the LinuxTV DVB Wiki:11 For a complete list of supported USB devices see the LinuxTV DVB Wiki:
12 <http://www.linuxtv.org/wiki/index.php/DVB_USB>12 <https://linuxtv.org/wiki/index.php/DVB_USB>
13 13
14 Say Y if you own a USB DVB device.14 Say Y if you own a USB DVB device.
15 15
drivers/media/usb/em28xx/em28xx-camera.c+2−2
@@ -21,7 +21,7 @@ · 20 unmodified lines
21 21
22#include <linux/i2c.h>22#include <linux/i2c.h>
23#include <media/soc_camera.h>23#include <media/soc_camera.h>
24#include <media/mt9v011.h>24#include <media/i2c/mt9v011.h>
25#include <media/v4l2-clk.h>25#include <media/v4l2-clk.h>
26#include <media/v4l2-common.h>26#include <media/v4l2-common.h>
27 27
@@ -322,7 +322,7 @@ int em28xx_detect_sensor(struct em28xx *dev) · 294 unmodified lines
322 322
323int em28xx_init_camera(struct em28xx *dev)323int em28xx_init_camera(struct em28xx *dev)
324{324{
325 char clk_name[V4L2_SUBDEV_NAME_SIZE];325 char clk_name[V4L2_CLK_NAME_SIZE];
326 struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus];326 struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus];
327 struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus];327 struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus];
328 struct em28xx_v4l2 *v4l2 = dev->v4l2;328 struct em28xx_v4l2 *v4l2 = dev->v4l2;
drivers/media/usb/em28xx/em28xx-cards.c+12−6
@@ -30,10 +30,10 @@ · 29 unmodified lines
30#include <linux/i2c.h>30#include <linux/i2c.h>
31#include <linux/usb.h>31#include <linux/usb.h>
32#include <media/tuner.h>32#include <media/tuner.h>
33#include <media/msp3400.h>33#include <media/drv-intf/msp3400.h>
34#include <media/saa7115.h>34#include <media/i2c/saa7115.h>
35#include <media/tvp5150.h>35#include <media/i2c/tvp5150.h>
36#include <media/tvaudio.h>36#include <media/i2c/tvaudio.h>
37#include <media/i2c-addr.h>37#include <media/i2c-addr.h>
38#include <media/tveeprom.h>38#include <media/tveeprom.h>
39#include <media/v4l2-common.h>39#include <media/v4l2-common.h>
@@ -1051,8 +1051,12 @@ struct em28xx_board em28xx_boards[] = { · 1011 unmodified lines
1051 },1051 },
1052 [EM2870_BOARD_TERRATEC_XS_MT2060] = {1052 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
1053 .name = "Terratec Cinergy T XS (MT2060)",1053 .name = "Terratec Cinergy T XS (MT2060)",
1054 .valid = EM28XX_BOARD_NOT_VALIDATED,1054 .xclk = EM28XX_XCLK_IR_RC5_MODE |
1055 EM28XX_XCLK_FREQUENCY_12MHZ,
1056 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1055 .tuner_type = TUNER_ABSENT, /* MT2060 */1057 .tuner_type = TUNER_ABSENT, /* MT2060 */
1058 .has_dvb = 1,
1059 .tuner_gpio = default_tuner_gpio,
1056 },1060 },
1057 [EM2870_BOARD_KWORLD_350U] = {1061 [EM2870_BOARD_KWORLD_350U] = {
1058 .name = "Kworld 350 U DVB-T",1062 .name = "Kworld 350 U DVB-T",
@@ -2368,7 +2372,7 @@ struct usb_device_id em28xx_id_table[] = { · 1309 unmodified lines
2368 { USB_DEVICE(0x0ccd, 0x0042),2372 { USB_DEVICE(0x0ccd, 0x0042),
2369 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },2373 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2370 { USB_DEVICE(0x0ccd, 0x0043),2374 { USB_DEVICE(0x0ccd, 0x0043),
2371 .driver_info = EM2870_BOARD_TERRATEC_XS },2375 .driver_info = EM2870_BOARD_TERRATEC_XS_MT2060 },
2372 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */2376 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
2373 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },2377 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
2374 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */2378 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
@@ -2471,6 +2475,8 @@ struct usb_device_id em28xx_id_table[] = { · 96 unmodified lines
2471 .driver_info = EM28178_BOARD_PCTV_461E },2475 .driver_info = EM28178_BOARD_PCTV_461E },
2472 { USB_DEVICE(0x2013, 0x025f),2476 { USB_DEVICE(0x2013, 0x025f),
2473 .driver_info = EM28178_BOARD_PCTV_292E },2477 .driver_info = EM28178_BOARD_PCTV_292E },
2478 { USB_DEVICE(0x2040, 0x0264), /* Hauppauge WinTV-soloHD */
2479 .driver_info = EM28178_BOARD_PCTV_292E },
2474 { USB_DEVICE(0x0413, 0x6f07),2480 { USB_DEVICE(0x0413, 0x6f07),
2475 .driver_info = EM2861_BOARD_LEADTEK_VC100 },2481 .driver_info = EM2861_BOARD_LEADTEK_VC100 },
2476 { USB_DEVICE(0xeb1a, 0x8179),2482 { USB_DEVICE(0xeb1a, 0x8179),
drivers/media/usb/em28xx/em28xx-dvb.c+15−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
38#include "lgdt3305.h"38#include "lgdt3305.h"
39#include "zl10353.h"39#include "zl10353.h"
40#include "s5h1409.h"40#include "s5h1409.h"
41#include "mt2060.h"
41#include "mt352.h"42#include "mt352.h"
42#include "mt352_priv.h" /* FIXME */43#include "mt352_priv.h" /* FIXME */
43#include "tda1002x.h"44#include "tda1002x.h"
@@ -815,6 +816,10 @@ static struct zl10353_config em28xx_zl10353_no_i2c_gate_dev = { · 771 unmodified lines
815 .parallel_ts = 1,816 .parallel_ts = 1,
816};817};
817 818
819static struct mt2060_config em28xx_mt2060_config = {
820 .i2c_address = 0x60,
821};
822
818static struct qt1010_config em28xx_qt1010_config = {823static struct qt1010_config em28xx_qt1010_config = {
819 .i2c_address = 0x62824 .i2c_address = 0x62
820};825};
@@ -1142,6 +1147,16 @@ static int em28xx_dvb_init(struct em28xx *dev) · 321 unmodified lines
1142 goto out_free;1147 goto out_free;
1143 }1148 }
1144 break;1149 break;
1150 case EM2870_BOARD_TERRATEC_XS_MT2060:
1151 dvb->fe[0] = dvb_attach(zl10353_attach,
1152 &em28xx_zl10353_no_i2c_gate_dev,
1153 &dev->i2c_adap[dev->def_i2c_bus]);
1154 if (dvb->fe[0] != NULL) {
1155 dvb_attach(mt2060_attach, dvb->fe[0],
1156 &dev->i2c_adap[dev->def_i2c_bus],
1157 &em28xx_mt2060_config, 1220);
1158 }
1159 break;
1145 case EM2870_BOARD_KWORLD_355U:1160 case EM2870_BOARD_KWORLD_355U:
1146 dvb->fe[0] = dvb_attach(zl10353_attach,1161 dvb->fe[0] = dvb_attach(zl10353_attach,
1147 &em28xx_zl10353_no_i2c_gate_dev,1162 &em28xx_zl10353_no_i2c_gate_dev,
drivers/media/usb/em28xx/em28xx-vbi.c+8−12
@@ -31,26 +31,22 @@ · 30 unmodified lines
31 31
32/* ------------------------------------------------------------------ */32/* ------------------------------------------------------------------ */
33 33
34static int vbi_queue_setup(struct vb2_queue *vq, const void *parg,34static int vbi_queue_setup(struct vb2_queue *vq,
35 unsigned int *nbuffers, unsigned int *nplanes,35 unsigned int *nbuffers, unsigned int *nplanes,
36 unsigned int sizes[], void *alloc_ctxs[])36 unsigned int sizes[], void *alloc_ctxs[])
37{37{
38 const struct v4l2_format *fmt = parg;
39 struct em28xx *dev = vb2_get_drv_priv(vq);38 struct em28xx *dev = vb2_get_drv_priv(vq);
40 struct em28xx_v4l2 *v4l2 = dev->v4l2;39 struct em28xx_v4l2 *v4l2 = dev->v4l2;
41 unsigned long size;40 unsigned long size = v4l2->vbi_width * v4l2->vbi_height * 2;
42 41
43 if (fmt)
44 size = fmt->fmt.pix.sizeimage;
45 else
46 size = v4l2->vbi_width * v4l2->vbi_height * 2;
47
48 if (0 == *nbuffers)
49 *nbuffers = 32;
50 if (*nbuffers < 2)42 if (*nbuffers < 2)
51 *nbuffers = 2;43 *nbuffers = 2;
52 if (*nbuffers > 32)44
53 *nbuffers = 32;45 if (*nplanes) {
46 if (sizes[0] < size)
47 return -EINVAL;
48 size = sizes[0];
49 }
54 50
55 *nplanes = 1;51 *nplanes = 1;
56 sizes[0] = size;52 sizes[0] = size;
drivers/media/usb/em28xx/em28xx-video.c+6−17
@@ -43,7 +43,7 @@ · 42 unmodified lines
43#include <media/v4l2-ioctl.h>43#include <media/v4l2-ioctl.h>
44#include <media/v4l2-event.h>44#include <media/v4l2-event.h>
45#include <media/v4l2-clk.h>45#include <media/v4l2-clk.h>
46#include <media/msp3400.h>46#include <media/drv-intf/msp3400.h>
47#include <media/tuner.h>47#include <media/tuner.h>
48 48
49#define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \49#define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \
@@ -438,7 +438,7 @@ static inline void finish_buffer(struct em28xx *dev, · 388 unmodified lines
438 buf->vb.field = V4L2_FIELD_NONE;438 buf->vb.field = V4L2_FIELD_NONE;
439 else439 else
440 buf->vb.field = V4L2_FIELD_INTERLACED;440 buf->vb.field = V4L2_FIELD_INTERLACED;
441 v4l2_get_timestamp(&buf->vb.timestamp);441 buf->vb.vb2_buf.timestamp = ktime_get_ns();
442 442
443 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);443 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
444}444}
@@ -871,30 +871,19 @@ static void res_free(struct em28xx *dev, enum v4l2_buf_type f_type) · 426 unmodified lines
871 Videobuf2 operations871 Videobuf2 operations
872 ------------------------------------------------------------------*/872 ------------------------------------------------------------------*/
873 873
874static int queue_setup(struct vb2_queue *vq, const void *parg,874static int queue_setup(struct vb2_queue *vq,
875 unsigned int *nbuffers, unsigned int *nplanes,875 unsigned int *nbuffers, unsigned int *nplanes,
876 unsigned int sizes[], void *alloc_ctxs[])876 unsigned int sizes[], void *alloc_ctxs[])
877{877{
878 const struct v4l2_format *fmt = parg;
879 struct em28xx *dev = vb2_get_drv_priv(vq);878 struct em28xx *dev = vb2_get_drv_priv(vq);
880 struct em28xx_v4l2 *v4l2 = dev->v4l2;879 struct em28xx_v4l2 *v4l2 = dev->v4l2;
881 unsigned long size;880 unsigned long size =
882
883 if (fmt)
884 size = fmt->fmt.pix.sizeimage;
885 else
886 size =
887 (v4l2->width * v4l2->height * v4l2->format->depth + 7) >> 3;881 (v4l2->width * v4l2->height * v4l2->format->depth + 7) >> 3;
888 882
889 if (size == 0)883 if (*nplanes)
890 return -EINVAL;884 return sizes[0] < size ? -EINVAL : 0;
891
892 if (0 == *nbuffers)
893 *nbuffers = 32;
894
895 *nplanes = 1;885 *nplanes = 1;
896 sizes[0] = size;886 sizes[0] = size;
897
898 return 0;887 return 0;
899}888}
900 889
drivers/media/usb/em28xx/em28xx.h+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
40#include <media/v4l2-device.h>40#include <media/v4l2-device.h>
41#include <media/v4l2-ctrls.h>41#include <media/v4l2-ctrls.h>
42#include <media/v4l2-fh.h>42#include <media/v4l2-fh.h>
43#include <media/ir-kbd-i2c.h>43#include <media/i2c/ir-kbd-i2c.h>
44#include <media/rc-core.h>44#include <media/rc-core.h>
45#include "tuner-xc2028.h"45#include "tuner-xc2028.h"
46#include "xc5000.h"46#include "xc5000.h"
drivers/media/usb/go7007/go7007-driver.c+1−1
@@ -466,7 +466,7 @@ static struct go7007_buffer *frame_boundary(struct go7007 *go, struct go7007_buf · 465 unmodified lines
466 else466 else
467 go7007_set_motion_regions(go, vb, 0);467 go7007_set_motion_regions(go, vb, 0);
468 468
469 v4l2_get_timestamp(&vb->vb.timestamp);469 vb->vb.vb2_buf.timestamp = ktime_get_ns();
470 vb_tmp = vb;470 vb_tmp = vb;
471 spin_lock(&go->spinlock);471 spin_lock(&go->spinlock);
472 list_del(&vb->list);472 list_del(&vb->list);
drivers/media/usb/go7007/go7007-usb.c+3−3
@@ -23,9 +23,9 @@ · 22 unmodified lines
23#include <linux/usb.h>23#include <linux/usb.h>
24#include <linux/i2c.h>24#include <linux/i2c.h>
25#include <asm/byteorder.h>25#include <asm/byteorder.h>
26#include <media/saa7115.h>26#include <media/i2c/saa7115.h>
27#include <media/tuner.h>27#include <media/tuner.h>
28#include <media/uda1342.h>28#include <media/i2c/uda1342.h>
29 29
30#include "go7007-priv.h"30#include "go7007-priv.h"
31 31
@@ -1289,7 +1289,7 @@ static int go7007_usb_probe(struct usb_interface *intf, · 1257 unmodified lines
1289 1289
1290 /* Allocate the URBs and buffers for receiving the audio stream */1290 /* Allocate the URBs and buffers for receiving the audio stream */
1291 if ((board->flags & GO7007_USB_EZUSB) &&1291 if ((board->flags & GO7007_USB_EZUSB) &&
1292 (board->flags & GO7007_BOARD_HAS_AUDIO)) {1292 (board->main_info.flags & GO7007_BOARD_HAS_AUDIO)) {
1293 for (i = 0; i < 8; ++i) {1293 for (i = 0; i < 8; ++i) {
1294 usb->audio_urbs[i] = usb_alloc_urb(0, GFP_KERNEL);1294 usb->audio_urbs[i] = usb_alloc_urb(0, GFP_KERNEL);
1295 if (usb->audio_urbs[i] == NULL)1295 if (usb->audio_urbs[i] == NULL)
drivers/media/usb/go7007/go7007-v4l2.c+1−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <media/v4l2-subdev.h>30#include <media/v4l2-subdev.h>
31#include <media/v4l2-event.h>31#include <media/v4l2-event.h>
32#include <media/videobuf2-vmalloc.h>32#include <media/videobuf2-vmalloc.h>
33#include <media/saa7115.h>33#include <media/i2c/saa7115.h>
34 34
35#include "go7007-priv.h"35#include "go7007-priv.h"
36 36
@@ -369,7 +369,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, · 332 unmodified lines
369}369}
370 370
371static int go7007_queue_setup(struct vb2_queue *q,371static int go7007_queue_setup(struct vb2_queue *q,
372 const void *parg,
373 unsigned int *num_buffers, unsigned int *num_planes,372 unsigned int *num_buffers, unsigned int *num_planes,
374 unsigned int sizes[], void *alloc_ctxs[])373 unsigned int sizes[], void *alloc_ctxs[])
375{374{
drivers/media/usb/gspca/ov534.c+7−2
@@ -1491,8 +1491,13 @@ static void sd_set_streamparm(struct gspca_dev *gspca_dev, · 1490 unmodified lines
1491 struct v4l2_fract *tpf = &cp->timeperframe;1491 struct v4l2_fract *tpf = &cp->timeperframe;
1492 struct sd *sd = (struct sd *) gspca_dev;1492 struct sd *sd = (struct sd *) gspca_dev;
1493 1493
1494 /* Set requested framerate */1494 if (tpf->numerator == 0 || tpf->denominator == 0)
1495 sd->frame_rate = tpf->denominator / tpf->numerator;1495 /* Set default framerate */
1496 sd->frame_rate = 30;
1497 else
1498 /* Set requested framerate */
1499 sd->frame_rate = tpf->denominator / tpf->numerator;
1500
1496 if (gspca_dev->streaming)1501 if (gspca_dev->streaming)
1497 set_frame_rate(gspca_dev);1502 set_frame_rate(gspca_dev);
1498 1503
drivers/media/usb/gspca/topro.c+5−1
@@ -4802,7 +4802,11 @@ static void sd_set_streamparm(struct gspca_dev *gspca_dev, · 4801 unmodified lines
4802 struct v4l2_fract *tpf = &cp->timeperframe;4802 struct v4l2_fract *tpf = &cp->timeperframe;
4803 int fr, i;4803 int fr, i;
4804 4804
4805 sd->framerate = tpf->denominator / tpf->numerator;4805 if (tpf->numerator == 0 || tpf->denominator == 0)
4806 sd->framerate = 30;
4807 else
4808 sd->framerate = tpf->denominator / tpf->numerator;
4809
4806 if (gspca_dev->streaming)4810 if (gspca_dev->streaming)
4807 setframerate(gspca_dev, v4l2_ctrl_g_ctrl(gspca_dev->exposure));4811 setframerate(gspca_dev, v4l2_ctrl_g_ctrl(gspca_dev->exposure));
4808 4812
drivers/media/usb/hackrf/hackrf.c+3−3
@@ -526,7 +526,7 @@ static void hackrf_urb_complete_in(struct urb *urb) · 525 unmodified lines
526 urb->transfer_buffer, len);526 urb->transfer_buffer, len);
527 vb2_set_plane_payload(&buffer->vb.vb2_buf, 0, len);527 vb2_set_plane_payload(&buffer->vb.vb2_buf, 0, len);
528 buffer->vb.sequence = dev->sequence++;528 buffer->vb.sequence = dev->sequence++;
529 v4l2_get_timestamp(&buffer->vb.timestamp);529 buffer->vb.vb2_buf.timestamp = ktime_get_ns();
530 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE);530 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE);
531exit_usb_submit_urb:531exit_usb_submit_urb:
532 usb_submit_urb(urb, GFP_ATOMIC);532 usb_submit_urb(urb, GFP_ATOMIC);
@@ -571,7 +571,7 @@ static void hackrf_urb_complete_out(struct urb *urb) · 38 unmodified lines
571 vb2_plane_vaddr(&buffer->vb.vb2_buf, 0), len);571 vb2_plane_vaddr(&buffer->vb.vb2_buf, 0), len);
572 urb->actual_length = len;572 urb->actual_length = len;
573 buffer->vb.sequence = dev->sequence++;573 buffer->vb.sequence = dev->sequence++;
574 v4l2_get_timestamp(&buffer->vb.timestamp);574 buffer->vb.vb2_buf.timestamp = ktime_get_ns();
575 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE);575 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE);
576exit_usb_submit_urb:576exit_usb_submit_urb:
577 usb_submit_urb(urb, GFP_ATOMIC);577 usb_submit_urb(urb, GFP_ATOMIC);
@@ -759,7 +759,7 @@ static void hackrf_return_all_buffers(struct vb2_queue *vq, · 181 unmodified lines
759}759}
760 760
761static int hackrf_queue_setup(struct vb2_queue *vq,761static int hackrf_queue_setup(struct vb2_queue *vq,
762 const void *parg, unsigned int *nbuffers,762 unsigned int *nbuffers,
763 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])763 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
764{764{
765 struct hackrf_dev *dev = vb2_get_drv_priv(vq);765 struct hackrf_dev *dev = vb2_get_drv_priv(vq);
drivers/media/usb/hdpvr/hdpvr-video.c+1−1
@@ -642,7 +642,7 @@ static int vidioc_s_dv_timings(struct file *file, void *_fh, · 641 unmodified lines
642 if (dev->status != STATUS_IDLE)642 if (dev->status != STATUS_IDLE)
643 return -EBUSY;643 return -EBUSY;
644 for (i = 0; i < ARRAY_SIZE(hdpvr_dv_timings); i++)644 for (i = 0; i < ARRAY_SIZE(hdpvr_dv_timings); i++)
645 if (v4l2_match_dv_timings(timings, hdpvr_dv_timings + i, 0))645 if (v4l2_match_dv_timings(timings, hdpvr_dv_timings + i, 0, false))
646 break;646 break;
647 if (i == ARRAY_SIZE(hdpvr_dv_timings))647 if (i == ARRAY_SIZE(hdpvr_dv_timings))
648 return -EINVAL;648 return -EINVAL;
drivers/media/usb/hdpvr/hdpvr.h+1−1
@@ -17,7 +17,7 @@ · 16 unmodified lines
17 17
18#include <media/v4l2-device.h>18#include <media/v4l2-device.h>
19#include <media/v4l2-ctrls.h>19#include <media/v4l2-ctrls.h>
20#include <media/ir-kbd-i2c.h>20#include <media/i2c/ir-kbd-i2c.h>
21 21
22#define HDPVR_MAX 822#define HDPVR_MAX 8
23#define HDPVR_I2C_MAX_SIZE 12823#define HDPVR_I2C_MAX_SIZE 128
drivers/media/usb/msi2500/msi2500.c+0−1
@@ -616,7 +616,6 @@ static int msi2500_querycap(struct file *file, void *fh, · 615 unmodified lines
616 616
617/* Videobuf2 operations */617/* Videobuf2 operations */
618static int msi2500_queue_setup(struct vb2_queue *vq,618static int msi2500_queue_setup(struct vb2_queue *vq,
619 const void *parg,
620 unsigned int *nbuffers,619 unsigned int *nbuffers,
621 unsigned int *nplanes, unsigned int sizes[],620 unsigned int *nplanes, unsigned int sizes[],
622 void *alloc_ctxs[])621 void *alloc_ctxs[])
drivers/media/usb/pvrusb2/pvrusb2-audio.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
23#include "pvrusb2-hdw-internal.h"23#include "pvrusb2-hdw-internal.h"
24#include "pvrusb2-debug.h"24#include "pvrusb2-debug.h"
25#include <linux/videodev2.h>25#include <linux/videodev2.h>
26#include <media/msp3400.h>26#include <media/drv-intf/msp3400.h>
27#include <media/v4l2-common.h>27#include <media/v4l2-common.h>
28 28
29 29
drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
32 32
33#include "pvrusb2-hdw-internal.h"33#include "pvrusb2-hdw-internal.h"
34#include "pvrusb2-debug.h"34#include "pvrusb2-debug.h"
35#include <media/cx25840.h>35#include <media/drv-intf/cx25840.h>
36#include <linux/videodev2.h>36#include <linux/videodev2.h>
37#include <media/v4l2-common.h>37#include <media/v4l2-common.h>
38#include <linux/errno.h>38#include <linux/errno.h>
drivers/media/usb/pvrusb2/pvrusb2-hdw-internal.h+2−2
@@ -39,8 +39,8 @@ · 38 unmodified lines
39#include "pvrusb2-hdw.h"39#include "pvrusb2-hdw.h"
40#include "pvrusb2-io.h"40#include "pvrusb2-io.h"
41#include <media/v4l2-device.h>41#include <media/v4l2-device.h>
42#include <media/cx2341x.h>42#include <media/drv-intf/cx2341x.h>
43#include <media/ir-kbd-i2c.h>43#include <media/i2c/ir-kbd-i2c.h>
44#include "pvrusb2-devattr.h"44#include "pvrusb2-devattr.h"
45 45
46/* Legal values for PVR2_CID_HSM */46/* Legal values for PVR2_CID_HSM */
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
20 20
21#include <linux/i2c.h>21#include <linux/i2c.h>
22#include <linux/module.h>22#include <linux/module.h>
23#include <media/ir-kbd-i2c.h>23#include <media/i2c/ir-kbd-i2c.h>
24#include "pvrusb2-i2c-core.h"24#include "pvrusb2-i2c-core.h"
25#include "pvrusb2-hdw-internal.h"25#include "pvrusb2-hdw-internal.h"
26#include "pvrusb2-debug.h"26#include "pvrusb2-debug.h"
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c+14−2
@@ -628,6 +628,7 @@ static int pvr2_g_ext_ctrls(struct file *file, void *priv, · 627 unmodified lines
628 struct pvr2_v4l2_fh *fh = file->private_data;628 struct pvr2_v4l2_fh *fh = file->private_data;
629 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;629 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
630 struct v4l2_ext_control *ctrl;630 struct v4l2_ext_control *ctrl;
631 struct pvr2_ctrl *cptr;
631 unsigned int idx;632 unsigned int idx;
632 int val;633 int val;
633 int ret;634 int ret;
@@ -635,8 +636,15 @@ static int pvr2_g_ext_ctrls(struct file *file, void *priv, · 1 unmodified line
635 ret = 0;636 ret = 0;
636 for (idx = 0; idx < ctls->count; idx++) {637 for (idx = 0; idx < ctls->count; idx++) {
637 ctrl = ctls->controls + idx;638 ctrl = ctls->controls + idx;
638 ret = pvr2_ctrl_get_value(639 cptr = pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id);
639 pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id), &val);640 if (cptr) {
641 if (ctls->which == V4L2_CTRL_WHICH_DEF_VAL)
642 pvr2_ctrl_get_def(cptr, &val);
643 else
644 ret = pvr2_ctrl_get_value(cptr, &val);
645 } else
646 ret = -EINVAL;
647
640 if (ret) {648 if (ret) {
641 ctls->error_idx = idx;649 ctls->error_idx = idx;
642 return ret;650 return ret;
@@ -658,6 +666,10 @@ static int pvr2_s_ext_ctrls(struct file *file, void *priv, · 15 unmodified lines
658 unsigned int idx;666 unsigned int idx;
659 int ret;667 int ret;
660 668
669 /* Default value cannot be changed */
670 if (ctls->which == V4L2_CTRL_WHICH_DEF_VAL)
671 return -EINVAL;
672
661 ret = 0;673 ret = 0;
662 for (idx = 0; idx < ctls->count; idx++) {674 for (idx = 0; idx < ctls->count; idx++) {
663 ctrl = ctls->controls + idx;675 ctrl = ctls->controls + idx;
drivers/media/usb/pvrusb2/pvrusb2-video-v4l.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
35#include "pvrusb2-debug.h"35#include "pvrusb2-debug.h"
36#include <linux/videodev2.h>36#include <linux/videodev2.h>
37#include <media/v4l2-common.h>37#include <media/v4l2-common.h>
38#include <media/saa7115.h>38#include <media/i2c/saa7115.h>
39#include <linux/errno.h>39#include <linux/errno.h>
40 40
41struct routing_scheme {41struct routing_scheme {
drivers/media/usb/pwc/pwc-if.c+2−3
@@ -316,8 +316,7 @@ static void pwc_isoc_handler(struct urb *urb) · 315 unmodified lines
316 struct pwc_frame_buf *fbuf = pdev->fill_buf;316 struct pwc_frame_buf *fbuf = pdev->fill_buf;
317 317
318 if (pdev->vsync == 1) {318 if (pdev->vsync == 1) {
319 v4l2_get_timestamp(319 fbuf->vb.vb2_buf.timestamp = ktime_get_ns();
320 &fbuf->vb.timestamp);
321 pdev->vsync = 2;320 pdev->vsync = 2;
322 }321 }
323 322
@@ -571,7 +570,7 @@ static void pwc_video_release(struct v4l2_device *v) · 247 unmodified lines
571/***************************************************************************/570/***************************************************************************/
572/* Videobuf2 operations */571/* Videobuf2 operations */
573 572
574static int queue_setup(struct vb2_queue *vq, const void *parg,573static int queue_setup(struct vb2_queue *vq,
575 unsigned int *nbuffers, unsigned int *nplanes,574 unsigned int *nbuffers, unsigned int *nplanes,
576 unsigned int sizes[], void *alloc_ctxs[])575 unsigned int sizes[], void *alloc_ctxs[])
577{576{
drivers/media/usb/s2255/s2255drv.c+2−2
@@ -574,7 +574,7 @@ static void s2255_got_frame(struct s2255_vc *vc, int jpgsize) · 573 unmodified lines
574 buf = list_entry(vc->buf_list.next,574 buf = list_entry(vc->buf_list.next,
575 struct s2255_buffer, list);575 struct s2255_buffer, list);
576 list_del(&buf->list);576 list_del(&buf->list);
577 v4l2_get_timestamp(&buf->vb.timestamp);577 buf->vb.vb2_buf.timestamp = ktime_get_ns();
578 buf->vb.field = vc->field;578 buf->vb.field = vc->field;
579 buf->vb.sequence = vc->frame_count;579 buf->vb.sequence = vc->frame_count;
580 spin_unlock_irqrestore(&vc->qlock, flags);580 spin_unlock_irqrestore(&vc->qlock, flags);
@@ -660,7 +660,7 @@ static void s2255_fillbuff(struct s2255_vc *vc, · 79 unmodified lines
660 Videobuf operations660 Videobuf operations
661 ------------------------------------------------------------------*/661 ------------------------------------------------------------------*/
662 662
663static int queue_setup(struct vb2_queue *vq, const void *parg,663static int queue_setup(struct vb2_queue *vq,
664 unsigned int *nbuffers, unsigned int *nplanes,664 unsigned int *nbuffers, unsigned int *nplanes,
665 unsigned int sizes[], void *alloc_ctxs[])665 unsigned int sizes[], void *alloc_ctxs[])
666{666{
drivers/media/usb/stk1160/stk1160-core.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
34#include <linux/usb.h>34#include <linux/usb.h>
35#include <linux/mm.h>35#include <linux/mm.h>
36#include <linux/vmalloc.h>36#include <linux/vmalloc.h>
37#include <media/saa7115.h>37#include <media/i2c/saa7115.h>
38 38
39#include "stk1160.h"39#include "stk1160.h"
40#include "stk1160-reg.h"40#include "stk1160-reg.h"
drivers/media/usb/stk1160/stk1160-v4l.c+2−2
@@ -33,7 +33,7 @@ · 32 unmodified lines
33#include <media/v4l2-event.h>33#include <media/v4l2-event.h>
34#include <media/videobuf2-vmalloc.h>34#include <media/videobuf2-vmalloc.h>
35 35
36#include <media/saa7115.h>36#include <media/i2c/saa7115.h>
37 37
38#include "stk1160.h"38#include "stk1160.h"
39#include "stk1160-reg.h"39#include "stk1160-reg.h"
@@ -664,7 +664,7 @@ static const struct v4l2_ioctl_ops stk1160_ioctl_ops = { · 624 unmodified lines
664/*664/*
665 * Videobuf2 operations665 * Videobuf2 operations
666 */666 */
667static int queue_setup(struct vb2_queue *vq, const void *parg,667static int queue_setup(struct vb2_queue *vq,
668 unsigned int *nbuffers, unsigned int *nplanes,668 unsigned int *nbuffers, unsigned int *nplanes,
669 unsigned int sizes[], void *alloc_ctxs[])669 unsigned int sizes[], void *alloc_ctxs[])
670{670{
drivers/media/usb/stk1160/stk1160-video.c+1−1
@@ -99,7 +99,7 @@ void stk1160_buffer_done(struct stk1160 *dev) · 98 unmodified lines
99 buf->vb.sequence = dev->sequence++;99 buf->vb.sequence = dev->sequence++;
100 buf->vb.field = V4L2_FIELD_INTERLACED;100 buf->vb.field = V4L2_FIELD_INTERLACED;
101 buf->vb.vb2_buf.planes[0].bytesused = buf->bytesused;101 buf->vb.vb2_buf.planes[0].bytesused = buf->bytesused;
102 v4l2_get_timestamp(&buf->vb.timestamp);102 buf->vb.vb2_buf.timestamp = ktime_get_ns();
103 103
104 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->bytesused);104 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->bytesused);
105 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);105 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
drivers/media/usb/tm6000/tm6000-cards.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include <linux/slab.h>26#include <linux/slab.h>
27#include <media/v4l2-common.h>27#include <media/v4l2-common.h>
28#include <media/tuner.h>28#include <media/tuner.h>
29#include <media/tvaudio.h>29#include <media/i2c/tvaudio.h>
30#include <media/i2c-addr.h>30#include <media/i2c-addr.h>
31#include <media/rc-map.h>31#include <media/rc-map.h>
32 32
drivers/media/usb/ttusb-dec/ttusb_dec.c+1−1
@@ -1606,7 +1606,7 @@ static int fe_send_command(struct dvb_frontend* fe, const u8 command, · 1605 unmodified lines
1606 return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);1606 return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1607}1607}
1608 1608
1609static struct ttusbdecfe_config fe_config = {1609static const struct ttusbdecfe_config fe_config = {
1610 .send_command = fe_send_command1610 .send_command = fe_send_command
1611};1611};
1612 1612
drivers/media/usb/usbtv/usbtv-video.c+5−6
@@ -322,7 +322,7 @@ static void usbtv_image_chunk(struct usbtv *usbtv, __be32 *chunk) · 321 unmodified lines
322 322
323 buf->vb.field = V4L2_FIELD_INTERLACED;323 buf->vb.field = V4L2_FIELD_INTERLACED;
324 buf->vb.sequence = usbtv->sequence++;324 buf->vb.sequence = usbtv->sequence++;
325 v4l2_get_timestamp(&buf->vb.timestamp);325 buf->vb.vb2_buf.timestamp = ktime_get_ns();
326 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, size);326 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, size);
327 vb2_buffer_done(&buf->vb.vb2_buf, state);327 vb2_buffer_done(&buf->vb.vb2_buf, state);
328 list_del(&buf->list);328 list_del(&buf->list);
@@ -599,19 +599,18 @@ static struct v4l2_file_operations usbtv_fops = { · 270 unmodified lines
599};599};
600 600
601static int usbtv_queue_setup(struct vb2_queue *vq,601static int usbtv_queue_setup(struct vb2_queue *vq,
602 const void *parg, unsigned int *nbuffers,602 unsigned int *nbuffers,
603 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])603 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
604{604{
605 const struct v4l2_format *fmt = parg;
606 struct usbtv *usbtv = vb2_get_drv_priv(vq);605 struct usbtv *usbtv = vb2_get_drv_priv(vq);
607 unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32);606 unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32);
608 607
609 if (vq->num_buffers + *nbuffers < 2)608 if (vq->num_buffers + *nbuffers < 2)
610 *nbuffers = 2 - vq->num_buffers;609 *nbuffers = 2 - vq->num_buffers;
610 if (*nplanes)
611 return sizes[0] < size ? -EINVAL : 0;
611 *nplanes = 1;612 *nplanes = 1;
612 if (fmt && fmt->fmt.pix.sizeimage < size)613 sizes[0] = size;
613 return -EINVAL;
614 sizes[0] = fmt ? fmt->fmt.pix.sizeimage : size;
615 614
616 return 0;615 return 0;
617}616}
drivers/media/usb/usbvision/usbvision-core.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
37#include <linux/videodev2.h>37#include <linux/videodev2.h>
38#include <linux/i2c.h>38#include <linux/i2c.h>
39 39
40#include <media/saa7115.h>40#include <media/i2c/saa7115.h>
41#include <media/v4l2-common.h>41#include <media/v4l2-common.h>
42#include <media/tuner.h>42#include <media/tuner.h>
43 43
drivers/media/usb/usbvision/usbvision-video.c+23−2
@@ -59,7 +59,7 @@ · 58 unmodified lines
59#include <linux/videodev2.h>59#include <linux/videodev2.h>
60#include <linux/i2c.h>60#include <linux/i2c.h>
61 61
62#include <media/saa7115.h>62#include <media/i2c/saa7115.h>
63#include <media/v4l2-common.h>63#include <media/v4l2-common.h>
64#include <media/v4l2-ioctl.h>64#include <media/v4l2-ioctl.h>
65#include <media/v4l2-event.h>65#include <media/v4l2-event.h>
@@ -1461,11 +1461,32 @@ static int usbvision_probe(struct usb_interface *intf, · 1395 unmodified lines
1461 printk(KERN_INFO "%s: %s found\n", __func__,1461 printk(KERN_INFO "%s: %s found\n", __func__,
1462 usbvision_device_data[model].model_string);1462 usbvision_device_data[model].model_string);
1463 1463
1464 /*
1465 * this is a security check.
1466 * an exploit using an incorrect bInterfaceNumber is known
1467 */
1468 if (ifnum >= USB_MAXINTERFACES || !dev->actconfig->interface[ifnum])
1469 return -ENODEV;
1470
1464 if (usbvision_device_data[model].interface >= 0)1471 if (usbvision_device_data[model].interface >= 0)
1465 interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];1472 interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
1466 else1473 else if (ifnum < dev->actconfig->desc.bNumInterfaces)
1467 interface = &dev->actconfig->interface[ifnum]->altsetting[0];1474 interface = &dev->actconfig->interface[ifnum]->altsetting[0];
1475 else {
1476 dev_err(&intf->dev, "interface %d is invalid, max is %d\n",
1477 ifnum, dev->actconfig->desc.bNumInterfaces - 1);
1478 ret = -ENODEV;
1479 goto err_usb;
1480 }
1481
1482 if (interface->desc.bNumEndpoints < 2) {
1483 dev_err(&intf->dev, "interface %d has %d endpoints, but must"
1484 " have minimum 2\n", ifnum, interface->desc.bNumEndpoints);
1485 ret = -ENODEV;
1486 goto err_usb;
1487 }
1468 endpoint = &interface->endpoint[1].desc;1488 endpoint = &interface->endpoint[1].desc;
1489
1469 if (!usb_endpoint_xfer_isoc(endpoint)) {1490 if (!usb_endpoint_xfer_isoc(endpoint)) {
1470 dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",1491 dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
1471 __func__, ifnum);1492 __func__, ifnum);
drivers/media/usb/uvc/uvc_ctrl.c+2−1
@@ -227,7 +227,8 @@ static struct uvc_control_info uvc_ctrls[] = { · 226 unmodified lines
227 .size = 4,227 .size = 4,
228 .flags = UVC_CTRL_FLAG_SET_CUR228 .flags = UVC_CTRL_FLAG_SET_CUR
229 | UVC_CTRL_FLAG_GET_RANGE229 | UVC_CTRL_FLAG_GET_RANGE
230 | UVC_CTRL_FLAG_RESTORE,230 | UVC_CTRL_FLAG_RESTORE
231 | UVC_CTRL_FLAG_AUTO_UPDATE,
231 },232 },
232 {233 {
233 .entity = UVC_GUID_UVC_CAMERA,234 .entity = UVC_GUID_UVC_CAMERA,
drivers/media/usb/uvc/uvc_driver.c+2−1
@@ -2540,7 +2540,8 @@ static struct usb_device_id uvc_ids[] = { · 2539 unmodified lines
2540 .bInterfaceProtocol = 0,2540 .bInterfaceProtocol = 0,
2541 .driver_info = UVC_QUIRK_FORCE_Y8 },2541 .driver_info = UVC_QUIRK_FORCE_Y8 },
2542 /* Generic USB Video Class */2542 /* Generic USB Video Class */
2543 { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, 0) },2543 { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_UNDEFINED) },
2544 { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15) },
2544 {}2545 {}
2545};2546};
2546 2547
drivers/media/usb/uvc/uvc_queue.c+5−9
@@ -69,23 +69,19 @@ static void uvc_queue_return_buffers(struct uvc_video_queue *queue, · 68 unmodified lines
69 * videobuf2 queue operations69 * videobuf2 queue operations
70 */70 */
71 71
72static int uvc_queue_setup(struct vb2_queue *vq, const void *parg,72static int uvc_queue_setup(struct vb2_queue *vq,
73 unsigned int *nbuffers, unsigned int *nplanes,73 unsigned int *nbuffers, unsigned int *nplanes,
74 unsigned int sizes[], void *alloc_ctxs[])74 unsigned int sizes[], void *alloc_ctxs[])
75{75{
76 const struct v4l2_format *fmt = parg;
77 struct uvc_video_queue *queue = vb2_get_drv_priv(vq);76 struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
78 struct uvc_streaming *stream = uvc_queue_to_stream(queue);77 struct uvc_streaming *stream = uvc_queue_to_stream(queue);
78 unsigned size = stream->ctrl.dwMaxVideoFrameSize;
79 79
80 /* Make sure the image size is large enough. */80 /* Make sure the image size is large enough. */
81 if (fmt && fmt->fmt.pix.sizeimage < stream->ctrl.dwMaxVideoFrameSize)81 if (*nplanes)
82 return -EINVAL;82 return sizes[0] < size ? -EINVAL : 0;
83
84 *nplanes = 1;83 *nplanes = 1;
85 84 sizes[0] = size;
86 sizes[0] = fmt ? fmt->fmt.pix.sizeimage
87 : stream->ctrl.dwMaxVideoFrameSize;
88
89 return 0;85 return 0;
90}86}
91 87
drivers/media/usb/uvc/uvc_v4l2.c+20−0
@@ -983,6 +983,22 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file, void *fh, · 982 unmodified lines
983 unsigned int i;983 unsigned int i;
984 int ret;984 int ret;
985 985
986 if (ctrls->which == V4L2_CTRL_WHICH_DEF_VAL) {
987 for (i = 0; i < ctrls->count; ++ctrl, ++i) {
988 struct v4l2_queryctrl qc = { .id = ctrl->id };
989
990 ret = uvc_query_v4l2_ctrl(chain, &qc);
991 if (ret < 0) {
992 ctrls->error_idx = i;
993 return ret;
994 }
995
996 ctrl->value = qc.default_value;
997 }
998
999 return 0;
1000 }
1001
986 ret = uvc_ctrl_begin(chain);1002 ret = uvc_ctrl_begin(chain);
987 if (ret < 0)1003 if (ret < 0)
988 return ret;1004 return ret;
@@ -1010,6 +1026,10 @@ static int uvc_ioctl_s_try_ext_ctrls(struct uvc_fh *handle, · 21 unmodified lines
1010 unsigned int i;1026 unsigned int i;
1011 int ret;1027 int ret;
1012 1028
1029 /* Default value cannot be changed */
1030 if (ctrls->which == V4L2_CTRL_WHICH_DEF_VAL)
1031 return -EINVAL;
1032
1013 ret = uvc_ctrl_begin(chain);1033 ret = uvc_ctrl_begin(chain);
1014 if (ret < 0)1034 if (ret < 0)
1015 return ret;1035 return ret;
drivers/media/usb/uvc/uvc_video.c+6−11
@@ -694,22 +694,19 @@ void uvc_video_clock_update(struct uvc_streaming *stream, · 693 unmodified lines
694 ts.tv_nsec -= NSEC_PER_SEC;694 ts.tv_nsec -= NSEC_PER_SEC;
695 }695 }
696 696
697 uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %lu.%06lu "697 uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %llu "
698 "buf ts %lu.%06lu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n",698 "buf ts %llu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n",
699 stream->dev->name,699 stream->dev->name,
700 sof >> 16, div_u64(((u64)sof & 0xffff) * 1000000LLU, 65536),700 sof >> 16, div_u64(((u64)sof & 0xffff) * 1000000LLU, 65536),
701 y, ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC,701 y, timespec_to_ns(&ts), vbuf->vb2_buf.timestamp,
702 vbuf->timestamp.tv_sec,
703 (unsigned long)vbuf->timestamp.tv_usec,
704 x1, first->host_sof, first->dev_sof,702 x1, first->host_sof, first->dev_sof,
705 x2, last->host_sof, last->dev_sof, y1, y2);703 x2, last->host_sof, last->dev_sof, y1, y2);
706 704
707 /* Update the V4L2 buffer. */705 /* Update the V4L2 buffer. */
708 vbuf->timestamp.tv_sec = ts.tv_sec;706 vbuf->vb2_buf.timestamp = timespec_to_ns(&ts);
709 vbuf->timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
710 707
711done:708done:
712 spin_unlock_irqrestore(&stream->clock.lock, flags);709 spin_unlock_irqrestore(&clock->lock, flags);
713}710}
714 711
715/* ------------------------------------------------------------------------712/* ------------------------------------------------------------------------
@@ -1034,9 +1031,7 @@ static int uvc_video_decode_start(struct uvc_streaming *stream, · 318 unmodified lines
1034 1031
1035 buf->buf.field = V4L2_FIELD_NONE;1032 buf->buf.field = V4L2_FIELD_NONE;
1036 buf->buf.sequence = stream->sequence;1033 buf->buf.sequence = stream->sequence;
1037 buf->buf.timestamp.tv_sec = ts.tv_sec;1034 buf->buf.vb2_buf.timestamp = timespec_to_ns(&ts);
1038 buf->buf.timestamp.tv_usec =
1039 ts.tv_nsec / NSEC_PER_USEC;
1040 1035
1041 /* TODO: Handle PTS and SCR. */1036 /* TODO: Handle PTS and SCR. */
1042 buf->state = UVC_BUF_STATE_ACTIVE;1037 buf->state = UVC_BUF_STATE_ACTIVE;
drivers/media/v4l2-core/v4l2-clk.c+9−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
15#include <linux/list.h>15#include <linux/list.h>
16#include <linux/module.h>16#include <linux/module.h>
17#include <linux/mutex.h>17#include <linux/mutex.h>
18#include <linux/of.h>
18#include <linux/slab.h>19#include <linux/slab.h>
19#include <linux/string.h>20#include <linux/string.h>
20 21
@@ -39,6 +40,7 @@ struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) · 18 unmodified lines
39{40{
40 struct v4l2_clk *clk;41 struct v4l2_clk *clk;
41 struct clk *ccf_clk = clk_get(dev, id);42 struct clk *ccf_clk = clk_get(dev, id);
43 char clk_name[V4L2_CLK_NAME_SIZE];
42 44
43 if (PTR_ERR(ccf_clk) == -EPROBE_DEFER)45 if (PTR_ERR(ccf_clk) == -EPROBE_DEFER)
44 return ERR_PTR(-EPROBE_DEFER);46 return ERR_PTR(-EPROBE_DEFER);
@@ -57,6 +59,13 @@ struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) · 12 unmodified lines
57 mutex_lock(&clk_lock);59 mutex_lock(&clk_lock);
58 clk = v4l2_clk_find(dev_name(dev));60 clk = v4l2_clk_find(dev_name(dev));
59 61
62 /* if dev_name is not found, try use the OF name to find again */
63 if (PTR_ERR(clk) == -ENODEV && dev->of_node) {
64 v4l2_clk_name_of(clk_name, sizeof(clk_name),
65 of_node_full_name(dev->of_node));
66 clk = v4l2_clk_find(clk_name);
67 }
68
60 if (!IS_ERR(clk))69 if (!IS_ERR(clk))
61 atomic_inc(&clk->use_count);70 atomic_inc(&clk->use_count);
62 mutex_unlock(&clk_lock);71 mutex_unlock(&clk_lock);
drivers/media/v4l2-core/v4l2-compat-ioctl32.c+3−3
@@ -630,7 +630,7 @@ static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input32 __ · 629 unmodified lines
630}630}
631 631
632struct v4l2_ext_controls32 {632struct v4l2_ext_controls32 {
633 __u32 ctrl_class;633 __u32 which;
634 __u32 count;634 __u32 count;
635 __u32 error_idx;635 __u32 error_idx;
636 __u32 reserved[2];636 __u32 reserved[2];
@@ -673,7 +673,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext · 36 unmodified lines
673 compat_caddr_t p;673 compat_caddr_t p;
674 674
675 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_ext_controls32)) ||675 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_ext_controls32)) ||
676 get_user(kp->ctrl_class, &up->ctrl_class) ||676 get_user(kp->which, &up->which) ||
677 get_user(kp->count, &up->count) ||677 get_user(kp->count, &up->count) ||
678 get_user(kp->error_idx, &up->error_idx) ||678 get_user(kp->error_idx, &up->error_idx) ||
679 copy_from_user(kp->reserved, up->reserved,679 copy_from_user(kp->reserved, up->reserved,
@@ -723,7 +723,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext · 43 unmodified lines
723 compat_caddr_t p;723 compat_caddr_t p;
724 724
725 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_ext_controls32)) ||725 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_ext_controls32)) ||
726 put_user(kp->ctrl_class, &up->ctrl_class) ||726 put_user(kp->which, &up->which) ||
727 put_user(kp->count, &up->count) ||727 put_user(kp->count, &up->count) ||
728 put_user(kp->error_idx, &up->error_idx) ||728 put_user(kp->error_idx, &up->error_idx) ||
729 copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved)))729 copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved)))
drivers/media/v4l2-core/v4l2-ctrls.c+53−24
@@ -1491,6 +1491,17 @@ static int new_to_user(struct v4l2_ext_control *c, · 1490 unmodified lines
1491 return ptr_to_user(c, ctrl, ctrl->p_new);1491 return ptr_to_user(c, ctrl, ctrl->p_new);
1492}1492}
1493 1493
1494/* Helper function: copy the initial control value back to the caller */
1495static int def_to_user(struct v4l2_ext_control *c, struct v4l2_ctrl *ctrl)
1496{
1497 int idx;
1498
1499 for (idx = 0; idx < ctrl->elems; idx++)
1500 ctrl->type_ops->init(ctrl, idx, ctrl->p_new);
1501
1502 return ptr_to_user(c, ctrl, ctrl->p_new);
1503}
1504
1494/* Helper function: copy the caller-provider value to the given control value */1505/* Helper function: copy the caller-provider value to the given control value */
1495static int user_to_ptr(struct v4l2_ext_control *c,1506static int user_to_ptr(struct v4l2_ext_control *c,
1496 struct v4l2_ctrl *ctrl,1507 struct v4l2_ctrl *ctrl,
@@ -1762,7 +1773,7 @@ static struct v4l2_ctrl_ref *find_private_ref( · 265 unmodified lines
1762 list_for_each_entry(ref, &hdl->ctrl_refs, node) {1773 list_for_each_entry(ref, &hdl->ctrl_refs, node) {
1763 /* Search for private user controls that are compatible with1774 /* Search for private user controls that are compatible with
1764 VIDIOC_G/S_CTRL. */1775 VIDIOC_G/S_CTRL. */
1765 if (V4L2_CTRL_ID2CLASS(ref->ctrl->id) == V4L2_CTRL_CLASS_USER &&1776 if (V4L2_CTRL_ID2WHICH(ref->ctrl->id) == V4L2_CTRL_CLASS_USER &&
1766 V4L2_CTRL_DRIVER_PRIV(ref->ctrl->id)) {1777 V4L2_CTRL_DRIVER_PRIV(ref->ctrl->id)) {
1767 if (!ref->ctrl->is_int)1778 if (!ref->ctrl->is_int)
1768 continue;1779 continue;
@@ -1831,7 +1842,7 @@ static int handler_new_ref(struct v4l2_ctrl_handler *hdl, · 62 unmodified lines
1831 struct v4l2_ctrl_ref *ref;1842 struct v4l2_ctrl_ref *ref;
1832 struct v4l2_ctrl_ref *new_ref;1843 struct v4l2_ctrl_ref *new_ref;
1833 u32 id = ctrl->id;1844 u32 id = ctrl->id;
1834 u32 class_ctrl = V4L2_CTRL_ID2CLASS(id) | 1;1845 u32 class_ctrl = V4L2_CTRL_ID2WHICH(id) | 1;
1835 int bucket = id % hdl->nr_of_buckets; /* which bucket to use */1846 int bucket = id % hdl->nr_of_buckets; /* which bucket to use */
1836 1847
1837 /*1848 /*
@@ -2253,9 +2264,9 @@ EXPORT_SYMBOL(v4l2_ctrl_add_handler); · 415 unmodified lines
2253 2264
2254bool v4l2_ctrl_radio_filter(const struct v4l2_ctrl *ctrl)2265bool v4l2_ctrl_radio_filter(const struct v4l2_ctrl *ctrl)
2255{2266{
2256 if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_FM_TX)2267 if (V4L2_CTRL_ID2WHICH(ctrl->id) == V4L2_CTRL_CLASS_FM_TX)
2257 return true;2268 return true;
2258 if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_FM_RX)2269 if (V4L2_CTRL_ID2WHICH(ctrl->id) == V4L2_CTRL_CLASS_FM_RX)
2259 return true;2270 return true;
2260 switch (ctrl->id) {2271 switch (ctrl->id) {
2261 case V4L2_CID_AUDIO_MUTE:2272 case V4L2_CID_AUDIO_MUTE:
@@ -2710,7 +2721,9 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler *hdl, · 448 unmodified lines
2710 2721
2711 cs->error_idx = i;2722 cs->error_idx = i;
2712 2723
2713 if (cs->ctrl_class && V4L2_CTRL_ID2CLASS(id) != cs->ctrl_class)2724 if (cs->which &&
2725 cs->which != V4L2_CTRL_WHICH_DEF_VAL &&
2726 V4L2_CTRL_ID2WHICH(id) != cs->which)
2714 return -EINVAL;2727 return -EINVAL;
2715 2728
2716 /* Old-style private controls are not allowed for2729 /* Old-style private controls are not allowed for
@@ -2787,11 +2800,11 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler *hdl, · 70 unmodified lines
2787/* Handles the corner case where cs->count == 0. It checks whether the2800/* Handles the corner case where cs->count == 0. It checks whether the
2788 specified control class exists. If that class ID is 0, then it checks2801 specified control class exists. If that class ID is 0, then it checks
2789 whether there are any controls at all. */2802 whether there are any controls at all. */
2790static int class_check(struct v4l2_ctrl_handler *hdl, u32 ctrl_class)2803static int class_check(struct v4l2_ctrl_handler *hdl, u32 which)
2791{2804{
2792 if (ctrl_class == 0)2805 if (which == 0 || which == V4L2_CTRL_WHICH_DEF_VAL)
2793 return list_empty(&hdl->ctrl_refs) ? -EINVAL : 0;2806 return list_empty(&hdl->ctrl_refs) ? -EINVAL : 0;
2794 return find_ref_lock(hdl, ctrl_class | 1) ? 0 : -EINVAL;2807 return find_ref_lock(hdl, which | 1) ? 0 : -EINVAL;
2795}2808}
2796 2809
2797 2810
@@ -2803,15 +2816,18 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs · 5 unmodified lines
2803 struct v4l2_ctrl_helper *helpers = helper;2816 struct v4l2_ctrl_helper *helpers = helper;
2804 int ret;2817 int ret;
2805 int i, j;2818 int i, j;
2819 bool def_value;
2820
2821 def_value = (cs->which == V4L2_CTRL_WHICH_DEF_VAL);
2806 2822
2807 cs->error_idx = cs->count;2823 cs->error_idx = cs->count;
2808 cs->ctrl_class = V4L2_CTRL_ID2CLASS(cs->ctrl_class);2824 cs->which = V4L2_CTRL_ID2WHICH(cs->which);
2809 2825
2810 if (hdl == NULL)2826 if (hdl == NULL)
2811 return -EINVAL;2827 return -EINVAL;
2812 2828
2813 if (cs->count == 0)2829 if (cs->count == 0)
2814 return class_check(hdl, cs->ctrl_class);2830 return class_check(hdl, cs->which);
2815 2831
2816 if (cs->count > ARRAY_SIZE(helper)) {2832 if (cs->count > ARRAY_SIZE(helper)) {
2817 helpers = kmalloc_array(cs->count, sizeof(helper[0]),2833 helpers = kmalloc_array(cs->count, sizeof(helper[0]),
@@ -2829,9 +2845,11 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs · 11 unmodified lines
2829 2845
2830 for (i = 0; !ret && i < cs->count; i++) {2846 for (i = 0; !ret && i < cs->count; i++) {
2831 int (*ctrl_to_user)(struct v4l2_ext_control *c,2847 int (*ctrl_to_user)(struct v4l2_ext_control *c,
2832 struct v4l2_ctrl *ctrl) = cur_to_user;2848 struct v4l2_ctrl *ctrl);
2833 struct v4l2_ctrl *master;2849 struct v4l2_ctrl *master;
2834 2850
2851 ctrl_to_user = def_value ? def_to_user : cur_to_user;
2852
2835 if (helpers[i].mref == NULL)2853 if (helpers[i].mref == NULL)
2836 continue;2854 continue;
2837 2855
@@ -2841,8 +2859,9 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs · 3 unmodified lines
2841 v4l2_ctrl_lock(master);2859 v4l2_ctrl_lock(master);
2842 2860
2843 /* g_volatile_ctrl will update the new control values */2861 /* g_volatile_ctrl will update the new control values */
2844 if ((master->flags & V4L2_CTRL_FLAG_VOLATILE) ||2862 if (!def_value &&
2845 (master->has_volatiles && !is_cur_manual(master))) {2863 ((master->flags & V4L2_CTRL_FLAG_VOLATILE) ||
2864 (master->has_volatiles && !is_cur_manual(master)))) {
2846 for (j = 0; j < master->ncontrols; j++)2865 for (j = 0; j < master->ncontrols; j++)
2847 cur_to_new(master->cluster[j]);2866 cur_to_new(master->cluster[j]);
2848 ret = call_op(master, g_volatile_ctrl);2867 ret = call_op(master, g_volatile_ctrl);
@@ -3064,13 +3083,18 @@ static int try_set_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, · 215 unmodified lines
3064 int ret;3083 int ret;
3065 3084
3066 cs->error_idx = cs->count;3085 cs->error_idx = cs->count;
3067 cs->ctrl_class = V4L2_CTRL_ID2CLASS(cs->ctrl_class);3086
3087 /* Default value cannot be changed */
3088 if (cs->which == V4L2_CTRL_WHICH_DEF_VAL)
3089 return -EINVAL;
3090
3091 cs->which = V4L2_CTRL_ID2WHICH(cs->which);
3068 3092
3069 if (hdl == NULL)3093 if (hdl == NULL)
3070 return -EINVAL;3094 return -EINVAL;
3071 3095
3072 if (cs->count == 0)3096 if (cs->count == 0)
3073 return class_check(hdl, cs->ctrl_class);3097 return class_check(hdl, cs->which);
3074 3098
3075 if (cs->count > ARRAY_SIZE(helper)) {3099 if (cs->count > ARRAY_SIZE(helper)) {
3076 helpers = kmalloc_array(cs->count, sizeof(helper[0]),3100 helpers = kmalloc_array(cs->count, sizeof(helper[0]),
@@ -3300,7 +3324,8 @@ EXPORT_SYMBOL(v4l2_ctrl_notify); · 223 unmodified lines
3300int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,3324int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
3301 s64 min, s64 max, u64 step, s64 def)3325 s64 min, s64 max, u64 step, s64 def)
3302{3326{
3303 bool changed;3327 bool value_changed;
3328 bool range_changed = false;
3304 int ret;3329 int ret;
3305 3330
3306 lockdep_assert_held(ctrl->handler->lock);3331 lockdep_assert_held(ctrl->handler->lock);
@@ -3324,10 +3349,14 @@ int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, · 17 unmodified lines
3324 default:3349 default:
3325 return -EINVAL;3350 return -EINVAL;
3326 }3351 }
3327 ctrl->minimum = min;3352 if ((ctrl->minimum != min) || (ctrl->maximum != max) ||
3328 ctrl->maximum = max;3353 (ctrl->step != step) || ctrl->default_value != def) {
3329 ctrl->step = step;3354 range_changed = true;
3330 ctrl->default_value = def;3355 ctrl->minimum = min;
3356 ctrl->maximum = max;
3357 ctrl->step = step;
3358 ctrl->default_value = def;
3359 }
3331 cur_to_new(ctrl);3360 cur_to_new(ctrl);
3332 if (validate_new(ctrl, ctrl->p_new)) {3361 if (validate_new(ctrl, ctrl->p_new)) {
3333 if (ctrl->type == V4L2_CTRL_TYPE_INTEGER64)3362 if (ctrl->type == V4L2_CTRL_TYPE_INTEGER64)
@@ -3337,12 +3366,12 @@ int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, · 3 unmodified lines
3337 }3366 }
3338 3367
3339 if (ctrl->type == V4L2_CTRL_TYPE_INTEGER64)3368 if (ctrl->type == V4L2_CTRL_TYPE_INTEGER64)
3340 changed = *ctrl->p_new.p_s64 != *ctrl->p_cur.p_s64;3369 value_changed = *ctrl->p_new.p_s64 != *ctrl->p_cur.p_s64;
3341 else3370 else
3342 changed = *ctrl->p_new.p_s32 != *ctrl->p_cur.p_s32;3371 value_changed = *ctrl->p_new.p_s32 != *ctrl->p_cur.p_s32;
3343 if (changed)3372 if (value_changed)
3344 ret = set_ctrl(NULL, ctrl, V4L2_EVENT_CTRL_CH_RANGE);3373 ret = set_ctrl(NULL, ctrl, V4L2_EVENT_CTRL_CH_RANGE);
3345 else3374 else if (range_changed)
3346 send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_RANGE);3375 send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_RANGE);
3347 return ret;3376 return ret;
3348}3377}
drivers/media/v4l2-core/v4l2-device.c+15−6
@@ -118,11 +118,20 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) · 117 unmodified lines
118 if (sd->flags & V4L2_SUBDEV_FL_IS_I2C) {118 if (sd->flags & V4L2_SUBDEV_FL_IS_I2C) {
119 struct i2c_client *client = v4l2_get_subdevdata(sd);119 struct i2c_client *client = v4l2_get_subdevdata(sd);
120 120
121 /* We need to unregister the i2c client explicitly.121 /*
122 We cannot rely on i2c_del_adapter to always122 * We need to unregister the i2c client
123 unregister clients for us, since if the i2c bus123 * explicitly. We cannot rely on
124 is a platform bus, then it is never deleted. */124 * i2c_del_adapter to always unregister
125 if (client)125 * clients for us, since if the i2c bus is a
126 * platform bus, then it is never deleted.
127 *
128 * Device tree or ACPI based devices must not
129 * be unregistered as they have not been
130 * registered by us, and would not be
131 * re-created by just probing the V4L2 driver.
132 */
133 if (client &&
134 !client->dev.of_node && !client->dev.fwnode)
126 i2c_unregister_device(client);135 i2c_unregister_device(client);
127 continue;136 continue;
128 }137 }
@@ -131,7 +140,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) · 2 unmodified lines
131 if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) {140 if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) {
132 struct spi_device *spi = v4l2_get_subdevdata(sd);141 struct spi_device *spi = v4l2_get_subdevdata(sd);
133 142
134 if (spi)143 if (spi && !spi->dev.of_node && !spi->dev.fwnode)
135 spi_unregister_device(spi);144 spi_unregister_device(spi);
136 continue;145 continue;
137 }146 }
drivers/media/v4l2-core/v4l2-dv-timings.c+14−2
@@ -209,8 +209,13 @@ bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *t, · 208 unmodified lines
209 if (v4l2_valid_dv_timings(v4l2_dv_timings_presets + i, cap,209 if (v4l2_valid_dv_timings(v4l2_dv_timings_presets + i, cap,
210 fnc, fnc_handle) &&210 fnc, fnc_handle) &&
211 v4l2_match_dv_timings(t, v4l2_dv_timings_presets + i,211 v4l2_match_dv_timings(t, v4l2_dv_timings_presets + i,
212 pclock_delta)) {212 pclock_delta, false)) {
213 u32 flags = t->bt.flags & V4L2_DV_FL_REDUCED_FPS;
214
213 *t = v4l2_dv_timings_presets[i];215 *t = v4l2_dv_timings_presets[i];
216 if (can_reduce_fps(&t->bt))
217 t->bt.flags |= flags;
218
214 return true;219 return true;
215 }220 }
216 }221 }
@@ -223,12 +228,14 @@ EXPORT_SYMBOL_GPL(v4l2_find_dv_timings_cap); · 6 unmodified lines
223 * @t1 - compare this v4l2_dv_timings struct...228 * @t1 - compare this v4l2_dv_timings struct...
224 * @t2 - with this struct.229 * @t2 - with this struct.
225 * @pclock_delta - the allowed pixelclock deviation.230 * @pclock_delta - the allowed pixelclock deviation.
231 * @match_reduced_fps - if true, then fail if V4L2_DV_FL_REDUCED_FPS does not
232 * match.
226 *233 *
227 * Compare t1 with t2 with a given margin of error for the pixelclock.234 * Compare t1 with t2 with a given margin of error for the pixelclock.
228 */235 */
229bool v4l2_match_dv_timings(const struct v4l2_dv_timings *t1,236bool v4l2_match_dv_timings(const struct v4l2_dv_timings *t1,
230 const struct v4l2_dv_timings *t2,237 const struct v4l2_dv_timings *t2,
231 unsigned pclock_delta)238 unsigned pclock_delta, bool match_reduced_fps)
232{239{
233 if (t1->type != t2->type || t1->type != V4L2_DV_BT_656_1120)240 if (t1->type != t2->type || t1->type != V4L2_DV_BT_656_1120)
234 return false;241 return false;
@@ -239,9 +246,14 @@ bool v4l2_match_dv_timings(const struct v4l2_dv_timings *t1, · 4 unmodified lines
239 t1->bt.pixelclock >= t2->bt.pixelclock - pclock_delta &&246 t1->bt.pixelclock >= t2->bt.pixelclock - pclock_delta &&
240 t1->bt.pixelclock <= t2->bt.pixelclock + pclock_delta &&247 t1->bt.pixelclock <= t2->bt.pixelclock + pclock_delta &&
241 t1->bt.hfrontporch == t2->bt.hfrontporch &&248 t1->bt.hfrontporch == t2->bt.hfrontporch &&
249 t1->bt.hsync == t2->bt.hsync &&
250 t1->bt.hbackporch == t2->bt.hbackporch &&
242 t1->bt.vfrontporch == t2->bt.vfrontporch &&251 t1->bt.vfrontporch == t2->bt.vfrontporch &&
243 t1->bt.vsync == t2->bt.vsync &&252 t1->bt.vsync == t2->bt.vsync &&
244 t1->bt.vbackporch == t2->bt.vbackporch &&253 t1->bt.vbackporch == t2->bt.vbackporch &&
254 (!match_reduced_fps ||
255 (t1->bt.flags & V4L2_DV_FL_REDUCED_FPS) ==
256 (t2->bt.flags & V4L2_DV_FL_REDUCED_FPS)) &&
245 (!t1->bt.interlaced ||257 (!t1->bt.interlaced ||
246 (t1->bt.il_vfrontporch == t2->bt.il_vfrontporch &&258 (t1->bt.il_vfrontporch == t2->bt.il_vfrontporch &&
247 t1->bt.il_vsync == t2->bt.il_vsync &&259 t1->bt.il_vsync == t2->bt.il_vsync &&
drivers/media/v4l2-core/v4l2-ioctl.c+7−7
@@ -565,8 +565,8 @@ static void v4l_print_ext_controls(const void *arg, bool write_only) · 564 unmodified lines
565 const struct v4l2_ext_controls *p = arg;565 const struct v4l2_ext_controls *p = arg;
566 int i;566 int i;
567 567
568 pr_cont("class=0x%x, count=%d, error_idx=%d",568 pr_cont("which=0x%x, count=%d, error_idx=%d",
569 p->ctrl_class, p->count, p->error_idx);569 p->which, p->count, p->error_idx);
570 for (i = 0; i < p->count; i++) {570 for (i = 0; i < p->count; i++) {
571 if (!p->controls[i].size)571 if (!p->controls[i].size)
572 pr_cont(", id/val=0x%x/0x%x",572 pr_cont(", id/val=0x%x/0x%x",
@@ -902,13 +902,13 @@ static int check_ext_ctrls(struct v4l2_ext_controls *c, int allow_priv) · 329 unmodified lines
902 Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL902 Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL
903 is it allowed for backwards compatibility.903 is it allowed for backwards compatibility.
904 */904 */
905 if (!allow_priv && c->ctrl_class == V4L2_CID_PRIVATE_BASE)905 if (!allow_priv && c->which == V4L2_CID_PRIVATE_BASE)
906 return 0;906 return 0;
907 if (c->ctrl_class == 0)907 if (!c->which)
908 return 1;908 return 1;
909 /* Check that all controls are from the same control class. */909 /* Check that all controls are from the same control class. */
910 for (i = 0; i < c->count; i++) {910 for (i = 0; i < c->count; i++) {
911 if (V4L2_CTRL_ID2CLASS(c->controls[i].id) != c->ctrl_class) {911 if (V4L2_CTRL_ID2WHICH(c->controls[i].id) != c->which) {
912 c->error_idx = i;912 c->error_idx = i;
913 return 0;913 return 0;
914 }914 }
@@ -1969,7 +1969,7 @@ static int v4l_g_ctrl(const struct v4l2_ioctl_ops *ops, · 1054 unmodified lines
1969 if (ops->vidioc_g_ext_ctrls == NULL)1969 if (ops->vidioc_g_ext_ctrls == NULL)
1970 return -ENOTTY;1970 return -ENOTTY;
1971 1971
1972 ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id);1972 ctrls.which = V4L2_CTRL_ID2WHICH(p->id);
1973 ctrls.count = 1;1973 ctrls.count = 1;
1974 ctrls.controls = &ctrl;1974 ctrls.controls = &ctrl;
1975 ctrl.id = p->id;1975 ctrl.id = p->id;
@@ -2003,7 +2003,7 @@ static int v4l_s_ctrl(const struct v4l2_ioctl_ops *ops, · 27 unmodified lines
2003 if (ops->vidioc_s_ext_ctrls == NULL)2003 if (ops->vidioc_s_ext_ctrls == NULL)
2004 return -ENOTTY;2004 return -ENOTTY;
2005 2005
2006 ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id);2006 ctrls.which = V4L2_CTRL_ID2WHICH(p->id);
2007 ctrls.count = 1;2007 ctrls.count = 1;
2008 ctrls.controls = &ctrl;2008 ctrls.controls = &ctrl;
2009 ctrl.id = p->id;2009 ctrl.id = p->id;
drivers/media/v4l2-core/videobuf2-core.c+836−90
@@ -28,11 +28,161 @@ · 27 unmodified lines
28 28
29#include <trace/events/vb2.h>29#include <trace/events/vb2.h>
30 30
31#include "videobuf2-internal.h"31static int debug;
32module_param(debug, int, 0644);
32 33
33int vb2_debug;34#define dprintk(level, fmt, arg...) \
34EXPORT_SYMBOL_GPL(vb2_debug);35 do { \
35module_param_named(debug, vb2_debug, int, 0644);36 if (debug >= level) \
37 pr_info("vb2-core: %s: " fmt, __func__, ## arg); \
38 } while (0)
39
40#ifdef CONFIG_VIDEO_ADV_DEBUG
41
42/*
43 * If advanced debugging is on, then count how often each op is called
44 * successfully, which can either be per-buffer or per-queue.
45 *
46 * This makes it easy to check that the 'init' and 'cleanup'
47 * (and variations thereof) stay balanced.
48 */
49
50#define log_memop(vb, op) \
51 dprintk(2, "call_memop(%p, %d, %s)%s\n", \
52 (vb)->vb2_queue, (vb)->index, #op, \
53 (vb)->vb2_queue->mem_ops->op ? "" : " (nop)")
54
55#define call_memop(vb, op, args...) \
56({ \
57 struct vb2_queue *_q = (vb)->vb2_queue; \
58 int err; \
59 \
60 log_memop(vb, op); \
61 err = _q->mem_ops->op ? _q->mem_ops->op(args) : 0; \
62 if (!err) \
63 (vb)->cnt_mem_ ## op++; \
64 err; \
65})
66
67#define call_ptr_memop(vb, op, args...) \
68({ \
69 struct vb2_queue *_q = (vb)->vb2_queue; \
70 void *ptr; \
71 \
72 log_memop(vb, op); \
73 ptr = _q->mem_ops->op ? _q->mem_ops->op(args) : NULL; \
74 if (!IS_ERR_OR_NULL(ptr)) \
75 (vb)->cnt_mem_ ## op++; \
76 ptr; \
77})
78
79#define call_void_memop(vb, op, args...) \
80({ \
81 struct vb2_queue *_q = (vb)->vb2_queue; \
82 \
83 log_memop(vb, op); \
84 if (_q->mem_ops->op) \
85 _q->mem_ops->op(args); \
86 (vb)->cnt_mem_ ## op++; \
87})
88
89#define log_qop(q, op) \
90 dprintk(2, "call_qop(%p, %s)%s\n", q, #op, \
91 (q)->ops->op ? "" : " (nop)")
92
93#define call_qop(q, op, args...) \
94({ \
95 int err; \
96 \
97 log_qop(q, op); \
98 err = (q)->ops->op ? (q)->ops->op(args) : 0; \
99 if (!err) \
100 (q)->cnt_ ## op++; \
101 err; \
102})
103
104#define call_void_qop(q, op, args...) \
105({ \
106 log_qop(q, op); \
107 if ((q)->ops->op) \
108 (q)->ops->op(args); \
109 (q)->cnt_ ## op++; \
110})
111
112#define log_vb_qop(vb, op, args...) \
113 dprintk(2, "call_vb_qop(%p, %d, %s)%s\n", \
114 (vb)->vb2_queue, (vb)->index, #op, \
115 (vb)->vb2_queue->ops->op ? "" : " (nop)")
116
117#define call_vb_qop(vb, op, args...) \
118({ \
119 int err; \
120 \
121 log_vb_qop(vb, op); \
122 err = (vb)->vb2_queue->ops->op ? \
123 (vb)->vb2_queue->ops->op(args) : 0; \
124 if (!err) \
125 (vb)->cnt_ ## op++; \
126 err; \
127})
128
129#define call_void_vb_qop(vb, op, args...) \
130({ \
131 log_vb_qop(vb, op); \
132 if ((vb)->vb2_queue->ops->op) \
133 (vb)->vb2_queue->ops->op(args); \
134 (vb)->cnt_ ## op++; \
135})
136
137#else
138
139#define call_memop(vb, op, args...) \
140 ((vb)->vb2_queue->mem_ops->op ? \
141 (vb)->vb2_queue->mem_ops->op(args) : 0)
142
143#define call_ptr_memop(vb, op, args...) \
144 ((vb)->vb2_queue->mem_ops->op ? \
145 (vb)->vb2_queue->mem_ops->op(args) : NULL)
146
147#define call_void_memop(vb, op, args...) \
148 do { \
149 if ((vb)->vb2_queue->mem_ops->op) \
150 (vb)->vb2_queue->mem_ops->op(args); \
151 } while (0)
152
153#define call_qop(q, op, args...) \
154 ((q)->ops->op ? (q)->ops->op(args) : 0)
155
156#define call_void_qop(q, op, args...) \
157 do { \
158 if ((q)->ops->op) \
159 (q)->ops->op(args); \
160 } while (0)
161
162#define call_vb_qop(vb, op, args...) \
163 ((vb)->vb2_queue->ops->op ? (vb)->vb2_queue->ops->op(args) : 0)
164
165#define call_void_vb_qop(vb, op, args...) \
166 do { \
167 if ((vb)->vb2_queue->ops->op) \
168 (vb)->vb2_queue->ops->op(args); \
169 } while (0)
170
171#endif
172
173#define call_bufop(q, op, args...) \
174({ \
175 int ret = 0; \
176 if (q && q->buf_ops && q->buf_ops->op) \
177 ret = q->buf_ops->op(args); \
178 ret; \
179})
180
181#define call_void_bufop(q, op, args...) \
182({ \
183 if (q && q->buf_ops && q->buf_ops->op) \
184 q->buf_ops->op(args); \
185})
36 186
37static void __vb2_queue_cancel(struct vb2_queue *q);187static void __vb2_queue_cancel(struct vb2_queue *q);
38static void __enqueue_in_driver(struct vb2_buffer *vb);188static void __enqueue_in_driver(struct vb2_buffer *vb);
@@ -53,7 +203,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb) · 14 unmodified lines
53 * NOTE: mmapped areas should be page aligned203 * NOTE: mmapped areas should be page aligned
54 */204 */
55 for (plane = 0; plane < vb->num_planes; ++plane) {205 for (plane = 0; plane < vb->num_planes; ++plane) {
56 unsigned long size = PAGE_ALIGN(q->plane_sizes[plane]);206 unsigned long size = PAGE_ALIGN(vb->planes[plane].length);
57 207
58 mem_priv = call_ptr_memop(vb, alloc, q->alloc_ctx[plane],208 mem_priv = call_ptr_memop(vb, alloc, q->alloc_ctx[plane],
59 size, dma_dir, q->gfp_flags);209 size, dma_dir, q->gfp_flags);
@@ -62,7 +212,6 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb) · 2 unmodified lines
62 212
63 /* Associate allocator private data with this plane */213 /* Associate allocator private data with this plane */
64 vb->planes[plane].mem_priv = mem_priv;214 vb->planes[plane].mem_priv = mem_priv;
65 vb->planes[plane].length = q->plane_sizes[plane];
66 }215 }
67 216
68 return 0;217 return 0;
@@ -136,58 +285,31 @@ static void __vb2_buf_dmabuf_put(struct vb2_buffer *vb) · 67 unmodified lines
136 __vb2_plane_dmabuf_put(vb, &vb->planes[plane]);285 __vb2_plane_dmabuf_put(vb, &vb->planes[plane]);
137}286}
138 287
139/**
140 * __setup_lengths() - setup initial lengths for every plane in
141 * every buffer on the queue
142 */
143static void __setup_lengths(struct vb2_queue *q, unsigned int n)
144{
145 unsigned int buffer, plane;
146 struct vb2_buffer *vb;
147
148 for (buffer = q->num_buffers; buffer < q->num_buffers + n; ++buffer) {
149 vb = q->bufs[buffer];
150 if (!vb)
151 continue;
152
153 for (plane = 0; plane < vb->num_planes; ++plane)
154 vb->planes[plane].length = q->plane_sizes[plane];
155 }
156}
157
158/**288/**
159 * __setup_offsets() - setup unique offsets ("cookies") for every plane in289 * __setup_offsets() - setup unique offsets ("cookies") for every plane in
160 * every buffer on the queue290 * the buffer.
161 */291 */
162static void __setup_offsets(struct vb2_queue *q, unsigned int n)292static void __setup_offsets(struct vb2_buffer *vb)
163{293{
164 unsigned int buffer, plane;294 struct vb2_queue *q = vb->vb2_queue;
165 struct vb2_buffer *vb;295 unsigned int plane;
166 unsigned long off;296 unsigned long off = 0;
297
298 if (vb->index) {
299 struct vb2_buffer *prev = q->bufs[vb->index - 1];
300 struct vb2_plane *p = &prev->planes[prev->num_planes - 1];
167 301
168 if (q->num_buffers) {
169 struct vb2_plane *p;
170 vb = q->bufs[q->num_buffers - 1];
171 p = &vb->planes[vb->num_planes - 1];
172 off = PAGE_ALIGN(p->m.offset + p->length);302 off = PAGE_ALIGN(p->m.offset + p->length);
173 } else {
174 off = 0;
175 }303 }
176 304
177 for (buffer = q->num_buffers; buffer < q->num_buffers + n; ++buffer) {305 for (plane = 0; plane < vb->num_planes; ++plane) {
178 vb = q->bufs[buffer];306 vb->planes[plane].m.offset = off;
179 if (!vb)
180 continue;
181
182 for (plane = 0; plane < vb->num_planes; ++plane) {
183 vb->planes[plane].m.offset = off;
184 307
185 dprintk(3, "buffer %d, plane %d offset 0x%08lx\n",308 dprintk(3, "buffer %d, plane %d offset 0x%08lx\n",
186 buffer, plane, off);309 vb->index, plane, off);
187 310
188 off += vb->planes[plane].length;311 off += vb->planes[plane].length;
189 off = PAGE_ALIGN(off);312 off = PAGE_ALIGN(off);
190 }
191 }313 }
192}314}
193 315
@@ -199,9 +321,10 @@ static void __setup_offsets(struct vb2_queue *q, unsigned int n) · 5 unmodified lines
199 * Returns the number of buffers successfully allocated.321 * Returns the number of buffers successfully allocated.
200 */322 */
201static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory,323static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory,
202 unsigned int num_buffers, unsigned int num_planes)324 unsigned int num_buffers, unsigned int num_planes,
325 const unsigned plane_sizes[VB2_MAX_PLANES])
203{326{
204 unsigned int buffer;327 unsigned int buffer, plane;
205 struct vb2_buffer *vb;328 struct vb2_buffer *vb;
206 int ret;329 int ret;
207 330
@@ -219,6 +342,11 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory, · 11 unmodified lines
219 vb->index = q->num_buffers + buffer;342 vb->index = q->num_buffers + buffer;
220 vb->type = q->type;343 vb->type = q->type;
221 vb->memory = memory;344 vb->memory = memory;
345 for (plane = 0; plane < num_planes; ++plane) {
346 vb->planes[plane].length = plane_sizes[plane];
347 vb->planes[plane].min_length = plane_sizes[plane];
348 }
349 q->bufs[vb->index] = vb;
222 350
223 /* Allocate video buffer memory for the MMAP type */351 /* Allocate video buffer memory for the MMAP type */
224 if (memory == VB2_MEMORY_MMAP) {352 if (memory == VB2_MEMORY_MMAP) {
@@ -226,9 +354,11 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory, · 1 unmodified line
226 if (ret) {354 if (ret) {
227 dprintk(1, "failed allocating memory for "355 dprintk(1, "failed allocating memory for "
228 "buffer %d\n", buffer);356 "buffer %d\n", buffer);
357 q->bufs[vb->index] = NULL;
229 kfree(vb);358 kfree(vb);
230 break;359 break;
231 }360 }
361 __setup_offsets(vb);
232 /*362 /*
233 * Call the driver-provided buffer initialization363 * Call the driver-provided buffer initialization
234 * callback, if given. An error in initialization364 * callback, if given. An error in initialization
@@ -239,18 +369,13 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory, · 4 unmodified lines
239 dprintk(1, "buffer %d %p initialization"369 dprintk(1, "buffer %d %p initialization"
240 " failed\n", buffer, vb);370 " failed\n", buffer, vb);
241 __vb2_buf_mem_free(vb);371 __vb2_buf_mem_free(vb);
372 q->bufs[vb->index] = NULL;
242 kfree(vb);373 kfree(vb);
243 break;374 break;
244 }375 }
245 }376 }
246
247 q->bufs[q->num_buffers + buffer] = vb;
248 }377 }
249 378
250 __setup_lengths(q, buffer);
251 if (memory == VB2_MEMORY_MMAP)
252 __setup_offsets(q, buffer);
253
254 dprintk(1, "allocated %d buffers, %d plane(s) each\n",379 dprintk(1, "allocated %d buffers, %d plane(s) each\n",
255 buffer, num_planes);380 buffer, num_planes);
256 381
@@ -330,7 +455,7 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned int buffers) · 73 unmodified lines
330 bool unbalanced = q->cnt_start_streaming != q->cnt_stop_streaming ||455 bool unbalanced = q->cnt_start_streaming != q->cnt_stop_streaming ||
331 q->cnt_wait_prepare != q->cnt_wait_finish;456 q->cnt_wait_prepare != q->cnt_wait_finish;
332 457
333 if (unbalanced || vb2_debug) {458 if (unbalanced || debug) {
334 pr_info("vb2: counters for queue %p:%s\n", q,459 pr_info("vb2: counters for queue %p:%s\n", q,
335 unbalanced ? " UNBALANCED!" : "");460 unbalanced ? " UNBALANCED!" : "");
336 pr_info("vb2: setup: %u start_streaming: %u stop_streaming: %u\n",461 pr_info("vb2: setup: %u start_streaming: %u stop_streaming: %u\n",
@@ -356,7 +481,7 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned int buffers) · 19 unmodified lines
356 vb->cnt_buf_prepare != vb->cnt_buf_finish ||481 vb->cnt_buf_prepare != vb->cnt_buf_finish ||
357 vb->cnt_buf_init != vb->cnt_buf_cleanup;482 vb->cnt_buf_init != vb->cnt_buf_cleanup;
358 483
359 if (unbalanced || vb2_debug) {484 if (unbalanced || debug) {
360 pr_info("vb2: counters for queue %p, buffer %d:%s\n",485 pr_info("vb2: counters for queue %p, buffer %d:%s\n",
361 q, buffer, unbalanced ? " UNBALANCED!" : "");486 q, buffer, unbalanced ? " UNBALANCED!" : "");
362 pr_info("vb2: buf_init: %u buf_cleanup: %u buf_prepare: %u buf_finish: %u\n",487 pr_info("vb2: buf_init: %u buf_cleanup: %u buf_prepare: %u buf_finish: %u\n",
@@ -442,13 +567,10 @@ static bool __buffers_in_use(struct vb2_queue *q) · 79 unmodified lines
442 * Should be called from vidioc_querybuf ioctl handler in driver.567 * Should be called from vidioc_querybuf ioctl handler in driver.
443 * The passed buffer should have been verified.568 * The passed buffer should have been verified.
444 * This function fills the relevant information for the userspace.569 * This function fills the relevant information for the userspace.
445 *
446 * The return values from this function are intended to be directly returned
447 * from vidioc_querybuf handler in driver.
448 */570 */
449int vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb)571void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb)
450{572{
451 return call_bufop(q, fill_user_buffer, q->bufs[index], pb);573 call_void_bufop(q, fill_user_buffer, q->bufs[index], pb);
452}574}
453EXPORT_SYMBOL_GPL(vb2_core_querybuf);575EXPORT_SYMBOL_GPL(vb2_core_querybuf);
454 576
@@ -570,6 +692,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 115 unmodified lines
570 unsigned int *count)692 unsigned int *count)
571{693{
572 unsigned int num_buffers, allocated_buffers, num_planes = 0;694 unsigned int num_buffers, allocated_buffers, num_planes = 0;
695 unsigned plane_sizes[VB2_MAX_PLANES] = { };
573 int ret;696 int ret;
574 697
575 if (q->streaming) {698 if (q->streaming) {
@@ -613,7 +736,6 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 37 unmodified lines
613 */736 */
614 num_buffers = min_t(unsigned int, *count, VB2_MAX_FRAME);737 num_buffers = min_t(unsigned int, *count, VB2_MAX_FRAME);
615 num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed);738 num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed);
616 memset(q->plane_sizes, 0, sizeof(q->plane_sizes));
617 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));739 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
618 q->memory = memory;740 q->memory = memory;
619 741
@@ -621,14 +743,14 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 1 unmodified line
621 * Ask the driver how many buffers and planes per buffer it requires.743 * Ask the driver how many buffers and planes per buffer it requires.
622 * Driver also sets the size and allocator context for each plane.744 * Driver also sets the size and allocator context for each plane.
623 */745 */
624 ret = call_qop(q, queue_setup, q, NULL, &num_buffers, &num_planes,746 ret = call_qop(q, queue_setup, q, &num_buffers, &num_planes,
625 q->plane_sizes, q->alloc_ctx);747 plane_sizes, q->alloc_ctx);
626 if (ret)748 if (ret)
627 return ret;749 return ret;
628 750
629 /* Finally, allocate buffers and video memory */751 /* Finally, allocate buffers and video memory */
630 allocated_buffers =752 allocated_buffers =
631 __vb2_queue_alloc(q, memory, num_buffers, num_planes);753 __vb2_queue_alloc(q, memory, num_buffers, num_planes, plane_sizes);
632 if (allocated_buffers == 0) {754 if (allocated_buffers == 0) {
633 dprintk(1, "memory allocation failed\n");755 dprintk(1, "memory allocation failed\n");
634 return -ENOMEM;756 return -ENOMEM;
@@ -646,9 +768,16 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 11 unmodified lines
646 */768 */
647 if (!ret && allocated_buffers < num_buffers) {769 if (!ret && allocated_buffers < num_buffers) {
648 num_buffers = allocated_buffers;770 num_buffers = allocated_buffers;
771 /*
772 * num_planes is set by the previous queue_setup(), but since it
773 * signals to queue_setup() whether it is called from create_bufs()
774 * vs reqbufs() we zero it here to signal that queue_setup() is
775 * called for the reqbufs() case.
776 */
777 num_planes = 0;
649 778
650 ret = call_qop(q, queue_setup, q, NULL, &num_buffers,779 ret = call_qop(q, queue_setup, q, &num_buffers,
651 &num_planes, q->plane_sizes, q->alloc_ctx);780 &num_planes, plane_sizes, q->alloc_ctx);
652 781
653 if (!ret && allocated_buffers < num_buffers)782 if (!ret && allocated_buffers < num_buffers)
654 ret = -ENOMEM;783 ret = -ENOMEM;
@@ -701,9 +830,11 @@ EXPORT_SYMBOL_GPL(vb2_core_reqbufs); · 46 unmodified lines
701 * from vidioc_create_bufs handler in driver.830 * from vidioc_create_bufs handler in driver.
702 */831 */
703int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,832int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
704 unsigned int *count, const void *parg)833 unsigned int *count, unsigned requested_planes,
834 const unsigned requested_sizes[])
705{835{
706 unsigned int num_planes = 0, num_buffers, allocated_buffers;836 unsigned int num_planes = 0, num_buffers, allocated_buffers;
837 unsigned plane_sizes[VB2_MAX_PLANES] = { };
707 int ret;838 int ret;
708 839
709 if (q->num_buffers == VB2_MAX_FRAME) {840 if (q->num_buffers == VB2_MAX_FRAME) {
@@ -712,7 +843,6 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory, · 2 unmodified lines
712 }843 }
713 844
714 if (!q->num_buffers) {845 if (!q->num_buffers) {
715 memset(q->plane_sizes, 0, sizeof(q->plane_sizes));
716 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));846 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
717 q->memory = memory;847 q->memory = memory;
718 q->waiting_for_buffers = !q->is_output;848 q->waiting_for_buffers = !q->is_output;
@@ -720,18 +850,23 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory, · 1 unmodified line
720 850
721 num_buffers = min(*count, VB2_MAX_FRAME - q->num_buffers);851 num_buffers = min(*count, VB2_MAX_FRAME - q->num_buffers);
722 852
853 if (requested_planes && requested_sizes) {
854 num_planes = requested_planes;
855 memcpy(plane_sizes, requested_sizes, sizeof(plane_sizes));
856 }
857
723 /*858 /*
724 * Ask the driver, whether the requested number of buffers, planes per859 * Ask the driver, whether the requested number of buffers, planes per
725 * buffer and their sizes are acceptable860 * buffer and their sizes are acceptable
726 */861 */
727 ret = call_qop(q, queue_setup, q, parg, &num_buffers,862 ret = call_qop(q, queue_setup, q, &num_buffers,
728 &num_planes, q->plane_sizes, q->alloc_ctx);863 &num_planes, plane_sizes, q->alloc_ctx);
729 if (ret)864 if (ret)
730 return ret;865 return ret;
731 866
732 /* Finally, allocate buffers and video memory */867 /* Finally, allocate buffers and video memory */
733 allocated_buffers = __vb2_queue_alloc(q, memory, num_buffers,868 allocated_buffers = __vb2_queue_alloc(q, memory, num_buffers,
734 num_planes);869 num_planes, plane_sizes);
735 if (allocated_buffers == 0) {870 if (allocated_buffers == 0) {
736 dprintk(1, "memory allocation failed\n");871 dprintk(1, "memory allocation failed\n");
737 return -ENOMEM;872 return -ENOMEM;
@@ -747,8 +882,8 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory, · 9 unmodified lines
747 * q->num_buffers contains the total number of buffers, that the882 * q->num_buffers contains the total number of buffers, that the
748 * queue driver has set up883 * queue driver has set up
749 */884 */
750 ret = call_qop(q, queue_setup, q, parg, &num_buffers,885 ret = call_qop(q, queue_setup, q, &num_buffers,
751 &num_planes, q->plane_sizes, q->alloc_ctx);886 &num_planes, plane_sizes, q->alloc_ctx);
752 887
753 if (!ret && allocated_buffers < num_buffers)888 if (!ret && allocated_buffers < num_buffers)
754 ret = -ENOMEM;889 ret = -ENOMEM;
@@ -964,11 +1099,12 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb) · 209 unmodified lines
964 "reacquiring memory\n", plane);1099 "reacquiring memory\n", plane);
965 1100
966 /* Check if the provided plane buffer is large enough */1101 /* Check if the provided plane buffer is large enough */
967 if (planes[plane].length < q->plane_sizes[plane]) {1102 if (planes[plane].length < vb->planes[plane].min_length) {
968 dprintk(1, "provided buffer size %u is less than "1103 dprintk(1, "provided buffer size %u is less than "
969 "setup size %u for plane %d\n",1104 "setup size %u for plane %d\n",
970 planes[plane].length,1105 planes[plane].length,
971 q->plane_sizes[plane], plane);1106 vb->planes[plane].min_length,
1107 plane);
972 ret = -EINVAL;1108 ret = -EINVAL;
973 goto err;1109 goto err;
974 }1110 }
@@ -1081,7 +1217,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb) · 106 unmodified lines
1081 if (planes[plane].length == 0)1217 if (planes[plane].length == 0)
1082 planes[plane].length = dbuf->size;1218 planes[plane].length = dbuf->size;
1083 1219
1084 if (planes[plane].length < q->plane_sizes[plane]) {1220 if (planes[plane].length < vb->planes[plane].min_length) {
1085 dprintk(1, "invalid dmabuf length for plane %d\n",1221 dprintk(1, "invalid dmabuf length for plane %d\n",
1086 plane);1222 plane);
1087 ret = -EINVAL;1223 ret = -EINVAL;
@@ -1263,9 +1399,7 @@ int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb) · 175 unmodified lines
1263 return ret;1399 return ret;
1264 1400
1265 /* Fill buffer information for the userspace */1401 /* Fill buffer information for the userspace */
1266 ret = call_bufop(q, fill_user_buffer, vb, pb);1402 call_void_bufop(q, fill_user_buffer, vb, pb);
1267 if (ret)
1268 return ret;
1269 1403
1270 dprintk(1, "prepare of buffer %d succeeded\n", vb->index);1404 dprintk(1, "prepare of buffer %d succeeded\n", vb->index);
1271 1405
@@ -1386,7 +1520,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb) · 114 unmodified lines
1386 q->waiting_for_buffers = false;1520 q->waiting_for_buffers = false;
1387 vb->state = VB2_BUF_STATE_QUEUED;1521 vb->state = VB2_BUF_STATE_QUEUED;
1388 1522
1389 call_bufop(q, set_timestamp, vb, pb);1523 call_void_bufop(q, copy_timestamp, vb, pb);
1390 1524
1391 trace_vb2_qbuf(q, vb);1525 trace_vb2_qbuf(q, vb);
1392 1526
@@ -1398,9 +1532,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb) · 5 unmodified lines
1398 __enqueue_in_driver(vb);1532 __enqueue_in_driver(vb);
1399 1533
1400 /* Fill buffer information for the userspace */1534 /* Fill buffer information for the userspace */
1401 ret = call_bufop(q, fill_user_buffer, vb, pb);1535 call_void_bufop(q, fill_user_buffer, vb, pb);
1402 if (ret)
1403 return ret;
1404 1536
1405 /*1537 /*
1406 * If streamon has been called, and we haven't yet called1538 * If streamon has been called, and we haven't yet called
@@ -1623,9 +1755,7 @@ int vb2_core_dqbuf(struct vb2_queue *q, void *pb, bool nonblocking) · 216 unmodified lines
1623 call_void_vb_qop(vb, buf_finish, vb);1755 call_void_vb_qop(vb, buf_finish, vb);
1624 1756
1625 /* Fill buffer information for the userspace */1757 /* Fill buffer information for the userspace */
1626 ret = call_bufop(q, fill_user_buffer, vb, pb);1758 call_void_bufop(q, fill_user_buffer, vb, pb);
1627 if (ret)
1628 return ret;
1629 1759
1630 /* Remove from videobuf queue */1760 /* Remove from videobuf queue */
1631 list_del(&vb->queued_entry);1761 list_del(&vb->queued_entry);
@@ -2073,6 +2203,8 @@ int vb2_core_queue_init(struct vb2_queue *q) · 441 unmodified lines
2073}2203}
2074EXPORT_SYMBOL_GPL(vb2_core_queue_init);2204EXPORT_SYMBOL_GPL(vb2_core_queue_init);
2075 2205
2206static int __vb2_init_fileio(struct vb2_queue *q, int read);
2207static int __vb2_cleanup_fileio(struct vb2_queue *q);
2076/**2208/**
2077 * vb2_core_queue_release() - stop streaming, release the queue and free memory2209 * vb2_core_queue_release() - stop streaming, release the queue and free memory
2078 * @q: videobuf2 queue2210 * @q: videobuf2 queue
@@ -2083,6 +2215,7 @@ EXPORT_SYMBOL_GPL(vb2_core_queue_init); · 4 unmodified lines
2083 */2215 */
2084void vb2_core_queue_release(struct vb2_queue *q)2216void vb2_core_queue_release(struct vb2_queue *q)
2085{2217{
2218 __vb2_cleanup_fileio(q);
2086 __vb2_queue_cancel(q);2219 __vb2_queue_cancel(q);
2087 mutex_lock(&q->mmap_lock);2220 mutex_lock(&q->mmap_lock);
2088 __vb2_queue_free(q, q->num_buffers);2221 __vb2_queue_free(q, q->num_buffers);
@@ -2090,6 +2223,619 @@ void vb2_core_queue_release(struct vb2_queue *q) · 1 unmodified line
2090}2223}
2091EXPORT_SYMBOL_GPL(vb2_core_queue_release);2224EXPORT_SYMBOL_GPL(vb2_core_queue_release);
2092 2225
2093MODULE_DESCRIPTION("Driver helper framework for Video for Linux 2");2226/**
2227 * vb2_core_poll() - implements poll userspace operation
2228 * @q: videobuf2 queue
2229 * @file: file argument passed to the poll file operation handler
2230 * @wait: wait argument passed to the poll file operation handler
2231 *
2232 * This function implements poll file operation handler for a driver.
2233 * For CAPTURE queues, if a buffer is ready to be dequeued, the userspace will
2234 * be informed that the file descriptor of a video device is available for
2235 * reading.
2236 * For OUTPUT queues, if a buffer is ready to be dequeued, the file descriptor
2237 * will be reported as available for writing.
2238 *
2239 * The return values from this function are intended to be directly returned
2240 * from poll handler in driver.
2241 */
2242unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file,
2243 poll_table *wait)
2244{
2245 unsigned long req_events = poll_requested_events(wait);
2246 struct vb2_buffer *vb = NULL;
2247 unsigned long flags;
2248
2249 if (!q->is_output && !(req_events & (POLLIN | POLLRDNORM)))
2250 return 0;
2251 if (q->is_output && !(req_events & (POLLOUT | POLLWRNORM)))
2252 return 0;
2253
2254 /*
2255 * Start file I/O emulator only if streaming API has not been used yet.
2256 */
2257 if (q->num_buffers == 0 && !vb2_fileio_is_active(q)) {
2258 if (!q->is_output && (q->io_modes & VB2_READ) &&
2259 (req_events & (POLLIN | POLLRDNORM))) {
2260 if (__vb2_init_fileio(q, 1))
2261 return POLLERR;
2262 }
2263 if (q->is_output && (q->io_modes & VB2_WRITE) &&
2264 (req_events & (POLLOUT | POLLWRNORM))) {
2265 if (__vb2_init_fileio(q, 0))
2266 return POLLERR;
2267 /*
2268 * Write to OUTPUT queue can be done immediately.
2269 */
2270 return POLLOUT | POLLWRNORM;
2271 }
2272 }
2273
2274 /*
2275 * There is nothing to wait for if the queue isn't streaming, or if the
2276 * error flag is set.
2277 */
2278 if (!vb2_is_streaming(q) || q->error)
2279 return POLLERR;
2280
2281 /*
2282 * For output streams you can call write() as long as there are fewer
2283 * buffers queued than there are buffers available.
2284 */
2285 if (q->is_output && q->fileio && q->queued_count < q->num_buffers)
2286 return POLLOUT | POLLWRNORM;
2287
2288 if (list_empty(&q->done_list)) {
2289 /*
2290 * If the last buffer was dequeued from a capture queue,
2291 * return immediately. DQBUF will return -EPIPE.
2292 */
2293 if (q->last_buffer_dequeued)
2294 return POLLIN | POLLRDNORM;
2295
2296 poll_wait(file, &q->done_wq, wait);
2297 }
2298
2299 /*
2300 * Take first buffer available for dequeuing.
2301 */
2302 spin_lock_irqsave(&q->done_lock, flags);
2303 if (!list_empty(&q->done_list))
2304 vb = list_first_entry(&q->done_list, struct vb2_buffer,
2305 done_entry);
2306 spin_unlock_irqrestore(&q->done_lock, flags);
2307
2308 if (vb && (vb->state == VB2_BUF_STATE_DONE
2309 || vb->state == VB2_BUF_STATE_ERROR)) {
2310 return (q->is_output) ?
2311 POLLOUT | POLLWRNORM :
2312 POLLIN | POLLRDNORM;
2313 }
2314 return 0;
2315}
2316EXPORT_SYMBOL_GPL(vb2_core_poll);
2317
2318/**
2319 * struct vb2_fileio_buf - buffer context used by file io emulator
2320 *
2321 * vb2 provides a compatibility layer and emulator of file io (read and
2322 * write) calls on top of streaming API. This structure is used for
2323 * tracking context related to the buffers.
2324 */
2325struct vb2_fileio_buf {
2326 void *vaddr;
2327 unsigned int size;
2328 unsigned int pos;
2329 unsigned int queued:1;
2330};
2331
2332/**
2333 * struct vb2_fileio_data - queue context used by file io emulator
2334 *
2335 * @cur_index: the index of the buffer currently being read from or
2336 * written to. If equal to q->num_buffers then a new buffer
2337 * must be dequeued.
2338 * @initial_index: in the read() case all buffers are queued up immediately
2339 * in __vb2_init_fileio() and __vb2_perform_fileio() just cycles
2340 * buffers. However, in the write() case no buffers are initially
2341 * queued, instead whenever a buffer is full it is queued up by
2342 * __vb2_perform_fileio(). Only once all available buffers have
2343 * been queued up will __vb2_perform_fileio() start to dequeue
2344 * buffers. This means that initially __vb2_perform_fileio()
2345 * needs to know what buffer index to use when it is queuing up
2346 * the buffers for the first time. That initial index is stored
2347 * in this field. Once it is equal to q->num_buffers all
2348 * available buffers have been queued and __vb2_perform_fileio()
2349 * should start the normal dequeue/queue cycle.
2350 *
2351 * vb2 provides a compatibility layer and emulator of file io (read and
2352 * write) calls on top of streaming API. For proper operation it required
2353 * this structure to save the driver state between each call of the read
2354 * or write function.
2355 */
2356struct vb2_fileio_data {
2357 unsigned int count;
2358 unsigned int type;
2359 unsigned int memory;
2360 struct vb2_buffer *b;
2361 struct vb2_fileio_buf bufs[VB2_MAX_FRAME];
2362 unsigned int cur_index;
2363 unsigned int initial_index;
2364 unsigned int q_count;
2365 unsigned int dq_count;
2366 unsigned read_once:1;
2367 unsigned write_immediately:1;
2368};
2369
2370/**
2371 * __vb2_init_fileio() - initialize file io emulator
2372 * @q: videobuf2 queue
2373 * @read: mode selector (1 means read, 0 means write)
2374 */
2375static int __vb2_init_fileio(struct vb2_queue *q, int read)
2376{
2377 struct vb2_fileio_data *fileio;
2378 int i, ret;
2379 unsigned int count = 0;
2380
2381 /*
2382 * Sanity check
2383 */
2384 if (WARN_ON((read && !(q->io_modes & VB2_READ)) ||
2385 (!read && !(q->io_modes & VB2_WRITE))))
2386 return -EINVAL;
2387
2388 /*
2389 * Check if device supports mapping buffers to kernel virtual space.
2390 */
2391 if (!q->mem_ops->vaddr)
2392 return -EBUSY;
2393
2394 /*
2395 * Check if streaming api has not been already activated.
2396 */
2397 if (q->streaming || q->num_buffers > 0)
2398 return -EBUSY;
2399
2400 /*
2401 * Start with count 1, driver can increase it in queue_setup()
2402 */
2403 count = 1;
2404
2405 dprintk(3, "setting up file io: mode %s, count %d, read_once %d, write_immediately %d\n",
2406 (read) ? "read" : "write", count, q->fileio_read_once,
2407 q->fileio_write_immediately);
2408
2409 fileio = kzalloc(sizeof(*fileio), GFP_KERNEL);
2410 if (fileio == NULL)
2411 return -ENOMEM;
2412
2413 fileio->b = kzalloc(q->buf_struct_size, GFP_KERNEL);
2414 if (fileio->b == NULL) {
2415 kfree(fileio);
2416 return -ENOMEM;
2417 }
2418
2419 fileio->read_once = q->fileio_read_once;
2420 fileio->write_immediately = q->fileio_write_immediately;
2421
2422 /*
2423 * Request buffers and use MMAP type to force driver
2424 * to allocate buffers by itself.
2425 */
2426 fileio->count = count;
2427 fileio->memory = VB2_MEMORY_MMAP;
2428 fileio->type = q->type;
2429 q->fileio = fileio;
2430 ret = vb2_core_reqbufs(q, fileio->memory, &fileio->count);
2431 if (ret)
2432 goto err_kfree;
2433
2434 /*
2435 * Check if plane_count is correct
2436 * (multiplane buffers are not supported).
2437 */
2438 if (q->bufs[0]->num_planes != 1) {
2439 ret = -EBUSY;
2440 goto err_reqbufs;
2441 }
2442
2443 /*
2444 * Get kernel address of each buffer.
2445 */
2446 for (i = 0; i < q->num_buffers; i++) {
2447 fileio->bufs[i].vaddr = vb2_plane_vaddr(q->bufs[i], 0);
2448 if (fileio->bufs[i].vaddr == NULL) {
2449 ret = -EINVAL;
2450 goto err_reqbufs;
2451 }
2452 fileio->bufs[i].size = vb2_plane_size(q->bufs[i], 0);
2453 }
2454
2455 /*
2456 * Read mode requires pre queuing of all buffers.
2457 */
2458 if (read) {
2459 /*
2460 * Queue all buffers.
2461 */
2462 for (i = 0; i < q->num_buffers; i++) {
2463 struct vb2_buffer *b = fileio->b;
2464
2465 memset(b, 0, q->buf_struct_size);
2466 b->type = q->type;
2467 b->memory = q->memory;
2468 b->index = i;
2469 ret = vb2_core_qbuf(q, i, b);
2470 if (ret)
2471 goto err_reqbufs;
2472 fileio->bufs[i].queued = 1;
2473 }
2474 /*
2475 * All buffers have been queued, so mark that by setting
2476 * initial_index to q->num_buffers
2477 */
2478 fileio->initial_index = q->num_buffers;
2479 fileio->cur_index = q->num_buffers;
2480 }
2481
2482 /*
2483 * Start streaming.
2484 */
2485 ret = vb2_core_streamon(q, q->type);
2486 if (ret)
2487 goto err_reqbufs;
2488
2489 return ret;
2490
2491err_reqbufs:
2492 fileio->count = 0;
2493 vb2_core_reqbufs(q, fileio->memory, &fileio->count);
2494
2495err_kfree:
2496 q->fileio = NULL;
2497 kfree(fileio);
2498 return ret;
2499}
2500
2501/**
2502 * __vb2_cleanup_fileio() - free resourced used by file io emulator
2503 * @q: videobuf2 queue
2504 */
2505static int __vb2_cleanup_fileio(struct vb2_queue *q)
2506{
2507 struct vb2_fileio_data *fileio = q->fileio;
2508
2509 if (fileio) {
2510 vb2_core_streamoff(q, q->type);
2511 q->fileio = NULL;
2512 fileio->count = 0;
2513 vb2_core_reqbufs(q, fileio->memory, &fileio->count);
2514 kfree(fileio->b);
2515 kfree(fileio);
2516 dprintk(3, "file io emulator closed\n");
2517 }
2518 return 0;
2519}
2520
2521/**
2522 * __vb2_perform_fileio() - perform a single file io (read or write) operation
2523 * @q: videobuf2 queue
2524 * @data: pointed to target userspace buffer
2525 * @count: number of bytes to read or write
2526 * @ppos: file handle position tracking pointer
2527 * @nonblock: mode selector (1 means blocking calls, 0 means nonblocking)
2528 * @read: access mode selector (1 means read, 0 means write)
2529 */
2530static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_t count,
2531 loff_t *ppos, int nonblock, int read)
2532{
2533 struct vb2_fileio_data *fileio;
2534 struct vb2_fileio_buf *buf;
2535 bool is_multiplanar = q->is_multiplanar;
2536 /*
2537 * When using write() to write data to an output video node the vb2 core
2538 * should copy timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody
2539 * else is able to provide this information with the write() operation.
2540 */
2541 bool copy_timestamp = !read && q->copy_timestamp;
2542 int ret, index;
2543
2544 dprintk(3, "mode %s, offset %ld, count %zd, %sblocking\n",
2545 read ? "read" : "write", (long)*ppos, count,
2546 nonblock ? "non" : "");
2547
2548 if (!data)
2549 return -EINVAL;
2550
2551 /*
2552 * Initialize emulator on first call.
2553 */
2554 if (!vb2_fileio_is_active(q)) {
2555 ret = __vb2_init_fileio(q, read);
2556 dprintk(3, "vb2_init_fileio result: %d\n", ret);
2557 if (ret)
2558 return ret;
2559 }
2560 fileio = q->fileio;
2561
2562 /*
2563 * Check if we need to dequeue the buffer.
2564 */
2565 index = fileio->cur_index;
2566 if (index >= q->num_buffers) {
2567 struct vb2_buffer *b = fileio->b;
2568
2569 /*
2570 * Call vb2_dqbuf to get buffer back.
2571 */
2572 memset(b, 0, q->buf_struct_size);
2573 b->type = q->type;
2574 b->memory = q->memory;
2575 ret = vb2_core_dqbuf(q, b, nonblock);
2576 dprintk(5, "vb2_dqbuf result: %d\n", ret);
2577 if (ret)
2578 return ret;
2579 fileio->dq_count += 1;
2580
2581 fileio->cur_index = index = b->index;
2582 buf = &fileio->bufs[index];
2583
2584 /*
2585 * Get number of bytes filled by the driver
2586 */
2587 buf->pos = 0;
2588 buf->queued = 0;
2589 buf->size = read ? vb2_get_plane_payload(q->bufs[index], 0)
2590 : vb2_plane_size(q->bufs[index], 0);
2591 /* Compensate for data_offset on read in the multiplanar case. */
2592 if (is_multiplanar && read &&
2593 b->planes[0].data_offset < buf->size) {
2594 buf->pos = b->planes[0].data_offset;
2595 buf->size -= buf->pos;
2596 }
2597 } else {
2598 buf = &fileio->bufs[index];
2599 }
2600
2601 /*
2602 * Limit count on last few bytes of the buffer.
2603 */
2604 if (buf->pos + count > buf->size) {
2605 count = buf->size - buf->pos;
2606 dprintk(5, "reducing read count: %zd\n", count);
2607 }
2608
2609 /*
2610 * Transfer data to userspace.
2611 */
2612 dprintk(3, "copying %zd bytes - buffer %d, offset %u\n",
2613 count, index, buf->pos);
2614 if (read)
2615 ret = copy_to_user(data, buf->vaddr + buf->pos, count);
2616 else
2617 ret = copy_from_user(buf->vaddr + buf->pos, data, count);
2618 if (ret) {
2619 dprintk(3, "error copying data\n");
2620 return -EFAULT;
2621 }
2622
2623 /*
2624 * Update counters.
2625 */
2626 buf->pos += count;
2627 *ppos += count;
2628
2629 /*
2630 * Queue next buffer if required.
2631 */
2632 if (buf->pos == buf->size || (!read && fileio->write_immediately)) {
2633 struct vb2_buffer *b = fileio->b;
2634
2635 /*
2636 * Check if this is the last buffer to read.
2637 */
2638 if (read && fileio->read_once && fileio->dq_count == 1) {
2639 dprintk(3, "read limit reached\n");
2640 return __vb2_cleanup_fileio(q);
2641 }
2642
2643 /*
2644 * Call vb2_qbuf and give buffer to the driver.
2645 */
2646 memset(b, 0, q->buf_struct_size);
2647 b->type = q->type;
2648 b->memory = q->memory;
2649 b->index = index;
2650 b->planes[0].bytesused = buf->pos;
2651
2652 if (copy_timestamp)
2653 b->timestamp = ktime_get_ns();
2654 ret = vb2_core_qbuf(q, index, b);
2655 dprintk(5, "vb2_dbuf result: %d\n", ret);
2656 if (ret)
2657 return ret;
2658
2659 /*
2660 * Buffer has been queued, update the status
2661 */
2662 buf->pos = 0;
2663 buf->queued = 1;
2664 buf->size = vb2_plane_size(q->bufs[index], 0);
2665 fileio->q_count += 1;
2666 /*
2667 * If we are queuing up buffers for the first time, then
2668 * increase initial_index by one.
2669 */
2670 if (fileio->initial_index < q->num_buffers)
2671 fileio->initial_index++;
2672 /*
2673 * The next buffer to use is either a buffer that's going to be
2674 * queued for the first time (initial_index < q->num_buffers)
2675 * or it is equal to q->num_buffers, meaning that the next
2676 * time we need to dequeue a buffer since we've now queued up
2677 * all the 'first time' buffers.
2678 */
2679 fileio->cur_index = fileio->initial_index;
2680 }
2681
2682 /*
2683 * Return proper number of bytes processed.
2684 */
2685 if (ret == 0)
2686 ret = count;
2687 return ret;
2688}
2689
2690size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
2691 loff_t *ppos, int nonblocking)
2692{
2693 return __vb2_perform_fileio(q, data, count, ppos, nonblocking, 1);
2694}
2695EXPORT_SYMBOL_GPL(vb2_read);
2696
2697size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count,
2698 loff_t *ppos, int nonblocking)
2699{
2700 return __vb2_perform_fileio(q, (char __user *) data, count,
2701 ppos, nonblocking, 0);
2702}
2703EXPORT_SYMBOL_GPL(vb2_write);
2704
2705struct vb2_threadio_data {
2706 struct task_struct *thread;
2707 vb2_thread_fnc fnc;
2708 void *priv;
2709 bool stop;
2710};
2711
2712static int vb2_thread(void *data)
2713{
2714 struct vb2_queue *q = data;
2715 struct vb2_threadio_data *threadio = q->threadio;
2716 struct vb2_fileio_data *fileio = q->fileio;
2717 bool copy_timestamp = false;
2718 int prequeue = 0;
2719 int index = 0;
2720 int ret = 0;
2721
2722 if (q->is_output) {
2723 prequeue = q->num_buffers;
2724 copy_timestamp = q->copy_timestamp;
2725 }
2726
2727 set_freezable();
2728
2729 for (;;) {
2730 struct vb2_buffer *vb;
2731 struct vb2_buffer *b = fileio->b;
2732
2733 /*
2734 * Call vb2_dqbuf to get buffer back.
2735 */
2736 memset(b, 0, q->buf_struct_size);
2737 b->type = q->type;
2738 b->memory = q->memory;
2739 if (prequeue) {
2740 b->index = index++;
2741 prequeue--;
2742 } else {
2743 call_void_qop(q, wait_finish, q);
2744 if (!threadio->stop)
2745 ret = vb2_core_dqbuf(q, b, 0);
2746 call_void_qop(q, wait_prepare, q);
2747 dprintk(5, "file io: vb2_dqbuf result: %d\n", ret);
2748 }
2749 if (ret || threadio->stop)
2750 break;
2751 try_to_freeze();
2752
2753 vb = q->bufs[b->index];
2754 if (b->state == VB2_BUF_STATE_DONE)
2755 if (threadio->fnc(vb, threadio->priv))
2756 break;
2757 call_void_qop(q, wait_finish, q);
2758 if (copy_timestamp)
2759 b->timestamp = ktime_get_ns();;
2760 if (!threadio->stop)
2761 ret = vb2_core_qbuf(q, b->index, b);
2762 call_void_qop(q, wait_prepare, q);
2763 if (ret || threadio->stop)
2764 break;
2765 }
2766
2767 /* Hmm, linux becomes *very* unhappy without this ... */
2768 while (!kthread_should_stop()) {
2769 set_current_state(TASK_INTERRUPTIBLE);
2770 schedule();
2771 }
2772 return 0;
2773}
2774
2775/*
2776 * This function should not be used for anything else but the videobuf2-dvb
2777 * support. If you think you have another good use-case for this, then please
2778 * contact the linux-media mailinglist first.
2779 */
2780int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv,
2781 const char *thread_name)
2782{
2783 struct vb2_threadio_data *threadio;
2784 int ret = 0;
2785
2786 if (q->threadio)
2787 return -EBUSY;
2788 if (vb2_is_busy(q))
2789 return -EBUSY;
2790 if (WARN_ON(q->fileio))
2791 return -EBUSY;
2792
2793 threadio = kzalloc(sizeof(*threadio), GFP_KERNEL);
2794 if (threadio == NULL)
2795 return -ENOMEM;
2796 threadio->fnc = fnc;
2797 threadio->priv = priv;
2798
2799 ret = __vb2_init_fileio(q, !q->is_output);
2800 dprintk(3, "file io: vb2_init_fileio result: %d\n", ret);
2801 if (ret)
2802 goto nomem;
2803 q->threadio = threadio;
2804 threadio->thread = kthread_run(vb2_thread, q, "vb2-%s", thread_name);
2805 if (IS_ERR(threadio->thread)) {
2806 ret = PTR_ERR(threadio->thread);
2807 threadio->thread = NULL;
2808 goto nothread;
2809 }
2810 return 0;
2811
2812nothread:
2813 __vb2_cleanup_fileio(q);
2814nomem:
2815 kfree(threadio);
2816 return ret;
2817}
2818EXPORT_SYMBOL_GPL(vb2_thread_start);
2819
2820int vb2_thread_stop(struct vb2_queue *q)
2821{
2822 struct vb2_threadio_data *threadio = q->threadio;
2823 int err;
2824
2825 if (threadio == NULL)
2826 return 0;
2827 threadio->stop = true;
2828 /* Wake up all pending sleeps in the thread */
2829 vb2_queue_error(q);
2830 err = kthread_stop(threadio->thread);
2831 __vb2_cleanup_fileio(q);
2832 threadio->thread = NULL;
2833 kfree(threadio);
2834 q->threadio = NULL;
2835 return err;
2836}
2837EXPORT_SYMBOL_GPL(vb2_thread_stop);
2838
2839MODULE_DESCRIPTION("Media buffer core framework");
2094MODULE_AUTHOR("Pawel Osciak <pawel@osciak.com>, Marek Szyprowski");2840MODULE_AUTHOR("Pawel Osciak <pawel@osciak.com>, Marek Szyprowski");
2095MODULE_LICENSE("GPL");2841MODULE_LICENSE("GPL");
drivers/media/v4l2-core/videobuf2-internal.h+0−161
@@ -1,161 +0,0 @@
1#ifndef _MEDIA_VIDEOBUF2_INTERNAL_H
2#define _MEDIA_VIDEOBUF2_INTERNAL_H
3
4#include <linux/err.h>
5#include <linux/kernel.h>
6#include <linux/module.h>
7#include <media/videobuf2-core.h>
8
9extern int vb2_debug;
10
11#define dprintk(level, fmt, arg...) \
12 do { \
13 if (vb2_debug >= level) \
14 pr_info("vb2: %s: " fmt, __func__, ## arg); \
15 } while (0)
16
17#ifdef CONFIG_VIDEO_ADV_DEBUG
18
19/*
20 * If advanced debugging is on, then count how often each op is called
21 * successfully, which can either be per-buffer or per-queue.
22 *
23 * This makes it easy to check that the 'init' and 'cleanup'
24 * (and variations thereof) stay balanced.
25 */
26
27#define log_memop(vb, op) \
28 dprintk(2, "call_memop(%p, %d, %s)%s\n", \
29 (vb)->vb2_queue, (vb)->index, #op, \
30 (vb)->vb2_queue->mem_ops->op ? "" : " (nop)")
31
32#define call_memop(vb, op, args...) \
33({ \
34 struct vb2_queue *_q = (vb)->vb2_queue; \
35 int err; \
36 \
37 log_memop(vb, op); \
38 err = _q->mem_ops->op ? _q->mem_ops->op(args) : 0; \
39 if (!err) \
40 (vb)->cnt_mem_ ## op++; \
41 err; \
42})
43
44#define call_ptr_memop(vb, op, args...) \
45({ \
46 struct vb2_queue *_q = (vb)->vb2_queue; \
47 void *ptr; \
48 \
49 log_memop(vb, op); \
50 ptr = _q->mem_ops->op ? _q->mem_ops->op(args) : NULL; \
51 if (!IS_ERR_OR_NULL(ptr)) \
52 (vb)->cnt_mem_ ## op++; \
53 ptr; \
54})
55
56#define call_void_memop(vb, op, args...) \
57({ \
58 struct vb2_queue *_q = (vb)->vb2_queue; \
59 \
60 log_memop(vb, op); \
61 if (_q->mem_ops->op) \
62 _q->mem_ops->op(args); \
63 (vb)->cnt_mem_ ## op++; \
64})
65
66#define log_qop(q, op) \
67 dprintk(2, "call_qop(%p, %s)%s\n", q, #op, \
68 (q)->ops->op ? "" : " (nop)")
69
70#define call_qop(q, op, args...) \
71({ \
72 int err; \
73 \
74 log_qop(q, op); \
75 err = (q)->ops->op ? (q)->ops->op(args) : 0; \
76 if (!err) \
77 (q)->cnt_ ## op++; \
78 err; \
79})
80
81#define call_void_qop(q, op, args...) \
82({ \
83 log_qop(q, op); \
84 if ((q)->ops->op) \
85 (q)->ops->op(args); \
86 (q)->cnt_ ## op++; \
87})
88
89#define log_vb_qop(vb, op, args...) \
90 dprintk(2, "call_vb_qop(%p, %d, %s)%s\n", \
91 (vb)->vb2_queue, (vb)->index, #op, \
92 (vb)->vb2_queue->ops->op ? "" : " (nop)")
93
94#define call_vb_qop(vb, op, args...) \
95({ \
96 int err; \
97 \
98 log_vb_qop(vb, op); \
99 err = (vb)->vb2_queue->ops->op ? \
100 (vb)->vb2_queue->ops->op(args) : 0; \
101 if (!err) \
102 (vb)->cnt_ ## op++; \
103 err; \
104})
105
106#define call_void_vb_qop(vb, op, args...) \
107({ \
108 log_vb_qop(vb, op); \
109 if ((vb)->vb2_queue->ops->op) \
110 (vb)->vb2_queue->ops->op(args); \
111 (vb)->cnt_ ## op++; \
112})
113
114#else
115
116#define call_memop(vb, op, args...) \
117 ((vb)->vb2_queue->mem_ops->op ? \
118 (vb)->vb2_queue->mem_ops->op(args) : 0)
119
120#define call_ptr_memop(vb, op, args...) \
121 ((vb)->vb2_queue->mem_ops->op ? \
122 (vb)->vb2_queue->mem_ops->op(args) : NULL)
123
124#define call_void_memop(vb, op, args...) \
125 do { \
126 if ((vb)->vb2_queue->mem_ops->op) \
127 (vb)->vb2_queue->mem_ops->op(args); \
128 } while (0)
129
130#define call_qop(q, op, args...) \
131 ((q)->ops->op ? (q)->ops->op(args) : 0)
132
133#define call_void_qop(q, op, args...) \
134 do { \
135 if ((q)->ops->op) \
136 (q)->ops->op(args); \
137 } while (0)
138
139#define call_vb_qop(vb, op, args...) \
140 ((vb)->vb2_queue->ops->op ? (vb)->vb2_queue->ops->op(args) : 0)
141
142#define call_void_vb_qop(vb, op, args...) \
143 do { \
144 if ((vb)->vb2_queue->ops->op) \
145 (vb)->vb2_queue->ops->op(args); \
146 } while (0)
147
148#endif
149
150#define call_bufop(q, op, args...) \
151({ \
152 int ret = 0; \
153 if (q && q->buf_ops && q->buf_ops->op) \
154 ret = q->buf_ops->op(args); \
155 ret; \
156})
157
158bool vb2_buffer_in_use(struct vb2_queue *q, struct vb2_buffer *vb);
159int vb2_verify_memory_type(struct vb2_queue *q,
160 enum vb2_memory memory, unsigned int type);
161#endif /* _MEDIA_VIDEOBUF2_INTERNAL_H */
drivers/media/v4l2-core/videobuf2-v4l2.c+73−630
@@ -31,7 +31,14 @@ · 30 unmodified lines
31 31
32#include <media/videobuf2-v4l2.h>32#include <media/videobuf2-v4l2.h>
33 33
34#include "videobuf2-internal.h"34static int debug;
35module_param(debug, int, 0644);
36
37#define dprintk(level, fmt, arg...) \
38 do { \
39 if (debug >= level) \
40 pr_info("vb2-v4l2: %s: " fmt, __func__, ## arg); \
41 } while (0)
35 42
36/* Flags that are set by the vb2 core */43/* Flags that are set by the vb2 core */
37#define V4L2_BUFFER_MASK_FLAGS (V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED | \44#define V4L2_BUFFER_MASK_FLAGS (V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED | \
@@ -52,7 +59,7 @@ static int __verify_planes_array(struct vb2_buffer *vb, const struct v4l2_buffer · 14 unmodified lines
52 return 0;59 return 0;
53 60
54 /* Is memory for copying plane information present? */61 /* Is memory for copying plane information present? */
55 if (NULL == b->m.planes) {62 if (b->m.planes == NULL) {
56 dprintk(1, "multi-planar buffer passed but "63 dprintk(1, "multi-planar buffer passed but "
57 "planes array not provided\n");64 "planes array not provided\n");
58 return -EINVAL;65 return -EINVAL;
@@ -107,7 +114,7 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b) · 48 unmodified lines
107 return 0;114 return 0;
108}115}
109 116
110static int __set_timestamp(struct vb2_buffer *vb, const void *pb)117static void __copy_timestamp(struct vb2_buffer *vb, const void *pb)
111{118{
112 const struct v4l2_buffer *b = pb;119 const struct v4l2_buffer *b = pb;
113 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);120 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
@@ -118,14 +125,12 @@ static int __set_timestamp(struct vb2_buffer *vb, const void *pb) · 4 unmodified lines
118 * For output buffers copy the timestamp if needed,125 * For output buffers copy the timestamp if needed,
119 * and the timecode field and flag if needed.126 * and the timecode field and flag if needed.
120 */127 */
121 if ((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) ==128 if (q->copy_timestamp)
122 V4L2_BUF_FLAG_TIMESTAMP_COPY)129 vb->timestamp = timeval_to_ns(&b->timestamp);
123 vbuf->timestamp = b->timestamp;
124 vbuf->flags |= b->flags & V4L2_BUF_FLAG_TIMECODE;130 vbuf->flags |= b->flags & V4L2_BUF_FLAG_TIMECODE;
125 if (b->flags & V4L2_BUF_FLAG_TIMECODE)131 if (b->flags & V4L2_BUF_FLAG_TIMECODE)
126 vbuf->timecode = b->timecode;132 vbuf->timecode = b->timecode;
127 }133 }
128 return 0;
129};134};
130 135
131static void vb2_warn_zero_bytesused(struct vb2_buffer *vb)136static void vb2_warn_zero_bytesused(struct vb2_buffer *vb)
@@ -176,7 +181,7 @@ static int vb2_queue_or_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b, · 44 unmodified lines
176 * __fill_v4l2_buffer() - fill in a struct v4l2_buffer with information to be181 * __fill_v4l2_buffer() - fill in a struct v4l2_buffer with information to be
177 * returned to userspace182 * returned to userspace
178 */183 */
179static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)184static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
180{185{
181 struct v4l2_buffer *b = pb;186 struct v4l2_buffer *b = pb;
182 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);187 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
@@ -191,7 +196,7 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) · 8 unmodified lines
191 196
192 b->flags = vbuf->flags;197 b->flags = vbuf->flags;
193 b->field = vbuf->field;198 b->field = vbuf->field;
194 b->timestamp = vbuf->timestamp;199 b->timestamp = ns_to_timeval(vb->timestamp);
195 b->timecode = vbuf->timecode;200 b->timecode = vbuf->timecode;
196 b->sequence = vbuf->sequence;201 b->sequence = vbuf->sequence;
197 b->reserved2 = 0;202 b->reserved2 = 0;
@@ -238,8 +243,7 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) · 40 unmodified lines
238 */243 */
239 b->flags &= ~V4L2_BUFFER_MASK_FLAGS;244 b->flags &= ~V4L2_BUFFER_MASK_FLAGS;
240 b->flags |= q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK;245 b->flags |= q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK;
241 if ((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) !=246 if (!q->copy_timestamp) {
242 V4L2_BUF_FLAG_TIMESTAMP_COPY) {
243 /*247 /*
244 * For non-COPY timestamps, drop timestamp source bits248 * For non-COPY timestamps, drop timestamp source bits
245 * and obtain the timestamp source from the queue.249 * and obtain the timestamp source from the queue.
@@ -272,7 +276,10 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) · 26 unmodified lines
272 if (vb2_buffer_in_use(q, vb))276 if (vb2_buffer_in_use(q, vb))
273 b->flags |= V4L2_BUF_FLAG_MAPPED;277 b->flags |= V4L2_BUF_FLAG_MAPPED;
274 278
275 return 0;279 if (!q->is_output &&
280 b->flags & V4L2_BUF_FLAG_DONE &&
281 b->flags & V4L2_BUF_FLAG_LAST)
282 q->last_buffer_dequeued = true;
276}283}
277 284
278/**285/**
@@ -308,8 +315,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, · 29 unmodified lines
308 "for an output buffer\n");315 "for an output buffer\n");
309 return -EINVAL;316 return -EINVAL;
310 }317 }
311 vbuf->timestamp.tv_sec = 0;318 vb->timestamp = 0;
312 vbuf->timestamp.tv_usec = 0;
313 vbuf->sequence = 0;319 vbuf->sequence = 0;
314 320
315 if (V4L2_TYPE_IS_MULTIPLANAR(b->type)) {321 if (V4L2_TYPE_IS_MULTIPLANAR(b->type)) {
@@ -404,8 +410,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, · 88 unmodified lines
404 410
405 /* Zero flags that the vb2 core handles */411 /* Zero flags that the vb2 core handles */
406 vbuf->flags = b->flags & ~V4L2_BUFFER_MASK_FLAGS;412 vbuf->flags = b->flags & ~V4L2_BUFFER_MASK_FLAGS;
407 if ((vb->vb2_queue->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) !=413 if (!vb->vb2_queue->copy_timestamp || !V4L2_TYPE_IS_OUTPUT(b->type)) {
408 V4L2_BUF_FLAG_TIMESTAMP_COPY || !V4L2_TYPE_IS_OUTPUT(b->type)) {
409 /*414 /*
410 * Non-COPY timestamps and non-OUTPUT queues will get415 * Non-COPY timestamps and non-OUTPUT queues will get
411 * their timestamp and timestamp source flags from the416 * their timestamp and timestamp source flags from the
@@ -434,7 +439,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, · 22 unmodified lines
434static const struct vb2_buf_ops v4l2_buf_ops = {439static const struct vb2_buf_ops v4l2_buf_ops = {
435 .fill_user_buffer = __fill_v4l2_buffer,440 .fill_user_buffer = __fill_v4l2_buffer,
436 .fill_vb2_buffer = __fill_vb2_buffer,441 .fill_vb2_buffer = __fill_vb2_buffer,
437 .set_timestamp = __set_timestamp,442 .copy_timestamp = __copy_timestamp,
438};443};
439 444
440/**445/**
@@ -466,8 +471,9 @@ int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b) · 25 unmodified lines
466 }471 }
467 vb = q->bufs[b->index];472 vb = q->bufs[b->index];
468 ret = __verify_planes_array(vb, b);473 ret = __verify_planes_array(vb, b);
469 474 if (!ret)
470 return ret ? ret : vb2_core_querybuf(q, b->index, b);475 vb2_core_querybuf(q, b->index, b);
476 return ret;
471}477}
472EXPORT_SYMBOL(vb2_querybuf);478EXPORT_SYMBOL(vb2_querybuf);
473 479
@@ -525,14 +531,52 @@ EXPORT_SYMBOL_GPL(vb2_prepare_buf); · 51 unmodified lines
525 */531 */
526int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)532int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
527{533{
528 int ret = vb2_verify_memory_type(q, create->memory,534 unsigned requested_planes = 1;
529 create->format.type);535 unsigned requested_sizes[VIDEO_MAX_PLANES];
536 struct v4l2_format *f = &create->format;
537 int ret = vb2_verify_memory_type(q, create->memory, f->type);
538 unsigned i;
530 539
531 create->index = q->num_buffers;540 create->index = q->num_buffers;
532 if (create->count == 0)541 if (create->count == 0)
533 return ret != -EBUSY ? ret : 0;542 return ret != -EBUSY ? ret : 0;
543
544 switch (f->type) {
545 case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
546 case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
547 requested_planes = f->fmt.pix_mp.num_planes;
548 if (requested_planes == 0 ||
549 requested_planes > VIDEO_MAX_PLANES)
550 return -EINVAL;
551 for (i = 0; i < requested_planes; i++)
552 requested_sizes[i] =
553 f->fmt.pix_mp.plane_fmt[i].sizeimage;
554 break;
555 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
556 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
557 requested_sizes[0] = f->fmt.pix.sizeimage;
558 break;
559 case V4L2_BUF_TYPE_VBI_CAPTURE:
560 case V4L2_BUF_TYPE_VBI_OUTPUT:
561 requested_sizes[0] = f->fmt.vbi.samples_per_line *
562 (f->fmt.vbi.count[0] + f->fmt.vbi.count[1]);
563 break;
564 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
565 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
566 requested_sizes[0] = f->fmt.sliced.io_size;
567 break;
568 case V4L2_BUF_TYPE_SDR_CAPTURE:
569 case V4L2_BUF_TYPE_SDR_OUTPUT:
570 requested_sizes[0] = f->fmt.sdr.buffersize;
571 break;
572 default:
573 return -EINVAL;
574 }
575 for (i = 0; i < requested_planes; i++)
576 if (requested_sizes[i] == 0)
577 return -EINVAL;
534 return ret ? ret : vb2_core_create_bufs(q, create->memory,578 return ret ? ret : vb2_core_create_bufs(q, create->memory,
535 &create->count, &create->format);579 &create->count, requested_planes, requested_sizes);
536}580}
537EXPORT_SYMBOL_GPL(vb2_create_bufs);581EXPORT_SYMBOL_GPL(vb2_create_bufs);
538 582
@@ -583,10 +627,6 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, · 44 unmodified lines
583 627
584 ret = vb2_core_dqbuf(q, b, nonblocking);628 ret = vb2_core_dqbuf(q, b, nonblocking);
585 629
586 if (!ret && !q->is_output &&
587 b->flags & V4L2_BUF_FLAG_LAST)
588 q->last_buffer_dequeued = true;
589
590 return ret;630 return ret;
591}631}
592 632
@@ -723,14 +763,13 @@ int vb2_queue_init(struct vb2_queue *q) · 130 unmodified lines
723 q->buf_ops = &v4l2_buf_ops;763 q->buf_ops = &v4l2_buf_ops;
724 q->is_multiplanar = V4L2_TYPE_IS_MULTIPLANAR(q->type);764 q->is_multiplanar = V4L2_TYPE_IS_MULTIPLANAR(q->type);
725 q->is_output = V4L2_TYPE_IS_OUTPUT(q->type);765 q->is_output = V4L2_TYPE_IS_OUTPUT(q->type);
766 q->copy_timestamp = (q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK)
767 == V4L2_BUF_FLAG_TIMESTAMP_COPY;
726 768
727 return vb2_core_queue_init(q);769 return vb2_core_queue_init(q);
728}770}
729EXPORT_SYMBOL_GPL(vb2_queue_init);771EXPORT_SYMBOL_GPL(vb2_queue_init);
730 772
731static int __vb2_init_fileio(struct vb2_queue *q, int read);
732static int __vb2_cleanup_fileio(struct vb2_queue *q);
733
734/**773/**
735 * vb2_queue_release() - stop streaming, release the queue and free memory774 * vb2_queue_release() - stop streaming, release the queue and free memory
736 * @q: videobuf2 queue775 * @q: videobuf2 queue
@@ -741,7 +780,6 @@ static int __vb2_cleanup_fileio(struct vb2_queue *q); · 4 unmodified lines
741 */780 */
742void vb2_queue_release(struct vb2_queue *q)781void vb2_queue_release(struct vb2_queue *q)
743{782{
744 __vb2_cleanup_fileio(q);
745 vb2_core_queue_release(q);783 vb2_core_queue_release(q);
746}784}
747EXPORT_SYMBOL_GPL(vb2_queue_release);785EXPORT_SYMBOL_GPL(vb2_queue_release);
@@ -769,9 +807,7 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait) · 21 unmodified lines
769{807{
770 struct video_device *vfd = video_devdata(file);808 struct video_device *vfd = video_devdata(file);
771 unsigned long req_events = poll_requested_events(wait);809 unsigned long req_events = poll_requested_events(wait);
772 struct vb2_buffer *vb = NULL;
773 unsigned int res = 0;810 unsigned int res = 0;
774 unsigned long flags;
775 811
776 if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {812 if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {
777 struct v4l2_fh *fh = file->private_data;813 struct v4l2_fh *fh = file->private_data;
@@ -782,611 +818,18 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait) · 4 unmodified lines
782 poll_wait(file, &fh->wait, wait);818 poll_wait(file, &fh->wait, wait);
783 }819 }
784 820
785 if (!q->is_output && !(req_events & (POLLIN | POLLRDNORM)))
786 return res;
787 if (q->is_output && !(req_events & (POLLOUT | POLLWRNORM)))
788 return res;
789
790 /*
791 * Start file I/O emulator only if streaming API has not been used yet.
792 */
793 if (q->num_buffers == 0 && !vb2_fileio_is_active(q)) {
794 if (!q->is_output && (q->io_modes & VB2_READ) &&
795 (req_events & (POLLIN | POLLRDNORM))) {
796 if (__vb2_init_fileio(q, 1))
797 return res | POLLERR;
798 }
799 if (q->is_output && (q->io_modes & VB2_WRITE) &&
800 (req_events & (POLLOUT | POLLWRNORM))) {
801 if (__vb2_init_fileio(q, 0))
802 return res | POLLERR;
803 /*
804 * Write to OUTPUT queue can be done immediately.
805 */
806 return res | POLLOUT | POLLWRNORM;
807 }
808 }
809
810 /*
811 * There is nothing to wait for if the queue isn't streaming, or if the
812 * error flag is set.
813 */
814 if (!vb2_is_streaming(q) || q->error)
815 return res | POLLERR;
816 /*821 /*
817 * For compatibility with vb1: if QBUF hasn't been called yet, then822 * For compatibility with vb1: if QBUF hasn't been called yet, then
818 * return POLLERR as well. This only affects capture queues, output823 * return POLLERR as well. This only affects capture queues, output
819 * queues will always initialize waiting_for_buffers to false.824 * queues will always initialize waiting_for_buffers to false.
820 */825 */
821 if (q->waiting_for_buffers)826 if (q->waiting_for_buffers && (req_events & (POLLIN | POLLRDNORM)))
822 return res | POLLERR;827 return POLLERR;
823
824 /*
825 * For output streams you can write as long as there are fewer buffers
826 * queued than there are buffers available.
827 */
828 if (q->is_output && q->queued_count < q->num_buffers)
829 return res | POLLOUT | POLLWRNORM;
830
831 if (list_empty(&q->done_list)) {
832 /*
833 * If the last buffer was dequeued from a capture queue,
834 * return immediately. DQBUF will return -EPIPE.
835 */
836 if (q->last_buffer_dequeued)
837 return res | POLLIN | POLLRDNORM;
838
839 poll_wait(file, &q->done_wq, wait);
840 }
841 828
842 /*829 return res | vb2_core_poll(q, file, wait);
843 * Take first buffer available for dequeuing.
844 */
845 spin_lock_irqsave(&q->done_lock, flags);
846 if (!list_empty(&q->done_list))
847 vb = list_first_entry(&q->done_list, struct vb2_buffer,
848 done_entry);
849 spin_unlock_irqrestore(&q->done_lock, flags);
850
851 if (vb && (vb->state == VB2_BUF_STATE_DONE
852 || vb->state == VB2_BUF_STATE_ERROR)) {
853 return (q->is_output) ?
854 res | POLLOUT | POLLWRNORM :
855 res | POLLIN | POLLRDNORM;
856 }
857 return res;
858}830}
859EXPORT_SYMBOL_GPL(vb2_poll);831EXPORT_SYMBOL_GPL(vb2_poll);
860 832
861/**
862 * struct vb2_fileio_buf - buffer context used by file io emulator
863 *
864 * vb2 provides a compatibility layer and emulator of file io (read and
865 * write) calls on top of streaming API. This structure is used for
866 * tracking context related to the buffers.
867 */
868struct vb2_fileio_buf {
869 void *vaddr;
870 unsigned int size;
871 unsigned int pos;
872 unsigned int queued:1;
873};
874
875/**
876 * struct vb2_fileio_data - queue context used by file io emulator
877 *
878 * @cur_index: the index of the buffer currently being read from or
879 * written to. If equal to q->num_buffers then a new buffer
880 * must be dequeued.
881 * @initial_index: in the read() case all buffers are queued up immediately
882 * in __vb2_init_fileio() and __vb2_perform_fileio() just cycles
883 * buffers. However, in the write() case no buffers are initially
884 * queued, instead whenever a buffer is full it is queued up by
885 * __vb2_perform_fileio(). Only once all available buffers have
886 * been queued up will __vb2_perform_fileio() start to dequeue
887 * buffers. This means that initially __vb2_perform_fileio()
888 * needs to know what buffer index to use when it is queuing up
889 * the buffers for the first time. That initial index is stored
890 * in this field. Once it is equal to q->num_buffers all
891 * available buffers have been queued and __vb2_perform_fileio()
892 * should start the normal dequeue/queue cycle.
893 *
894 * vb2 provides a compatibility layer and emulator of file io (read and
895 * write) calls on top of streaming API. For proper operation it required
896 * this structure to save the driver state between each call of the read
897 * or write function.
898 */
899struct vb2_fileio_data {
900 struct v4l2_requestbuffers req;
901 struct v4l2_plane p;
902 struct v4l2_buffer b;
903 struct vb2_fileio_buf bufs[VB2_MAX_FRAME];
904 unsigned int cur_index;
905 unsigned int initial_index;
906 unsigned int q_count;
907 unsigned int dq_count;
908 unsigned read_once:1;
909 unsigned write_immediately:1;
910};
911
912/**
913 * __vb2_init_fileio() - initialize file io emulator
914 * @q: videobuf2 queue
915 * @read: mode selector (1 means read, 0 means write)
916 */
917static int __vb2_init_fileio(struct vb2_queue *q, int read)
918{
919 struct vb2_fileio_data *fileio;
920 int i, ret;
921 unsigned int count = 0;
922
923 /*
924 * Sanity check
925 */
926 if (WARN_ON((read && !(q->io_modes & VB2_READ)) ||
927 (!read && !(q->io_modes & VB2_WRITE))))
928 return -EINVAL;
929
930 /*
931 * Check if device supports mapping buffers to kernel virtual space.
932 */
933 if (!q->mem_ops->vaddr)
934 return -EBUSY;
935
936 /*
937 * Check if streaming api has not been already activated.
938 */
939 if (q->streaming || q->num_buffers > 0)
940 return -EBUSY;
941
942 /*
943 * Start with count 1, driver can increase it in queue_setup()
944 */
945 count = 1;
946
947 dprintk(3, "setting up file io: mode %s, count %d, read_once %d, write_immediately %d\n",
948 (read) ? "read" : "write", count, q->fileio_read_once,
949 q->fileio_write_immediately);
950
951 fileio = kzalloc(sizeof(struct vb2_fileio_data), GFP_KERNEL);
952 if (fileio == NULL)
953 return -ENOMEM;
954
955 fileio->read_once = q->fileio_read_once;
956 fileio->write_immediately = q->fileio_write_immediately;
957
958 /*
959 * Request buffers and use MMAP type to force driver
960 * to allocate buffers by itself.
961 */
962 fileio->req.count = count;
963 fileio->req.memory = VB2_MEMORY_MMAP;
964 fileio->req.type = q->type;
965 q->fileio = fileio;
966 ret = vb2_core_reqbufs(q, fileio->req.memory, &fileio->req.count);
967 if (ret)
968 goto err_kfree;
969
970 /*
971 * Check if plane_count is correct
972 * (multiplane buffers are not supported).
973 */
974 if (q->bufs[0]->num_planes != 1) {
975 ret = -EBUSY;
976 goto err_reqbufs;
977 }
978
979 /*
980 * Get kernel address of each buffer.
981 */
982 for (i = 0; i < q->num_buffers; i++) {
983 fileio->bufs[i].vaddr = vb2_plane_vaddr(q->bufs[i], 0);
984 if (fileio->bufs[i].vaddr == NULL) {
985 ret = -EINVAL;
986 goto err_reqbufs;
987 }
988 fileio->bufs[i].size = vb2_plane_size(q->bufs[i], 0);
989 }
990
991 /*
992 * Read mode requires pre queuing of all buffers.
993 */
994 if (read) {
995 bool is_multiplanar = q->is_multiplanar;
996
997 /*
998 * Queue all buffers.
999 */
1000 for (i = 0; i < q->num_buffers; i++) {
1001 struct v4l2_buffer *b = &fileio->b;
1002
1003 memset(b, 0, sizeof(*b));
1004 b->type = q->type;
1005 if (is_multiplanar) {
1006 memset(&fileio->p, 0, sizeof(fileio->p));
1007 b->m.planes = &fileio->p;
1008 b->length = 1;
1009 }
1010 b->memory = q->memory;
1011 b->index = i;
1012 ret = vb2_internal_qbuf(q, b);
1013 if (ret)
1014 goto err_reqbufs;
1015 fileio->bufs[i].queued = 1;
1016 }
1017 /*
1018 * All buffers have been queued, so mark that by setting
1019 * initial_index to q->num_buffers
1020 */
1021 fileio->initial_index = q->num_buffers;
1022 fileio->cur_index = q->num_buffers;
1023 }
1024
1025 /*
1026 * Start streaming.
1027 */
1028 ret = vb2_core_streamon(q, q->type);
1029 if (ret)
1030 goto err_reqbufs;
1031
1032 return ret;
1033
1034err_reqbufs:
1035 fileio->req.count = 0;
1036 vb2_core_reqbufs(q, fileio->req.memory, &fileio->req.count);
1037
1038err_kfree:
1039 q->fileio = NULL;
1040 kfree(fileio);
1041 return ret;
1042}
1043
1044/**
1045 * __vb2_cleanup_fileio() - free resourced used by file io emulator
1046 * @q: videobuf2 queue
1047 */
1048static int __vb2_cleanup_fileio(struct vb2_queue *q)
1049{
1050 struct vb2_fileio_data *fileio = q->fileio;
1051
1052 if (fileio) {
1053 vb2_core_streamoff(q, q->type);
1054 q->fileio = NULL;
1055 fileio->req.count = 0;
1056 vb2_reqbufs(q, &fileio->req);
1057 kfree(fileio);
1058 dprintk(3, "file io emulator closed\n");
1059 }
1060 return 0;
1061}
1062
1063/**
1064 * __vb2_perform_fileio() - perform a single file io (read or write) operation
1065 * @q: videobuf2 queue
1066 * @data: pointed to target userspace buffer
1067 * @count: number of bytes to read or write
1068 * @ppos: file handle position tracking pointer
1069 * @nonblock: mode selector (1 means blocking calls, 0 means nonblocking)
1070 * @read: access mode selector (1 means read, 0 means write)
1071 */
1072static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_t count,
1073 loff_t *ppos, int nonblock, int read)
1074{
1075 struct vb2_fileio_data *fileio;
1076 struct vb2_fileio_buf *buf;
1077 bool is_multiplanar = q->is_multiplanar;
1078 /*
1079 * When using write() to write data to an output video node the vb2 core
1080 * should set timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody
1081 * else is able to provide this information with the write() operation.
1082 */
1083 bool set_timestamp = !read &&
1084 (q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) ==
1085 V4L2_BUF_FLAG_TIMESTAMP_COPY;
1086 int ret, index;
1087
1088 dprintk(3, "mode %s, offset %ld, count %zd, %sblocking\n",
1089 read ? "read" : "write", (long)*ppos, count,
1090 nonblock ? "non" : "");
1091
1092 if (!data)
1093 return -EINVAL;
1094
1095 /*
1096 * Initialize emulator on first call.
1097 */
1098 if (!vb2_fileio_is_active(q)) {
1099 ret = __vb2_init_fileio(q, read);
1100 dprintk(3, "vb2_init_fileio result: %d\n", ret);
1101 if (ret)
1102 return ret;
1103 }
1104 fileio = q->fileio;
1105
1106 /*
1107 * Check if we need to dequeue the buffer.
1108 */
1109 index = fileio->cur_index;
1110 if (index >= q->num_buffers) {
1111 /*
1112 * Call vb2_dqbuf to get buffer back.
1113 */
1114 memset(&fileio->b, 0, sizeof(fileio->b));
1115 fileio->b.type = q->type;
1116 fileio->b.memory = q->memory;
1117 if (is_multiplanar) {
1118 memset(&fileio->p, 0, sizeof(fileio->p));
1119 fileio->b.m.planes = &fileio->p;
1120 fileio->b.length = 1;
1121 }
1122 ret = vb2_internal_dqbuf(q, &fileio->b, nonblock);
1123 dprintk(5, "vb2_dqbuf result: %d\n", ret);
1124 if (ret)
1125 return ret;
1126 fileio->dq_count += 1;
1127
1128 fileio->cur_index = index = fileio->b.index;
1129 buf = &fileio->bufs[index];
1130
1131 /*
1132 * Get number of bytes filled by the driver
1133 */
1134 buf->pos = 0;
1135 buf->queued = 0;
1136 buf->size = read ? vb2_get_plane_payload(q->bufs[index], 0)
1137 : vb2_plane_size(q->bufs[index], 0);
1138 /* Compensate for data_offset on read in the multiplanar case. */
1139 if (is_multiplanar && read &&
1140 fileio->b.m.planes[0].data_offset < buf->size) {
1141 buf->pos = fileio->b.m.planes[0].data_offset;
1142 buf->size -= buf->pos;
1143 }
1144 } else {
1145 buf = &fileio->bufs[index];
1146 }
1147
1148 /*
1149 * Limit count on last few bytes of the buffer.
1150 */
1151 if (buf->pos + count > buf->size) {
1152 count = buf->size - buf->pos;
1153 dprintk(5, "reducing read count: %zd\n", count);
1154 }
1155
1156 /*
1157 * Transfer data to userspace.
1158 */
1159 dprintk(3, "copying %zd bytes - buffer %d, offset %u\n",
1160 count, index, buf->pos);
1161 if (read)
1162 ret = copy_to_user(data, buf->vaddr + buf->pos, count);
1163 else
1164 ret = copy_from_user(buf->vaddr + buf->pos, data, count);
1165 if (ret) {
1166 dprintk(3, "error copying data\n");
1167 return -EFAULT;
1168 }
1169
1170 /*
1171 * Update counters.
1172 */
1173 buf->pos += count;
1174 *ppos += count;
1175
1176 /*
1177 * Queue next buffer if required.
1178 */
1179 if (buf->pos == buf->size || (!read && fileio->write_immediately)) {
1180 /*
1181 * Check if this is the last buffer to read.
1182 */
1183 if (read && fileio->read_once && fileio->dq_count == 1) {
1184 dprintk(3, "read limit reached\n");
1185 return __vb2_cleanup_fileio(q);
1186 }
1187
1188 /*
1189 * Call vb2_qbuf and give buffer to the driver.
1190 */
1191 memset(&fileio->b, 0, sizeof(fileio->b));
1192 fileio->b.type = q->type;
1193 fileio->b.memory = q->memory;
1194 fileio->b.index = index;
1195 fileio->b.bytesused = buf->pos;
1196 if (is_multiplanar) {
1197 memset(&fileio->p, 0, sizeof(fileio->p));
1198 fileio->p.bytesused = buf->pos;
1199 fileio->b.m.planes = &fileio->p;
1200 fileio->b.length = 1;
1201 }
1202 if (set_timestamp)
1203 v4l2_get_timestamp(&fileio->b.timestamp);
1204 ret = vb2_internal_qbuf(q, &fileio->b);
1205 dprintk(5, "vb2_dbuf result: %d\n", ret);
1206 if (ret)
1207 return ret;
1208
1209 /*
1210 * Buffer has been queued, update the status
1211 */
1212 buf->pos = 0;
1213 buf->queued = 1;
1214 buf->size = vb2_plane_size(q->bufs[index], 0);
1215 fileio->q_count += 1;
1216 /*
1217 * If we are queuing up buffers for the first time, then
1218 * increase initial_index by one.
1219 */
1220 if (fileio->initial_index < q->num_buffers)
1221 fileio->initial_index++;
1222 /*
1223 * The next buffer to use is either a buffer that's going to be
1224 * queued for the first time (initial_index < q->num_buffers)
1225 * or it is equal to q->num_buffers, meaning that the next
1226 * time we need to dequeue a buffer since we've now queued up
1227 * all the 'first time' buffers.
1228 */
1229 fileio->cur_index = fileio->initial_index;
1230 }
1231
1232 /*
1233 * Return proper number of bytes processed.
1234 */
1235 if (ret == 0)
1236 ret = count;
1237 return ret;
1238}
1239
1240size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
1241 loff_t *ppos, int nonblocking)
1242{
1243 return __vb2_perform_fileio(q, data, count, ppos, nonblocking, 1);
1244}
1245EXPORT_SYMBOL_GPL(vb2_read);
1246
1247size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count,
1248 loff_t *ppos, int nonblocking)
1249{
1250 return __vb2_perform_fileio(q, (char __user *) data, count,
1251 ppos, nonblocking, 0);
1252}
1253EXPORT_SYMBOL_GPL(vb2_write);
1254
1255struct vb2_threadio_data {
1256 struct task_struct *thread;
1257 vb2_thread_fnc fnc;
1258 void *priv;
1259 bool stop;
1260};
1261
1262static int vb2_thread(void *data)
1263{
1264 struct vb2_queue *q = data;
1265 struct vb2_threadio_data *threadio = q->threadio;
1266 struct vb2_fileio_data *fileio = q->fileio;
1267 bool set_timestamp = false;
1268 int prequeue = 0;
1269 int index = 0;
1270 int ret = 0;
1271
1272 if (q->is_output) {
1273 prequeue = q->num_buffers;
1274 set_timestamp =
1275 (q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) ==
1276 V4L2_BUF_FLAG_TIMESTAMP_COPY;
1277 }
1278
1279 set_freezable();
1280
1281 for (;;) {
1282 struct vb2_buffer *vb;
1283
1284 /*
1285 * Call vb2_dqbuf to get buffer back.
1286 */
1287 memset(&fileio->b, 0, sizeof(fileio->b));
1288 fileio->b.type = q->type;
1289 fileio->b.memory = q->memory;
1290 if (prequeue) {
1291 fileio->b.index = index++;
1292 prequeue--;
1293 } else {
1294 call_void_qop(q, wait_finish, q);
1295 if (!threadio->stop)
1296 ret = vb2_internal_dqbuf(q, &fileio->b, 0);
1297 call_void_qop(q, wait_prepare, q);
1298 dprintk(5, "file io: vb2_dqbuf result: %d\n", ret);
1299 }
1300 if (ret || threadio->stop)
1301 break;
1302 try_to_freeze();
1303
1304 vb = q->bufs[fileio->b.index];
1305 if (!(fileio->b.flags & V4L2_BUF_FLAG_ERROR))
1306 if (threadio->fnc(vb, threadio->priv))
1307 break;
1308 call_void_qop(q, wait_finish, q);
1309 if (set_timestamp)
1310 v4l2_get_timestamp(&fileio->b.timestamp);
1311 if (!threadio->stop)
1312 ret = vb2_internal_qbuf(q, &fileio->b);
1313 call_void_qop(q, wait_prepare, q);
1314 if (ret || threadio->stop)
1315 break;
1316 }
1317
1318 /* Hmm, linux becomes *very* unhappy without this ... */
1319 while (!kthread_should_stop()) {
1320 set_current_state(TASK_INTERRUPTIBLE);
1321 schedule();
1322 }
1323 return 0;
1324}
1325
1326/*
1327 * This function should not be used for anything else but the videobuf2-dvb
1328 * support. If you think you have another good use-case for this, then please
1329 * contact the linux-media mailinglist first.
1330 */
1331int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv,
1332 const char *thread_name)
1333{
1334 struct vb2_threadio_data *threadio;
1335 int ret = 0;
1336
1337 if (q->threadio)
1338 return -EBUSY;
1339 if (vb2_is_busy(q))
1340 return -EBUSY;
1341 if (WARN_ON(q->fileio))
1342 return -EBUSY;
1343
1344 threadio = kzalloc(sizeof(*threadio), GFP_KERNEL);
1345 if (threadio == NULL)
1346 return -ENOMEM;
1347 threadio->fnc = fnc;
1348 threadio->priv = priv;
1349
1350 ret = __vb2_init_fileio(q, !q->is_output);
1351 dprintk(3, "file io: vb2_init_fileio result: %d\n", ret);
1352 if (ret)
1353 goto nomem;
1354 q->threadio = threadio;
1355 threadio->thread = kthread_run(vb2_thread, q, "vb2-%s", thread_name);
1356 if (IS_ERR(threadio->thread)) {
1357 ret = PTR_ERR(threadio->thread);
1358 threadio->thread = NULL;
1359 goto nothread;
1360 }
1361 return 0;
1362
1363nothread:
1364 __vb2_cleanup_fileio(q);
1365nomem:
1366 kfree(threadio);
1367 return ret;
1368}
1369EXPORT_SYMBOL_GPL(vb2_thread_start);
1370
1371int vb2_thread_stop(struct vb2_queue *q)
1372{
1373 struct vb2_threadio_data *threadio = q->threadio;
1374 int err;
1375
1376 if (threadio == NULL)
1377 return 0;
1378 threadio->stop = true;
1379 /* Wake up all pending sleeps in the thread */
1380 vb2_queue_error(q);
1381 err = kthread_stop(threadio->thread);
1382 __vb2_cleanup_fileio(q);
1383 threadio->thread = NULL;
1384 kfree(threadio);
1385 q->threadio = NULL;
1386 return err;
1387}
1388EXPORT_SYMBOL_GPL(vb2_thread_stop);
1389
1390/*833/*
1391 * The following functions are not part of the vb2 core API, but are helper834 * The following functions are not part of the vb2 core API, but are helper
1392 * functions that plug into struct v4l2_ioctl_ops, struct v4l2_file_operations835 * functions that plug into struct v4l2_ioctl_ops, struct v4l2_file_operations
@@ -1440,8 +883,8 @@ int vb2_ioctl_create_bufs(struct file *file, void *priv, · 47 unmodified lines
1440 return res;883 return res;
1441 if (vb2_queue_is_busy(vdev, file))884 if (vb2_queue_is_busy(vdev, file))
1442 return -EBUSY;885 return -EBUSY;
1443 res = vb2_core_create_bufs(vdev->queue, p->memory, &p->count,886
1444 &p->format);887 res = vb2_create_bufs(vdev->queue, p);
1445 if (res == 0)888 if (res == 0)
1446 vdev->queue->owner = file->private_data;889 vdev->queue->owner = file->private_data;
1447 return res;890 return res;
drivers/mfd/timberdale.c+2−2
@@ -39,8 +39,8 @@ · 38 unmodified lines
39#include <linux/spi/max7301.h>39#include <linux/spi/max7301.h>
40#include <linux/spi/mc33880.h>40#include <linux/spi/mc33880.h>
41 41
42#include <media/timb_radio.h>42#include <linux/platform_data/media/timb_radio.h>
43#include <media/timb_video.h>43#include <linux/platform_data/media/timb_video.h>
44 44
45#include <linux/timb_dma.h>45#include <linux/timb_dma.h>
46 46
drivers/staging/media/bcm2048/radio-bcm2048.c+2−2
@@ -1000,8 +1000,8 @@ static int bcm2048_set_fm_search_tune_mode(struct bcm2048_device *bdev, · 999 unmodified lines
1000 timeout = BCM2048_AUTO_SEARCH_TIMEOUT;1000 timeout = BCM2048_AUTO_SEARCH_TIMEOUT;
1001 1001
1002 if (!wait_for_completion_timeout(&bdev->compl,1002 if (!wait_for_completion_timeout(&bdev->compl,
1003 msecs_to_jiffies(timeout)))1003 msecs_to_jiffies(timeout)))
1004 dev_err(&bdev->client->dev, "IRQ timeout.\n");1004 dev_err(&bdev->client->dev, "IRQ timeout.\n");
1005 1005
1006 if (value)1006 if (value)
1007 if (!bdev->scan_state)1007 if (!bdev->scan_state)
drivers/staging/media/davinci_vpfe/Kconfig+2−0
@@ -2,6 +2,8 @@ config VIDEO_DM365_VPFE · 1 unmodified line
2 tristate "DM365 VPFE Media Controller Capture Driver"2 tristate "DM365 VPFE Media Controller Capture Driver"
3 depends on VIDEO_V4L2 && ARCH_DAVINCI_DM365 && !VIDEO_DM365_ISIF3 depends on VIDEO_V4L2 && ARCH_DAVINCI_DM365 && !VIDEO_DM365_ISIF
4 depends on HAS_DMA4 depends on HAS_DMA
5 depends on VIDEO_V4L2_SUBDEV_API
6 depends on VIDEO_DAVINCI_VPBE_DISPLAY
5 select VIDEOBUF2_DMA_CONTIG7 select VIDEOBUF2_DMA_CONTIG
6 help8 help
7 Support for DM365 VPFE based Media Controller Capture driver.9 Support for DM365 VPFE based Media Controller Capture driver.
drivers/staging/media/davinci_vpfe/dm365_ipipe.c+3−2
@@ -1536,8 +1536,9 @@ ipipe_get_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, · 1535 unmodified lines
1536 * @fse: pointer to v4l2_subdev_frame_size_enum structure.1536 * @fse: pointer to v4l2_subdev_frame_size_enum structure.
1537 */1537 */
1538static int1538static int
1539ipipe_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,1539ipipe_enum_frame_size(struct v4l2_subdev *sd,
1540 struct v4l2_subdev_frame_size_enum *fse)1540 struct v4l2_subdev_pad_config *cfg,
1541 struct v4l2_subdev_frame_size_enum *fse)
1541{1542{
1542 struct vpfe_ipipe_device *ipipe = v4l2_get_subdevdata(sd);1543 struct vpfe_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
1543 struct v4l2_mbus_framefmt format;1544 struct v4l2_mbus_framefmt format;
drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c+1−1
@@ -254,7 +254,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe) · 253 unmodified lines
254 void __iomem *ipipe_base = ipipe->base_addr;254 void __iomem *ipipe_base = ipipe->base_addr;
255 struct v4l2_mbus_framefmt *outformat;255 struct v4l2_mbus_framefmt *outformat;
256 u32 color_pat;256 u32 color_pat;
257 u32 ipipe_mode;257 int ipipe_mode;
258 u32 data_path;258 u32 data_path;
259 259
260 /* enable clock to IPIPE */260 /* enable clock to IPIPE */
drivers/staging/media/davinci_vpfe/dm365_resizer.c+1−6
@@ -63,16 +63,11 @@ resizer_calculate_line_length(u32 pix, int width, int height, · 62 unmodified lines
63 if (pix == MEDIA_BUS_FMT_UYVY8_2X8 ||63 if (pix == MEDIA_BUS_FMT_UYVY8_2X8 ||
64 pix == MEDIA_BUS_FMT_SGRBG12_1X12) {64 pix == MEDIA_BUS_FMT_SGRBG12_1X12) {
65 *line_len = width << 1;65 *line_len = width << 1;
66 } else if (pix == MEDIA_BUS_FMT_Y8_1X8 ||
67 pix == MEDIA_BUS_FMT_UV8_1X8) {
68 *line_len = width;
69 *line_len_c = width;
70 } else {66 } else {
71 /* YUV 420 */
72 /* round width to upper 32 byte boundary */
73 *line_len = width;67 *line_len = width;
74 *line_len_c = width;68 *line_len_c = width;
75 }69 }
70
76 /* adjust the line len to be a multiple of 32 */71 /* adjust the line len to be a multiple of 32 */
77 *line_len += 31;72 *line_len += 31;
78 *line_len &= ~0x1f;73 *line_len &= ~0x1f;
drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c+1−1
@@ -227,7 +227,7 @@ static int vpfe_enable_clock(struct vpfe_device *vpfe_dev) · 226 unmodified lines
227 return 0;227 return 0;
228 228
229 vpfe_dev->clks = kcalloc(vpfe_cfg->num_clocks,229 vpfe_dev->clks = kcalloc(vpfe_cfg->num_clocks,
230 sizeof(struct clock *), GFP_KERNEL);230 sizeof(*vpfe_dev->clks), GFP_KERNEL);
231 if (vpfe_dev->clks == NULL)231 if (vpfe_dev->clks == NULL)
232 return -ENOMEM;232 return -ENOMEM;
233 233
drivers/staging/media/davinci_vpfe/vpfe_video.c+2−2
@@ -470,7 +470,7 @@ void vpfe_video_process_buffer_complete(struct vpfe_video_device *video) · 469 unmodified lines
470{470{
471 struct vpfe_pipeline *pipe = &video->pipe;471 struct vpfe_pipeline *pipe = &video->pipe;
472 472
473 v4l2_get_timestamp(&video->cur_frm->vb.timestamp);473 video->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
474 vb2_buffer_done(&video->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);474 vb2_buffer_done(&video->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
475 if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS)475 if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS)
476 video->cur_frm = video->next_frm;476 video->cur_frm = video->next_frm;
@@ -1078,7 +1078,7 @@ vpfe_g_dv_timings(struct file *file, void *fh, · 601 unmodified lines
1078 * the buffer nbuffers and buffer size1078 * the buffer nbuffers and buffer size
1079 */1079 */
1080static int1080static int
1081vpfe_buffer_queue_setup(struct vb2_queue *vq, const void *parg,1081vpfe_buffer_queue_setup(struct vb2_queue *vq,
1082 unsigned int *nbuffers, unsigned int *nplanes,1082 unsigned int *nbuffers, unsigned int *nplanes,
1083 unsigned int sizes[], void *alloc_ctxs[])1083 unsigned int sizes[], void *alloc_ctxs[])
1084{1084{
drivers/staging/media/lirc/lirc_imon.c+2−0
@@ -885,12 +885,14 @@ static int imon_probe(struct usb_interface *interface, · 884 unmodified lines
885 vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);885 vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);
886 886
887 /* Everything went fine. Just unlock and return retval (with is 0) */887 /* Everything went fine. Just unlock and return retval (with is 0) */
888 mutex_unlock(&context->ctx_lock);
888 goto driver_unlock;889 goto driver_unlock;
889 890
890unregister_lirc:891unregister_lirc:
891 lirc_unregister_driver(driver->minor);892 lirc_unregister_driver(driver->minor);
892 893
893free_tx_urb:894free_tx_urb:
895 mutex_unlock(&context->ctx_lock);
894 usb_free_urb(tx_urb);896 usb_free_urb(tx_urb);
895 897
896free_rx_urb:898free_rx_urb:
drivers/staging/media/lirc/lirc_parallel.c+15−20
@@ -33,7 +33,7 @@ · 32 unmodified lines
33#include <linux/fs.h>33#include <linux/fs.h>
34#include <linux/kernel.h>34#include <linux/kernel.h>
35#include <linux/ioport.h>35#include <linux/ioport.h>
36#include <linux/time.h>36#include <linux/ktime.h>
37#include <linux/mm.h>37#include <linux/mm.h>
38#include <linux/delay.h>38#include <linux/delay.h>
39 39
@@ -144,25 +144,22 @@ static void lirc_off(void) · 104 unmodified lines
144 144
145static unsigned int init_lirc_timer(void)145static unsigned int init_lirc_timer(void)
146{146{
147 struct timeval tv, now;147 ktime_t kt, now, timeout;
148 unsigned int level, newlevel, timeelapsed, newtimer;148 unsigned int level, newlevel, timeelapsed, newtimer;
149 int count = 0;149 int count = 0;
150 150
151 do_gettimeofday(&tv);151 kt = ktime_get();
152 tv.tv_sec++; /* wait max. 1 sec. */152 /* wait max. 1 sec. */
153 timeout = ktime_add_ns(kt, NSEC_PER_SEC);
153 level = lirc_get_timer();154 level = lirc_get_timer();
154 do {155 do {
155 newlevel = lirc_get_timer();156 newlevel = lirc_get_timer();
156 if (level == 0 && newlevel != 0)157 if (level == 0 && newlevel != 0)
157 count++;158 count++;
158 level = newlevel;159 level = newlevel;
159 do_gettimeofday(&now);160 now = ktime_get();
160 } while (count < 1000 && (now.tv_sec < tv.tv_sec161 } while (count < 1000 && (ktime_before(now, timeout)));
161 || (now.tv_sec == tv.tv_sec162 timeelapsed = ktime_us_delta(now, kt);
162 && now.tv_usec < tv.tv_usec)));
163
164 timeelapsed = (now.tv_sec + 1 - tv.tv_sec)*1000000
165 + (now.tv_usec - tv.tv_usec);
166 if (count >= 1000 && timeelapsed > 0) {163 if (count >= 1000 && timeelapsed > 0) {
167 if (default_timer == 0) {164 if (default_timer == 0) {
168 /* autodetect timer */165 /* autodetect timer */
@@ -220,8 +217,8 @@ static void rbuf_write(int signal) · 51 unmodified lines
220 217
221static void lirc_lirc_irq_handler(void *blah)218static void lirc_lirc_irq_handler(void *blah)
222{219{
223 struct timeval tv;220 ktime_t kt, delkt;
224 static struct timeval lasttv;221 static ktime_t lastkt;
225 static int init;222 static int init;
226 long signal;223 long signal;
227 int data;224 int data;
@@ -244,16 +241,14 @@ static void lirc_lirc_irq_handler(void *blah) · 16 unmodified lines
244 241
245#ifdef LIRC_TIMER242#ifdef LIRC_TIMER
246 if (init) {243 if (init) {
247 do_gettimeofday(&tv);244 kt = ktime_get();
248 245
249 signal = tv.tv_sec - lasttv.tv_sec;246 delkt = ktime_sub(kt, lastkt);
250 if (signal > 15)247 if (ktime_compare(delkt, ktime_set(15, 0)) > 0)
251 /* really long time */248 /* really long time */
252 data = PULSE_MASK;249 data = PULSE_MASK;
253 else250 else
254 data = (int) (signal*1000000 +251 data = (int)(ktime_to_us(delkt) + LIRC_SFH506_DELAY);
255 tv.tv_usec - lasttv.tv_usec +
256 LIRC_SFH506_DELAY);
257 252
258 rbuf_write(data); /* space */253 rbuf_write(data); /* space */
259 } else {254 } else {
@@ -301,7 +296,7 @@ static void lirc_lirc_irq_handler(void *blah) · 41 unmodified lines
301 data = 1;296 data = 1;
302 rbuf_write(PULSE_BIT|data); /* pulse */297 rbuf_write(PULSE_BIT|data); /* pulse */
303 }298 }
304 do_gettimeofday(&lasttv);299 lastkt = ktime_get();
305#else300#else
306 /* add your code here */301 /* add your code here */
307#endif302#endif
drivers/staging/media/lirc/lirc_sasem.c+9−11
@@ -42,6 +42,7 @@ · 41 unmodified lines
42#include <linux/slab.h>42#include <linux/slab.h>
43#include <linux/uaccess.h>43#include <linux/uaccess.h>
44#include <linux/usb.h>44#include <linux/usb.h>
45#include <linux/ktime.h>
45 46
46#include <media/lirc.h>47#include <media/lirc.h>
47#include <media/lirc_dev.h>48#include <media/lirc_dev.h>
@@ -111,7 +112,7 @@ struct sasem_context { · 63 unmodified lines
111 } tx;112 } tx;
112 113
113 /* for dealing with repeat codes (wish there was a toggle bit!) */114 /* for dealing with repeat codes (wish there was a toggle bit!) */
114 struct timeval presstime;115 ktime_t presstime;
115 char lastcode[8];116 char lastcode[8];
116 int codesaved;117 int codesaved;
117};118};
@@ -566,8 +567,8 @@ static void incoming_packet(struct sasem_context *context, · 448 unmodified lines
566{567{
567 int len = urb->actual_length;568 int len = urb->actual_length;
568 unsigned char *buf = urb->transfer_buffer;569 unsigned char *buf = urb->transfer_buffer;
569 long ms;570 u64 ns;
570 struct timeval tv;571 ktime_t kt;
571 572
572 if (len != 8) {573 if (len != 8) {
573 dev_warn(&context->dev->dev,574 dev_warn(&context->dev->dev,
@@ -584,9 +585,8 @@ static void incoming_packet(struct sasem_context *context, · 10 unmodified lines
584 */585 */
585 586
586 /* get the time since the last button press */587 /* get the time since the last button press */
587 do_gettimeofday(&tv);588 kt = ktime_get();
588 ms = (tv.tv_sec - context->presstime.tv_sec) * 1000 +589 ns = ktime_to_ns(ktime_sub(kt, context->presstime));
589 (tv.tv_usec - context->presstime.tv_usec) / 1000;
590 590
591 if (memcmp(buf, "\x08\0\0\0\0\0\0\0", 8) == 0) {591 if (memcmp(buf, "\x08\0\0\0\0\0\0\0", 8) == 0) {
592 /*592 /*
@@ -600,10 +600,9 @@ static void incoming_packet(struct sasem_context *context, · 7 unmodified lines
600 * in that time and then get a false repeat of the previous600 * in that time and then get a false repeat of the previous
601 * press but it is long enough for a genuine repeat601 * press but it is long enough for a genuine repeat
602 */602 */
603 if ((ms < 250) && (context->codesaved != 0)) {603 if ((ns < 250 * NSEC_PER_MSEC) && (context->codesaved != 0)) {
604 memcpy(buf, &context->lastcode, 8);604 memcpy(buf, &context->lastcode, 8);
605 context->presstime.tv_sec = tv.tv_sec;605 context->presstime = kt;
606 context->presstime.tv_usec = tv.tv_usec;
607 }606 }
608 } else {607 } else {
609 /* save the current valid code for repeats */608 /* save the current valid code for repeats */
@@ -613,8 +612,7 @@ static void incoming_packet(struct sasem_context *context, · 3 unmodified lines
613 * just for safety reasons612 * just for safety reasons
614 */613 */
615 context->codesaved = 1;614 context->codesaved = 1;
616 context->presstime.tv_sec = tv.tv_sec;615 context->presstime = kt;
617 context->presstime.tv_usec = tv.tv_usec;
618 }616 }
619 617
620 lirc_buffer_write(context->driver->rbuf, buf);618 lirc_buffer_write(context->driver->rbuf, buf);
drivers/staging/media/lirc/lirc_serial.c+17−33
@@ -59,7 +59,7 @@ · 58 unmodified lines
59#include <linux/ioport.h>59#include <linux/ioport.h>
60#include <linux/kernel.h>60#include <linux/kernel.h>
61#include <linux/serial_reg.h>61#include <linux/serial_reg.h>
62#include <linux/time.h>62#include <linux/ktime.h>
63#include <linux/string.h>63#include <linux/string.h>
64#include <linux/types.h>64#include <linux/types.h>
65#include <linux/wait.h>65#include <linux/wait.h>
@@ -204,7 +204,7 @@ static struct lirc_serial hardware[] = { · 138 unmodified lines
204 204
205#define RBUF_LEN 256205#define RBUF_LEN 256
206 206
207static struct timeval lasttv = {0, 0};207static ktime_t lastkt;
208 208
209static struct lirc_buffer rbuf;209static struct lirc_buffer rbuf;
210 210
@@ -542,10 +542,10 @@ static void frbwrite(int l) · 331 unmodified lines
542 542
543static irqreturn_t lirc_irq_handler(int i, void *blah)543static irqreturn_t lirc_irq_handler(int i, void *blah)
544{544{
545 struct timeval tv;545 ktime_t kt;
546 int counter, dcd;546 int counter, dcd;
547 u8 status;547 u8 status;
548 long deltv;548 ktime_t delkt;
549 int data;549 int data;
550 static int last_dcd = -1;550 static int last_dcd = -1;
551 551
@@ -565,7 +565,7 @@ static irqreturn_t lirc_irq_handler(int i, void *blah) · 13 unmodified lines
565 if ((status & hardware[type].signal_pin_change)565 if ((status & hardware[type].signal_pin_change)
566 && sense != -1) {566 && sense != -1) {
567 /* get current time */567 /* get current time */
568 do_gettimeofday(&tv);568 kt = ktime_get();
569 569
570 /* New mode, written by Trent Piepho570 /* New mode, written by Trent Piepho
571 <xyzzy@u.washington.edu>. */571 <xyzzy@u.washington.edu>. */
@@ -594,34 +594,20 @@ static irqreturn_t lirc_irq_handler(int i, void *blah) · 22 unmodified lines
594 dcd = (status & hardware[type].signal_pin) ? 1 : 0;594 dcd = (status & hardware[type].signal_pin) ? 1 : 0;
595 595
596 if (dcd == last_dcd) {596 if (dcd == last_dcd) {
597 pr_warn("ignoring spike: %d %d %lx %lx %lx %lx\n",597 pr_warn("ignoring spike: %d %d %llx %llx\n",
598 dcd, sense,598 dcd, sense, ktime_to_us(kt),
599 tv.tv_sec, lasttv.tv_sec,599 ktime_to_us(lastkt));
600 (unsigned long)tv.tv_usec,
601 (unsigned long)lasttv.tv_usec);
602 continue;600 continue;
603 }601 }
604 602
605 deltv = tv.tv_sec-lasttv.tv_sec;603 delkt = ktime_sub(kt, lastkt);
606 if (tv.tv_sec < lasttv.tv_sec ||604 if (ktime_compare(delkt, ktime_set(15, 0)) > 0) {
607 (tv.tv_sec == lasttv.tv_sec &&
608 tv.tv_usec < lasttv.tv_usec)) {
609 pr_warn("AIEEEE: your clock just jumped backwards\n");
610 pr_warn("%d %d %lx %lx %lx %lx\n",
611 dcd, sense,
612 tv.tv_sec, lasttv.tv_sec,
613 (unsigned long)tv.tv_usec,
614 (unsigned long)lasttv.tv_usec);
615 data = PULSE_MASK;
616 } else if (deltv > 15) {
617 data = PULSE_MASK; /* really long time */605 data = PULSE_MASK; /* really long time */
618 if (!(dcd^sense)) {606 if (!(dcd^sense)) {
619 /* sanity check */607 /* sanity check */
620 pr_warn("AIEEEE: %d %d %lx %lx %lx %lx\n",608 pr_warn("AIEEEE: %d %d %llx %llx\n",
621 dcd, sense,609 dcd, sense, ktime_to_us(kt),
622 tv.tv_sec, lasttv.tv_sec,610 ktime_to_us(lastkt));
623 (unsigned long)tv.tv_usec,
624 (unsigned long)lasttv.tv_usec);
625 /*611 /*
626 * detecting pulse while this612 * detecting pulse while this
627 * MUST be a space!613 * MUST be a space!
@@ -629,11 +615,9 @@ static irqreturn_t lirc_irq_handler(int i, void *blah) · 1 unmodified line
629 sense = sense ? 0 : 1;615 sense = sense ? 0 : 1;
630 }616 }
631 } else617 } else
632 data = (int) (deltv*1000000 +618 data = (int) ktime_to_us(delkt);
633 tv.tv_usec -
634 lasttv.tv_usec);
635 frbwrite(dcd^sense ? data : (data|PULSE_BIT));619 frbwrite(dcd^sense ? data : (data|PULSE_BIT));
636 lasttv = tv;620 lastkt = kt;
637 last_dcd = dcd;621 last_dcd = dcd;
638 wake_up_interruptible(&rbuf.wait_poll);622 wake_up_interruptible(&rbuf.wait_poll);
639 }623 }
@@ -790,7 +774,7 @@ static int set_use_inc(void *data) · 150 unmodified lines
790 unsigned long flags;774 unsigned long flags;
791 775
792 /* initialize timestamp */776 /* initialize timestamp */
793 do_gettimeofday(&lasttv);777 lastkt = ktime_get();
794 778
795 spin_lock_irqsave(&hardware[type].lock, flags);779 spin_lock_irqsave(&hardware[type].lock, flags);
796 780
@@ -979,7 +963,7 @@ static int lirc_serial_resume(struct platform_device *dev) · 182 unmodified lines
979 963
980 spin_lock_irqsave(&hardware[type].lock, flags);964 spin_lock_irqsave(&hardware[type].lock, flags);
981 /* Enable Interrupt */965 /* Enable Interrupt */
982 do_gettimeofday(&lasttv);966 lastkt = ktime_get();
983 soutp(UART_IER, sinp(UART_IER)|UART_IER_MSI);967 soutp(UART_IER, sinp(UART_IER)|UART_IER_MSI);
984 off();968 off();
985 969
drivers/staging/media/omap4iss/Kconfig+1−1
@@ -1,6 +1,6 @@
1config VIDEO_OMAP41config VIDEO_OMAP4
2 tristate "OMAP 4 Camera support"2 tristate "OMAP 4 Camera support"
3 depends on VIDEO_V4L2=y && VIDEO_V4L2_SUBDEV_API && I2C=y && ARCH_OMAP43 depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
4 depends on HAS_DMA4 depends on HAS_DMA
5 select MFD_SYSCON5 select MFD_SYSCON
6 select VIDEOBUF2_DMA_CONTIG6 select VIDEOBUF2_DMA_CONTIG
drivers/staging/media/omap4iss/iss.c+2−2
@@ -601,8 +601,8 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe, · 600 unmodified lines
601 subdev = media_entity_to_v4l2_subdev(entity);601 subdev = media_entity_to_v4l2_subdev(entity);
602 ret = v4l2_subdev_call(subdev, video, s_stream, 0);602 ret = v4l2_subdev_call(subdev, video, s_stream, 0);
603 if (ret < 0) {603 if (ret < 0) {
604 dev_dbg(iss->dev, "%s: module stop timeout.\n",604 dev_warn(iss->dev, "%s: module stop timeout.\n",
605 subdev->name);605 subdev->name);
606 /* If the entity failed to stopped, assume it has606 /* If the entity failed to stopped, assume it has
607 * crashed. Mark it as such, the ISS will be reset when607 * crashed. Mark it as such, the ISS will be reset when
608 * applications will release it.608 * applications will release it.
drivers/staging/media/omap4iss/iss.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
20#include <linux/platform_device.h>20#include <linux/platform_device.h>
21#include <linux/wait.h>21#include <linux/wait.h>
22 22
23#include <media/omap4iss.h>23#include <linux/platform_data/media/omap4iss.h>
24 24
25#include "iss_regs.h"25#include "iss_regs.h"
26#include "iss_csiphy.h"26#include "iss_csiphy.h"
drivers/staging/media/omap4iss/iss_csi2.c+3−3
@@ -674,6 +674,9 @@ static void csi2_isr_ctx(struct iss_csi2_device *csi2, · 673 unmodified lines
674 status = iss_reg_read(csi2->iss, csi2->regs1, CSI2_CTX_IRQSTATUS(n));674 status = iss_reg_read(csi2->iss, csi2->regs1, CSI2_CTX_IRQSTATUS(n));
675 iss_reg_write(csi2->iss, csi2->regs1, CSI2_CTX_IRQSTATUS(n), status);675 iss_reg_write(csi2->iss, csi2->regs1, CSI2_CTX_IRQSTATUS(n), status);
676 676
677 if (omap4iss_module_sync_is_stopping(&csi2->wait, &csi2->stopping))
678 return;
679
677 /* Propagate frame number */680 /* Propagate frame number */
678 if (status & CSI2_CTX_IRQ_FS) {681 if (status & CSI2_CTX_IRQ_FS) {
679 struct iss_pipeline *pipe =682 struct iss_pipeline *pipe =
@@ -776,9 +779,6 @@ void omap4iss_csi2_isr(struct iss_csi2_device *csi2) · 96 unmodified lines
776 pipe->error = true;779 pipe->error = true;
777 }780 }
778 781
779 if (omap4iss_module_sync_is_stopping(&csi2->wait, &csi2->stopping))
780 return;
781
782 /* Successful cases */782 /* Successful cases */
783 if (csi2_irqstatus & CSI2_IRQ_CONTEXT0)783 if (csi2_irqstatus & CSI2_IRQ_CONTEXT0)
784 csi2_isr_ctx(csi2, &csi2->contexts[0]);784 csi2_isr_ctx(csi2, &csi2->contexts[0]);
drivers/staging/media/omap4iss/iss_csiphy.h+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
14#ifndef OMAP4_ISS_CSI_PHY_H14#ifndef OMAP4_ISS_CSI_PHY_H
15#define OMAP4_ISS_CSI_PHY_H15#define OMAP4_ISS_CSI_PHY_H
16 16
17#include <media/omap4iss.h>17#include <linux/platform_data/media/omap4iss.h>
18 18
19struct iss_csi2_device;19struct iss_csi2_device;
20 20
drivers/staging/media/omap4iss/iss_resizer.c+2−2
@@ -158,8 +158,8 @@ static void resizer_set_outaddr(struct iss_resizer_device *resizer, u32 addr) · 157 unmodified lines
158 /* Program UV buffer address... Hardcoded to be contiguous! */158 /* Program UV buffer address... Hardcoded to be contiguous! */
159 if ((informat->code == MEDIA_BUS_FMT_UYVY8_1X16) &&159 if ((informat->code == MEDIA_BUS_FMT_UYVY8_1X16) &&
160 (outformat->code == MEDIA_BUS_FMT_YUYV8_1_5X8)) {160 (outformat->code == MEDIA_BUS_FMT_YUYV8_1_5X8)) {
161 u32 c_addr = addr + (resizer->video_out.bpl_value *161 u32 c_addr = addr + resizer->video_out.bpl_value
162 (outformat->height - 1));162 * outformat->height;
163 163
164 /* Ensure Y_BAD_L[6:0] = C_BAD_L[6:0]*/164 /* Ensure Y_BAD_L[6:0] = C_BAD_L[6:0]*/
165 if ((c_addr ^ addr) & 0x7f) {165 if ((c_addr ^ addr) & 0x7f) {
drivers/staging/media/omap4iss/iss_video.c+1−2
@@ -287,7 +287,6 @@ iss_video_check_format(struct iss_video *video, struct iss_video_fh *vfh) · 286 unmodified lines
287 */287 */
288 288
289static int iss_video_queue_setup(struct vb2_queue *vq,289static int iss_video_queue_setup(struct vb2_queue *vq,
290 const void *parg,
291 unsigned int *count, unsigned int *num_planes,290 unsigned int *count, unsigned int *num_planes,
292 unsigned int sizes[], void *alloc_ctxs[])291 unsigned int sizes[], void *alloc_ctxs[])
293{292{
@@ -434,7 +433,7 @@ struct iss_buffer *omap4iss_video_buffer_next(struct iss_video *video) · 140 unmodified lines
434 list_del(&buf->list);433 list_del(&buf->list);
435 spin_unlock_irqrestore(&video->qlock, flags);434 spin_unlock_irqrestore(&video->qlock, flags);
436 435
437 v4l2_get_timestamp(&buf->vb.timestamp);436 buf->vb.vb2_buf.timestamp = ktime_get_ns();
438 437
439 /* Do frame number propagation only if this is the output video node.438 /* Do frame number propagation only if this is the output video node.
440 * Frame number either comes from the CSI receivers or it gets439 * Frame number either comes from the CSI receivers or it gets
drivers/usb/gadget/function/uvc_queue.c+2−2
@@ -41,7 +41,7 @@ · 40 unmodified lines
41 * videobuf2 queue operations41 * videobuf2 queue operations
42 */42 */
43 43
44static int uvc_queue_setup(struct vb2_queue *vq, const void *parg,44static int uvc_queue_setup(struct vb2_queue *vq,
45 unsigned int *nbuffers, unsigned int *nplanes,45 unsigned int *nbuffers, unsigned int *nplanes,
46 unsigned int sizes[], void *alloc_ctxs[])46 unsigned int sizes[], void *alloc_ctxs[])
47{47{
@@ -329,7 +329,7 @@ struct uvc_buffer *uvcg_queue_next_buffer(struct uvc_video_queue *queue, · 281 unmodified lines
329 329
330 buf->buf.field = V4L2_FIELD_NONE;330 buf->buf.field = V4L2_FIELD_NONE;
331 buf->buf.sequence = queue->sequence++;331 buf->buf.sequence = queue->sequence++;
332 v4l2_get_timestamp(&buf->buf.timestamp);332 buf->buf.vb2_buf.timestamp = ktime_get_ns();
333 333
334 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused);334 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused);
335 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);335 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);
firmware/WHENCE+1−1
@@ -677,7 +677,7 @@ File: av7110/bootcode.bin · 676 unmodified lines
677 677
678Licence: GPLv2 or later678Licence: GPLv2 or later
679 679
680ARM assembly source code available at http://www.linuxtv.org/downloads/firmware/Boot.S680ARM assembly source code available at https://linuxtv.org/downloads/firmware/Boot.S
681 681
682--------------------------------------------------------------------------682--------------------------------------------------------------------------
683 683
include/linux/platform_data/camera-rcar.h+0−25
@@ -1,25 +0,0 @@
1/*
2 * Platform data for Renesas R-Car VIN soc-camera driver
3 *
4 * Copyright (C) 2011-2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Cogent Embedded, Inc., <source@cogentembedded.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __CAMERA_RCAR_H_
14#define __CAMERA_RCAR_H_
15
16#define RCAR_VIN_HSYNC_ACTIVE_LOW (1 << 0)
17#define RCAR_VIN_VSYNC_ACTIVE_LOW (1 << 1)
18#define RCAR_VIN_BT601 (1 << 2)
19#define RCAR_VIN_BT656 (1 << 3)
20
21struct rcar_vin_platform_data {
22 unsigned int flags;
23};
24
25#endif /* __CAMERA_RCAR_H_ */
include/linux/platform_data/media/camera-mx2.hrenamed from include/linux/platform_data/camera-mx2.h+0−0

File renamed without changes.

include/linux/platform_data/media/camera-mx3.hrenamed from include/linux/platform_data/camera-mx3.h+0−0

File renamed without changes.

include/linux/platform_data/media/camera-pxa.hrenamed from include/linux/platform_data/camera-pxa.h+0−0

File renamed without changes.

include/linux/platform_data/media/coda.hrenamed from include/linux/platform_data/coda.h+0−0

File renamed without changes.

include/linux/platform_data/media/gpio-ir-recv.hrenamed from include/media/gpio-ir-recv.h+0−1
@@ -21,4 +21,3 @@ struct gpio_ir_recv_platform_data { · 20 unmodified lines
21};21};
22 22
23#endif /* __GPIO_IR_RECV_H__ */23#endif /* __GPIO_IR_RECV_H__ */
24
include/linux/platform_data/media/ir-rx51.hrenamed from include/media/ir-rx51.h+0−0

File renamed without changes.

include/linux/platform_data/media/mmp-camera.hrenamed from include/media/mmp-camera.h+0−0

File renamed without changes.

include/linux/platform_data/media/omap1_camera.hrenamed from include/media/omap1_camera.h+0−0

File renamed without changes.

include/linux/platform_data/media/omap4iss.hrenamed from include/media/omap4iss.h+0−0

File renamed without changes.

include/linux/platform_data/media/s5p_hdmi.hrenamed from include/media/s5p_hdmi.h+0−1
@@ -34,4 +34,3 @@ struct s5p_hdmi_platform_data { · 33 unmodified lines
34};34};
35 35
36#endif /* S5P_HDMI_H */36#endif /* S5P_HDMI_H */
37
include/linux/platform_data/media/si4713.hrenamed from include/media/si4713.h+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * include/media/si4713.h2 * include/linux/platform_data/media/si4713.h
3 *3 *
4 * Board related data definitions for Si4713 i2c device driver.4 * Board related data definitions for Si4713 i2c device driver.
5 *5 *
include/linux/platform_data/media/sii9234.hrenamed from include/media/sii9234.h+0−0

File renamed without changes.

include/linux/platform_data/media/soc_camera_platform.hrenamed from include/media/soc_camera_platform.h+0−0

File renamed without changes.

include/linux/platform_data/media/timb_radio.hrenamed from include/media/timb_radio.h+0−0

File renamed without changes.

include/linux/platform_data/media/timb_video.hrenamed from include/media/timb_video.h+0−0

File renamed without changes.

include/linux/videodev2.h+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
46 * All kernel-specific stuff were moved to media/v4l2-dev.h, so46 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
47 * no #if __KERNEL tests are allowed here47 * no #if __KERNEL tests are allowed here
48 *48 *
49 * See http://linuxtv.org for more info49 * See https://linuxtv.org for more info
50 *50 *
51 * Author: Bill Dirks <bill@thedirks.org>51 * Author: Bill Dirks <bill@thedirks.org>
52 * Justin Schoeman52 * Justin Schoeman
include/media/drv-intf/cx2341x.hrenamed from include/media/cx2341x.h+0−0

File renamed without changes.

include/media/drv-intf/cx25840.hrenamed from include/media/cx25840.h+0−0

File renamed without changes.

include/media/drv-intf/exynos-fimc.hrenamed from include/media/exynos-fimc.h+0−0

File renamed without changes.

include/media/drv-intf/msp3400.hrenamed from include/media/msp3400.h+0−1
@@ -223,4 +223,3 @@ · 222 unmodified lines
223 */223 */
224 224
225#endif /* MSP3400_H */225#endif /* MSP3400_H */
226
include/media/drv-intf/s3c_camif.hrenamed from include/media/s3c_camif.h+0−0

File renamed without changes.

include/media/drv-intf/saa7146.hrenamed from include/media/saa7146.h+0−0

File renamed without changes.

include/media/drv-intf/saa7146_vv.hrenamed from include/media/saa7146_vv.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
4#include <media/v4l2-common.h>4#include <media/v4l2-common.h>
5#include <media/v4l2-ioctl.h>5#include <media/v4l2-ioctl.h>
6#include <media/v4l2-fh.h>6#include <media/v4l2-fh.h>
7#include <media/saa7146.h>7#include <media/drv-intf/saa7146.h>
8#include <media/videobuf-dma-sg.h>8#include <media/videobuf-dma-sg.h>
9 9
10#define MAX_SAA7146_CAPTURE_BUFFERS 32 /* arbitrary */10#define MAX_SAA7146_CAPTURE_BUFFERS 32 /* arbitrary */
include/media/drv-intf/sh_mobile_ceu.hrenamed from include/media/sh_mobile_ceu.h+0−0

File renamed without changes.

include/media/drv-intf/sh_mobile_csi2.hrenamed from include/media/sh_mobile_csi2.h+0−0

File renamed without changes.

include/media/drv-intf/sh_vou.hrenamed from include/media/sh_vou.h+0−0

File renamed without changes.

include/media/drv-intf/si476x.hrenamed from include/media/si476x.h+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * include/media/si476x.h -- Common definitions for si476x driver2 * include/media/drv-intf/si476x.h -- Common definitions for si476x driver
3 *3 *
4 * Copyright (C) 2012 Innovative Converged Devices(ICD)4 * Copyright (C) 2012 Innovative Converged Devices(ICD)
5 * Copyright (C) 2013 Andrey Smirnov5 * Copyright (C) 2013 Andrey Smirnov
include/media/drv-intf/soc_mediabus.hrenamed from include/media/soc_mediabus.h+0−0

File renamed without changes.

include/media/drv-intf/tea575x.hrenamed from include/media/tea575x.h+1−1
@@ -63,7 +63,7 @@ struct snd_tea575x { · 62 unmodified lines
63 u32 band; /* 0: FM, 1: FM-Japan, 2: AM */63 u32 band; /* 0: FM, 1: FM-Japan, 2: AM */
64 u32 freq; /* frequency */64 u32 freq; /* frequency */
65 struct mutex mutex;65 struct mutex mutex;
66 struct snd_tea575x_ops *ops;66 const struct snd_tea575x_ops *ops;
67 void *private_data;67 void *private_data;
68 u8 card[32];68 u8 card[32];
69 u8 bus_info[32];69 u8 bus_info[32];
include/media/i2c/ad9389b.hrenamed from include/media/ad9389b.h+0−0

File renamed without changes.

include/media/i2c/adp1653.hrenamed from include/media/adp1653.h+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * include/media/adp1653.h2 * include/media/i2c/adp1653.h
3 *3 *
4 * Copyright (C) 2008--2011 Nokia Corporation4 * Copyright (C) 2008--2011 Nokia Corporation
5 *5 *
include/media/i2c/adv7183.hrenamed from include/media/adv7183.h+0−0

File renamed without changes.

include/media/i2c/adv7343.hrenamed from include/media/adv7343.h+0−0

File renamed without changes.

include/media/i2c/adv7393.hrenamed from include/media/adv7393.h+0−0

File renamed without changes.

include/media/i2c/adv7511.hrenamed from include/media/adv7511.h+0−0

File renamed without changes.

include/media/i2c/adv7604.hrenamed from include/media/adv7604.h+0−0

File renamed without changes.

include/media/i2c/adv7842.hrenamed from include/media/adv7842.h+0−0

File renamed without changes.

include/media/i2c/ak881x.hrenamed from include/media/ak881x.h+0−0

File renamed without changes.

include/media/i2c/as3645a.hrenamed from include/media/as3645a.h+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * include/media/as3645a.h2 * include/media/i2c/as3645a.h
3 *3 *
4 * Copyright (C) 2008-2011 Nokia Corporation4 * Copyright (C) 2008-2011 Nokia Corporation
5 *5 *
include/media/i2c/bt819.hrenamed from include/media/bt819.h+0−0

File renamed without changes.

include/media/i2c/cs5345.hrenamed from include/media/cs5345.h+0−0

File renamed without changes.

include/media/i2c/cs53l32a.hrenamed from include/media/cs53l32a.h+0−0

File renamed without changes.

include/media/i2c/ir-kbd-i2c.hrenamed from include/media/ir-kbd-i2c.h+0−0

File renamed without changes.

include/media/i2c/lm3560.hrenamed from include/media/lm3560.h+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * include/media/lm3560.h2 * include/media/i2c/lm3560.h
3 *3 *
4 * Copyright (C) 2013 Texas Instruments4 * Copyright (C) 2013 Texas Instruments
5 *5 *
include/media/i2c/lm3646.hrenamed from include/media/lm3646.h+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * include/media/lm3646.h2 * include/media/i2c/lm3646.h
3 *3 *
4 * Copyright (C) 2014 Texas Instruments4 * Copyright (C) 2014 Texas Instruments
5 *5 *
include/media/i2c/m52790.hrenamed from include/media/m52790.h+0−0

File renamed without changes.

include/media/i2c/m5mols.hrenamed from include/media/m5mols.h+0−0

File renamed without changes.

include/media/i2c/mt9m032.hrenamed from include/media/mt9m032.h+0−0

File renamed without changes.

include/media/i2c/mt9p031.hrenamed from include/media/mt9p031.h+0−0

File renamed without changes.

include/media/i2c/mt9t001.hrenamed from include/media/mt9t001.h+0−0

File renamed without changes.

include/media/i2c/mt9t112.hrenamed from include/media/mt9t112.h+0−0

File renamed without changes.

include/media/i2c/mt9v011.hrenamed from include/media/mt9v011.h+0−0

File renamed without changes.

include/media/i2c/mt9v022.hrenamed from include/media/mt9v022.h+0−0

File renamed without changes.

include/media/i2c/mt9v032.hrenamed from include/media/mt9v032.h+0−0

File renamed without changes.

include/media/i2c/noon010pc30.hrenamed from include/media/noon010pc30.h+0−0

File renamed without changes.

include/media/i2c/ov2659.hrenamed from include/media/ov2659.h+0−0

File renamed without changes.

include/media/i2c/ov7670.hrenamed from include/media/ov7670.h+0−0

File renamed without changes.

include/media/i2c/ov772x.hrenamed from include/media/ov772x.h+0−0

File renamed without changes.

include/media/i2c/ov9650.hrenamed from include/media/ov9650.h+0−0

File renamed without changes.

include/media/i2c/rj54n1cb0c.hrenamed from include/media/rj54n1cb0c.h+0−0

File renamed without changes.

include/media/i2c/s5c73m3.hrenamed from include/media/s5c73m3.h+0−0

File renamed without changes.

include/media/i2c/s5k4ecgx.hrenamed from include/media/s5k4ecgx.h+0−0

File renamed without changes.

include/media/i2c/s5k6aa.hrenamed from include/media/s5k6aa.h+0−0

File renamed without changes.

include/media/i2c/saa6588.hrenamed from include/media/saa6588.h+0−0

File renamed without changes.

include/media/i2c/saa7115.hrenamed from include/media/saa7115.h+0−1
@@ -138,4 +138,3 @@ struct saa7115_platform_data { · 137 unmodified lines
138};138};
139 139
140#endif140#endif
141
include/media/i2c/saa7127.hrenamed from include/media/saa7127.h+0−1
@@ -38,4 +38,3 @@ enum saa7127_output_type { · 37 unmodified lines
38};38};
39 39
40#endif40#endif
41
include/media/i2c/smiapp.hrenamed from include/media/smiapp.h+1−1
@@ -1,5 +1,5 @@
1/*1/*
2 * include/media/smiapp.h2 * include/media/i2c/smiapp.h
3 *3 *
4 * Generic driver for SMIA/SMIA++ compliant camera modules4 * Generic driver for SMIA/SMIA++ compliant camera modules
5 *5 *
include/media/i2c/sr030pc30.hrenamed from include/media/sr030pc30.h+0−0

File renamed without changes.

include/media/i2c/tc358743.hrenamed from include/media/tc358743.h+0−0

File renamed without changes.

include/media/i2c/ths7303.hrenamed from include/media/ths7303.h+0−0

File renamed without changes.

include/media/i2c/tvaudio.hrenamed from include/media/tvaudio.h+0−0

File renamed without changes.

include/media/i2c/tvp514x.hrenamed from include/media/tvp514x.h+0−0

File renamed without changes.

include/media/i2c/tvp5150.hrenamed from include/media/tvp5150.h+0−1
@@ -31,4 +31,3 @@ · 30 unmodified lines
31#define TVP5150_BLACK_SCREEN 131#define TVP5150_BLACK_SCREEN 1
32 32
33#endif33#endif
34
include/media/i2c/tvp7002.hrenamed from include/media/tvp7002.h+0−0

File renamed without changes.

include/media/i2c/tw9910.hrenamed from include/media/tw9910.h+0−0

File renamed without changes.

include/media/i2c/uda1342.hrenamed from include/media/uda1342.h+0−0

File renamed without changes.

include/media/i2c/upd64031a.hrenamed from include/media/upd64031a.h+0−0

File renamed without changes.

include/media/i2c/upd64083.hrenamed from include/media/upd64083.h+0−0

File renamed without changes.

include/media/i2c/wm8775.hrenamed from include/media/wm8775.h+0−0

File renamed without changes.

include/media/lirc.h+1−168
@@ -1,168 +1 @@
1/*1#include <uapi/linux/lirc.h>
2 * lirc.h - linux infrared remote control header file
3 * last modified 2010/07/13 by Jarod Wilson
4 */
5
6#ifndef _LINUX_LIRC_H
7#define _LINUX_LIRC_H
8
9#include <linux/types.h>
10#include <linux/ioctl.h>
11
12#define PULSE_BIT 0x01000000
13#define PULSE_MASK 0x00FFFFFF
14
15#define LIRC_MODE2_SPACE 0x00000000
16#define LIRC_MODE2_PULSE 0x01000000
17#define LIRC_MODE2_FREQUENCY 0x02000000
18#define LIRC_MODE2_TIMEOUT 0x03000000
19
20#define LIRC_VALUE_MASK 0x00FFFFFF
21#define LIRC_MODE2_MASK 0xFF000000
22
23#define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE)
24#define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE)
25#define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)
26#define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT)
27
28#define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK)
29#define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK)
30
31#define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE)
32#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)
33#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)
34#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT)
35
36/* used heavily by lirc userspace */
37#define lirc_t int
38
39/*** lirc compatible hardware features ***/
40
41#define LIRC_MODE2SEND(x) (x)
42#define LIRC_SEND2MODE(x) (x)
43#define LIRC_MODE2REC(x) ((x) << 16)
44#define LIRC_REC2MODE(x) ((x) >> 16)
45
46#define LIRC_MODE_RAW 0x00000001
47#define LIRC_MODE_PULSE 0x00000002
48#define LIRC_MODE_MODE2 0x00000004
49#define LIRC_MODE_LIRCCODE 0x00000010
50
51
52#define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW)
53#define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE)
54#define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2)
55#define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE)
56
57#define LIRC_CAN_SEND_MASK 0x0000003f
58
59#define LIRC_CAN_SET_SEND_CARRIER 0x00000100
60#define LIRC_CAN_SET_SEND_DUTY_CYCLE 0x00000200
61#define LIRC_CAN_SET_TRANSMITTER_MASK 0x00000400
62
63#define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW)
64#define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE)
65#define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2)
66#define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE)
67
68#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK)
69
70#define LIRC_CAN_SET_REC_CARRIER (LIRC_CAN_SET_SEND_CARRIER << 16)
71#define LIRC_CAN_SET_REC_DUTY_CYCLE (LIRC_CAN_SET_SEND_DUTY_CYCLE << 16)
72
73#define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000
74#define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000
75#define LIRC_CAN_GET_REC_RESOLUTION 0x20000000
76#define LIRC_CAN_SET_REC_TIMEOUT 0x10000000
77#define LIRC_CAN_SET_REC_FILTER 0x08000000
78
79#define LIRC_CAN_MEASURE_CARRIER 0x02000000
80#define LIRC_CAN_USE_WIDEBAND_RECEIVER 0x04000000
81
82#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK)
83#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK)
84
85#define LIRC_CAN_NOTIFY_DECODE 0x01000000
86
87/*** IOCTL commands for lirc driver ***/
88
89#define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32)
90
91#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32)
92#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32)
93#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32)
94#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32)
95#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32)
96#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32)
97#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32)
98
99#define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32)
100#define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32)
101
102#define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, __u32)
103#define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, __u32)
104#define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, __u32)
105#define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, __u32)
106
107/* code length in bits, currently only for LIRC_MODE_LIRCCODE */
108#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32)
109
110#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32)
111#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32)
112/* Note: these can reset the according pulse_width */
113#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32)
114#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32)
115#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32)
116#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)
117#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32)
118
119/*
120 * when a timeout != 0 is set the driver will send a
121 * LIRC_MODE2_TIMEOUT data packet, otherwise LIRC_MODE2_TIMEOUT is
122 * never sent, timeout is disabled by default
123 */
124#define LIRC_SET_REC_TIMEOUT _IOW('i', 0x00000018, __u32)
125
126/* 1 enables, 0 disables timeout reports in MODE2 */
127#define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32)
128
129/*
130 * pulses shorter than this are filtered out by hardware (software
131 * emulation in lirc_dev?)
132 */
133#define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, __u32)
134/*
135 * spaces shorter than this are filtered out by hardware (software
136 * emulation in lirc_dev?)
137 */
138#define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, __u32)
139/*
140 * if filter cannot be set independently for pulse/space, this should
141 * be used
142 */
143#define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, __u32)
144
145/*
146 * if enabled from the next key press on the driver will send
147 * LIRC_MODE2_FREQUENCY packets
148 */
149#define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32)
150
151/*
152 * to set a range use
153 * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the
154 * lower bound first and later
155 * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
156 */
157
158#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32)
159#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32)
160
161#define LIRC_NOTIFY_DECODE _IO('i', 0x00000020)
162
163#define LIRC_SETUP_START _IO('i', 0x00000021)
164#define LIRC_SETUP_END _IO('i', 0x00000022)
165
166#define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32)
167
168#endif
include/media/rc-core.h+1−0
@@ -239,6 +239,7 @@ static inline void init_ir_raw_event(struct ir_raw_event *ev) · 238 unmodified lines
239 memset(ev, 0, sizeof(*ev));239 memset(ev, 0, sizeof(*ev));
240}240}
241 241
242#define IR_DEFAULT_TIMEOUT MS_TO_NS(125)
242#define IR_MAX_DURATION 500000000 /* 500 ms */243#define IR_MAX_DURATION 500000000 /* 500 ms */
243#define US_TO_NS(usec) ((usec) * 1000)244#define US_TO_NS(usec) ((usec) * 1000)
244#define MS_TO_US(msec) ((msec) * 1000)245#define MS_TO_US(msec) ((msec) * 1000)
include/media/rc-map.h+20−20
@@ -33,26 +33,26 @@ enum rc_type { · 32 unmodified lines
33 RC_TYPE_XMP = 18, /* XMP protocol */33 RC_TYPE_XMP = 18, /* XMP protocol */
34};34};
35 35
36#define RC_BIT_NONE 036#define RC_BIT_NONE 0ULL
37#define RC_BIT_UNKNOWN (1 << RC_TYPE_UNKNOWN)37#define RC_BIT_UNKNOWN (1ULL << RC_TYPE_UNKNOWN)
38#define RC_BIT_OTHER (1 << RC_TYPE_OTHER)38#define RC_BIT_OTHER (1ULL << RC_TYPE_OTHER)
39#define RC_BIT_RC5 (1 << RC_TYPE_RC5)39#define RC_BIT_RC5 (1ULL << RC_TYPE_RC5)
40#define RC_BIT_RC5X (1 << RC_TYPE_RC5X)40#define RC_BIT_RC5X (1ULL << RC_TYPE_RC5X)
41#define RC_BIT_RC5_SZ (1 << RC_TYPE_RC5_SZ)41#define RC_BIT_RC5_SZ (1ULL << RC_TYPE_RC5_SZ)
42#define RC_BIT_JVC (1 << RC_TYPE_JVC)42#define RC_BIT_JVC (1ULL << RC_TYPE_JVC)
43#define RC_BIT_SONY12 (1 << RC_TYPE_SONY12)43#define RC_BIT_SONY12 (1ULL << RC_TYPE_SONY12)
44#define RC_BIT_SONY15 (1 << RC_TYPE_SONY15)44#define RC_BIT_SONY15 (1ULL << RC_TYPE_SONY15)
45#define RC_BIT_SONY20 (1 << RC_TYPE_SONY20)45#define RC_BIT_SONY20 (1ULL << RC_TYPE_SONY20)
46#define RC_BIT_NEC (1 << RC_TYPE_NEC)46#define RC_BIT_NEC (1ULL << RC_TYPE_NEC)
47#define RC_BIT_SANYO (1 << RC_TYPE_SANYO)47#define RC_BIT_SANYO (1ULL << RC_TYPE_SANYO)
48#define RC_BIT_MCE_KBD (1 << RC_TYPE_MCE_KBD)48#define RC_BIT_MCE_KBD (1ULL << RC_TYPE_MCE_KBD)
49#define RC_BIT_RC6_0 (1 << RC_TYPE_RC6_0)49#define RC_BIT_RC6_0 (1ULL << RC_TYPE_RC6_0)
50#define RC_BIT_RC6_6A_20 (1 << RC_TYPE_RC6_6A_20)50#define RC_BIT_RC6_6A_20 (1ULL << RC_TYPE_RC6_6A_20)
51#define RC_BIT_RC6_6A_24 (1 << RC_TYPE_RC6_6A_24)51#define RC_BIT_RC6_6A_24 (1ULL << RC_TYPE_RC6_6A_24)
52#define RC_BIT_RC6_6A_32 (1 << RC_TYPE_RC6_6A_32)52#define RC_BIT_RC6_6A_32 (1ULL << RC_TYPE_RC6_6A_32)
53#define RC_BIT_RC6_MCE (1 << RC_TYPE_RC6_MCE)53#define RC_BIT_RC6_MCE (1ULL << RC_TYPE_RC6_MCE)
54#define RC_BIT_SHARP (1 << RC_TYPE_SHARP)54#define RC_BIT_SHARP (1ULL << RC_TYPE_SHARP)
55#define RC_BIT_XMP (1 << RC_TYPE_XMP)55#define RC_BIT_XMP (1ULL << RC_TYPE_XMP)
56 56
57#define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | \57#define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | \
58 RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \58 RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \
include/media/v4l2-clk.h+5−0
@@ -65,7 +65,12 @@ static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id, · 64 unmodified lines
65 return __v4l2_clk_register_fixed(dev_id, rate, THIS_MODULE);65 return __v4l2_clk_register_fixed(dev_id, rate, THIS_MODULE);
66}66}
67 67
68#define V4L2_CLK_NAME_SIZE 64
69
68#define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \70#define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \
69 "%d-%04x", adap, client)71 "%d-%04x", adap, client)
70 72
73#define v4l2_clk_name_of(name, size, of_full_name) snprintf(name, size, \
74 "of-%s", of_full_name)
75
71#endif76#endif
include/media/v4l2-dv-timings.h+24−1
@@ -107,12 +107,14 @@ bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *t, · 106 unmodified lines
107 * @standard: the timings according to the standard.107 * @standard: the timings according to the standard.
108 * @pclock_delta: maximum delta in Hz between standard->pixelclock and108 * @pclock_delta: maximum delta in Hz between standard->pixelclock and
109 * the measured timings.109 * the measured timings.
110 * @match_reduced_fps: if true, then fail if V4L2_DV_FL_REDUCED_FPS does not
111 * match.
110 *112 *
111 * Returns true if the two timings match, returns false otherwise.113 * Returns true if the two timings match, returns false otherwise.
112 */114 */
113bool v4l2_match_dv_timings(const struct v4l2_dv_timings *measured,115bool v4l2_match_dv_timings(const struct v4l2_dv_timings *measured,
114 const struct v4l2_dv_timings *standard,116 const struct v4l2_dv_timings *standard,
115 unsigned pclock_delta);117 unsigned pclock_delta, bool match_reduced_fps);
116 118
117/**119/**
118 * v4l2_print_dv_timings() - log the contents of a dv_timings struct120 * v4l2_print_dv_timings() - log the contents of a dv_timings struct
@@ -183,4 +185,25 @@ bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync, · 64 unmodified lines
183 */185 */
184struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);186struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
185 187
188/*
189 * reduce_fps - check if conditions for reduced fps are true.
190 * bt - v4l2 timing structure
191 * For different timings reduced fps is allowed if following conditions
192 * are met -
193 * For CVT timings: if reduced blanking v2 (vsync == 8) is true.
194 * For CEA861 timings: if V4L2_DV_FL_CAN_REDUCE_FPS flag is true.
195 */
196static inline bool can_reduce_fps(struct v4l2_bt_timings *bt)
197{
198 if ((bt->standards & V4L2_DV_BT_STD_CVT) && (bt->vsync == 8))
199 return true;
200
201 if ((bt->standards & V4L2_DV_BT_STD_CEA861) &&
202 (bt->flags & V4L2_DV_FL_CAN_REDUCE_FPS))
203 return true;
204
205 return false;
206}
207
208
186#endif209#endif
include/media/videobuf2-core.h+87−21
@@ -129,6 +129,8 @@ struct vb2_mem_ops { · 128 unmodified lines
129 * @dbuf_mapped: flag to show whether dbuf is mapped or not129 * @dbuf_mapped: flag to show whether dbuf is mapped or not
130 * @bytesused: number of bytes occupied by data in the plane (payload)130 * @bytesused: number of bytes occupied by data in the plane (payload)
131 * @length: size of this plane (NOT the payload) in bytes131 * @length: size of this plane (NOT the payload) in bytes
132 * @min_length: minimum required size of this plane (NOT the payload) in bytes.
133 * @length is always greater or equal to @min_length.
132 * @offset: when memory in the associated struct vb2_buffer is134 * @offset: when memory in the associated struct vb2_buffer is
133 * VB2_MEMORY_MMAP, equals the offset from the start of135 * VB2_MEMORY_MMAP, equals the offset from the start of
134 * the device memory for this plane (or is a "cookie" that136 * the device memory for this plane (or is a "cookie" that
@@ -150,6 +152,7 @@ struct vb2_plane { · 15 unmodified lines
150 unsigned int dbuf_mapped;152 unsigned int dbuf_mapped;
151 unsigned int bytesused;153 unsigned int bytesused;
152 unsigned int length;154 unsigned int length;
155 unsigned int min_length;
153 union {156 union {
154 unsigned int offset;157 unsigned int offset;
155 unsigned long userptr;158 unsigned long userptr;
@@ -211,6 +214,7 @@ struct vb2_queue; · 55 unmodified lines
211 * @num_planes: number of planes in the buffer214 * @num_planes: number of planes in the buffer
212 * on an internal driver queue215 * on an internal driver queue
213 * @planes: private per-plane information; do not change216 * @planes: private per-plane information; do not change
217 * @timestamp: frame timestamp in ns
214 */218 */
215struct vb2_buffer {219struct vb2_buffer {
216 struct vb2_queue *vb2_queue;220 struct vb2_queue *vb2_queue;
@@ -219,6 +223,7 @@ struct vb2_buffer { · 2 unmodified lines
219 unsigned int memory;223 unsigned int memory;
220 unsigned int num_planes;224 unsigned int num_planes;
221 struct vb2_plane planes[VB2_MAX_PLANES];225 struct vb2_plane planes[VB2_MAX_PLANES];
226 u64 timestamp;
222 227
223 /* private: internal use only228 /* private: internal use only
224 *229 *
@@ -268,21 +273,26 @@ struct vb2_buffer { · 43 unmodified lines
268 * struct vb2_ops - driver-specific callbacks273 * struct vb2_ops - driver-specific callbacks
269 *274 *
270 * @queue_setup: called from VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS275 * @queue_setup: called from VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS
271 * handlers before memory allocation, or, if276 * handlers before memory allocation. It can be called
272 * *num_planes != 0, after the allocation to verify a277 * twice: if the original number of requested buffers
273 * smaller number of buffers. Driver should return278 * could not be allocated, then it will be called a
274 * the required number of buffers in *num_buffers, the279 * second time with the actually allocated number of
275 * required number of planes per buffer in *num_planes; the280 * buffers to verify if that is OK.
276 * size of each plane should be set in the sizes[] array281 * The driver should return the required number of buffers
277 * and optional per-plane allocator specific context in the282 * in *num_buffers, the required number of planes per
278 * alloc_ctxs[] array. When called from VIDIOC_REQBUFS,283 * buffer in *num_planes, the size of each plane should be
279 * fmt == NULL, the driver has to use the currently284 * set in the sizes[] array and optional per-plane
280 * configured format and *num_buffers is the total number285 * allocator specific context in the alloc_ctxs[] array.
281 * of buffers, that are being allocated. When called from286 * When called from VIDIOC_REQBUFS, *num_planes == 0, the
282 * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the287 * driver has to use the currently configured format to
283 * target frame format (if the format isn't valid the288 * determine the plane sizes and *num_buffers is the total
284 * callback must return -EINVAL). In this case *num_buffers289 * number of buffers that are being allocated. When called
285 * are being allocated additionally to q->num_buffers.290 * from VIDIOC_CREATE_BUFS, *num_planes != 0 and it
291 * describes the requested number of planes and sizes[]
292 * contains the requested plane sizes. If either
293 * *num_planes or the requested sizes are invalid callback
294 * must return -EINVAL. In this case *num_buffers are
295 * being allocated additionally to q->num_buffers.
286 * @wait_prepare: release any locks taken while calling vb2 functions;296 * @wait_prepare: release any locks taken while calling vb2 functions;
287 * it is called before an ioctl needs to wait for a new297 * it is called before an ioctl needs to wait for a new
288 * buffer to arrive; required to avoid a deadlock in298 * buffer to arrive; required to avoid a deadlock in
@@ -344,7 +354,7 @@ struct vb2_buffer { · 55 unmodified lines
344 * pre-queued buffers before calling STREAMON.354 * pre-queued buffers before calling STREAMON.
345 */355 */
346struct vb2_ops {356struct vb2_ops {
347 int (*queue_setup)(struct vb2_queue *q, const void *parg,357 int (*queue_setup)(struct vb2_queue *q,
348 unsigned int *num_buffers, unsigned int *num_planes,358 unsigned int *num_buffers, unsigned int *num_planes,
349 unsigned int sizes[], void *alloc_ctxs[]);359 unsigned int sizes[], void *alloc_ctxs[]);
350 360
@@ -362,11 +372,22 @@ struct vb2_ops { · 11 unmodified lines
362 void (*buf_queue)(struct vb2_buffer *vb);372 void (*buf_queue)(struct vb2_buffer *vb);
363};373};
364 374
375/**
376 * struct vb2_ops - driver-specific callbacks
377 *
378 * @fill_user_buffer: given a vb2_buffer fill in the userspace structure.
379 * For V4L2 this is a struct v4l2_buffer.
380 * @fill_vb2_buffer: given a userspace structure, fill in the vb2_buffer.
381 * If the userspace structure is invalid, then this op
382 * will return an error.
383 * @copy_timestamp: copy the timestamp from a userspace structure to
384 * the vb2_buffer struct.
385 */
365struct vb2_buf_ops {386struct vb2_buf_ops {
366 int (*fill_user_buffer)(struct vb2_buffer *vb, void *pb);387 void (*fill_user_buffer)(struct vb2_buffer *vb, void *pb);
367 int (*fill_vb2_buffer)(struct vb2_buffer *vb, const void *pb,388 int (*fill_vb2_buffer)(struct vb2_buffer *vb, const void *pb,
368 struct vb2_plane *planes);389 struct vb2_plane *planes);
369 int (*set_timestamp)(struct vb2_buffer *vb, const void *pb);390 void (*copy_timestamp)(struct vb2_buffer *vb, const void *pb);
370};391};
371 392
372/**393/**
@@ -429,6 +450,7 @@ struct vb2_buf_ops { · 56 unmodified lines
429 * called since poll() needs to return POLLERR in that situation.450 * called since poll() needs to return POLLERR in that situation.
430 * @is_multiplanar: set if buffer type is multiplanar451 * @is_multiplanar: set if buffer type is multiplanar
431 * @is_output: set if buffer type is output452 * @is_output: set if buffer type is output
453 * @copy_timestamp: set if vb2-core should set timestamps
432 * @last_buffer_dequeued: used in poll() and DQBUF to immediately return if the454 * @last_buffer_dequeued: used in poll() and DQBUF to immediately return if the
433 * last decoded buffer was already dequeued. Set for capture queues455 * last decoded buffer was already dequeued. Set for capture queues
434 * when a buffer with the V4L2_BUF_FLAG_LAST is dequeued.456 * when a buffer with the V4L2_BUF_FLAG_LAST is dequeued.
@@ -470,7 +492,6 @@ struct vb2_queue { · 35 unmodified lines
470 wait_queue_head_t done_wq;492 wait_queue_head_t done_wq;
471 493
472 void *alloc_ctx[VB2_MAX_PLANES];494 void *alloc_ctx[VB2_MAX_PLANES];
473 unsigned int plane_sizes[VB2_MAX_PLANES];
474 495
475 unsigned int streaming:1;496 unsigned int streaming:1;
476 unsigned int start_streaming_called:1;497 unsigned int start_streaming_called:1;
@@ -478,6 +499,7 @@ struct vb2_queue { · 1 unmodified line
478 unsigned int waiting_for_buffers:1;499 unsigned int waiting_for_buffers:1;
479 unsigned int is_multiplanar:1;500 unsigned int is_multiplanar:1;
480 unsigned int is_output:1;501 unsigned int is_output:1;
502 unsigned int copy_timestamp:1;
481 unsigned int last_buffer_dequeued:1;503 unsigned int last_buffer_dequeued:1;
482 504
483 struct vb2_fileio_data *fileio;505 struct vb2_fileio_data *fileio;
@@ -503,11 +525,12 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state); · 19 unmodified lines
503void vb2_discard_done(struct vb2_queue *q);525void vb2_discard_done(struct vb2_queue *q);
504int vb2_wait_for_all_buffers(struct vb2_queue *q);526int vb2_wait_for_all_buffers(struct vb2_queue *q);
505 527
506int vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb);528void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb);
507int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,529int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
508 unsigned int *count);530 unsigned int *count);
509int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,531int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
510 unsigned int *count, const void *parg);532 unsigned int *count, unsigned requested_planes,
533 const unsigned int requested_sizes[]);
511int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb);534int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb);
512int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb);535int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb);
513int vb2_core_dqbuf(struct vb2_queue *q, void *pb, bool nonblocking);536int vb2_core_dqbuf(struct vb2_queue *q, void *pb, bool nonblocking);
@@ -531,6 +554,42 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q, · 17 unmodified lines
531 unsigned long pgoff,554 unsigned long pgoff,
532 unsigned long flags);555 unsigned long flags);
533#endif556#endif
557unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file,
558 poll_table *wait);
559size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
560 loff_t *ppos, int nonblock);
561size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count,
562 loff_t *ppos, int nonblock);
563
564/*
565 * vb2_thread_fnc - callback function for use with vb2_thread
566 *
567 * This is called whenever a buffer is dequeued in the thread.
568 */
569typedef int (*vb2_thread_fnc)(struct vb2_buffer *vb, void *priv);
570
571/**
572 * vb2_thread_start() - start a thread for the given queue.
573 * @q: videobuf queue
574 * @fnc: callback function
575 * @priv: priv pointer passed to the callback function
576 * @thread_name:the name of the thread. This will be prefixed with "vb2-".
577 *
578 * This starts a thread that will queue and dequeue until an error occurs
579 * or @vb2_thread_stop is called.
580 *
581 * This function should not be used for anything else but the videobuf2-dvb
582 * support. If you think you have another good use-case for this, then please
583 * contact the linux-media mailinglist first.
584 */
585int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv,
586 const char *thread_name);
587
588/**
589 * vb2_thread_stop() - stop the thread for the given queue.
590 * @q: videobuf queue
591 */
592int vb2_thread_stop(struct vb2_queue *q);
534 593
535/**594/**
536 * vb2_is_streaming() - return streaming status of the queue595 * vb2_is_streaming() - return streaming status of the queue
@@ -635,4 +694,11 @@ static inline void vb2_clear_last_buffer_dequeued(struct vb2_queue *q) · 98 unmodified lines
635 q->last_buffer_dequeued = false;694 q->last_buffer_dequeued = false;
636}695}
637 696
697/*
698 * The following functions are not part of the vb2 core API, but are useful
699 * functions for videobuf2-*.
700 */
701bool vb2_buffer_in_use(struct vb2_queue *q, struct vb2_buffer *vb);
702int vb2_verify_memory_type(struct vb2_queue *q,
703 enum vb2_memory memory, unsigned int type);
638#endif /* _MEDIA_VIDEOBUF2_CORE_H */704#endif /* _MEDIA_VIDEOBUF2_CORE_H */
include/media/videobuf2-v4l2.h+2−38
@@ -28,7 +28,6 @@ · 27 unmodified lines
28 * @vb2_buf: video buffer 228 * @vb2_buf: video buffer 2
29 * @flags: buffer informational flags29 * @flags: buffer informational flags
30 * @field: enum v4l2_field; field order of the image in the buffer30 * @field: enum v4l2_field; field order of the image in the buffer
31 * @timestamp: frame timestamp
32 * @timecode: frame timecode31 * @timecode: frame timecode
33 * @sequence: sequence count of this frame32 * @sequence: sequence count of this frame
34 * Should contain enough information to be able to cover all the fields33 * Should contain enough information to be able to cover all the fields
@@ -39,7 +38,6 @@ struct vb2_v4l2_buffer { · 4 unmodified lines
39 38
40 __u32 flags;39 __u32 flags;
41 __u32 field;40 __u32 field;
42 struct timeval timestamp;
43 struct v4l2_timecode timecode;41 struct v4l2_timecode timecode;
44 __u32 sequence;42 __u32 sequence;
45};43};
@@ -65,42 +63,8 @@ int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type); · 19 unmodified lines
65 63
66int __must_check vb2_queue_init(struct vb2_queue *q);64int __must_check vb2_queue_init(struct vb2_queue *q);
67void vb2_queue_release(struct vb2_queue *q);65void vb2_queue_release(struct vb2_queue *q);
68 66unsigned int vb2_poll(struct vb2_queue *q, struct file *file,
69unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait);67 poll_table *wait);
70size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
71 loff_t *ppos, int nonblock);
72size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count,
73 loff_t *ppos, int nonblock);
74
75/*
76 * vb2_thread_fnc - callback function for use with vb2_thread
77 *
78 * This is called whenever a buffer is dequeued in the thread.
79 */
80typedef int (*vb2_thread_fnc)(struct vb2_buffer *vb, void *priv);
81
82/**
83 * vb2_thread_start() - start a thread for the given queue.
84 * @q: videobuf queue
85 * @fnc: callback function
86 * @priv: priv pointer passed to the callback function
87 * @thread_name:the name of the thread. This will be prefixed with "vb2-".
88 *
89 * This starts a thread that will queue and dequeue until an error occurs
90 * or @vb2_thread_stop is called.
91 *
92 * This function should not be used for anything else but the videobuf2-dvb
93 * support. If you think you have another good use-case for this, then please
94 * contact the linux-media mailinglist first.
95 */
96int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv,
97 const char *thread_name);
98
99/**
100 * vb2_thread_stop() - stop the thread for the given queue.
101 * @q: videobuf queue
102 */
103int vb2_thread_stop(struct vb2_queue *q);
104 68
105/*69/*
106 * The following functions are not part of the vb2 core API, but are simple70 * The following functions are not part of the vb2 core API, but are simple
include/trace/events/v4l2.h+2−2
@@ -184,7 +184,7 @@ DECLARE_EVENT_CLASS(vb2_v4l2_event_class, · 183 unmodified lines
184 __field(int, minor)184 __field(int, minor)
185 __field(u32, flags)185 __field(u32, flags)
186 __field(u32, field)186 __field(u32, field)
187 __field(s64, timestamp)187 __field(u64, timestamp)
188 __field(u32, timecode_type)188 __field(u32, timecode_type)
189 __field(u32, timecode_flags)189 __field(u32, timecode_flags)
190 __field(u8, timecode_frames)190 __field(u8, timecode_frames)
@@ -205,7 +205,7 @@ DECLARE_EVENT_CLASS(vb2_v4l2_event_class, · 14 unmodified lines
205 __entry->minor = owner ? owner->vdev->minor : -1;205 __entry->minor = owner ? owner->vdev->minor : -1;
206 __entry->flags = vbuf->flags;206 __entry->flags = vbuf->flags;
207 __entry->field = vbuf->field;207 __entry->field = vbuf->field;
208 __entry->timestamp = timeval_to_ns(&vbuf->timestamp);208 __entry->timestamp = vb->timestamp;
209 __entry->timecode_type = vbuf->timecode.type;209 __entry->timecode_type = vbuf->timecode.type;
210 __entry->timecode_flags = vbuf->timecode.flags;210 __entry->timecode_flags = vbuf->timecode.flags;
211 __entry->timecode_frames = vbuf->timecode.frames;211 __entry->timecode_frames = vbuf->timecode.frames;
include/trace/events/vb2.h+5−2
@@ -18,6 +18,7 @@ DECLARE_EVENT_CLASS(vb2_event_class, · 17 unmodified lines
18 __field(u32, index)18 __field(u32, index)
19 __field(u32, type)19 __field(u32, type)
20 __field(u32, bytesused)20 __field(u32, bytesused)
21 __field(u64, timestamp)
21 ),22 ),
22 23
23 TP_fast_assign(24 TP_fast_assign(
@@ -28,14 +29,16 @@ DECLARE_EVENT_CLASS(vb2_event_class, · 4 unmodified lines
28 __entry->index = vb->index;29 __entry->index = vb->index;
29 __entry->type = vb->type;30 __entry->type = vb->type;
30 __entry->bytesused = vb->planes[0].bytesused;31 __entry->bytesused = vb->planes[0].bytesused;
32 __entry->timestamp = vb->timestamp;
31 ),33 ),
32 34
33 TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, "35 TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, "
34 "type = %u, bytesused = %u", __entry->owner,36 "type = %u, bytesused = %u, timestamp = %llu", __entry->owner,
35 __entry->queued_count,37 __entry->queued_count,
36 __entry->owned_by_drv_count,38 __entry->owned_by_drv_count,
37 __entry->index, __entry->type,39 __entry->index, __entry->type,
38 __entry->bytesused40 __entry->bytesused,
41 __entry->timestamp
39 )42 )
40)43)
41 44
include/uapi/drm/drm_fourcc.h+1−1
@@ -225,7 +225,7 @@ · 224 unmodified lines
225 * - multiple of 128 pixels for the width225 * - multiple of 128 pixels for the width
226 * - multiple of 32 pixels for the height226 * - multiple of 32 pixels for the height
227 *227 *
228 * For more information: see http://linuxtv.org/downloads/v4l-dvb-apis/re32.html228 * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html
229 */229 */
230#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)230#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
231 231
include/uapi/linux/dvb/video.h+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
26 26
27#include <linux/types.h>27#include <linux/types.h>
28#ifndef __KERNEL__28#ifndef __KERNEL__
29#include <stdint.h>
30#include <time.h>29#include <time.h>
31#endif30#endif
32 31
include/uapi/linux/lirc.h+168−0
@@ -0,0 +1,168 @@
1/*
2 * lirc.h - linux infrared remote control header file
3 * last modified 2010/07/13 by Jarod Wilson
4 */
5
6#ifndef _LINUX_LIRC_H
7#define _LINUX_LIRC_H
8
9#include <linux/types.h>
10#include <linux/ioctl.h>
11
12#define PULSE_BIT 0x01000000
13#define PULSE_MASK 0x00FFFFFF
14
15#define LIRC_MODE2_SPACE 0x00000000
16#define LIRC_MODE2_PULSE 0x01000000
17#define LIRC_MODE2_FREQUENCY 0x02000000
18#define LIRC_MODE2_TIMEOUT 0x03000000
19
20#define LIRC_VALUE_MASK 0x00FFFFFF
21#define LIRC_MODE2_MASK 0xFF000000
22
23#define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE)
24#define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE)
25#define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)
26#define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT)
27
28#define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK)
29#define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK)
30
31#define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE)
32#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)
33#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)
34#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT)
35
36/* used heavily by lirc userspace */
37#define lirc_t int
38
39/*** lirc compatible hardware features ***/
40
41#define LIRC_MODE2SEND(x) (x)
42#define LIRC_SEND2MODE(x) (x)
43#define LIRC_MODE2REC(x) ((x) << 16)
44#define LIRC_REC2MODE(x) ((x) >> 16)
45
46#define LIRC_MODE_RAW 0x00000001
47#define LIRC_MODE_PULSE 0x00000002
48#define LIRC_MODE_MODE2 0x00000004
49#define LIRC_MODE_LIRCCODE 0x00000010
50
51
52#define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW)
53#define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE)
54#define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2)
55#define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE)
56
57#define LIRC_CAN_SEND_MASK 0x0000003f
58
59#define LIRC_CAN_SET_SEND_CARRIER 0x00000100
60#define LIRC_CAN_SET_SEND_DUTY_CYCLE 0x00000200
61#define LIRC_CAN_SET_TRANSMITTER_MASK 0x00000400
62
63#define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW)
64#define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE)
65#define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2)
66#define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE)
67
68#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK)
69
70#define LIRC_CAN_SET_REC_CARRIER (LIRC_CAN_SET_SEND_CARRIER << 16)
71#define LIRC_CAN_SET_REC_DUTY_CYCLE (LIRC_CAN_SET_SEND_DUTY_CYCLE << 16)
72
73#define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000
74#define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000
75#define LIRC_CAN_GET_REC_RESOLUTION 0x20000000
76#define LIRC_CAN_SET_REC_TIMEOUT 0x10000000
77#define LIRC_CAN_SET_REC_FILTER 0x08000000
78
79#define LIRC_CAN_MEASURE_CARRIER 0x02000000
80#define LIRC_CAN_USE_WIDEBAND_RECEIVER 0x04000000
81
82#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK)
83#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK)
84
85#define LIRC_CAN_NOTIFY_DECODE 0x01000000
86
87/*** IOCTL commands for lirc driver ***/
88
89#define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32)
90
91#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32)
92#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32)
93#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32)
94#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32)
95#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32)
96#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32)
97#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32)
98
99#define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32)
100#define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32)
101
102#define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, __u32)
103#define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, __u32)
104#define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, __u32)
105#define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, __u32)
106
107/* code length in bits, currently only for LIRC_MODE_LIRCCODE */
108#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32)
109
110#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32)
111#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32)
112/* Note: these can reset the according pulse_width */
113#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32)
114#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32)
115#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32)
116#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)
117#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32)
118
119/*
120 * when a timeout != 0 is set the driver will send a
121 * LIRC_MODE2_TIMEOUT data packet, otherwise LIRC_MODE2_TIMEOUT is
122 * never sent, timeout is disabled by default
123 */
124#define LIRC_SET_REC_TIMEOUT _IOW('i', 0x00000018, __u32)
125
126/* 1 enables, 0 disables timeout reports in MODE2 */
127#define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32)
128
129/*
130 * pulses shorter than this are filtered out by hardware (software
131 * emulation in lirc_dev?)
132 */
133#define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, __u32)
134/*
135 * spaces shorter than this are filtered out by hardware (software
136 * emulation in lirc_dev?)
137 */
138#define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, __u32)
139/*
140 * if filter cannot be set independently for pulse/space, this should
141 * be used
142 */
143#define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, __u32)
144
145/*
146 * if enabled from the next key press on the driver will send
147 * LIRC_MODE2_FREQUENCY packets
148 */
149#define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32)
150
151/*
152 * to set a range use
153 * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the
154 * lower bound first and later
155 * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
156 */
157
158#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32)
159#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32)
160
161#define LIRC_NOTIFY_DECODE _IO('i', 0x00000020)
162
163#define LIRC_SETUP_START _IO('i', 0x00000021)
164#define LIRC_SETUP_END _IO('i', 0x00000022)
165
166#define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32)
167
168#endif
include/uapi/linux/usb/video.h+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
28 28
29/* A.3. Video Interface Protocol Codes */29/* A.3. Video Interface Protocol Codes */
30#define UVC_PC_PROTOCOL_UNDEFINED 0x0030#define UVC_PC_PROTOCOL_UNDEFINED 0x00
31#define UVC_PC_PROTOCOL_15 0x01
31 32
32/* A.5. Video Class-Specific VC Interface Descriptor Subtypes */33/* A.5. Video Class-Specific VC Interface Descriptor Subtypes */
33#define UVC_VC_DESCRIPTOR_UNDEFINED 0x0034#define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
include/uapi/linux/v4l2-controls.h+4−2
@@ -158,8 +158,10 @@ enum v4l2_colorfx { · 157 unmodified lines
158 * We reserve 16 controls for this driver. */158 * We reserve 16 controls for this driver. */
159#define V4L2_CID_USER_S2255_BASE (V4L2_CID_USER_BASE + 0x1030)159#define V4L2_CID_USER_S2255_BASE (V4L2_CID_USER_BASE + 0x1030)
160 160
161/* The base for the si476x driver controls. See include/media/si476x.h for the list161/*
162 * of controls. Total of 16 controls is reserved for this driver */162 * The base for the si476x driver controls. See include/media/drv-intf/si476x.h
163 * for the list of controls. Total of 16 controls is reserved for this driver
164 */
163#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040)165#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040)
164 166
165/* The base for the TI VPE driver controls. Total of 16 controls is reserved for167/* The base for the TI VPE driver controls. Total of 16 controls is reserved for
include/uapi/linux/videodev2.h+12−2
@@ -46,7 +46,7 @@ · 45 unmodified lines
46 * All kernel-specific stuff were moved to media/v4l2-dev.h, so46 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
47 * no #if __KERNEL tests are allowed here47 * no #if __KERNEL tests are allowed here
48 *48 *
49 * See http://linuxtv.org for more info49 * See https://linuxtv.org for more info
50 *50 *
51 * Author: Bill Dirks <bill@thedirks.org>51 * Author: Bill Dirks <bill@thedirks.org>
52 * Justin Schoeman52 * Justin Schoeman
@@ -1476,7 +1476,12 @@ struct v4l2_ext_control { · 1423 unmodified lines
1476} __attribute__ ((packed));1476} __attribute__ ((packed));
1477 1477
1478struct v4l2_ext_controls {1478struct v4l2_ext_controls {
1479 __u32 ctrl_class;1479 union {
1480#ifndef __KERNEL__
1481 __u32 ctrl_class;
1482#endif
1483 __u32 which;
1484 };
1480 __u32 count;1485 __u32 count;
1481 __u32 error_idx;1486 __u32 error_idx;
1482 __u32 reserved[2];1487 __u32 reserved[2];
@@ -1484,9 +1489,14 @@ struct v4l2_ext_controls { · 1 unmodified line
1484};1489};
1485 1490
1486#define V4L2_CTRL_ID_MASK (0x0fffffff)1491#define V4L2_CTRL_ID_MASK (0x0fffffff)
1492#ifndef __KERNEL__
1487#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)1493#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
1494#endif
1495#define V4L2_CTRL_ID2WHICH(id) ((id) & 0x0fff0000UL)
1488#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)1496#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
1489#define V4L2_CTRL_MAX_DIMS (4)1497#define V4L2_CTRL_MAX_DIMS (4)
1498#define V4L2_CTRL_WHICH_CUR_VAL 0
1499#define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000
1490 1500
1491enum v4l2_ctrl_type {1501enum v4l2_ctrl_type {
1492 V4L2_CTRL_TYPE_INTEGER = 1,1502 V4L2_CTRL_TYPE_INTEGER = 1,
sound/pci/es1968.c+2−2
@@ -113,7 +113,7 @@ · 112 unmodified lines
113#include <sound/initval.h>113#include <sound/initval.h>
114 114
115#ifdef CONFIG_SND_ES1968_RADIO115#ifdef CONFIG_SND_ES1968_RADIO
116#include <media/tea575x.h>116#include <media/drv-intf/tea575x.h>
117#endif117#endif
118 118
119#define CARD_NAME "ESS Maestro1/2"119#define CARD_NAME "ESS Maestro1/2"
@@ -2605,7 +2605,7 @@ static void snd_es1968_tea575x_set_direction(struct snd_tea575x *tea, bool outpu · 2485 unmodified lines
2605 }2605 }
2606}2606}
2607 2607
2608static struct snd_tea575x_ops snd_es1968_tea_ops = {2608static const struct snd_tea575x_ops snd_es1968_tea_ops = {
2609 .set_pins = snd_es1968_tea575x_set_pins,2609 .set_pins = snd_es1968_tea575x_set_pins,
2610 .get_pins = snd_es1968_tea575x_get_pins,2610 .get_pins = snd_es1968_tea575x_get_pins,
2611 .set_direction = snd_es1968_tea575x_set_direction,2611 .set_direction = snd_es1968_tea575x_set_direction,
sound/pci/fm801.c+2−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include <sound/initval.h>30#include <sound/initval.h>
31 31
32#ifdef CONFIG_SND_FM801_TEA575X_BOOL32#ifdef CONFIG_SND_FM801_TEA575X_BOOL
33#include <media/tea575x.h>33#include <media/drv-intf/tea575x.h>
34#endif34#endif
35 35
36MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");36MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
@@ -815,7 +815,7 @@ static void snd_fm801_tea575x_set_direction(struct snd_tea575x *tea, bool output · 778 unmodified lines
815 fm801_writew(chip, GPIO_CTRL, reg);815 fm801_writew(chip, GPIO_CTRL, reg);
816}816}
817 817
818static struct snd_tea575x_ops snd_fm801_tea_ops = {818static const struct snd_tea575x_ops snd_fm801_tea_ops = {
819 .set_pins = snd_fm801_tea575x_set_pins,819 .set_pins = snd_fm801_tea575x_set_pins,
820 .get_pins = snd_fm801_tea575x_get_pins,820 .get_pins = snd_fm801_tea575x_get_pins,
821 .set_direction = snd_fm801_tea575x_set_direction,821 .set_direction = snd_fm801_tea575x_set_direction,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t