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
238238 !Iinclude/media/videobuf2-memops.h
239239 </sect1>
240240 <sect1><title>Digital TV (DVB) devices</title>
241−!Idrivers/media/dvb-core/dvb_ca_en50221.h
242−!Idrivers/media/dvb-core/dvb_frontend.h
241+ <sect1><title>Digital TV Common functions</title>
243242 !Idrivers/media/dvb-core/dvb_math.h
244243 !Idrivers/media/dvb-core/dvb_ringbuffer.h
245244 !Idrivers/media/dvb-core/dvbdev.h
246− <sect1><title>Digital TV Demux API</title>
247− <para>The kernel demux API defines a driver-internal interface for
248− registering low-level, hardware specific driver to a hardware
249− independent demux layer. It is only of interest for Digital TV
250− device driver writers. The header file for this API is named
251− <constant>demux.h</constant> and located in
252− <constant>drivers/media/dvb-core</constant>.</para>
253−
254− <para>The demux API should be implemented for each demux in the
255− system. It is used to select the TS source of a demux and to manage
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−
245+ </sect1>
246+ <sect1><title>Digital TV Frontend kABI</title>
247+!Pdrivers/media/dvb-core/dvb_frontend.h Digital TV Frontend
248+!Idrivers/media/dvb-core/dvb_frontend.h
249+ </sect1>
250+ <sect1><title>Digital TV Demux kABI</title>
251+!Pdrivers/media/dvb-core/demux.h Digital TV Demux
252+ <sect1><title>Demux Callback API</title>
253+!Pdrivers/media/dvb-core/demux.h Demux Callback
254+ </sect1>
311255 !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>
313261 <sect1><title>Remote Controller devices</title>
314262 !Iinclude/media/rc-core.h
315263 !Iinclude/media/lirc_dev.h
Documentation/DocBook/media/Makefile+4−2
@@ -199,8 +199,10 @@ DVB_DOCUMENTED = \ · 198 unmodified lines
199199 #
200200
201201 install_media_images = \
202− $(Q)-mkdir $(MEDIA_OBJ_DIR)/media_api; \
203− cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api
202+ $(Q)if [ "x$(findstring media_api.xml,$(DOCBOOKS))" != "x" ]; then \
203+ 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
204206
205207 $(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
206208 $(Q)base64 -d $< >$@
Documentation/DocBook/media/dvb/dvbproperty.xml+1−1
@@ -76,7 +76,7 @@ int main(void) · 75 unmodified lines
7676
7777 <para>NOTE: While it is possible to directly call the Kernel code like the
7878 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>,
8080 as it provides abstraction to work with the supported digital TV standards
8181 and provides methods for usual operations like program scanning and to
8282 read/write channel descriptor files.</para>
Documentation/DocBook/media/dvb/examples.xml+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 </para>
44 <para>NOTE: This section is out of date, and the code below won't even
55 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>
77 for updated/recommended examples.
88 </para>
99
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
3232 new standard Linux DVB API. As a commitment to the development of
3333 terminals based on open standards, Nokia and Convergence made it
3434 available 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.
3636 Convergence is the maintainer of the Linux DVB API. Together with the
3737 LinuxTV community (i.e. you, the reader of this document), the Linux DVB
3838 API 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
55 * This program can be used and distributed without restrictions.
66 *
77 * This program is provided with the V4L2 API
8− * see http://linuxtv.org/docs.php for more information
8+ * see https://linuxtv.org/docs.php for more information
99 */
1010
1111 #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
26662666 <para>V4L2 does not support digital terrestrial, cable or
26672667 satellite broadcast. A separate project aiming at digital receivers
26682668 exists. You can find its homepage at <ulink
2669−url="http://linuxtv.org">http://linuxtv.org</ulink>. The Linux DVB API
2669+url="https://linuxtv.org">https://linuxtv.org</ulink>. The Linux DVB API
26702670 has no connection to the V4L2 API except that drivers for hybrid
26712671 hardware may support both.</para>
26722672 </section>
Documentation/DocBook/media/v4l/io.xml+5−5
@@ -699,7 +699,7 @@ linkend="v4l2-buf-type" /></entry> · 698 unmodified lines
699699 buffer. It depends on the negotiated data format and may change with
700700 each buffer for compressed variable size data like JPEG images.
701701 Drivers must set this field when <structfield>type</structfield>
702−refers to an input stream, applications when it refers to an output stream.
702+refers to a capture stream, applications when it refers to an output stream.
703703 If the application sets this to 0 for an output stream, then
704704 <structfield>bytesused</structfield> will be set to the size of the
705705 buffer (see the <structfield>length</structfield> field of this struct) by
@@ -720,14 +720,14 @@ linkend="buffer-flags" />.</entry> · 14 unmodified lines
720720 <entry>Indicates the field order of the image in the
721721 buffer, see <xref linkend="v4l2-field" />. This field is not used when
722722 the 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,
724724 applications when it refers to an output stream.</entry>
725725 </row>
726726 <row>
727727 <entry>struct timeval</entry>
728728 <entry><structfield>timestamp</structfield></entry>
729729 <entry></entry>
730− <entry><para>For input streams this is time when the first data
730+ <entry><para>For capture streams this is time when the first data
731731 byte was captured, as returned by the
732732 <function>clock_gettime()</function> function for the relevant
733733 clock id; see <constant>V4L2_BUF_FLAG_TIMESTAMP_*</constant> in
@@ -866,7 +866,7 @@ must set this to 0.</entry> · 132 unmodified lines
866866 <entry></entry>
867867 <entry>The number of bytes occupied by data in the plane
868868 (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.
870870 If the application sets this to 0 for an output stream, then
871871 <structfield>bytesused</structfield> will be set to the size of the
872872 plane (see the <structfield>length</structfield> field of this struct)
@@ -919,7 +919,7 @@ must set this to 0.</entry> · 46 unmodified lines
919919 <entry></entry>
920920 <entry>Offset in bytes to video data in the plane.
921921 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.
923923 Note that data_offset is included in <structfield>bytesused</structfield>.
924924 So the size of the image in the plane is
925925 <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
151151 structs, ioctls) must be noted in more detail in the history chapter
152152 (compat.xml), along with the possible impact on existing drivers and
153153 applications. -->
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
159+union with ctrl_class and which. Which is used to select the current value of
160+the control or the default value.
161+ </revremark>
162+ </revision>
163+
154164 <revision>
155165 <revnumber>4.4</revnumber>
156166 <date>2015-05-26</date>
Documentation/DocBook/media/v4l/vidioc-create-bufs.xml+14−16
@@ -58,7 +58,7 @@ · 57 unmodified lines
5858 <para>This ioctl is used to create buffers for <link linkend="mmap">memory
5959 mapped</link> or <link linkend="userp">user pointer</link> or <link
6060 linkend="dmabuf">DMA buffer</link> I/O. It can be used as an alternative or in
61−addition to the <constant>VIDIOC_REQBUFS</constant> ioctl, when a tighter
61+addition to the &VIDIOC-REQBUFS; ioctl, when a tighter
6262 control over buffers is required. This ioctl can be called multiple times to
6363 create buffers of different sizes.</para>
6464
@@ -71,30 +71,28 @@ zeroed.</para> · 6 unmodified lines
7171
7272 <para>The <structfield>format</structfield> field specifies the image format
7373 that the buffers must be able to handle. The application has to fill in this
74−&v4l2-format;. Usually this will be done using the
75−<constant>VIDIOC_TRY_FMT</constant> or <constant>VIDIOC_G_FMT</constant> ioctl()
76−to ensure that the requested format is supported by the driver. Unsupported
77−formats will result in an error.</para>
74+&v4l2-format;. Usually this will be done using the &VIDIOC-TRY-FMT; or &VIDIOC-G-FMT; ioctls
75+to ensure that the requested format is supported by the driver.
76+Based on the format's <structfield>type</structfield> field the requested buffer
77+size (for single-planar) or plane sizes (for multi-planar formats) will be
78+used for the allocated buffers. The driver may return an error if the size(s)
79+are not supported by the hardware (usually because they are too small).</para>
7880
7981 <para>The buffers created by this ioctl will have as minimum size the size
80−defined by the <structfield>format.pix.sizeimage</structfield> field. If the
82+defined by the <structfield>format.pix.sizeimage</structfield> field (or the
83+corresponding fields for other format types). Usually if the
8184 <structfield>format.pix.sizeimage</structfield> field is less than the minimum
82−required for the given format, then <structfield>sizeimage</structfield> will be
83−increased by the driver to that minimum to allocate the buffers. If it is
84−larger, then the value will be used as-is. The same applies to the
85−<structfield>sizeimage</structfield> field of the
86−<structname>v4l2_plane_pix_format</structname> structure in the case of
87−multiplanar formats.</para>
85+required for the given format, then an error will be returned since drivers will
86+typically not allow this. If it is larger, then the value will be used as-is.
87+In other words, the driver may reject the requested size, but if it is accepted
88+the driver will use it unchanged.</para>
8889
8990 <para>When the ioctl is called with a pointer to this structure the driver
9091 will attempt to allocate up to the requested number of buffers and store the
9192 actual number allocated and the starting index in the
9293 <structfield>count</structfield> and the <structfield>index</structfield> fields
9394 respectively. On return <structfield>count</structfield> can be smaller than
94−the number requested. The driver may also increase buffer sizes if required,
95−however, it will not update <structfield>sizeimage</structfield> field values.
96−The user has to use <constant>VIDIOC_QUERYBUF</constant> to retrieve that
97−information.</para>
95+the number requested.</para>
9896
9997 <table pgwide="1" frame="none" id="v4l2-create-buffers">
10098 <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
9999 <para>We recommended the <application>v4l2-dbg</application>
100100 utility over calling this ioctl directly. It is available from the
101101 LinuxTV v4l-dvb repository; see <ulink
102−url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
102+url="https://linuxtv.org/repo/">https://linuxtv.org/repo/</ulink> for
103103 access instructions.</para>
104104
105105 <!-- 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
117117 <para>We recommended the <application>v4l2-dbg</application>
118118 utility over calling these ioctls directly. It is available from the
119119 LinuxTV v4l-dvb repository; see <ulink
120−url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
120+url="https://linuxtv.org/repo/">https://linuxtv.org/repo/</ulink> for
121121 access instructions.</para>
122122
123123 <!-- 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
198198 <constant>V4L2_STD_ATSC_16_VSB</constant> are U.S. terrestrial digital
199199 TV standards. Presently the V4L2 API does not support digital TV. See
200200 also the Linux DVB API at <ulink
201−url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>
201+url="https://linuxtv.org">https://linuxtv.org</ulink>.</para>
202202 <para><programlisting>
203203 #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
204204 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
6161
6262 <para>Applications must always fill in the
6363 <structfield>count</structfield>,
64−<structfield>ctrl_class</structfield>,
64+<structfield>which</structfield>,
6565 <structfield>controls</structfield> and
6666 <structfield>reserved</structfield> fields of &v4l2-ext-controls;, and
6767 initialize 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
109109 value or if an error is returned.</para>
110110
111111 <para>When the <structfield>id</structfield> or
112−<structfield>ctrl_class</structfield> is invalid drivers return an
112+<structfield>which</structfield> is invalid drivers return an
113113 &EINVAL;. When the value is out of bounds drivers can choose to take
114114 the closest valid value or return an &ERANGE;, whatever seems more
115115 appropriate. 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
223223 <tgroup cols="3">
224224 &cs-str;
225225 <tbody valign="top">
226+ <row>
227+ <entry>union</entry>
228+ <entry>(anonymous)</entry>
229+ </row>
226230 <row>
231+ <entry></entry>
227232 <entry>__u32</entry>
228233 <entry><structfield>ctrl_class</structfield></entry>
229234 <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
233238 <structfield>ctrl_class</structfield> to 0 and calling <constant>VIDIOC_TRY_EXT_CTRLS</constant>
234239 with a <structfield>count</structfield> of 0. If that succeeds, then the driver
235240 supports 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>
247+will return the current value of the control and <constant>V4L2_CTRL_WHICH_DEF_VAL</constant> will
248+return the default value of the control. Please note that you can only get the default value of the
249+control, 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
252+control class. This usage is deprecated, instead just use <constant>V4L2_CTRL_WHICH_CUR_VAL</constant>.
253+There are some very old drivers that do not yet support <constant>V4L2_CTRL_WHICH_CUR_VAL</constant>
254+and 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.
256+If that fails, then the driver does not support <constant>V4L2_CTRL_WHICH_CUR_VAL</constant>.</para>
257+</entry>
236258 </row>
237259 <row>
238260 <entry>__u32</entry>
@@ -390,7 +412,7 @@ These controls are described in <xref linkend="rf-tuner-controls" />.</entry> · 151 unmodified lines
390412 <listitem>
391413 <para>The &v4l2-ext-control; <structfield>id</structfield>
392414 is 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;
394416 <structfield>value</structfield> was inappropriate (e.g. the given menu
395417 index is not supported by the driver). This error code is
396418 also returned by the <constant>VIDIOC_S_EXT_CTRLS</constant> and
Documentation/DocBook/media_api.tmpl+3−3
@@ -19,10 +19,10 @@ · 18 unmodified lines
1919 <!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' />">
2020
2121 <!-- 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>">
2323
2424 <!-- 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>">
2626 <!ENTITY dash-ent-8 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
2727 <!ENTITY dash-ent-10 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
2828 <!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
9191 components, like mixers, PCM capture, PCM playback, etc, which
9292 are controlled via ALSA API.</para>
9393 <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>
9595 <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>
9696 </preface>
9797
Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt+10−10
@@ -35,7 +35,7 @@ Required properties (tsin (child) node): · 34 unmodified lines
3535
3636 - tsin-num : tsin id of the InputBlock (must be between 0 to 6)
3737 - 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.
3939
4040 Optional properties (tsin (child) node):
4141
@@ -55,27 +55,27 @@ Example: · 13 unmodified lines
5555 status = "okay";
5656 reg = <0x08a20000 0x10000>, <0x08a00000 0x4000>;
5757 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>;
5959 interrupt-names = "stfe-error-irq", "stfe-idle-irq";
60−
61− pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial",
62− "tsin4-serial", "tsin5-serial";
63−
6460 pinctrl-0 = <&pinctrl_tsin0_serial>;
6561 pinctrl-1 = <&pinctrl_tsin0_parallel>;
6662 pinctrl-2 = <&pinctrl_tsin3_serial>;
6763 pinctrl-3 = <&pinctrl_tsin4_serial_alt3>;
6864 pinctrl-4 = <&pinctrl_tsin5_serial_alt1>;
69−
65+ pinctrl-names = "tsin0-serial",
66+ "tsin0-parallel",
67+ "tsin3-serial",
68+ "tsin4-serial",
69+ "tsin5-serial";
7070 clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>;
71− clock-names = "stfe";
71+ clock-names = "c8sectpfe";
7272
7373 /* tsin0 is TSA on NIMA */
7474 tsin0: port@0 {
7575 tsin-num = <0>;
7676 serial-not-parallel;
7777 i2c-bus = <&ssc2>;
78− rst-gpio = <&pio15 4 0>;
78+ reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>;
7979 dvb-card = <STV0367_TDA18212_NIMA_1>;
8080 };
8181
@@ -83,7 +83,7 @@ Example: · 1 unmodified line
8383 tsin-num = <3>;
8484 serial-not-parallel;
8585 i2c-bus = <&ssc3>;
86− rst-gpio = <&pio15 7 0>;
86+ reset-gpios = <&pio15 7 GPIO_ACTIVE_HIGH>;
8787 dvb-card = <STV0367_TDA18212_NIMB_1>;
8888 };
8989 };
Documentation/dvb/README.dvb-usb+2−2
@@ -45,7 +45,7 @@ Supported devices · 44 unmodified lines
4545 See the LinuxTV DVB Wiki at www.linuxtv.org for a complete list of
4646 cards/drivers/firmwares:
4747
48−http://www.linuxtv.org/wiki/index.php/DVB_USB
48+https://linuxtv.org/wiki/index.php/DVB_USB
4949
5050 0. History & News:
5151 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang)
@@ -121,7 +121,7 @@ working. · 69 unmodified lines
121121 Have a look at the Wikipage for the DVB-USB-drivers to find out, which firmware
122122 you need for your device:
123123
124−http://www.linuxtv.org/wiki/index.php/DVB_USB
124+https://linuxtv.org/wiki/index.php/DVB_USB
125125
126126 1.2. Compiling
127127
Documentation/dvb/faq.txt+1−1
@@ -76,7 +76,7 @@ Some very frequently asked questions about linuxtv-dvb · 75 unmodified lines
7676 the TuxBox CVS many interesting DVB applications and the dBox2
7777 DVB source
7878
79− http://www.linuxtv.org/downloads/
79+ https://linuxtv.org/downloads
8080 DVB Swiss Army Knife library and utilities
8181
8282 http://www.nenie.org/misc/mpsys/
Documentation/dvb/get_dvb_firmware+11−11
@@ -152,7 +152,7 @@ sub tda10046lifeview { · 151 unmodified lines
152152
153153 sub av7110 {
154154 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";
156156 my $hash = "603431b6259715a8e88f376a53b64e2f";
157157 my $outfile = "dvb-ttpci-01.fw";
158158
@@ -303,7 +303,7 @@ sub vp7049 { · 144 unmodified lines
303303 }
304304
305305 sub 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";
307307 my $outfile = "dvb-dibusb-5.0.0.11.fw";
308308 my $hash = "fa490295a527360ca16dcdf3224ca243";
309309
@@ -351,7 +351,7 @@ sub nxt2004 { · 41 unmodified lines
351351
352352 sub or51211 {
353353 my $fwfile = "dvb-fe-or51211.fw";
354− my $url = "http://linuxtv.org/downloads/firmware/$fwfile";
354+ my $url = "https://linuxtv.org/downloads/firmware/$fwfile";
355355 my $hash = "d830949c771a289505bf9eafc225d491";
356356
357357 checkstandard();
@@ -364,7 +364,7 @@ sub or51211 { · 6 unmodified lines
364364
365365 sub cx231xx {
366366 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";
368368 my $hash = "7d3bb956dc9df0eafded2b56ba57cc42";
369369
370370 checkstandard();
@@ -376,7 +376,7 @@ sub cx231xx { · 5 unmodified lines
376376 }
377377
378378 sub cx18 {
379− my $url = "http://linuxtv.org/downloads/firmware/";
379+ my $url = "https://linuxtv.org/downloads/firmware/";
380380
381381 my %files = (
382382 'v4l-cx23418-apu.fw' => '588f081b562f5c653a3db1ad8f65939a',
@@ -450,7 +450,7 @@ sub mpc718 { · 67 unmodified lines
450450 }
451451
452452 sub cx23885 {
453− my $url = "http://linuxtv.org/downloads/firmware/";
453+ my $url = "https://linuxtv.org/downloads/firmware/";
454454
455455 my %files = (
456456 'v4l-cx23885-avcore-01.fw' => 'a9f8f5d901a7fb42f552e1ee6384f3bb',
@@ -472,7 +472,7 @@ sub cx23885 { · 15 unmodified lines
472472 }
473473
474474 sub pvrusb2 {
475− my $url = "http://linuxtv.org/downloads/firmware/";
475+ my $url = "https://linuxtv.org/downloads/firmware/";
476476
477477 my %files = (
478478 'v4l-cx25840.fw' => 'dadb79e9904fc8af96e8111d9cb59320',
@@ -494,7 +494,7 @@ sub pvrusb2 { · 15 unmodified lines
494494
495495 sub or51132_qam {
496496 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";
498498 my $hash = "7702e8938612de46ccadfe9b413cb3b5";
499499
500500 checkstandard();
@@ -507,7 +507,7 @@ sub or51132_qam { · 6 unmodified lines
507507
508508 sub or51132_vsb {
509509 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";
511511 my $hash = "c16208e02f36fc439a557ad4c613364a";
512512
513513 checkstandard();
@@ -519,7 +519,7 @@ sub or51132_vsb { · 5 unmodified lines
519519 }
520520
521521 sub 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";
523523 my $outfile = "dvb-usb-bluebird-01.fw";
524524 my $hash = "658397cb9eba9101af9031302671f49d";
525525
@@ -677,7 +677,7 @@ sub drxk_hauppauge_hvr930c { · 151 unmodified lines
677677 }
678678
679679 sub drxk_terratec_h5 {
680− my $url = "http://www.linuxtv.org/downloads/firmware/";
680+ my $url = "https://linuxtv.org/downloads/firmware/";
681681 my $hash = "19000dada8e2741162ccc50cc91fa7f1";
682682 my $fwfile = "dvb-usb-terratec-h5-drxk.fw";
683683
Documentation/dvb/readme.txt+5−5
@@ -2,12 +2,12 @@ Linux Digital Video Broadcast (DVB) subsystem · 1 unmodified line
22 =============================================
33
44 The main development site and CVS repository for these
5−drivers is http://linuxtv.org/.
5+drivers is https://linuxtv.org.
66
77 The developer mailing list linux-dvb is also hosted there,
8−see http://linuxtv.org/lists.php. Please check
9−the archive http://linuxtv.org/pipermail/linux-dvb/
10−and the Wiki http://linuxtv.org/wiki/
8+see https://linuxtv.org/lists.php. Please check
9+the archive https://linuxtv.org/pipermail/linux-dvb/
10+and the Wiki https://linuxtv.org/wiki/
1111 before asking newbie questions on the list.
1212
1313 API 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
1616 We plan to split this into separate packages, but it's not
1717 been done yet.
1818
19−http://linuxtv.org/downloads/
19+https://linuxtv.org/downloads/
2020
2121 What's inside this directory:
2222
Documentation/video4linux/API.html+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 <table border="0">
1010 <tr>
1111 <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>
1313 </td>
1414 <td>
1515 Obsoleted by V4L2 API
Documentation/video4linux/CARDLIST.em28xx+2−2
@@ -41,8 +41,8 @@ · 40 unmodified lines
4141 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005]
4242 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350]
4343 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357,eb1a:e359]
44− 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043]
45− 44 -> Terratec Cinergy T XS (MT2060) (em2870)
44+ 43 -> Terratec Cinergy T XS (em2870)
45+ 44 -> Terratec Cinergy T XS (MT2060) (em2870) [0ccd:0043]
4646 45 -> Pinnacle PCTV DVB-T (em2870)
4747 46 -> Compro, VideoMate U3 (em2870) [185b:2870]
4848 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]
Documentation/video4linux/fimc.txt+3−3
@@ -58,7 +58,7 @@ Not currently supported: · 57 unmodified lines
5858 4.1. Media device interface
5959
6060 The driver supports Media Controller API as defined at
61−http://linuxtv.org/downloads/v4l-dvb-apis/media_common.html
61+https://linuxtv.org/downloads/v4l-dvb-apis/media_common.html
6262 The media device driver name is "SAMSUNG S5P FIMC".
6363
6464 The purpose of this interface is to allow changing assignment of FIMC instances
@@ -83,11 +83,11 @@ undefined behaviour. · 18 unmodified lines
8383 4.3. Capture video node
8484
8585 The driver supports V4L2 Video Capture Interface as defined at:
86−http://linuxtv.org/downloads/v4l-dvb-apis/devices.html
86+https://linuxtv.org/downloads/v4l-dvb-apis/devices.html
8787
8888 At the capture and mem-to-mem video nodes only the multi-planar API is
8989 supported. For more details see:
90−http://linuxtv.org/downloads/v4l-dvb-apis/planar-apis.html
90+https://linuxtv.org/downloads/v4l-dvb-apis/planar-apis.html
9191
9292 4.4. Camera capture subdevs
9393
Documentation/video4linux/omap4_camera.txt+1−1
@@ -47,7 +47,7 @@ Tested platforms · 46 unmodified lines
4747 File list
4848 ---------
4949 drivers/staging/media/omap4iss/
50−include/media/omap4iss.h
50+include/linux/platform_data/media/omap4iss.h
5151
5252 References
5353 ----------
Documentation/video4linux/si4713.txt+1−1
@@ -157,7 +157,7 @@ int main (int argc, char *argv[]) · 156 unmodified lines
157157 }
158158
159159 The struct si4713_rnl and SI4713_IOC_MEASURE_RNL are defined under
160−include/media/si4713.h.
160+include/linux/platform_data/media/si4713.h.
161161
162162 Stereo/Mono and RDS subchannels
163163 ===============================
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
163163 * minimum number: many DMA engines need a minimum of 2 buffers in the
164164 * queue and you need to have another available for userspace processing.
165165 */
166−static int queue_setup(struct vb2_queue *vq, const void *parg,
166+static int queue_setup(struct vb2_queue *vq,
167167 unsigned int *nbuffers, unsigned int *nplanes,
168168 unsigned int sizes[], void *alloc_ctxs[])
169169 {
170− const struct v4l2_format *fmt = parg;
171170 struct skeleton *skel = vb2_get_drv_priv(vq);
172171
173172 skel->field = skel->format.field;
@@ -183,12 +182,12 @@ static int queue_setup(struct vb2_queue *vq, const void *parg, · 9 unmodified lines
183182
184183 if (vq->num_buffers + *nbuffers < 3)
185184 *nbuffers = 3 - vq->num_buffers;
185+ alloc_ctxs[0] = skel->alloc_ctx;
186186
187− if (fmt && fmt->fmt.pix.sizeimage < skel->format.sizeimage)
188− return -EINVAL;
187+ if (*nplanes)
188+ return sizes[0] < skel->format.sizeimage ? -EINVAL : 0;
189189 *nplanes = 1;
190− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : skel->format.sizeimage;
191− alloc_ctxs[0] = skel->alloc_ctx;
190+ sizes[0] = skel->format.sizeimage;
192191 return 0;
193192 }
194193
@@ -509,7 +508,7 @@ static int skeleton_s_dv_timings(struct file *file, void *_fh, · 314 unmodified lines
509508 return -EINVAL;
510509
511510 /* 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))
513512 return 0;
514513
515514 /*
MAINTAINERS+118−108
@@ -206,7 +206,7 @@ F: include/trace/events/9p.h · 205 unmodified lines
206206 A8293 MEDIA DRIVER
207207 M: Antti Palosaari <crope@iki.fi>
208208 L: linux-media@vger.kernel.org
209−W: http://linuxtv.org/
209+W: https://linuxtv.org
210210 W: http://palosaari.fi/linux/
211211 Q: http://patchwork.linuxtv.org/project/linux-media/list/
212212 T: git git://linuxtv.org/anttip/media_tree.git
@@ -395,7 +395,7 @@ M: Sakari Ailus <sakari.ailus@iki.fi> · 182 unmodified lines
395395 L: linux-media@vger.kernel.org
396396 S: Maintained
397397 F: drivers/media/i2c/adp1653.c
398−F: include/media/adp1653.h
398+F: include/media/i2c/adp1653.h
399399
400400 ADP5520 BACKLIGHT DRIVER WITH IO EXPANDER (ADP5520/ADP5501)
401401 M: Michael Hennerich <michael.hennerich@analog.com>
@@ -466,7 +466,7 @@ F: sound/oss/aedsp16.c · 64 unmodified lines
466466 AF9013 MEDIA DRIVER
467467 M: Antti Palosaari <crope@iki.fi>
468468 L: linux-media@vger.kernel.org
469−W: http://linuxtv.org/
469+W: https://linuxtv.org
470470 W: http://palosaari.fi/linux/
471471 Q: http://patchwork.linuxtv.org/project/linux-media/list/
472472 T: git git://linuxtv.org/anttip/media_tree.git
@@ -476,7 +476,7 @@ F: drivers/media/dvb-frontends/af9013* · 3 unmodified lines
476476 AF9033 MEDIA DRIVER
477477 M: Antti Palosaari <crope@iki.fi>
478478 L: linux-media@vger.kernel.org
479−W: http://linuxtv.org/
479+W: https://linuxtv.org
480480 W: http://palosaari.fi/linux/
481481 Q: http://patchwork.linuxtv.org/project/linux-media/list/
482482 T: git git://linuxtv.org/anttip/media_tree.git
@@ -522,7 +522,7 @@ AIMSLAB FM RADIO RECEIVER DRIVER · 39 unmodified lines
522522 M: Hans Verkuil <hverkuil@xs4all.nl>
523523 L: linux-media@vger.kernel.org
524524 T: git git://linuxtv.org/media_tree.git
525−W: http://linuxtv.org
525+W: https://linuxtv.org
526526 S: Maintained
527527 F: drivers/media/radio/radio-aimslab*
528528
@@ -536,7 +536,7 @@ F: include/linux/*aio*.h · 7 unmodified lines
536536 AIRSPY MEDIA DRIVER
537537 M: Antti Palosaari <crope@iki.fi>
538538 L: linux-media@vger.kernel.org
539−W: http://linuxtv.org/
539+W: https://linuxtv.org
540540 W: http://palosaari.fi/linux/
541541 Q: http://patchwork.linuxtv.org/project/linux-media/list/
542542 T: git git://linuxtv.org/anttip/media_tree.git
@@ -1773,7 +1773,7 @@ L: linux-media@vger.kernel.org · 1230 unmodified lines
17731773 T: git git://linuxtv.org/media_tree.git
17741774 S: Maintained
17751775 F: drivers/media/i2c/as3645a.c
1776−F: include/media/as3645a.h
1776+F: include/media/i2c/as3645a.h
17771777
17781778 ASC7621 HARDWARE MONITOR DRIVER
17791779 M: George Joseph <george.joseph@fairview5.com>
@@ -2064,7 +2064,7 @@ F: net/ax25/ · 284 unmodified lines
20642064 AZ6007 DVB DRIVER
20652065 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
20662066 L: linux-media@vger.kernel.org
2067−W: http://linuxtv.org
2067+W: https://linuxtv.org
20682068 T: git git://linuxtv.org/media_tree.git
20692069 S: Maintained
20702070 F: drivers/media/usb/dvb-usb-v2/az6007.c
@@ -2073,7 +2073,7 @@ AZTECH FM RADIO RECEIVER DRIVER · 2 unmodified lines
20732073 M: Hans Verkuil <hverkuil@xs4all.nl>
20742074 L: linux-media@vger.kernel.org
20752075 T: git git://linuxtv.org/media_tree.git
2076−W: http://linuxtv.org
2076+W: https://linuxtv.org
20772077 S: Maintained
20782078 F: drivers/media/radio/radio-aztech*
20792079
@@ -2126,7 +2126,7 @@ BDISP ST MEDIA DRIVER · 46 unmodified lines
21262126 M: Fabien Dessenne <fabien.dessenne@st.com>
21272127 L: linux-media@vger.kernel.org
21282128 T: git git://linuxtv.org/media_tree.git
2129−W: http://linuxtv.org
2129+W: https://linuxtv.org
21302130 S: Supported
21312131 F: drivers/media/platform/sti/bdisp
21322132
@@ -2519,7 +2519,7 @@ F: fs/btrfs/ · 386 unmodified lines
25192519 BTTV VIDEO4LINUX DRIVER
25202520 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
25212521 L: linux-media@vger.kernel.org
2522−W: http://linuxtv.org
2522+W: https://linuxtv.org
25232523 T: git git://linuxtv.org/media_tree.git
25242524 S: Odd fixes
25252525 F: Documentation/video4linux/bttv/
@@ -2558,7 +2558,7 @@ CADET FM/AM RADIO RECEIVER DRIVER · 32 unmodified lines
25582558 M: Hans Verkuil <hverkuil@xs4all.nl>
25592559 L: linux-media@vger.kernel.org
25602560 T: git git://linuxtv.org/media_tree.git
2561−W: http://linuxtv.org
2561+W: https://linuxtv.org
25622562 S: Maintained
25632563 F: drivers/media/radio/radio-cadet*
25642564
@@ -2851,7 +2851,7 @@ COBALT MEDIA DRIVER · 286 unmodified lines
28512851 M: Hans Verkuil <hans.verkuil@cisco.com>
28522852 L: linux-media@vger.kernel.org
28532853 T: git git://linuxtv.org/media_tree.git
2854−W: http://linuxtv.org
2854+W: https://linuxtv.org
28552855 S: Supported
28562856 F: drivers/media/pci/cobalt/
28572857
@@ -3096,6 +3096,15 @@ S: Maintained · 238 unmodified lines
30963096 F: crypto/ansi_cprng.c
30973097 F: crypto/rng.c
30983098
3099+CS3308 MEDIA DRIVER
3100+M: Hans Verkuil <hverkuil@xs4all.nl>
3101+L: linux-media@vger.kernel.org
3102+T: git git://linuxtv.org/media_tree.git
3103+W: http://linuxtv.org
3104+S: Odd Fixes
3105+F: drivers/media/i2c/cs3308.c
3106+F: drivers/media/i2c/cs3308.h
3107+
30993108 CS5535 Audio ALSA driver
31003109 M: Jaya Kumar <jayakumar.alsa@gmail.com>
31013110 S: Maintained
@@ -3111,7 +3120,7 @@ M: Andy Walls <awalls@md.metrocast.net> · 9 unmodified lines
31113120 L: ivtv-devel@ivtvdriver.org (subscribers-only)
31123121 L: linux-media@vger.kernel.org
31133122 T: git git://linuxtv.org/media_tree.git
3114−W: http://linuxtv.org
3123+W: https://linuxtv.org
31153124 W: http://www.ivtvdriver.org/index.php/Cx18
31163125 S: Maintained
31173126 F: Documentation/video4linux/cx18.txt
@@ -3122,7 +3131,7 @@ CX2341X MPEG ENCODER HELPER MODULE · 4 unmodified lines
31223131 M: Hans Verkuil <hverkuil@xs4all.nl>
31233132 L: linux-media@vger.kernel.org
31243133 T: git git://linuxtv.org/media_tree.git
3125−W: http://linuxtv.org
3134+W: https://linuxtv.org
31263135 S: Maintained
31273136 F: drivers/media/common/cx2341x*
31283137 F: include/media/cx2341x*
@@ -3131,7 +3140,7 @@ CX24120 MEDIA DRIVER · 2 unmodified lines
31313140 M: Jemma Denson <jdenson@gmail.com>
31323141 M: Patrick Boettcher <patrick.boettcher@posteo.de>
31333142 L: linux-media@vger.kernel.org
3134−W: http://linuxtv.org/
3143+W: https://linuxtv.org
31353144 Q: http://patchwork.linuxtv.org/project/linux-media/list/
31363145 S: Maintained
31373146 F: drivers/media/dvb-frontends/cx24120*
@@ -3139,7 +3148,7 @@ F: drivers/media/dvb-frontends/cx24120* · 1 unmodified line
31393148 CX88 VIDEO4LINUX DRIVER
31403149 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
31413150 L: linux-media@vger.kernel.org
3142−W: http://linuxtv.org
3151+W: https://linuxtv.org
31433152 T: git git://linuxtv.org/media_tree.git
31443153 S: Odd fixes
31453154 F: Documentation/video4linux/cx88/
@@ -3148,7 +3157,7 @@ F: drivers/media/pci/cx88/ · 2 unmodified lines
31483157 CXD2820R MEDIA DRIVER
31493158 M: Antti Palosaari <crope@iki.fi>
31503159 L: linux-media@vger.kernel.org
3151−W: http://linuxtv.org/
3160+W: https://linuxtv.org
31523161 W: http://palosaari.fi/linux/
31533162 Q: http://patchwork.linuxtv.org/project/linux-media/list/
31543163 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3254,7 +3263,7 @@ F: drivers/net/wan/pc300* · 99 unmodified lines
32543263 CYPRESS_FIRMWARE MEDIA DRIVER
32553264 M: Antti Palosaari <crope@iki.fi>
32563265 L: linux-media@vger.kernel.org
3257−W: http://linuxtv.org/
3266+W: https://linuxtv.org
32583267 W: http://palosaari.fi/linux/
32593268 Q: http://patchwork.linuxtv.org/project/linux-media/list/
32603269 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3761,14 +3770,14 @@ DT3155 MEDIA DRIVER · 500 unmodified lines
37613770 M: Hans Verkuil <hverkuil@xs4all.nl>
37623771 L: linux-media@vger.kernel.org
37633772 T: git git://linuxtv.org/media_tree.git
3764−W: http://linuxtv.org
3773+W: https://linuxtv.org
37653774 S: Odd Fixes
37663775 F: drivers/media/pci/dt3155/
37673776
37683777 DVB_USB_AF9015 MEDIA DRIVER
37693778 M: Antti Palosaari <crope@iki.fi>
37703779 L: linux-media@vger.kernel.org
3771−W: http://linuxtv.org/
3780+W: https://linuxtv.org
37723781 W: http://palosaari.fi/linux/
37733782 Q: http://patchwork.linuxtv.org/project/linux-media/list/
37743783 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3778,7 +3787,7 @@ F: drivers/media/usb/dvb-usb-v2/af9015* · 3 unmodified lines
37783787 DVB_USB_AF9035 MEDIA DRIVER
37793788 M: Antti Palosaari <crope@iki.fi>
37803789 L: linux-media@vger.kernel.org
3781−W: http://linuxtv.org/
3790+W: https://linuxtv.org
37823791 W: http://palosaari.fi/linux/
37833792 Q: http://patchwork.linuxtv.org/project/linux-media/list/
37843793 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3788,7 +3797,7 @@ F: drivers/media/usb/dvb-usb-v2/af9035* · 3 unmodified lines
37883797 DVB_USB_ANYSEE MEDIA DRIVER
37893798 M: Antti Palosaari <crope@iki.fi>
37903799 L: linux-media@vger.kernel.org
3791−W: http://linuxtv.org/
3800+W: https://linuxtv.org
37923801 W: http://palosaari.fi/linux/
37933802 Q: http://patchwork.linuxtv.org/project/linux-media/list/
37943803 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3798,7 +3807,7 @@ F: drivers/media/usb/dvb-usb-v2/anysee* · 3 unmodified lines
37983807 DVB_USB_AU6610 MEDIA DRIVER
37993808 M: Antti Palosaari <crope@iki.fi>
38003809 L: linux-media@vger.kernel.org
3801−W: http://linuxtv.org/
3810+W: https://linuxtv.org
38023811 W: http://palosaari.fi/linux/
38033812 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38043813 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3808,7 +3817,7 @@ F: drivers/media/usb/dvb-usb-v2/au6610* · 3 unmodified lines
38083817 DVB_USB_CE6230 MEDIA DRIVER
38093818 M: Antti Palosaari <crope@iki.fi>
38103819 L: linux-media@vger.kernel.org
3811−W: http://linuxtv.org/
3820+W: https://linuxtv.org
38123821 W: http://palosaari.fi/linux/
38133822 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38143823 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3818,7 +3827,7 @@ F: drivers/media/usb/dvb-usb-v2/ce6230* · 3 unmodified lines
38183827 DVB_USB_CXUSB MEDIA DRIVER
38193828 M: Michael Krufky <mkrufky@linuxtv.org>
38203829 L: linux-media@vger.kernel.org
3821−W: http://linuxtv.org/
3830+W: https://linuxtv.org
38223831 W: http://github.com/mkrufky
38233832 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38243833 T: git git://linuxtv.org/media_tree.git
@@ -3828,7 +3837,7 @@ F: drivers/media/usb/dvb-usb/cxusb* · 3 unmodified lines
38283837 DVB_USB_EC168 MEDIA DRIVER
38293838 M: Antti Palosaari <crope@iki.fi>
38303839 L: linux-media@vger.kernel.org
3831−W: http://linuxtv.org/
3840+W: https://linuxtv.org
38323841 W: http://palosaari.fi/linux/
38333842 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38343843 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3838,7 +3847,7 @@ F: drivers/media/usb/dvb-usb-v2/ec168* · 3 unmodified lines
38383847 DVB_USB_GL861 MEDIA DRIVER
38393848 M: Antti Palosaari <crope@iki.fi>
38403849 L: linux-media@vger.kernel.org
3841−W: http://linuxtv.org/
3850+W: https://linuxtv.org
38423851 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38433852 T: git git://linuxtv.org/anttip/media_tree.git
38443853 S: Maintained
@@ -3847,7 +3856,7 @@ F: drivers/media/usb/dvb-usb-v2/gl861* · 2 unmodified lines
38473856 DVB_USB_MXL111SF MEDIA DRIVER
38483857 M: Michael Krufky <mkrufky@linuxtv.org>
38493858 L: linux-media@vger.kernel.org
3850−W: http://linuxtv.org/
3859+W: https://linuxtv.org
38513860 W: http://github.com/mkrufky
38523861 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38533862 T: git git://linuxtv.org/mkrufky/mxl111sf.git
@@ -3857,7 +3866,7 @@ F: drivers/media/usb/dvb-usb-v2/mxl111sf* · 3 unmodified lines
38573866 DVB_USB_RTL28XXU MEDIA DRIVER
38583867 M: Antti Palosaari <crope@iki.fi>
38593868 L: linux-media@vger.kernel.org
3860−W: http://linuxtv.org/
3869+W: https://linuxtv.org
38613870 W: http://palosaari.fi/linux/
38623871 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38633872 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3867,7 +3876,7 @@ F: drivers/media/usb/dvb-usb-v2/rtl28xxu* · 3 unmodified lines
38673876 DVB_USB_V2 MEDIA DRIVER
38683877 M: Antti Palosaari <crope@iki.fi>
38693878 L: linux-media@vger.kernel.org
3870−W: http://linuxtv.org/
3879+W: https://linuxtv.org
38713880 W: http://palosaari.fi/linux/
38723881 Q: http://patchwork.linuxtv.org/project/linux-media/list/
38733882 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3897,7 +3906,7 @@ F: Documentation/devicetree/bindings/input/e3x0-button.txt · 23 unmodified lines
38973906 E4000 MEDIA DRIVER
38983907 M: Antti Palosaari <crope@iki.fi>
38993908 L: linux-media@vger.kernel.org
3900−W: http://linuxtv.org/
3909+W: https://linuxtv.org
39013910 W: http://palosaari.fi/linux/
39023911 Q: http://patchwork.linuxtv.org/project/linux-media/list/
39033912 T: git git://linuxtv.org/anttip/media_tree.git
@@ -3913,7 +3922,7 @@ F: drivers/scsi/eata.c · 9 unmodified lines
39133922 EC100 MEDIA DRIVER
39143923 M: Antti Palosaari <crope@iki.fi>
39153924 L: linux-media@vger.kernel.org
3916−W: http://linuxtv.org/
3925+W: https://linuxtv.org
39173926 W: http://palosaari.fi/linux/
39183927 Q: http://patchwork.linuxtv.org/project/linux-media/list/
39193928 T: git git://linuxtv.org/anttip/media_tree.git
@@ -4137,7 +4146,7 @@ F: drivers/net/ethernet/ibm/ehea/ · 217 unmodified lines
41374146 EM28XX VIDEO4LINUX DRIVER
41384147 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
41394148 L: linux-media@vger.kernel.org
4140−W: http://linuxtv.org
4149+W: https://linuxtv.org
41414150 T: git git://linuxtv.org/media_tree.git
41424151 S: Maintained
41434152 F: drivers/media/usb/em28xx/
@@ -4277,7 +4286,7 @@ F: drivers/media/tuners/fc0011.c · 133 unmodified lines
42774286 FC2580 MEDIA DRIVER
42784287 M: Antti Palosaari <crope@iki.fi>
42794288 L: linux-media@vger.kernel.org
4280−W: http://linuxtv.org/
4289+W: https://linuxtv.org
42814290 W: http://palosaari.fi/linux/
42824291 Q: http://patchwork.linuxtv.org/project/linux-media/list/
42834292 T: git git://linuxtv.org/anttip/media_tree.git
@@ -4600,7 +4609,7 @@ M: Heungjun Kim <riverful.kim@samsung.com> · 316 unmodified lines
46004609 L: linux-media@vger.kernel.org
46014610 S: Maintained
46024611 F: drivers/media/i2c/m5mols/
4603−F: include/media/m5mols.h
4612+F: include/media/i2c/m5mols.h
46044613
46054614 FUJITSU TABLET EXTRAS
46064615 M: Robert Gerlach <khnz@gmx.de>
@@ -4646,7 +4655,7 @@ GEMTEK FM RADIO RECEIVER DRIVER · 39 unmodified lines
46464655 M: Hans Verkuil <hverkuil@xs4all.nl>
46474656 L: linux-media@vger.kernel.org
46484657 T: git git://linuxtv.org/media_tree.git
4649−W: http://linuxtv.org
4658+W: https://linuxtv.org
46504659 S: Maintained
46514660 F: drivers/media/radio/radio-gemtek*
46524661
@@ -4854,7 +4863,7 @@ HDPVR USB VIDEO ENCODER DRIVER · 201 unmodified lines
48544863 M: Hans Verkuil <hverkuil@xs4all.nl>
48554864 L: linux-media@vger.kernel.org
48564865 T: git git://linuxtv.org/media_tree.git
4857−W: http://linuxtv.org
4866+W: https://linuxtv.org
48584867 S: Odd Fixes
48594868 F: drivers/media/usb/hdpvr/
48604869
@@ -4873,7 +4882,7 @@ F: drivers/tty/hvc/ · 12 unmodified lines
48734882 HACKRF MEDIA DRIVER
48744883 M: Antti Palosaari <crope@iki.fi>
48754884 L: linux-media@vger.kernel.org
4876−W: http://linuxtv.org/
4885+W: https://linuxtv.org
48774886 W: http://palosaari.fi/linux/
48784887 Q: http://patchwork.linuxtv.org/project/linux-media/list/
48794888 T: git git://linuxtv.org/anttip/media_tree.git
@@ -4916,7 +4925,7 @@ F: sound/parisc/harmony.* · 36 unmodified lines
49164925 HD29L2 MEDIA DRIVER
49174926 M: Antti Palosaari <crope@iki.fi>
49184927 L: linux-media@vger.kernel.org
4919−W: http://linuxtv.org/
4928+W: https://linuxtv.org
49204929 W: http://palosaari.fi/linux/
49214930 Q: http://patchwork.linuxtv.org/project/linux-media/list/
49224931 T: git git://linuxtv.org/anttip/media_tree.git
@@ -5822,7 +5831,7 @@ ISA RADIO MODULE · 899 unmodified lines
58225831 M: Hans Verkuil <hverkuil@xs4all.nl>
58235832 L: linux-media@vger.kernel.org
58245833 T: git git://linuxtv.org/media_tree.git
5825−W: http://linuxtv.org
5834+W: https://linuxtv.org
58265835 S: Maintained
58275836 F: drivers/media/radio/radio-isa*
58285837
@@ -5892,7 +5901,7 @@ F: drivers/hwmon/it87.c · 63 unmodified lines
58925901 IT913X MEDIA DRIVER
58935902 M: Antti Palosaari <crope@iki.fi>
58945903 L: linux-media@vger.kernel.org
5895−W: http://linuxtv.org/
5904+W: https://linuxtv.org
58965905 W: http://palosaari.fi/linux/
58975906 Q: http://patchwork.linuxtv.org/project/linux-media/list/
58985907 T: git git://linuxtv.org/anttip/media_tree.git
@@ -5913,7 +5922,7 @@ F: include/uapi/linux/ivtv* · 14 unmodified lines
59135922 IX2505V MEDIA DRIVER
59145923 M: Malcolm Priestley <tvboxspy@gmail.com>
59155924 L: linux-media@vger.kernel.org
5916−W: http://linuxtv.org/
5925+W: https://linuxtv.org
59175926 Q: http://patchwork.linuxtv.org/project/linux-media/list/
59185927 S: Maintained
59195928 F: drivers/media/dvb-frontends/ix2505v*
@@ -6002,7 +6011,7 @@ KEENE FM RADIO TRANSMITTER DRIVER · 82 unmodified lines
60026011 M: Hans Verkuil <hverkuil@xs4all.nl>
60036012 L: linux-media@vger.kernel.org
60046013 T: git git://linuxtv.org/media_tree.git
6005−W: http://linuxtv.org
6014+W: https://linuxtv.org
60066015 S: Maintained
60076016 F: drivers/media/radio/radio-keene*
60086017
@@ -6254,7 +6263,7 @@ F: drivers/usb/misc/legousbtower.c · 245 unmodified lines
62546263 LG2160 MEDIA DRIVER
62556264 M: Michael Krufky <mkrufky@linuxtv.org>
62566265 L: linux-media@vger.kernel.org
6257−W: http://linuxtv.org/
6266+W: https://linuxtv.org
62586267 W: http://github.com/mkrufky
62596268 Q: http://patchwork.linuxtv.org/project/linux-media/list/
62606269 T: git git://linuxtv.org/mkrufky/tuners.git
@@ -6264,7 +6273,7 @@ F: drivers/media/dvb-frontends/lg2160.* · 3 unmodified lines
62646273 LGDT3305 MEDIA DRIVER
62656274 M: Michael Krufky <mkrufky@linuxtv.org>
62666275 L: linux-media@vger.kernel.org
6267−W: http://linuxtv.org/
6276+W: https://linuxtv.org
62686277 W: http://github.com/mkrufky
62696278 Q: http://patchwork.linuxtv.org/project/linux-media/list/
62706279 T: git git://linuxtv.org/mkrufky/tuners.git
@@ -6521,7 +6530,7 @@ F: drivers/hwmon/lm95234.c · 250 unmodified lines
65216530 LME2510 MEDIA DRIVER
65226531 M: Malcolm Priestley <tvboxspy@gmail.com>
65236532 L: linux-media@vger.kernel.org
6524−W: http://linuxtv.org/
6533+W: https://linuxtv.org
65256534 Q: http://patchwork.linuxtv.org/project/linux-media/list/
65266535 S: Maintained
65276536 F: drivers/media/usb/dvb-usb-v2/lmedm04*
@@ -6627,7 +6636,7 @@ F: arch/m68k/hp300/ · 99 unmodified lines
66276636 M88DS3103 MEDIA DRIVER
66286637 M: Antti Palosaari <crope@iki.fi>
66296638 L: linux-media@vger.kernel.org
6630−W: http://linuxtv.org/
6639+W: https://linuxtv.org
66316640 W: http://palosaari.fi/linux/
66326641 Q: http://patchwork.linuxtv.org/project/linux-media/list/
66336642 T: git git://linuxtv.org/anttip/media_tree.git
@@ -6637,7 +6646,7 @@ F: drivers/media/dvb-frontends/m88ds3103* · 3 unmodified lines
66376646 M88RS2000 MEDIA DRIVER
66386647 M: Malcolm Priestley <tvboxspy@gmail.com>
66396648 L: linux-media@vger.kernel.org
6640−W: http://linuxtv.org/
6649+W: https://linuxtv.org
66416650 Q: http://patchwork.linuxtv.org/project/linux-media/list/
66426651 S: Maintained
66436652 F: drivers/media/dvb-frontends/m88rs2000*
@@ -6816,7 +6825,7 @@ MAXIRADIO FM RADIO RECEIVER DRIVER · 172 unmodified lines
68166825 M: Hans Verkuil <hverkuil@xs4all.nl>
68176826 L: linux-media@vger.kernel.org
68186827 T: git git://linuxtv.org/media_tree.git
6819−W: http://linuxtv.org
6828+W: https://linuxtv.org
68206829 S: Maintained
68216830 F: drivers/media/radio/radio-maxiradio*
68226831
@@ -6838,7 +6847,7 @@ F: drivers/media/platform/vsp1/ · 15 unmodified lines
68386847 MEDIA DRIVERS FOR ASCOT2E
68396848 M: Sergey Kozlov <serjk@netup.ru>
68406849 L: linux-media@vger.kernel.org
6841−W: http://linuxtv.org
6850+W: https://linuxtv.org
68426851 W: http://netup.tv/
68436852 T: git git://linuxtv.org/media_tree.git
68446853 S: Supported
@@ -6847,7 +6856,7 @@ F: drivers/media/dvb-frontends/ascot2e* · 2 unmodified lines
68476856 MEDIA DRIVERS FOR CXD2841ER
68486857 M: Sergey Kozlov <serjk@netup.ru>
68496858 L: linux-media@vger.kernel.org
6850−W: http://linuxtv.org/
6859+W: https://linuxtv.org
68516860 W: http://netup.tv/
68526861 T: git git://linuxtv.org/media_tree.git
68536862 S: Supported
@@ -6856,7 +6865,7 @@ F: drivers/media/dvb-frontends/cxd2841er* · 2 unmodified lines
68566865 MEDIA DRIVERS FOR HORUS3A
68576866 M: Sergey Kozlov <serjk@netup.ru>
68586867 L: linux-media@vger.kernel.org
6859−W: http://linuxtv.org/
6868+W: https://linuxtv.org
68606869 W: http://netup.tv/
68616870 T: git git://linuxtv.org/media_tree.git
68626871 S: Supported
@@ -6865,7 +6874,7 @@ F: drivers/media/dvb-frontends/horus3a* · 2 unmodified lines
68656874 MEDIA DRIVERS FOR LNBH25
68666875 M: Sergey Kozlov <serjk@netup.ru>
68676876 L: linux-media@vger.kernel.org
6868−W: http://linuxtv.org/
6877+W: https://linuxtv.org
68696878 W: http://netup.tv/
68706879 T: git git://linuxtv.org/media_tree.git
68716880 S: Supported
@@ -6874,7 +6883,7 @@ F: drivers/media/dvb-frontends/lnbh25* · 2 unmodified lines
68746883 MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
68756884 M: Sergey Kozlov <serjk@netup.ru>
68766885 L: linux-media@vger.kernel.org
6877−W: http://linuxtv.org/
6886+W: https://linuxtv.org
68786887 W: http://netup.tv/
68796888 T: git git://linuxtv.org/media_tree.git
68806889 S: Supported
@@ -6884,7 +6893,7 @@ MEDIA INPUT INFRASTRUCTURE (V4L/DVB) · 3 unmodified lines
68846893 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
68856894 P: LinuxTV.org Project
68866895 L: linux-media@vger.kernel.org
6887−W: http://linuxtv.org
6896+W: https://linuxtv.org
68886897 Q: http://patchwork.kernel.org/project/linux-media/list/
68896898 T: git git://linuxtv.org/media_tree.git
68906899 S: Maintained
@@ -6893,6 +6902,7 @@ F: Documentation/video4linux/ · 2 unmodified lines
68936902 F: Documentation/DocBook/media/
68946903 F: drivers/media/
68956904 F: drivers/staging/media/
6905+F: include/linux/platform_data/media/
68966906 F: include/media/
68976907 F: include/uapi/linux/dvb/
68986908 F: include/uapi/linux/videodev2.h
@@ -7044,7 +7054,7 @@ MIROSOUND PCM20 FM RADIO RECEIVER DRIVER · 145 unmodified lines
70447054 M: Hans Verkuil <hverkuil@xs4all.nl>
70457055 L: linux-media@vger.kernel.org
70467056 T: git git://linuxtv.org/media_tree.git
7047−W: http://linuxtv.org
7057+W: https://linuxtv.org
70487058 S: Odd Fixes
70497059 F: drivers/media/radio/radio-miropcm20*
70507060
@@ -7080,7 +7090,7 @@ F: drivers/iio/temperature/mlx90614.c · 29 unmodified lines
70807090 MN88472 MEDIA DRIVER
70817091 M: Antti Palosaari <crope@iki.fi>
70827092 L: linux-media@vger.kernel.org
7083−W: http://linuxtv.org/
7093+W: https://linuxtv.org
70847094 W: http://palosaari.fi/linux/
70857095 Q: http://patchwork.linuxtv.org/project/linux-media/list/
70867096 T: git git://linuxtv.org/anttip/media_tree.git
@@ -7091,7 +7101,7 @@ F: drivers/media/dvb-frontends/mn88472.h · 4 unmodified lines
70917101 MN88473 MEDIA DRIVER
70927102 M: Antti Palosaari <crope@iki.fi>
70937103 L: linux-media@vger.kernel.org
7094−W: http://linuxtv.org/
7104+W: https://linuxtv.org
70957105 W: http://palosaari.fi/linux/
70967106 Q: http://patchwork.linuxtv.org/project/linux-media/list/
70977107 T: git git://linuxtv.org/anttip/media_tree.git
@@ -7146,7 +7156,7 @@ F: drivers/platform/x86/msi-wmi.c · 48 unmodified lines
71467156 MSI001 MEDIA DRIVER
71477157 M: Antti Palosaari <crope@iki.fi>
71487158 L: linux-media@vger.kernel.org
7149−W: http://linuxtv.org/
7159+W: https://linuxtv.org
71507160 W: http://palosaari.fi/linux/
71517161 Q: http://patchwork.linuxtv.org/project/linux-media/list/
71527162 T: git git://linuxtv.org/anttip/media_tree.git
@@ -7156,7 +7166,7 @@ F: drivers/media/tuners/msi001* · 3 unmodified lines
71567166 MSI2500 MEDIA DRIVER
71577167 M: Antti Palosaari <crope@iki.fi>
71587168 L: linux-media@vger.kernel.org
7159−W: http://linuxtv.org/
7169+W: https://linuxtv.org
71607170 W: http://palosaari.fi/linux/
71617171 Q: http://patchwork.linuxtv.org/project/linux-media/list/
71627172 T: git git://linuxtv.org/anttip/media_tree.git
@@ -7175,7 +7185,7 @@ L: linux-media@vger.kernel.org · 12 unmodified lines
71757185 T: git git://linuxtv.org/media_tree.git
71767186 S: Maintained
71777187 F: drivers/media/i2c/mt9m032.c
7178−F: include/media/mt9m032.h
7188+F: include/media/i2c/mt9m032.h
71797189
71807190 MT9P031 APTINA CAMERA SENSOR
71817191 M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7183,7 +7193,7 @@ L: linux-media@vger.kernel.org · 1 unmodified line
71837193 T: git git://linuxtv.org/media_tree.git
71847194 S: Maintained
71857195 F: drivers/media/i2c/mt9p031.c
7186−F: include/media/mt9p031.h
7196+F: include/media/i2c/mt9p031.h
71877197
71887198 MT9T001 APTINA CAMERA SENSOR
71897199 M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7191,7 +7201,7 @@ L: linux-media@vger.kernel.org · 1 unmodified line
71917201 T: git git://linuxtv.org/media_tree.git
71927202 S: Maintained
71937203 F: drivers/media/i2c/mt9t001.c
7194−F: include/media/mt9t001.h
7204+F: include/media/i2c/mt9t001.h
71957205
71967206 MT9V032 APTINA CAMERA SENSOR
71977207 M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7200,7 +7210,7 @@ T: git git://linuxtv.org/media_tree.git · 2 unmodified lines
72007210 S: Maintained
72017211 F: Documentation/devicetree/bindings/media/i2c/mt9v032.txt
72027212 F: drivers/media/i2c/mt9v032.c
7203−F: include/media/mt9v032.h
7213+F: include/media/i2c/mt9v032.h
72047214
72057215 MULTIFUNCTION DEVICES (MFD)
72067216 M: Lee Jones <lee.jones@linaro.org>
@@ -7244,7 +7254,7 @@ F: drivers/usb/musb/ · 37 unmodified lines
72447254 MXL5007T MEDIA DRIVER
72457255 M: Michael Krufky <mkrufky@linuxtv.org>
72467256 L: linux-media@vger.kernel.org
7247−W: http://linuxtv.org/
7257+W: https://linuxtv.org
72487258 W: http://github.com/mkrufky
72497259 Q: http://patchwork.linuxtv.org/project/linux-media/list/
72507260 T: git git://linuxtv.org/mkrufky/tuners.git
@@ -8745,7 +8755,7 @@ F: include/uapi/linux/qnxtypes.h · 1494 unmodified lines
87458755 QT1010 MEDIA DRIVER
87468756 M: Antti Palosaari <crope@iki.fi>
87478757 L: linux-media@vger.kernel.org
8748−W: http://linuxtv.org/
8758+W: https://linuxtv.org
87498759 W: http://palosaari.fi/linux/
87508760 Q: http://patchwork.linuxtv.org/project/linux-media/list/
87518761 T: git git://linuxtv.org/anttip/media_tree.git
@@ -9038,7 +9048,7 @@ F: net/rose/ · 286 unmodified lines
90389048 RTL2830 MEDIA DRIVER
90399049 M: Antti Palosaari <crope@iki.fi>
90409050 L: linux-media@vger.kernel.org
9041−W: http://linuxtv.org/
9051+W: https://linuxtv.org
90429052 W: http://palosaari.fi/linux/
90439053 Q: http://patchwork.linuxtv.org/project/linux-media/list/
90449054 T: git git://linuxtv.org/anttip/media_tree.git
@@ -9048,7 +9058,7 @@ F: drivers/media/dvb-frontends/rtl2830* · 3 unmodified lines
90489058 RTL2832 MEDIA DRIVER
90499059 M: Antti Palosaari <crope@iki.fi>
90509060 L: linux-media@vger.kernel.org
9051−W: http://linuxtv.org/
9061+W: https://linuxtv.org
90529062 W: http://palosaari.fi/linux/
90539063 Q: http://patchwork.linuxtv.org/project/linux-media/list/
90549064 T: git git://linuxtv.org/anttip/media_tree.git
@@ -9058,7 +9068,7 @@ F: drivers/media/dvb-frontends/rtl2832* · 3 unmodified lines
90589068 RTL2832_SDR MEDIA DRIVER
90599069 M: Antti Palosaari <crope@iki.fi>
90609070 L: linux-media@vger.kernel.org
9061−W: http://linuxtv.org/
9071+W: https://linuxtv.org
90629072 W: http://palosaari.fi/linux/
90639073 Q: http://patchwork.linuxtv.org/project/linux-media/list/
90649074 T: git git://linuxtv.org/anttip/media_tree.git
@@ -9189,14 +9199,14 @@ SAA6588 RDS RECEIVER DRIVER · 124 unmodified lines
91899199 M: Hans Verkuil <hverkuil@xs4all.nl>
91909200 L: linux-media@vger.kernel.org
91919201 T: git git://linuxtv.org/media_tree.git
9192−W: http://linuxtv.org
9202+W: https://linuxtv.org
91939203 S: Odd Fixes
91949204 F: drivers/media/i2c/saa6588*
91959205
91969206 SAA7134 VIDEO4LINUX DRIVER
91979207 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
91989208 L: linux-media@vger.kernel.org
9199−W: http://linuxtv.org
9209+W: https://linuxtv.org
92009210 T: git git://linuxtv.org/media_tree.git
92019211 S: Odd fixes
92029212 F: Documentation/video4linux/*.saa7134
@@ -9258,7 +9268,7 @@ L: linux-media@vger.kernel.org · 55 unmodified lines
92589268 L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
92599269 S: Maintained
92609270 F: drivers/media/platform/s3c-camif/
9261−F: include/media/s3c_camif.h
9271+F: include/media/drv-intf/s3c_camif.h
92629272
92639273 SAMSUNG S5C73M3 CAMERA DRIVER
92649274 M: Kyungmin Park <kyungmin.park@samsung.com>
@@ -9633,7 +9643,7 @@ F: drivers/misc/sgi-xp/ · 368 unmodified lines
96339643 SI2157 MEDIA DRIVER
96349644 M: Antti Palosaari <crope@iki.fi>
96359645 L: linux-media@vger.kernel.org
9636−W: http://linuxtv.org/
9646+W: https://linuxtv.org
96379647 W: http://palosaari.fi/linux/
96389648 Q: http://patchwork.linuxtv.org/project/linux-media/list/
96399649 T: git git://linuxtv.org/anttip/media_tree.git
@@ -9643,7 +9653,7 @@ F: drivers/media/tuners/si2157* · 3 unmodified lines
96439653 SI2168 MEDIA DRIVER
96449654 M: Antti Palosaari <crope@iki.fi>
96459655 L: linux-media@vger.kernel.org
9646−W: http://linuxtv.org/
9656+W: https://linuxtv.org
96479657 W: http://palosaari.fi/linux/
96489658 Q: http://patchwork.linuxtv.org/project/linux-media/list/
96499659 T: git git://linuxtv.org/anttip/media_tree.git
@@ -9654,7 +9664,7 @@ SI470X FM RADIO RECEIVER I2C DRIVER · 4 unmodified lines
96549664 M: Hans Verkuil <hverkuil@xs4all.nl>
96559665 L: linux-media@vger.kernel.org
96569666 T: git git://linuxtv.org/media_tree.git
9657−W: http://linuxtv.org
9667+W: https://linuxtv.org
96589668 S: Odd Fixes
96599669 F: drivers/media/radio/si470x/radio-si470x-i2c.c
96609670
@@ -9662,7 +9672,7 @@ SI470X FM RADIO RECEIVER USB DRIVER · 1 unmodified line
96629672 M: Hans Verkuil <hverkuil@xs4all.nl>
96639673 L: linux-media@vger.kernel.org
96649674 T: git git://linuxtv.org/media_tree.git
9665−W: http://linuxtv.org
9675+W: https://linuxtv.org
96669676 S: Maintained
96679677 F: drivers/media/radio/si470x/radio-si470x-common.c
96689678 F: drivers/media/radio/si470x/radio-si470x.h
@@ -9672,7 +9682,7 @@ SI4713 FM RADIO TRANSMITTER I2C DRIVER · 3 unmodified lines
96729682 M: Eduardo Valentin <edubezval@gmail.com>
96739683 L: linux-media@vger.kernel.org
96749684 T: git git://linuxtv.org/media_tree.git
9675−W: http://linuxtv.org
9685+W: https://linuxtv.org
96769686 S: Odd Fixes
96779687 F: drivers/media/radio/si4713/si4713.?
96789688
@@ -9680,7 +9690,7 @@ SI4713 FM RADIO TRANSMITTER PLATFORM DRIVER · 1 unmodified line
96809690 M: Eduardo Valentin <edubezval@gmail.com>
96819691 L: linux-media@vger.kernel.org
96829692 T: git git://linuxtv.org/media_tree.git
9683−W: http://linuxtv.org
9693+W: https://linuxtv.org
96849694 S: Odd Fixes
96859695 F: drivers/media/radio/si4713/radio-platform-si4713.c
96869696
@@ -9688,14 +9698,14 @@ SI4713 FM RADIO TRANSMITTER USB DRIVER · 1 unmodified line
96889698 M: Hans Verkuil <hverkuil@xs4all.nl>
96899699 L: linux-media@vger.kernel.org
96909700 T: git git://linuxtv.org/media_tree.git
9691−W: http://linuxtv.org
9701+W: https://linuxtv.org
96929702 S: Maintained
96939703 F: drivers/media/radio/si4713/radio-usb-si4713.c
96949704
96959705 SIANO DVB DRIVER
96969706 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
96979707 L: linux-media@vger.kernel.org
9698−W: http://linuxtv.org
9708+W: https://linuxtv.org
96999709 T: git git://linuxtv.org/media_tree.git
97009710 S: Odd fixes
97019711 F: drivers/media/common/siano/
@@ -9720,7 +9730,7 @@ SH_VOU V4L2 OUTPUT DRIVER · 18 unmodified lines
97209730 L: linux-media@vger.kernel.org
97219731 S: Orphan
97229732 F: drivers/media/platform/sh_vou.c
9723−F: include/media/sh_vou.h
9733+F: include/media/drv-intf/sh_vou.h
97249734
97259735 SIMPLE FIRMWARE INTERFACE (SFI)
97269736 M: Len Brown <lenb@kernel.org>
@@ -9761,7 +9771,7 @@ F: drivers/i2c/busses/i2c-davinci.c · 34 unmodified lines
97619771 TI DAVINCI SERIES MEDIA DRIVER
97629772 M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
97639773 L: linux-media@vger.kernel.org
9764−W: http://linuxtv.org/
9774+W: https://linuxtv.org
97659775 Q: http://patchwork.linuxtv.org/project/linux-media/list/
97669776 T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
97679777 S: Maintained
@@ -9771,7 +9781,7 @@ F: include/media/davinci/ · 3 unmodified lines
97719781 TI AM437X VPFE DRIVER
97729782 M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
97739783 L: linux-media@vger.kernel.org
9774−W: http://linuxtv.org/
9784+W: https://linuxtv.org
97759785 Q: http://patchwork.linuxtv.org/project/linux-media/list/
97769786 T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
97779787 S: Maintained
@@ -9780,12 +9790,12 @@ F: drivers/media/platform/am437x/ · 2 unmodified lines
97809790 OV2659 OMNIVISION SENSOR DRIVER
97819791 M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
97829792 L: linux-media@vger.kernel.org
9783−W: http://linuxtv.org/
9793+W: https://linuxtv.org
97849794 Q: http://patchwork.linuxtv.org/project/linux-media/list/
97859795 T: git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
97869796 S: Maintained
97879797 F: drivers/media/i2c/ov2659.c
9788−F: include/media/ov2659.h
9798+F: include/media/i2c/ov2659.h
97899799
97909800 SILICON MOTION SM712 FRAME BUFFER DRIVER
97919801 M: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
@@ -9874,7 +9884,7 @@ M: Sakari Ailus <sakari.ailus@iki.fi> · 82 unmodified lines
98749884 L: linux-media@vger.kernel.org
98759885 S: Maintained
98769886 F: drivers/media/i2c/smiapp/
9877−F: include/media/smiapp.h
9887+F: include/media/i2c/smiapp.h
98789888 F: drivers/media/i2c/smiapp-pll.c
98799889 F: drivers/media/i2c/smiapp-pll.h
98809890 F: include/uapi/linux/smiapp.h
@@ -10038,7 +10048,7 @@ F: sound/soc/soc-generic-dmaengine-pcm.c · 157 unmodified lines
1003810048 SP2 MEDIA DRIVER
1003910049 M: Olli Salonen <olli.salonen@iki.fi>
1004010050 L: linux-media@vger.kernel.org
10041−W: http://linuxtv.org/
10051+W: https://linuxtv.org
1004210052 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1004310053 S: Maintained
1004410054 F: drivers/media/dvb-frontends/sp2*
@@ -10400,7 +10410,7 @@ F: net/ipv4/tcp_lp.c · 355 unmodified lines
1040010410 TDA10071 MEDIA DRIVER
1040110411 M: Antti Palosaari <crope@iki.fi>
1040210412 L: linux-media@vger.kernel.org
10403−W: http://linuxtv.org/
10413+W: https://linuxtv.org
1040410414 W: http://palosaari.fi/linux/
1040510415 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1040610416 T: git git://linuxtv.org/anttip/media_tree.git
@@ -10410,7 +10420,7 @@ F: drivers/media/dvb-frontends/tda10071* · 3 unmodified lines
1041010420 TDA18212 MEDIA DRIVER
1041110421 M: Antti Palosaari <crope@iki.fi>
1041210422 L: linux-media@vger.kernel.org
10413−W: http://linuxtv.org/
10423+W: https://linuxtv.org
1041410424 W: http://palosaari.fi/linux/
1041510425 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1041610426 T: git git://linuxtv.org/anttip/media_tree.git
@@ -10420,7 +10430,7 @@ F: drivers/media/tuners/tda18212* · 3 unmodified lines
1042010430 TDA18218 MEDIA DRIVER
1042110431 M: Antti Palosaari <crope@iki.fi>
1042210432 L: linux-media@vger.kernel.org
10423−W: http://linuxtv.org/
10433+W: https://linuxtv.org
1042410434 W: http://palosaari.fi/linux/
1042510435 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1042610436 T: git git://linuxtv.org/anttip/media_tree.git
@@ -10430,7 +10440,7 @@ F: drivers/media/tuners/tda18218* · 3 unmodified lines
1043010440 TDA18271 MEDIA DRIVER
1043110441 M: Michael Krufky <mkrufky@linuxtv.org>
1043210442 L: linux-media@vger.kernel.org
10433−W: http://linuxtv.org/
10443+W: https://linuxtv.org
1043410444 W: http://github.com/mkrufky
1043510445 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1043610446 T: git git://linuxtv.org/mkrufky/tuners.git
@@ -10440,7 +10450,7 @@ F: drivers/media/tuners/tda18271* · 3 unmodified lines
1044010450 TDA827x MEDIA DRIVER
1044110451 M: Michael Krufky <mkrufky@linuxtv.org>
1044210452 L: linux-media@vger.kernel.org
10443−W: http://linuxtv.org/
10453+W: https://linuxtv.org
1044410454 W: http://github.com/mkrufky
1044510455 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1044610456 T: git git://linuxtv.org/mkrufky/tuners.git
@@ -10450,7 +10460,7 @@ F: drivers/media/tuners/tda8290.* · 3 unmodified lines
1045010460 TDA8290 MEDIA DRIVER
1045110461 M: Michael Krufky <mkrufky@linuxtv.org>
1045210462 L: linux-media@vger.kernel.org
10453−W: http://linuxtv.org/
10463+W: https://linuxtv.org
1045410464 W: http://github.com/mkrufky
1045510465 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1045610466 T: git git://linuxtv.org/mkrufky/tuners.git
@@ -10461,14 +10471,14 @@ TDA9840 MEDIA DRIVER · 4 unmodified lines
1046110471 M: Hans Verkuil <hverkuil@xs4all.nl>
1046210472 L: linux-media@vger.kernel.org
1046310473 T: git git://linuxtv.org/media_tree.git
10464−W: http://linuxtv.org
10474+W: https://linuxtv.org
1046510475 S: Maintained
1046610476 F: drivers/media/i2c/tda9840*
1046710477
1046810478 TEA5761 TUNER DRIVER
1046910479 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
1047010480 L: linux-media@vger.kernel.org
10471−W: http://linuxtv.org
10481+W: https://linuxtv.org
1047210482 T: git git://linuxtv.org/media_tree.git
1047310483 S: Odd fixes
1047410484 F: drivers/media/tuners/tea5761.*
@@ -10476,7 +10486,7 @@ F: drivers/media/tuners/tea5761.* · 1 unmodified line
1047610486 TEA5767 TUNER DRIVER
1047710487 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
1047810488 L: linux-media@vger.kernel.org
10479−W: http://linuxtv.org
10489+W: https://linuxtv.org
1048010490 T: git git://linuxtv.org/media_tree.git
1048110491 S: Maintained
1048210492 F: drivers/media/tuners/tea5767.*
@@ -10485,7 +10495,7 @@ TEA6415C MEDIA DRIVER · 2 unmodified lines
1048510495 M: Hans Verkuil <hverkuil@xs4all.nl>
1048610496 L: linux-media@vger.kernel.org
1048710497 T: git git://linuxtv.org/media_tree.git
10488−W: http://linuxtv.org
10498+W: https://linuxtv.org
1048910499 S: Maintained
1049010500 F: drivers/media/i2c/tea6415c*
1049110501
@@ -10493,7 +10503,7 @@ TEA6420 MEDIA DRIVER · 1 unmodified line
1049310503 M: Hans Verkuil <hverkuil@xs4all.nl>
1049410504 L: linux-media@vger.kernel.org
1049510505 T: git git://linuxtv.org/media_tree.git
10496−W: http://linuxtv.org
10506+W: https://linuxtv.org
1049710507 S: Maintained
1049810508 F: drivers/media/i2c/tea6420*
1049910509
@@ -10591,7 +10601,7 @@ THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER · 91 unmodified lines
1059110601 M: Hans Verkuil <hverkuil@xs4all.nl>
1059210602 L: linux-media@vger.kernel.org
1059310603 T: git git://linuxtv.org/media_tree.git
10594−W: http://linuxtv.org
10604+W: https://linuxtv.org
1059510605 S: Maintained
1059610606 F: drivers/media/radio/radio-raremono.c
1059710607
@@ -10815,7 +10825,7 @@ M: Mats Randgaard <matrandg@cisco.com> · 217 unmodified lines
1081510825 L: linux-media@vger.kernel.org
1081610826 S: Maintained
1081710827 F: drivers/media/i2c/tc358743*
10818−F: include/media/tc358743.h
10828+F: include/media/i2c/tc358743.h
1081910829
1082010830 TMIO MMC DRIVER
1082110831 M: Ian Molton <ian@mnementh.co.uk>
@@ -10843,7 +10853,7 @@ F: mm/shmem.c · 21 unmodified lines
1084310853 TM6000 VIDEO4LINUX DRIVER
1084410854 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
1084510855 L: linux-media@vger.kernel.org
10846−W: http://linuxtv.org
10856+W: https://linuxtv.org
1084710857 T: git git://linuxtv.org/media_tree.git
1084810858 S: Odd fixes
1084910859 F: drivers/media/usb/tm6000/
@@ -10852,7 +10862,7 @@ TW68 VIDEO4LINUX DRIVER · 2 unmodified lines
1085210862 M: Hans Verkuil <hverkuil@xs4all.nl>
1085310863 L: linux-media@vger.kernel.org
1085410864 T: git git://linuxtv.org/media_tree.git
10855−W: http://linuxtv.org
10865+W: https://linuxtv.org
1085610866 S: Odd Fixes
1085710867 F: drivers/media/pci/tw68/
1085810868
@@ -10913,7 +10923,7 @@ F: include/uapi/linux/tty.h · 54 unmodified lines
1091310923 TUA9001 MEDIA DRIVER
1091410924 M: Antti Palosaari <crope@iki.fi>
1091510925 L: linux-media@vger.kernel.org
10916−W: http://linuxtv.org/
10926+W: https://linuxtv.org
1091710927 W: http://palosaari.fi/linux/
1091810928 Q: http://patchwork.linuxtv.org/project/linux-media/list/
1091910929 T: git git://linuxtv.org/anttip/media_tree.git
@@ -11260,7 +11270,7 @@ USB VISION DRIVER · 340 unmodified lines
1126011270 M: Hans Verkuil <hverkuil@xs4all.nl>
1126111271 L: linux-media@vger.kernel.org
1126211272 T: git git://linuxtv.org/media_tree.git
11263−W: http://linuxtv.org
11273+W: https://linuxtv.org
1126411274 S: Odd Fixes
1126511275 F: drivers/media/usb/usbvision/
1126611276
@@ -11474,7 +11484,7 @@ VIVID VIRTUAL VIDEO DRIVER · 207 unmodified lines
1147411484 M: Hans Verkuil <hverkuil@xs4all.nl>
1147511485 L: linux-media@vger.kernel.org
1147611486 T: git git://linuxtv.org/media_tree.git
11477−W: http://linuxtv.org
11487+W: https://linuxtv.org
1147811488 S: Maintained
1147911489 F: drivers/media/platform/vivid/*
1148011490
@@ -11763,7 +11773,7 @@ F: arch/x86/entry/vdso/ · 282 unmodified lines
1176311773 XC2028/3028 TUNER DRIVER
1176411774 M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
1176511775 L: linux-media@vger.kernel.org
11766−W: http://linuxtv.org
11776+W: https://linuxtv.org
1176711777 T: git git://linuxtv.org/media_tree.git
1176811778 S: Maintained
1176911779 F: drivers/media/tuners/tuner-xc2028.*
@@ -11932,7 +11942,7 @@ ZR36067 VIDEO FOR LINUX DRIVER · 162 unmodified lines
1193211942 L: mjpeg-users@lists.sourceforge.net
1193311943 L: linux-media@vger.kernel.org
1193411944 W: http://mjpeg.sourceforge.net/driver-zoran/
11935−T: hg http://linuxtv.org/hg/v4l-dvb
11945+T: hg https://linuxtv.org/hg/v4l-dvb
1193611946 S: Odd Fixes
1193711947 F: drivers/media/pci/zoran/
1193811948
arch/arm/boot/dts/stihxxx-b2120.dtsi+44−2
@@ -6,6 +6,9 @@ · 5 unmodified lines
66 * it under the terms of the GNU General Public License version 2 as
77 * published by the Free Software Foundation.
88 */
9+#include <dt-bindings/clock/stih407-clks.h>
10+#include <dt-bindings/gpio/gpio.h>
11+#include <dt-bindings/media/c8sectpfe.h>
912 / {
1013 soc {
1114 sbc_serial0: serial@9530000 {
@@ -35,12 +38,18 @@ · 23 unmodified lines
3538 status = "okay";
3639 };
3740
38− i2c@9842000 {
41+ ssc2: i2c@9842000 {
3942 status = "okay";
43+ clock-frequency = <100000>;
44+ st,i2c-min-scl-pulse-width-us = <0>;
45+ st,i2c-min-sda-pulse-width-us = <5>;
4046 };
4147
42− i2c@9843000 {
48+ ssc3: i2c@9843000 {
4349 status = "okay";
50+ clock-frequency = <100000>;
51+ st,i2c-min-scl-pulse-width-us = <0>;
52+ st,i2c-min-sda-pulse-width-us = <5>;
4453 };
4554
4655 i2c@9844000 {
@@ -93,5 +102,38 @@ · 46 unmodified lines
93102 phy-mode = "rgmii";
94103 fixed-link = <0 1 1000 0 0>;
95104 };
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+ };
96138 };
97139 };
arch/arm/mach-davinci/board-da850-evm.c+2−2
@@ -49,8 +49,8 @@ · 48 unmodified lines
4949 #include <asm/mach/arch.h>
5050 #include <asm/system_info.h>
5151
52−#include <media/tvp514x.h>
53−#include <media/adv7343.h>
52+#include <media/i2c/tvp514x.h>
53+#include <media/i2c/adv7343.h>
5454
5555 #define DA850_EVM_PHY_ID "davinci_mdio-0:00"
5656 #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
1919 #include <linux/gpio.h>
2020 #include <linux/clk.h>
2121 #include <linux/videodev2.h>
22−#include <media/tvp514x.h>
22+#include <media/i2c/tvp514x.h>
2323 #include <linux/spi/spi.h>
2424 #include <linux/spi/eeprom.h>
2525 #include <linux/platform_data/gpio-davinci.h>
arch/arm/mach-davinci/board-dm365-evm.c+2−2
@@ -40,8 +40,8 @@ · 39 unmodified lines
4040 #include <linux/platform_data/mtd-davinci.h>
4141 #include <linux/platform_data/keyscan-davinci.h>
4242
43−#include <media/ths7303.h>
44−#include <media/tvp514x.h>
43+#include <media/i2c/ths7303.h>
44+#include <media/i2c/tvp514x.h>
4545
4646 #include "davinci.h"
4747
arch/arm/mach-davinci/board-dm644x-evm.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/v4l2-dv-timings.h>
2727 #include <linux/export.h>
2828
29−#include <media/tvp514x.h>
29+#include <media/i2c/tvp514x.h>
3030
3131 #include <asm/mach-types.h>
3232 #include <asm/mach/arch.h>
arch/arm/mach-davinci/board-dm646x-evm.c+2−2
@@ -25,8 +25,8 @@ · 24 unmodified lines
2525 #include <linux/platform_data/at24.h>
2626 #include <linux/i2c/pcf857x.h>
2727
28−#include <media/tvp514x.h>
29−#include <media/adv7343.h>
28+#include <media/i2c/tvp514x.h>
29+#include <media/i2c/adv7343.h>
3030
3131 #include <linux/mtd/mtd.h>
3232 #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
177177 const struct imxuart_platform_data *pdata);
178178
179179 #include <linux/platform_data/video-mx3fb.h>
180−#include <linux/platform_data/camera-mx3.h>
180+#include <linux/platform_data/media/camera-mx3.h>
181181 struct imx_ipu_core_data {
182182 resource_size_t iobase;
183183 resource_size_t synirq;
@@ -192,7 +192,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb( · 8 unmodified lines
192192 const struct imx_ipu_core_data *data,
193193 struct mx3fb_platform_data *pdata);
194194
195−#include <linux/platform_data/camera-mx2.h>
195+#include <linux/platform_data/media/camera-mx2.h>
196196 struct imx_mx2_camera_data {
197197 const char *devid;
198198 resource_size_t iobasecsi;
arch/arm/mach-omap1/include/mach/camera.h+1−1
@@ -1,7 +1,7 @@
11 #ifndef __ASM_ARCH_CAMERA_H_
22 #define __ASM_ARCH_CAMERA_H_
33
4−#include <media/omap1_camera.h>
4+#include <linux/platform_data/media/omap1_camera.h>
55
66 void omap1_camera_init(void *);
77
arch/arm/mach-omap2/board-rx51-peripherals.c+2−2
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939
4040 #include <sound/tlv320aic3x.h>
4141 #include <sound/tpa6130a2-plat.h>
42−#include <media/si4713.h>
42+#include <linux/platform_data/media/si4713.h>
4343 #include <linux/platform_data/leds-lp55xx.h>
4444
4545 #include <linux/platform_data/tsl2563.h>
@@ -48,7 +48,7 @@ · 2 unmodified lines
4848 #include <video/omap-panel-data.h>
4949
5050 #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>
5252 #endif
5353
5454 #include "mux.h"
arch/arm/mach-pxa/devices.c+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #include <mach/irqs.h>
1515 #include <linux/platform_data/usb-ohci-pxa27x.h>
1616 #include <linux/platform_data/keypad-pxa27x.h>
17−#include <linux/platform_data/camera-pxa.h>
17+#include <linux/platform_data/media/camera-pxa.h>
1818 #include <mach/audio.h>
1919 #include <mach/hardware.h>
2020 #include <linux/platform_data/mmp_dma.h>
arch/arm/mach-pxa/em-x270.c+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 #include <linux/platform_data/usb-ohci-pxa27x.h>
4747 #include <linux/platform_data/mmc-pxamci.h>
4848 #include <linux/platform_data/keypad-pxa27x.h>
49−#include <linux/platform_data/camera-pxa.h>
49+#include <linux/platform_data/media/camera-pxa.h>
5050
5151 #include "generic.h"
5252 #include "devices.h"
arch/arm/mach-pxa/ezx.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #include <linux/platform_data/usb-ohci-pxa27x.h>
3535 #include <mach/hardware.h>
3636 #include <linux/platform_data/keypad-pxa27x.h>
37−#include <linux/platform_data/camera-pxa.h>
37+#include <linux/platform_data/media/camera-pxa.h>
3838
3939 #include "devices.h"
4040 #include "generic.h"
arch/arm/mach-pxa/mioa701.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 #include <linux/platform_data/mmc-pxamci.h>
5555 #include <mach/udc.h>
5656 #include <mach/pxa27x-udc.h>
57−#include <linux/platform_data/camera-pxa.h>
57+#include <linux/platform_data/media/camera-pxa.h>
5858 #include <mach/audio.h>
5959 #include <mach/smemc.h>
6060 #include <media/soc_camera.h>
arch/arm/mach-pxa/palmtreo.c+1−1
@@ -43,7 +43,7 @@ · 42 unmodified lines
4343 #include <linux/platform_data/usb-ohci-pxa27x.h>
4444 #include <mach/pxa2xx-regs.h>
4545 #include <linux/platform_data/asoc-palm27x.h>
46−#include <linux/platform_data/camera-pxa.h>
46+#include <linux/platform_data/media/camera-pxa.h>
4747 #include <mach/palm27x.h>
4848
4949 #include <sound/pxa2xx-lib.h>
arch/arm/mach-pxa/palmz72.c+1−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
4949 #include <mach/palm27x.h>
5050
5151 #include <mach/pm.h>
52−#include <linux/platform_data/camera-pxa.h>
52+#include <linux/platform_data/media/camera-pxa.h>
5353
5454 #include <media/soc_camera.h>
5555
arch/arm/mach-pxa/pcm990-baseboard.c+2−2
@@ -27,10 +27,10 @@ · 26 unmodified lines
2727 #include <linux/pwm.h>
2828 #include <linux/pwm_backlight.h>
2929
30−#include <media/mt9v022.h>
30+#include <media/i2c/mt9v022.h>
3131 #include <media/soc_camera.h>
3232
33−#include <linux/platform_data/camera-pxa.h>
33+#include <linux/platform_data/media/camera-pxa.h>
3434 #include <asm/mach/map.h>
3535 #include <mach/pxa27x.h>
3636 #include <mach/audio.h>
arch/arm/plat-samsung/devs.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #include <linux/platform_data/s3c-hsotg.h>
3737 #include <linux/platform_data/dma-s3c24xx.h>
3838
39−#include <media/s5p_hdmi.h>
39+#include <linux/platform_data/media/s5p_hdmi.h>
4040
4141 #include <asm/irq.h>
4242 #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
443443 };
444444
445445 #if IS_ENABLED(CONFIG_VIDEO_ADV7183)
446−#include <media/adv7183.h>
446+#include <media/i2c/adv7183.h>
447447 static struct v4l2_input adv7183_inputs[] = {
448448 {
449449 .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
933933 #endif
934934
935935 #if IS_ENABLED(CONFIG_VIDEO_ADV7842)
936−#include <media/adv7842.h>
936+#include <media/i2c/adv7842.h>
937937
938938 static struct v4l2_input adv7842_inputs[] = {
939939 {
@@ -1084,7 +1084,7 @@ static const struct ppi_info ppi_info = { · 144 unmodified lines
10841084 };
10851085
10861086 #if IS_ENABLED(CONFIG_VIDEO_ADV7511)
1087−#include <media/adv7511.h>
1087+#include <media/i2c/adv7511.h>
10881088
10891089 static struct v4l2_output adv7511_outputs[] = {
10901090 {
@@ -1125,7 +1125,7 @@ static struct bfin_display_config bfin_display_data = { · 34 unmodified lines
11251125 #endif
11261126
11271127 #if IS_ENABLED(CONFIG_VIDEO_ADV7343)
1128−#include <media/adv7343.h>
1128+#include <media/i2c/adv7343.h>
11291129
11301130 static struct v4l2_output adv7343_outputs[] = {
11311131 {
arch/sh/boards/mach-ap325rxa/setup.c+3−3
@@ -27,10 +27,10 @@ · 26 unmodified lines
2727 #include <linux/gpio.h>
2828 #include <linux/videodev2.h>
2929 #include <linux/sh_intc.h>
30−#include <media/ov772x.h>
30+#include <media/i2c/ov772x.h>
3131 #include <media/soc_camera.h>
32−#include <media/soc_camera_platform.h>
33−#include <media/sh_mobile_ceu.h>
32+#include <linux/platform_data/media/soc_camera_platform.h>
33+#include <media/drv-intf/sh_mobile_ceu.h>
3434 #include <video/sh_mobile_lcdc.h>
3535 #include <asm/io.h>
3636 #include <asm/clock.h>
arch/sh/boards/mach-ecovec24/setup.c+5−5
@@ -38,10 +38,10 @@ · 37 unmodified lines
3838 #include <video/sh_mobile_lcdc.h>
3939 #include <sound/sh_fsi.h>
4040 #include <sound/simple_card.h>
41−#include <media/sh_mobile_ceu.h>
41+#include <media/drv-intf/sh_mobile_ceu.h>
4242 #include <media/soc_camera.h>
43−#include <media/tw9910.h>
44−#include <media/mt9t112.h>
43+#include <media/i2c/tw9910.h>
44+#include <media/i2c/mt9t112.h>
4545 #include <asm/heartbeat.h>
4646 #include <asm/clock.h>
4747 #include <asm/suspend.h>
@@ -900,8 +900,8 @@ static struct platform_device irda_device = { · 852 unmodified lines
900900 .resource = irda_resources,
901901 };
902902
903−#include <media/ak881x.h>
904−#include <media/sh_vou.h>
903+#include <media/i2c/ak881x.h>
904+#include <media/drv-intf/sh_vou.h>
905905
906906 static struct ak881x_pdata ak881x_pdata = {
907907 .flags = AK881X_IF_MODE_SLAVE,
arch/sh/boards/mach-kfr2r09/setup.c+2−2
@@ -27,9 +27,9 @@ · 26 unmodified lines
2727 #include <linux/usb/r8a66597.h>
2828 #include <linux/videodev2.h>
2929 #include <linux/sh_intc.h>
30−#include <media/rj54n1cb0c.h>
30+#include <media/i2c/rj54n1cb0c.h>
3131 #include <media/soc_camera.h>
32−#include <media/sh_mobile_ceu.h>
32+#include <media/drv-intf/sh_mobile_ceu.h>
3333 #include <video/sh_mobile_lcdc.h>
3434 #include <asm/suspend.h>
3535 #include <asm/clock.h>
arch/sh/boards/mach-migor/setup.c+3−3
@@ -27,10 +27,10 @@ · 26 unmodified lines
2727 #include <linux/videodev2.h>
2828 #include <linux/sh_intc.h>
2929 #include <video/sh_mobile_lcdc.h>
30−#include <media/sh_mobile_ceu.h>
31−#include <media/ov772x.h>
30+#include <media/drv-intf/sh_mobile_ceu.h>
31+#include <media/i2c/ov772x.h>
3232 #include <media/soc_camera.h>
33−#include <media/tw9910.h>
33+#include <media/i2c/tw9910.h>
3434 #include <asm/clock.h>
3535 #include <asm/machvec.h>
3636 #include <asm/io.h>
arch/sh/boards/mach-se/7724/setup.c+3−3
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <linux/sh_intc.h>
3131 #include <linux/videodev2.h>
3232 #include <video/sh_mobile_lcdc.h>
33−#include <media/sh_mobile_ceu.h>
33+#include <media/drv-intf/sh_mobile_ceu.h>
3434 #include <sound/sh_fsi.h>
3535 #include <sound/simple_card.h>
3636 #include <asm/io.h>
@@ -534,8 +534,8 @@ static struct platform_device irda_device = { · 497 unmodified lines
534534 .resource = irda_resources,
535535 };
536536
537−#include <media/ak881x.h>
538−#include <media/sh_vou.h>
537+#include <media/i2c/ak881x.h>
538+#include <media/drv-intf/sh_vou.h>
539539
540540 static struct ak881x_pdata ak881x_pdata = {
541541 .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
161161 * The DRM pixel formats and IPU internal representation are ordered the other
162162 * way around, with the first named component ordered at the most significant
163163 * bits. Further, V4L2 formats are not well defined:
164− * http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html
164+ * https://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html
165165 * We choose the interpretation which matches GStreamer behavior.
166166 */
167167 static 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
444444 goto err_poll;
445445
446446 /* mark as finished */
447− v4l2_get_timestamp(&new_buf->vb.timestamp);
447+ new_buf->vb.vb2_buf.timestamp = ktime_get_ns();
448448 new_buf->vb.sequence = sur40->sequence++;
449449 new_buf->vb.field = V4L2_FIELD_NONE;
450450 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
644644 * minimum number: many DMA engines need a minimum of 2 buffers in the
645645 * queue and you need to have another available for userspace processing.
646646 */
647−static int sur40_queue_setup(struct vb2_queue *q, const void *parg,
647+static int sur40_queue_setup(struct vb2_queue *q,
648648 unsigned int *nbuffers, unsigned int *nplanes,
649649 unsigned int sizes[], void *alloc_ctxs[])
650650 {
651− const struct v4l2_format *fmt = parg;
652651 struct sur40_state *sur40 = vb2_get_drv_priv(q);
653652
654653 if (q->num_buffers + *nbuffers < 3)
655654 *nbuffers = 3 - q->num_buffers;
655+ alloc_ctxs[0] = sur40->alloc_ctx;
656656
657− if (fmt && fmt->fmt.pix.sizeimage < sur40_video_format.sizeimage)
658− return -EINVAL;
657+ if (*nplanes)
658+ return sizes[0] < sur40_video_format.sizeimage ? -EINVAL : 0;
659659
660660 *nplanes = 1;
661− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : sur40_video_format.sizeimage;
662− alloc_ctxs[0] = sur40->alloc_ctx;
661+ sizes[0] = sur40_video_format.sizeimage;
663662
664663 return 0;
665664 }
drivers/media/Kconfig+2−2
@@ -9,7 +9,7 @@ menuconfig MEDIA_SUPPORT · 8 unmodified lines
99 If you want to use Webcams, Video grabber devices and/or TV devices
1010 enable this option and other options below.
1111 Additional info and docs are available on the web at
12− <http://linuxtv.org>
12+ <https://linuxtv.org>
1313
1414 if MEDIA_SUPPORT
1515
@@ -51,7 +51,7 @@ config MEDIA_RADIO_SUPPORT · 35 unmodified lines
5151 Enable AM/FM radio support.
5252
5353 Additional info and docs are available on the web at
54− <http://linuxtv.org>
54+ <https://linuxtv.org>
5555
5656 Say Y when you have a board with radio support.
5757
drivers/media/common/cx2341x.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include <linux/videodev2.h>
2828
2929 #include <media/tuner.h>
30−#include <media/cx2341x.h>
30+#include <media/drv-intf/cx2341x.h>
3131 #include <media/v4l2-common.h>
3232
3333 MODULE_DESCRIPTION("cx23415/6/8 driver");
drivers/media/common/saa7146/saa7146_core.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020
2121 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2222
23−#include <media/saa7146.h>
23+#include <media/drv-intf/saa7146.h>
2424 #include <linux/module.h>
2525
2626 static int saa7146_num;
drivers/media/common/saa7146/saa7146_fops.c+1−1
@@ -1,6 +1,6 @@
11 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
3−#include <media/saa7146_vv.h>
3+#include <media/drv-intf/saa7146_vv.h>
44 #include <linux/module.h>
55
66 /****************************************************************************/
drivers/media/common/saa7146/saa7146_hlp.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22
33 #include <linux/kernel.h>
44 #include <linux/export.h>
5−#include <media/saa7146_vv.h>
5+#include <media/drv-intf/saa7146_vv.h>
66
77 static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format)
88 {
drivers/media/common/saa7146/saa7146_i2c.c+1−1
@@ -1,6 +1,6 @@
11 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
3−#include <media/saa7146_vv.h>
3+#include <media/drv-intf/saa7146_vv.h>
44
55 static u32 saa7146_i2c_func(struct i2c_adapter *adapter)
66 {
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>
22
33 static int vbi_pixel_to_capture = 720 * 2;
44
drivers/media/common/saa7146/saa7146_video.c+1−1
@@ -1,6 +1,6 @@
11 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
3−#include <media/saa7146_vv.h>
3+#include <media/drv-intf/saa7146_vv.h>
44 #include <media/v4l2-event.h>
55 #include <media/v4l2-ctrls.h>
66 #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
3030 #include <linux/input.h>
3131 #include <media/rc-core.h>
3232
33−#define IR_DEFAULT_TIMEOUT 100
34−
3533 struct smscore_device_t;
3634
3735 struct ir_t {
drivers/media/dvb-core/demux.h+65−2
@@ -32,6 +32,49 @@ · 31 unmodified lines
3232 #include <linux/time.h>
3333 #include <linux/dvb/dmx.h>
3434
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+
3578 /*
3679 * Common definitions
3780 */
@@ -187,8 +230,28 @@ struct dmx_section_feed { · 149 unmodified lines
187230 int (*stop_filtering)(struct dmx_section_feed *feed);
188231 };
189232
190−/*
191− * Callback functions
233+/**
234+ * 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.
192255 */
193256
194257 /**
drivers/media/dvb-core/dvb-usb-ids.h+1−0
@@ -389,4 +389,5 @@ · 388 unmodified lines
389389 #define USB_PID_PCTV_2002E_SE 0x025d
390390 #define USB_PID_SVEON_STV27 0xd3af
391391 #define USB_PID_TURBOX_DTT_2000 0xd3a4
392+#define USB_PID_WINTV_SOLOHD 0x0264
392393 #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
891891 }
892892
893893 /*
894− * Sleep until gettimeofday() > waketime + add_usec
895− * This needs to be as precise as possible, but as the delay is
896− * usually between 2ms and 32ms, it is done using a scheduled msleep
897− * followed by usleep (normally a busy-wait loop) for the remainder
894+ * Sleep for the amount of time given by add_usec parameter
895+ *
896+ * This needs to be as precise as possible, as it affects the detection of
897+ * the dish tone command at the satellite subsystem. The precision is improved
898+ * by using a scheduled msleep followed by udelay for the remainder.
898899 */
899900 void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec)
900901 {
901− s32 delta, newdelta;
902+ s32 delta;
902903
903− ktime_add_us(*waketime, add_usec);
904+ *waketime = ktime_add_us(*waketime, add_usec);
904905 delta = ktime_us_delta(ktime_get_real(), *waketime);
905906 if (delta > 2500) {
906907 msleep((delta - 1500) / 1000);
907− newdelta = ktime_us_delta(ktime_get_real(), *waketime);
908− delta = (newdelta > delta) ? 0 : newdelta;
908+ delta = ktime_us_delta(ktime_get_real(), *waketime);
909909 }
910910 if (delta > 0)
911911 udelay(delta);
@@ -2313,9 +2313,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file, · 1401 unmodified lines
23132313 dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",
23142314 __func__, c->delivery_system, fe->ops.info.type);
23152315
2316− /* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't
2317− * do it, it is done for it. */
2318− info->caps |= FE_CAN_INVERSION_AUTO;
2316+ /* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */
2317+ if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT))
2318+ info->caps |= FE_CAN_INVERSION_AUTO;
23192319 err = 0;
23202320 break;
23212321 }
@@ -2710,6 +2710,11 @@ int dvb_frontend_resume(struct dvb_frontend *fe) · 388 unmodified lines
27102710 else if (fe->ops.tuner_ops.init)
27112711 ret = fe->ops.tuner_ops.init(fe);
27122712
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+
27132718 fe->exit = DVB_FE_NO_EXIT;
27142719 fepriv->state = FESTATE_RETUNE;
27152720 dvb_frontend_wakeup(fe);
drivers/media/dvb-core/dvb_frontend.h+168−53
@@ -42,6 +42,29 @@ · 41 unmodified lines
4242
4343 #include "dvbdev.h"
4444
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+
4568 /*
4669 * Maximum number of Delivery systems per frontend. It
4770 * should be smaller or equal to 32
@@ -112,16 +135,6 @@ struct analog_parameters { · 64 unmodified lines
112135 u64 std;
113136 };
114137
115−enum 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−
125138 /**
126139 * enum dvbfe_algo - defines the algorithm used to tune into a channel
127140 *
@@ -152,15 +165,6 @@ enum dvbfe_algo { · 24 unmodified lines
152165 DVBFE_ALGO_RECOVERY = (1 << 31)
153166 };
154167
155−struct tuner_state {
156− u32 frequency;
157− u32 tunerstep;
158− u32 ifreq;
159− u32 bandwidth;
160− u32 iqsense;
161− u32 refclock;
162−};
163−
164168 /**
165169 * enum dvbfe_search - search callback possible return status
166170 *
@@ -209,12 +213,12 @@ enum dvbfe_search { · 42 unmodified lines
209213 * are stored at @dvb_frontend.dtv_property_cache;. The
210214 * tuner demod can change the parameters to reflect the
211215 * 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.
213219 * @set_analog_params: callback function used to tune into an analog TV
214220 * channel on hybrid tuners. It passes @analog_parameters;
215221 * to the driver.
216− * @calc_regs: callback function used to pass register data settings
217− * for simple tuners.
218222 * @set_config: callback function used to send some tuner-specific
219223 * parameters.
220224 * @get_frequency: get the actual tuned frequency
@@ -227,16 +231,10 @@ enum dvbfe_search { · 6 unmodified lines
227231 * via DVBv5 API (@dvb_frontend.dtv_property_cache;).
228232 * @get_afc: Used only by analog TV core. Reports the frequency
229233 * drift due to AFC.
230− * @set_frequency: Set a new frequency. Please notice that using
231− * set_params is preferred.
232− * @set_bandwidth: Set a new frequency. Please notice that using
233− * set_params is preferred.
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.
234+ * @calc_regs: callback function used to pass register data settings
235+ * for simple tuners. Shouldn't be used on newer drivers.
236+ * @set_frequency: Set a new frequency. Shouldn't be used on newer drivers.
237+ * @set_bandwidth: Set a new frequency. Shouldn't be used on newer drivers.
240238 *
241239 * NOTE: frequencies used on get_frequency and set_frequency are in Hz for
242240 * terrestrial/cable or kHz for satellite.
@@ -252,14 +250,10 @@ struct dvb_tuner_ops { · 9 unmodified lines
252250 int (*suspend)(struct dvb_frontend *fe);
253251 int (*resume)(struct dvb_frontend *fe);
254252
255− /** This is for simple PLLs - set all parameters in one go. */
253+ /* This is the recomended way to set the tuner */
256254 int (*set_params)(struct dvb_frontend *fe);
257255 int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
258256
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 */
263257 int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
264258
265259 int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
@@ -272,17 +266,23 @@ struct dvb_tuner_ops { · 6 unmodified lines
272266 int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
273267 int (*get_afc)(struct dvb_frontend *fe, s32 *afc);
274268
275− /** These are provided separately from set_params in order to facilitate silicon
276− * tuners which require sophisticated tuning loops, controlling each parameter separately. */
277− int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
278− int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
269+ /*
270+ * This is support for demods like the mt352 - fills out the supplied
271+ * buffer with what to write.
272+ *
273+ * Don't use on newer drivers.
274+ */
275+ int (*calc_regs)(struct dvb_frontend *fe, u8 *buf, int buf_len);
279276
280277 /*
281− * These are provided separately from set_params in order to facilitate silicon
282− * tuners which require sophisticated tuning loops, controlling each parameter separately.
278+ * These are provided separately from set_params in order to
279+ * facilitate silicon tuners which require sophisticated tuning loops,
280+ * controlling each parameter separately.
281+ *
282+ * Don't use on newer drivers.
283283 */
284− int (*set_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
285− int (*get_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 (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
286286 };
287287
288288 /**
@@ -404,6 +404,11 @@ struct dtv_frontend_properties; · 115 unmodified lines
404404 * FE_ENABLE_HIGH_LNB_VOLTAGE ioctl (only Satellite).
405405 * @dishnetwork_send_legacy_command: callback function to implement the
406406 * 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.
407412 * @i2c_gate_ctrl: controls the I2C gate. Newer drivers should use I2C
408413 * mux support instead.
409414 * @ts_bus_ctrl: callback function used to take control of the TS bus.
@@ -466,7 +471,8 @@ struct dvb_frontend_ops { · 56 unmodified lines
466471 int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);
467472 int (*set_lna)(struct dvb_frontend *);
468473
469− /* These callbacks are for devices that implement their own
474+ /*
475+ * These callbacks are for devices that implement their own
470476 * tuning algorithms, rather than a simple swzigzag
471477 */
472478 enum dvbfe_search (*search)(struct dvb_frontend *fe);
@@ -682,17 +688,126 @@ struct dvb_frontend { · 209 unmodified lines
682688 unsigned int exit;
683689 };
684690
685−extern 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+ */
702+int dvb_register_frontend(struct dvb_adapter *dvb,
686703 struct dvb_frontend *fe);
687704
688−extern 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+ */
717+int dvb_unregister_frontend(struct dvb_frontend *fe);
689718
690−extern 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+ */
733+void 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+ */
751+int 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+ */
772+int dvb_frontend_resume(struct dvb_frontend *fe);
691773
692−extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
693−extern int dvb_frontend_suspend(struct dvb_frontend *fe);
694−extern int dvb_frontend_resume(struct dvb_frontend *fe);
774+/**
775+ * dvb_frontend_reinitialise() - forces a reinitialisation at the frontend
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+ */
786+void dvb_frontend_reinitialise(struct dvb_frontend *fe);
695787
696−extern 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+ */
811+void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec);
697812
698813 #endif
drivers/media/dvb-frontends/Kconfig+1−1
@@ -264,7 +264,7 @@ config DVB_MB86A16 · 263 unmodified lines
264264 config DVB_TDA10071
265265 tristate "NXP TDA10071"
266266 depends on DVB_CORE && I2C
267− select REGMAP
267+ select REGMAP_I2C
268268 default m if !MEDIA_SUBDRV_AUTOSELECT
269269 help
270270 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
4444 int ret;
4545 u8 buf[] = { (reg >> 8) | 0x80, reg & 0xff, data };
4646
47− struct i2c_msg msg = { .addr = state->config->demod_address,
47+ struct i2c_msg msg = { .addr = state->config.demod_address,
4848 .flags = 0, .buf = buf, .len = 3 };
4949
5050 ret = i2c_transfer(state->i2c, &msg, 1);
@@ -64,9 +64,9 @@ u8 au8522_readreg(struct au8522_state *state, u16 reg) · 13 unmodified lines
6464 u8 b1[] = { 0 };
6565
6666 struct i2c_msg msg[] = {
67− { .addr = state->config->demod_address, .flags = 0,
67+ { .addr = state->config.demod_address, .flags = 0,
6868 .buf = b0, .len = 2 },
69− { .addr = state->config->demod_address, .flags = I2C_M_RD,
69+ { .addr = state->config.demod_address, .flags = I2C_M_RD,
7070 .buf = b1, .len = 1 } };
7171
7272 ret = i2c_transfer(state->i2c, msg, 2);
@@ -140,7 +140,7 @@ EXPORT_SYMBOL(au8522_release_state); · 67 unmodified lines
140140
141141 static int au8522_led_gpio_enable(struct au8522_state *state, int onoff)
142142 {
143− struct au8522_led_config *led_config = state->config->led_cfg;
143+ struct au8522_led_config *led_config = state->config.led_cfg;
144144 u8 val;
145145
146146 /* 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
170170 */
171171 int au8522_led_ctrl(struct au8522_state *state, int led)
172172 {
173− struct au8522_led_config *led_config = state->config->led_cfg;
173+ struct au8522_led_config *led_config = state->config.led_cfg;
174174 int i, ret = 0;
175175
176176 /* 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
730730 struct v4l2_ctrl_handler *hdl;
731731 struct v4l2_subdev *sd;
732732 int instance;
733− struct au8522_config *demod_config;
734733
735734 /* Check if the adapter supports the needed features */
736735 if (!i2c_check_functionality(client->adapter,
@@ -754,15 +753,7 @@ static int au8522_probe(struct i2c_client *client, · 17 unmodified lines
754753 break;
755754 }
756755
757− demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL);
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;
756+ state->config.demod_address = 0x8e >> 1;
766757 state->i2c = client->adapter;
767758
768759 sd = &state->sd;
@@ -784,8 +775,7 @@ static int au8522_probe(struct i2c_client *client, · 15 unmodified lines
784775 int err = hdl->error;
785776
786777 v4l2_ctrl_handler_free(hdl);
787− kfree(demod_config);
788− kfree(state);
778+ au8522_release_state(state);
789779 return err;
790780 }
791781
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
566566 au8522_writereg(state,
567567 VSB_mod_tab[i].reg,
568568 VSB_mod_tab[i].data);
569− au8522_set_if(fe, state->config->vsb_if);
569+ au8522_set_if(fe, state->config.vsb_if);
570570 break;
571571 case QAM_64:
572572 dprintk("%s() QAM 64\n", __func__);
@@ -574,7 +574,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, · 1 unmodified line
574574 au8522_writereg(state,
575575 QAM64_mod_tab[i].reg,
576576 QAM64_mod_tab[i].data);
577− au8522_set_if(fe, state->config->qam_if);
577+ au8522_set_if(fe, state->config.qam_if);
578578 break;
579579 case QAM_256:
580580 if (zv_mode) {
@@ -583,7 +583,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, · 2 unmodified lines
583583 au8522_writereg(state,
584584 QAM256_mod_tab_zv_mode[i].reg,
585585 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);
587587 msleep(100);
588588 au8522_writereg(state, 0x821a, 0x00);
589589 } else {
@@ -592,7 +592,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, · 2 unmodified lines
592592 au8522_writereg(state,
593593 QAM256_mod_tab[i].reg,
594594 QAM256_mod_tab[i].data);
595− au8522_set_if(fe, state->config->qam_if);
595+ au8522_set_if(fe, state->config.qam_if);
596596 }
597597 break;
598598 default:
@@ -666,7 +666,7 @@ static int au8522_read_status(struct dvb_frontend *fe, enum fe_status *status) · 67 unmodified lines
666666 *status |= FE_HAS_LOCK | FE_HAS_SYNC;
667667 }
668668
669− switch (state->config->status_mode) {
669+ switch (state->config.status_mode) {
670670 case AU8522_DEMODLOCKING:
671671 dprintk("%s() DEMODLOCKING\n", __func__);
672672 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
704704
705705 static int au8522_led_status(struct au8522_state *state, const u16 *snr)
706706 {
707− struct au8522_led_config *led_config = state->config->led_cfg;
707+ struct au8522_led_config *led_config = state->config.led_cfg;
708708 int led;
709709 u16 strong;
710710
@@ -758,7 +758,7 @@ static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr) · 47 unmodified lines
758758 au8522_readreg(state, 0x4311),
759759 snr);
760760
761− if (state->config->led_cfg)
761+ if (state->config.led_cfg)
762762 au8522_led_status(state, snr);
763763
764764 return ret;
@@ -866,7 +866,7 @@ struct dvb_frontend *au8522_attach(const struct au8522_config *config, · 101 unmodified lines
866866 }
867867
868868 /* setup the state */
869− state->config = config;
869+ state->config = *config;
870870 state->i2c = i2c;
871871 state->operational_mode = AU8522_DIGITAL_MODE;
872872
drivers/media/dvb-frontends/au8522_priv.h+1−1
@@ -50,7 +50,7 @@ struct au8522_state { · 49 unmodified lines
5050 struct list_head hybrid_tuner_instance_list;
5151
5252 /* configuration settings */
53− const struct au8522_config *config;
53+ struct au8522_config config;
5454
5555 struct dvb_frontend frontend;
5656
drivers/media/dvb-frontends/bsbe1-d01a.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2222 *
2323 *
24− * the project's page is at http://www.linuxtv.org
24+ * the project's page is at https://linuxtv.org
2525 */
2626
2727 #ifndef BSBE1_D01A_H
drivers/media/dvb-frontends/bsbe1.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2020 *
2121 *
22− * the project's page is at http://www.linuxtv.org
22+ * the project's page is at https://linuxtv.org
2323 */
2424
2525 #ifndef BSBE1_H
drivers/media/dvb-frontends/bsru6.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2020 *
2121 *
22− * the project's page is at http://www.linuxtv.org
22+ * the project's page is at https://linuxtv.org
2323 */
2424
2525 #ifndef BSRU6_H
drivers/media/dvb-frontends/isl6405.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2323 *
2424 *
25− * the project's page is at http://www.linuxtv.org
25+ * the project's page is at https://linuxtv.org
2626 */
2727 #include <linux/delay.h>
2828 #include <linux/errno.h>
drivers/media/dvb-frontends/isl6405.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2323 *
2424 *
25− * the project's page is at http://www.linuxtv.org
25+ * the project's page is at https://linuxtv.org
2626 */
2727
2828 #ifndef _ISL6405_H
drivers/media/dvb-frontends/isl6421.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2323 *
2424 *
25− * the project's page is at http://www.linuxtv.org
25+ * the project's page is at https://linuxtv.org
2626 */
2727 #include <linux/delay.h>
2828 #include <linux/errno.h>
drivers/media/dvb-frontends/isl6421.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2323 *
2424 *
25− * the project's page is at http://www.linuxtv.org
25+ * the project's page is at https://linuxtv.org
2626 */
2727
2828 #ifndef _ISL6421_H
drivers/media/dvb-frontends/lnbp21.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2323 *
2424 *
25− * the project's page is at http://www.linuxtv.org
25+ * the project's page is at https://linuxtv.org
2626 */
2727 #include <linux/delay.h>
2828 #include <linux/errno.h>
drivers/media/dvb-frontends/lnbp21.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2222 *
2323 *
24− * the project's page is at http://www.linuxtv.org
24+ * the project's page is at https://linuxtv.org
2525 */
2626
2727 #ifndef _LNBP21_H
drivers/media/dvb-frontends/lnbp22.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2323 *
2424 *
25− * the project's page is at http://www.linuxtv.org
25+ * the project's page is at https://linuxtv.org
2626 */
2727 #include <linux/delay.h>
2828 #include <linux/errno.h>
drivers/media/dvb-frontends/lnbp22.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2323 *
2424 *
25− * the project's page is at http://www.linuxtv.org
25+ * the project's page is at https://linuxtv.org
2626 */
2727
2828 #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
976976
977977 ret = __i2c_transfer(client->adapter, msg, 2);
978978 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);
980981 if (ret >= 0)
981982 ret = -EREMOTEIO;
982983 return ret;
@@ -999,7 +1000,8 @@ static int rtl2832_regmap_write(void *context, const void *data, size_t count) · 16 unmodified lines
9991000
10001001 ret = __i2c_transfer(client->adapter, msg, 1);
10011002 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);
10031005 if (ret >= 0)
10041006 ret = -EREMOTEIO;
10051007 return ret;
@@ -1028,7 +1030,8 @@ static int rtl2832_regmap_gather_write(void *context, const void *reg, · 22 unmodified lines
10281030
10291031 ret = __i2c_transfer(client->adapter, msg, 1);
10301032 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);
10321035 if (ret >= 0)
10331036 ret = -EREMOTEIO;
10341037 return ret;
@@ -1097,18 +1100,6 @@ static int rtl2832_enable_slave_ts(struct i2c_client *client) · 62 unmodified lines
10971100 if (ret)
10981101 goto err;
10991102
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−
11121103 ret = rtl2832_bulk_write(client, 0x192, "\x7f\xf7\xff", 3);
11131104 if (ret)
11141105 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
310310 len = rtl2832_sdr_convert_stream(dev, ptr, urb->transfer_buffer,
311311 urb->actual_length);
312312 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();
314314 fbuf->vb.sequence = dev->sequence++;
315315 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
316316 }
@@ -490,7 +490,7 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh, · 173 unmodified lines
490490
491491 /* Videobuf2 operations */
492492 static int rtl2832_sdr_queue_setup(struct vb2_queue *vq,
493− const void *parg, unsigned int *nbuffers,
493+ unsigned int *nbuffers,
494494 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
495495 {
496496 struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq);
drivers/media/dvb-frontends/si2165.c+229−122
@@ -1,21 +1,21 @@
11 /*
2− Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator
3−
4− Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org>
5−
6− 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 by
8− the Free Software Foundation; either version 2 of the License, or
9− (at your option) any later version.
10−
11− This program is distributed in the hope that it will be useful,
12− but WITHOUT ANY WARRANTY; without even the implied warranty of
13− MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14− GNU General Public License for more details.
15−
16− References:
17− http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf
18−*/
2+ * Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator
3+ *
4+ * Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org>
5+ *
6+ * 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 by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * References:
17+ * http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf
18+ */
1919
2020 #include <linux/delay.h>
2121 #include <linux/errno.h>
@@ -31,16 +31,18 @@ · 9 unmodified lines
3131 #include "si2165_priv.h"
3232 #include "si2165.h"
3333
34−/* Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx
35− * uses 16 MHz xtal */
36−
37−/* Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx
38− * uses 24 MHz clock provided by tuner */
34+/*
35+ * Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx
36+ * uses 16 MHz xtal
37+ *
38+ * Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx
39+ * uses 24 MHz clock provided by tuner
40+ */
3941
4042 struct si2165_state {
4143 struct i2c_adapter *i2c;
4244
43− struct dvb_frontend frontend;
45+ struct dvb_frontend fe;
4446
4547 struct si2165_config config;
4648
@@ -241,6 +243,27 @@ err: · 194 unmodified lines
241243 return ret;
242244 }
243245
246+#define REG16(reg, val) { (reg), (val) & 0xff }, { (reg)+1, (val)>>8 & 0xff }
247+struct si2165_reg_value_pair {
248+ u16 reg;
249+ u8 val;
250+};
251+
252+static 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+
244267 static int si2165_get_tune_settings(struct dvb_frontend *fe,
245268 struct dvb_frontend_tune_settings *s)
246269 {
@@ -258,8 +281,10 @@ static int si2165_init_pll(struct si2165_state *state) · 11 unmodified lines
258281 u8 divl = 12;
259282 u8 buf[4];
260283
261− /* hardcoded values can be deleted if calculation is verified
262− * or it yields the same values as the windows driver */
284+ /*
285+ * hardcoded values can be deleted if calculation is verified
286+ * or it yields the same values as the windows driver
287+ */
263288 switch (ref_freq_Hz) {
264289 case 16000000u:
265290 divn = 56;
@@ -274,8 +299,10 @@ static int si2165_init_pll(struct si2165_state *state) · 8 unmodified lines
274299 if (ref_freq_Hz > 16000000u)
275300 divr = 2;
276301
277− /* now select divn and divp such that
278− * fvco is in 1624..1824 MHz */
302+ /*
303+ * now select divn and divp such that
304+ * fvco is in 1624..1824 MHz
305+ */
279306 if (1624000000u * divr > ref_freq_Hz * 2u * 63u)
280307 divp = 4;
281308
@@ -341,10 +368,12 @@ static int si2165_upload_firmware_block(struct si2165_state *state, · 59 unmodified lines
341368 if (len % 4 != 0)
342369 return -EINVAL;
343370
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",
345373 len, offset, block_count);
346374 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",
348377 len, offset, cur_block, block_count);
349378 wordcount = data[offset];
350379 if (wordcount < 1 || data[offset+1] ||
@@ -383,7 +412,8 @@ static int si2165_upload_firmware_block(struct si2165_state *state, · 32 unmodified lines
383412 cur_block++;
384413 }
385414
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",
387417 len, offset, cur_block, block_count);
388418
389419 if (poffset)
@@ -633,7 +663,7 @@ static int si2165_init(struct dvb_frontend *fe) · 243 unmodified lines
633663 goto error;
634664
635665 /* ber_pkt */
636− ret = si2165_writereg16(state, 0x0470 , 0x7530);
666+ ret = si2165_writereg16(state, 0x0470, 0x7530);
637667 if (ret < 0)
638668 goto error;
639669
@@ -660,22 +690,19 @@ static int si2165_init(struct dvb_frontend *fe) · 20 unmodified lines
660690 goto error;
661691 }
662692
663− /* write adc values after each reset*/
664− ret = si2165_writereg8(state, 0x012a, 0x46);
665− if (ret < 0)
666− goto error;
667− ret = si2165_writereg8(state, 0x012c, 0x00);
693+ /* ts output config */
694+ ret = si2165_writereg8(state, 0x04e4, 0x20);
668695 if (ret < 0)
669− goto error;
670− ret = si2165_writereg8(state, 0x012e, 0x0a);
696+ return ret;
697+ ret = si2165_writereg16(state, 0x04ef, 0x00fe);
671698 if (ret < 0)
672− goto error;
673− ret = si2165_writereg8(state, 0x012f, 0xff);
699+ return ret;
700+ ret = si2165_writereg24(state, 0x04f4, 0x555555);
674701 if (ret < 0)
675− goto error;
676− ret = si2165_writereg8(state, 0x0123, 0x70);
702+ return ret;
703+ ret = si2165_writereg8(state, 0x04e5, 0x01);
677704 if (ret < 0)
678− goto error;
705+ return ret;
679706
680707 return 0;
681708 error:
@@ -733,16 +760,26 @@ static int si2165_set_oversamp(struct si2165_state *state, u32 dvb_rate) · 51 unmodified lines
733760 do_div(oversamp, dvb_rate);
734761 reg_value = oversamp & 0x3fffffff;
735762
736− /* oversamp, usbdump contained 0x03100000; */
763+ dprintk("%s: Write oversamp=%#x\n", __func__, reg_value);
737764 return si2165_writereg32(state, 0x00e4, reg_value);
738765 }
739766
740−static int si2165_set_if_freq_shift(struct si2165_state *state, u32 IF)
767+static int si2165_set_if_freq_shift(struct si2165_state *state)
741768 {
769+ struct dvb_frontend *fe = &state->fe;
742770 u64 if_freq_shift;
743771 s32 reg_value = 0;
744772 u32 fe_clk = si2165_get_fe_clk(state);
773+ u32 IF = 0;
745774
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);
746783 if_freq_shift = IF;
747784 if_freq_shift <<= 29;
748785
@@ -758,25 +795,39 @@ static int si2165_set_if_freq_shift(struct si2165_state *state, u32 IF) · 9 unmodified lines
758795 return si2165_writereg32(state, 0x00e8, reg_value);
759796 }
760797
761−static int si2165_set_parameters(struct dvb_frontend *fe)
798+static 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+
821+static int si2165_set_frontend_dvbt(struct dvb_frontend *fe)
762822 {
763823 int ret;
764824 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
765825 struct si2165_state *state = fe->demodulator_priv;
766− u8 val[3];
767− u32 IF;
768826 u32 dvb_rate = 0;
769827 u16 bw10k;
770828
771829 dprintk("%s: called\n", __func__);
772830
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−
780831 if (!state->has_dvbt)
781832 return -EINVAL;
782833
@@ -788,34 +839,10 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 5 unmodified lines
788839 bw10k = 800;
789840 }
790841
791− /* standard = DVB-T */
792− ret = si2165_writereg8(state, 0x00ec, 0x01);
793− if (ret < 0)
794− return ret;
795842 ret = si2165_adjust_pll_divl(state, 12);
796843 if (ret < 0)
797844 return ret;
798845
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;
819846 /* bandwidth in 10KHz steps */
820847 ret = si2165_writereg16(state, 0x0308, bw10k);
821848 if (ret < 0)
@@ -823,48 +850,115 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 1 unmodified line
823850 ret = si2165_set_oversamp(state, dvb_rate);
824851 if (ret < 0)
825852 return ret;
826− /* impulsive_noise_remover */
827− ret = si2165_writereg8(state, 0x031c, 0x01);
828− if (ret < 0)
829− return ret;
830− ret = si2165_writereg8(state, 0x00cb, 0x00);
853+
854+ ret = si2165_write_reg_list(state, dvbt_regs, ARRAY_SIZE(dvbt_regs));
831855 if (ret < 0)
832856 return ret;
857+
858+ return 0;
859+}
860+
861+static const struct si2165_reg_value_pair dvbc_regs[] = {
862+ /* standard = DVB-C */
863+ { 0x00ec, 0x05 },
864+ { 0x08f8, 0x00 },
865+
833866 /* agc2 */
834− ret = si2165_writereg8(state, 0x016e, 0x41);
835− if (ret < 0)
836− return ret;
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;
867+ { 0x016e, 0x50 },
868+ { 0x016c, 0x0e },
869+ { 0x016d, 0x10 },
843870 /* agc */
844− ret = si2165_writereg8(state, 0x015b, 0x03);
845− if (ret < 0)
846− return ret;
847− ret = si2165_writereg8(state, 0x0150, 0x78);
848− if (ret < 0)
849− return ret;
871+ { 0x015b, 0x03 },
872+ { 0x0150, 0x68 },
850873 /* 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+
892+static 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);
852907 if (ret < 0)
853908 return ret;
854− ret = si2165_writereg8(state, 0x01c8, 0x68);
909+
910+ /* Oversampling */
911+ ret = si2165_set_oversamp(state, dvb_rate);
855912 if (ret < 0)
856913 return ret;
857− /* freq_sync_range */
858− ret = si2165_writereg16(state, 0x030c, 0x0064);
914+
915+ ret = si2165_writereg32(state, 0x00c4, bw_hz);
859916 if (ret < 0)
860917 return ret;
861− /* gp_reg0 */
862− ret = si2165_readreg8(state, 0x0387, val);
918+
919+ ret = si2165_write_reg_list(state, dvbc_regs, ARRAY_SIZE(dvbc_regs));
863920 if (ret < 0)
864921 return ret;
865− ret = si2165_writereg8(state, 0x0387, 0x00);
922+
923+ return 0;
924+}
925+
926+static 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+
934+static 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);
866944 if (ret < 0)
867945 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+
868962 /* dsp_addr_jump */
869963 ret = si2165_writereg32(state, 0x0348, 0xf4000000);
870964 if (ret < 0)
@@ -874,8 +968,7 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 3 unmodified lines
874968 fe->ops.tuner_ops.set_params(fe);
875969
876970 /* recalc if_freq_shift if IF might has changed */
877− fe->ops.tuner_ops.get_if_frequency(fe, &IF);
878− ret = si2165_set_if_freq_shift(state, IF);
971+ ret = si2165_set_if_freq_shift(state);
879972 if (ret < 0)
880973 return ret;
881974
@@ -886,6 +979,7 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 4 unmodified lines
886979 ret = si2165_writereg8(state, 0x0341, 0x00);
887980 if (ret < 0)
888981 return ret;
982+
889983 /* reset all */
890984 ret = si2165_writereg8(state, 0x00c0, 0x00);
891985 if (ret < 0)
@@ -894,6 +988,13 @@ static int si2165_set_parameters(struct dvb_frontend *fe) · 2 unmodified lines
894988 ret = si2165_writereg32(state, 0x0384, 0x00000000);
895989 if (ret < 0)
896990 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+
897998 /* start_synchro */
898999 ret = si2165_writereg8(state, 0x02e0, 0x01);
8991000 if (ret < 0)
@@ -917,7 +1018,12 @@ static void si2165_release(struct dvb_frontend *fe) · 17 unmodified lines
9171018 static struct dvb_frontend_ops si2165_ops = {
9181019 .info = {
9191020 .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 |
9211027 FE_CAN_FEC_2_3 |
9221028 FE_CAN_FEC_3_4 |
9231029 FE_CAN_FEC_5_6 |
@@ -930,7 +1036,6 @@ static struct dvb_frontend_ops si2165_ops = { · 6 unmodified lines
9301036 FE_CAN_QAM_128 |
9311037 FE_CAN_QAM_256 |
9321038 FE_CAN_QAM_AUTO |
933− FE_CAN_TRANSMISSION_MODE_AUTO |
9341039 FE_CAN_GUARD_INTERVAL_AUTO |
9351040 FE_CAN_HIERARCHY_AUTO |
9361041 FE_CAN_MUTE_TS |
@@ -943,7 +1048,7 @@ static struct dvb_frontend_ops si2165_ops = { · 6 unmodified lines
9431048 .init = si2165_init,
9441049 .sleep = si2165_sleep,
9451050
946− .set_frontend = si2165_set_parameters,
1051+ .set_frontend = si2165_set_frontend,
9471052 .read_status = si2165_read_status,
9481053
9491054 .release = si2165_release,
@@ -979,9 +1084,9 @@ struct dvb_frontend *si2165_attach(const struct si2165_config *config, · 29 unmodified lines
9791084 }
9801085
9811086 /* create dvb_frontend */
982− memcpy(&state->frontend.ops, &si2165_ops,
1087+ memcpy(&state->fe.ops, &si2165_ops,
9831088 sizeof(struct dvb_frontend_ops));
984− state->frontend.demodulator_priv = state;
1089+ state->fe.demodulator_priv = state;
9851090
9861091 /* powerup */
9871092 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
10331138 KBUILD_MODNAME, chip_name, rev_char, state->chip_type,
10341139 state->chip_revcode);
10351140
1036− strlcat(state->frontend.ops.info.name, chip_name,
1037− sizeof(state->frontend.ops.info.name));
1141+ strlcat(state->fe.ops.info.name, chip_name,
1142+ sizeof(state->fe.ops.info.name));
10381143
10391144 n = 0;
10401145 if (state->has_dvbt) {
1041− state->frontend.ops.delsys[n++] = SYS_DVBT;
1042− strlcat(state->frontend.ops.info.name, " DVB-T",
1043− sizeof(state->frontend.ops.info.name));
1146+ state->fe.ops.delsys[n++] = SYS_DVBT;
1147+ strlcat(state->fe.ops.info.name, " DVB-T",
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));
10441154 }
1045− if (state->has_dvbc)
1046− dev_warn(&state->i2c->dev, "%s: DVB-C is not yet supported.\n",
1047− KBUILD_MODNAME);
10481155
1049− return &state->frontend;
1156+ return &state->fe;
10501157
10511158 error:
10521159 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
252252 {
253253 int rc;
254254 u8 f;
255+ u32 bw;
255256 struct stb6100_state *state = fe->tuner_priv;
256257
257258 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
259260 return rc;
260261 f = rc & STB6100_F_F;
261262
262− state->status.bandwidth = (f + 5) * 2000; /* x2 for ZIF */
263+ bw = (f + 5) * 2000; /* x2 for ZIF */
263264
264− *bandwidth = state->bandwidth = state->status.bandwidth * 1000;
265+ *bandwidth = state->bandwidth = bw * 1000;
265266 dprintk(verbose, FE_DEBUG, 1, "bandwidth = %u Hz", state->bandwidth);
266267 return 0;
267268 }
@@ -495,68 +496,28 @@ static int stb6100_sleep(struct dvb_frontend *fe) · 227 unmodified lines
495496 static int stb6100_init(struct dvb_frontend *fe)
496497 {
497498 struct stb6100_state *state = fe->tuner_priv;
498− struct tuner_state *status = &state->status;
499+ int refclk = 27000000; /* Hz */
499500
500− status->tunerstep = 125000;
501− status->ifreq = 0;
502− status->refclock = 27000000; /* Hz */
503− status->iqsense = 1;
504− status->bandwidth = 36000; /* kHz */
505− state->bandwidth = status->bandwidth * 1000; /* Hz */
506− state->reference = status->refclock / 1000; /* kHz */
501+ /*
502+ * iqsense = 1
503+ * tunerstep = 125000
504+ */
505+ state->bandwidth = 36000000; /* Hz */
506+ state->reference = refclk / 1000; /* kHz */
507507
508508 /* Set default bandwidth. Modified, PN 13-May-10 */
509509 return 0;
510510 }
511511
512−static int stb6100_get_state(struct dvb_frontend *fe,
513− enum tuner_param param,
514− struct tuner_state *state)
512+static int stb6100_set_params(struct dvb_frontend *fe)
515513 {
516− switch (param) {
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− }
514+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
532515
533− return 0;
534−}
516+ if (c->frequency > 0)
517+ stb6100_set_frequency(fe, c->frequency);
535518
536−static int stb6100_set_state(struct dvb_frontend *fe,
537− enum tuner_param param,
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− }
519+ if (c->bandwidth_hz > 0)
520+ stb6100_set_bandwidth(fe, c->bandwidth_hz);
560521
561522 return 0;
562523 }
@@ -572,8 +533,9 @@ static struct dvb_tuner_ops stb6100_ops = { · 9 unmodified lines
572533 .init = stb6100_init,
573534 .sleep = stb6100_sleep,
574535 .get_status = stb6100_get_status,
575− .get_state = stb6100_get_state,
576− .set_state = stb6100_set_state,
536+ .set_params = stb6100_set_params,
537+ .get_frequency = stb6100_get_frequency,
538+ .get_bandwidth = stb6100_get_bandwidth,
577539 .release = stb6100_release
578540 };
579541
drivers/media/dvb-frontends/stb6100.h+0−1
@@ -86,7 +86,6 @@ struct stb6100_state { · 85 unmodified lines
8686 const struct stb6100_config *config;
8787 struct dvb_tuner_ops ops;
8888 struct dvb_frontend *frontend;
89− struct tuner_state status;
9089
9190 u32 frequency;
9291 u32 srate;
drivers/media/dvb-frontends/stb6100_cfg.h+21−16
@@ -19,20 +19,21 @@ · 18 unmodified lines
1919 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2020 */
2121
22+#include <linux/dvb/frontend.h>
23+#include "dvb_frontend.h"
24+
2225 static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)
2326 {
2427 struct dvb_frontend_ops *frontend_ops = &fe->ops;
2528 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
26− struct tuner_state t_state;
2729 int err = 0;
2830
29− if (tuner_ops->get_state) {
30− err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
31+ if (tuner_ops->get_frequency) {
32+ err = tuner_ops->get_frequency(fe, frequency);
3133 if (err < 0) {
3234 printk("%s: Invalid parameter\n", __func__);
3335 return err;
3436 }
35− *frequency = t_state.frequency;
3637 }
3738 return 0;
3839 }
@@ -41,13 +42,16 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency) · 2 unmodified lines
4142 {
4243 struct dvb_frontend_ops *frontend_ops = &fe->ops;
4344 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;
4547 int err = 0;
4648
47− t_state.frequency = frequency;
49+ c->frequency = frequency;
50+ c->bandwidth_hz = 0; /* Don't adjust the bandwidth */
4851
49− if (tuner_ops->set_state) {
50− err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
52+ if (tuner_ops->set_params) {
53+ err = tuner_ops->set_params(fe);
54+ c->bandwidth_hz = bw;
5155 if (err < 0) {
5256 printk("%s: Invalid parameter\n", __func__);
5357 return err;
@@ -60,16 +64,14 @@ static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) · 6 unmodified lines
6064 {
6165 struct dvb_frontend_ops *frontend_ops = &fe->ops;
6266 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
63− struct tuner_state t_state;
6467 int err = 0;
6568
66− if (tuner_ops->get_state) {
67− err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
69+ if (tuner_ops->get_bandwidth) {
70+ err = tuner_ops->get_bandwidth(fe, bandwidth);
6871 if (err < 0) {
6972 printk("%s: Invalid parameter\n", __func__);
7073 return err;
7174 }
72− *bandwidth = t_state.bandwidth;
7375 }
7476 return 0;
7577 }
@@ -78,13 +80,16 @@ static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth) · 2 unmodified lines
7880 {
7981 struct dvb_frontend_ops *frontend_ops = &fe->ops;
8082 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;
8285 int err = 0;
8386
84− t_state.bandwidth = bandwidth;
87+ c->bandwidth_hz = bandwidth;
88+ c->frequency = 0; /* Don't adjust the frequency */
8589
86− if (tuner_ops->set_state) {
87− err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
90+ if (tuner_ops->set_params) {
91+ err = tuner_ops->set_params(fe);
92+ c->frequency = freq;
8893 if (err < 0) {
8994 printk("%s: Invalid parameter\n", __func__);
9095 return err;
drivers/media/dvb-frontends/stb6100_proc.h+23−20
@@ -17,27 +17,27 @@ · 16 unmodified lines
1717 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1818 */
1919
20+#include <linux/dvb/frontend.h>
21+#include "dvb_frontend.h"
22+
2023 static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency)
2124 {
2225 struct dvb_frontend_ops *frontend_ops = &fe->ops;
2326 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
24− struct tuner_state state;
2527 int err = 0;
2628
27− if (tuner_ops->get_state) {
29+ if (tuner_ops->get_frequency) {
2830 if (frontend_ops->i2c_gate_ctrl)
2931 frontend_ops->i2c_gate_ctrl(fe, 1);
3032
31− err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &state);
33+ err = tuner_ops->get_frequency(fe, frequency);
3234 if (err < 0) {
33− printk(KERN_ERR "%s: Invalid parameter\n", __func__);
35+ printk("%s: Invalid parameter\n", __func__);
3436 return err;
3537 }
3638
3739 if (frontend_ops->i2c_gate_ctrl)
3840 frontend_ops->i2c_gate_ctrl(fe, 0);
39−
40− *frequency = state.frequency;
4141 }
4242
4343 return 0;
@@ -47,18 +47,21 @@ static int stb6100_set_freq(struct dvb_frontend *fe, u32 frequency) · 3 unmodified lines
4747 {
4848 struct dvb_frontend_ops *frontend_ops = &fe->ops;
4949 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;
5152 int err = 0;
5253
53− state.frequency = frequency;
54+ c->frequency = frequency;
55+ c->bandwidth_hz = 0; /* Don't adjust the bandwidth */
5456
55− if (tuner_ops->set_state) {
57+ if (tuner_ops->set_params) {
5658 if (frontend_ops->i2c_gate_ctrl)
5759 frontend_ops->i2c_gate_ctrl(fe, 1);
5860
59− err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &state);
61+ err = tuner_ops->set_params(fe);
62+ c->bandwidth_hz = bw;
6063 if (err < 0) {
61− printk(KERN_ERR "%s: Invalid parameter\n", __func__);
64+ printk("%s: Invalid parameter\n", __func__);
6265 return err;
6366 }
6467
@@ -74,14 +77,13 @@ static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth) · 9 unmodified lines
7477 {
7578 struct dvb_frontend_ops *frontend_ops = &fe->ops;
7679 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
77− struct tuner_state state;
7880 int err = 0;
7981
80− if (tuner_ops->get_state) {
82+ if (tuner_ops->get_bandwidth) {
8183 if (frontend_ops->i2c_gate_ctrl)
8284 frontend_ops->i2c_gate_ctrl(fe, 1);
8385
84− err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &state);
86+ err = tuner_ops->get_bandwidth(fe, bandwidth);
8587 if (err < 0) {
8688 printk(KERN_ERR "%s: Invalid parameter\n", __func__);
8789 return err;
@@ -89,8 +91,6 @@ static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth) · 1 unmodified line
8991
9092 if (frontend_ops->i2c_gate_ctrl)
9193 frontend_ops->i2c_gate_ctrl(fe, 0);
92−
93− *bandwidth = state.bandwidth;
9494 }
9595
9696 return 0;
@@ -100,16 +100,19 @@ static int stb6100_set_bandw(struct dvb_frontend *fe, u32 bandwidth) · 3 unmodified lines
100100 {
101101 struct dvb_frontend_ops *frontend_ops = &fe->ops;
102102 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;
104105 int err = 0;
105106
106− state.bandwidth = bandwidth;
107+ c->bandwidth_hz = bandwidth;
108+ c->frequency = 0; /* Don't adjust the frequency */
107109
108− if (tuner_ops->set_state) {
110+ if (tuner_ops->set_params) {
109111 if (frontend_ops->i2c_gate_ctrl)
110112 frontend_ops->i2c_gate_ctrl(fe, 1);
111113
112− err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &state);
114+ err = tuner_ops->set_params(fe);
115+ c->frequency = freq;
113116 if (err < 0) {
114117 printk(KERN_ERR "%s: Invalid parameter\n", __func__);
115118 return err;
drivers/media/dvb-frontends/tda665x.c+88−95
@@ -66,26 +66,13 @@ exit: · 65 unmodified lines
6666 return err;
6767 }
6868
69−static int tda665x_get_state(struct dvb_frontend *fe,
70− enum tuner_param param,
71− struct tuner_state *tstate)
69+static int tda665x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
7270 {
7371 struct tda665x_state *state = fe->tuner_priv;
74− int err = 0;
7572
76− switch (param) {
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− }
73+ *frequency = state->frequency;
8774
88− return err;
75+ return 0;
8976 }
9077
9178 static int tda665x_get_status(struct dvb_frontend *fe, u32 *status)
@@ -111,9 +98,8 @@ exit: · 19 unmodified lines
11198 return err;
11299 }
113100
114−static int tda665x_set_state(struct dvb_frontend *fe,
115− enum tuner_param param,
116− struct tuner_state *tstate)
101+static int tda665x_set_frequency(struct dvb_frontend *fe,
102+ u32 new_frequency)
117103 {
118104 struct tda665x_state *state = fe->tuner_priv;
119105 const struct tda665x_config *config = state->config;
@@ -121,88 +107,96 @@ static int tda665x_set_state(struct dvb_frontend *fe, · 1 unmodified line
121107 u8 buf[4];
122108 int err = 0;
123109
124− if (param & DVBFE_TUNER_FREQUENCY) {
125−
126− frequency = tstate->frequency;
127− if ((frequency < config->frequency_max) || (frequency > config->frequency_min)) {
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);
110+ if ((new_frequency < config->frequency_max)
111+ || (new_frequency > config->frequency_min)) {
112+ printk(KERN_ERR "%s: Frequency beyond limits, frequency=%d\n",
113+ __func__, new_frequency);
197114 return -EINVAL;
198115 }
199116
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+
200185 return 0;
201186 exit:
202187 printk(KERN_ERR "%s: I/O Error\n", __func__);
203188 return err;
204189 }
205190
191+static 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+
206200 static int tda665x_release(struct dvb_frontend *fe)
207201 {
208202 struct tda665x_state *state = fe->tuner_priv;
@@ -213,10 +207,9 @@ static int tda665x_release(struct dvb_frontend *fe) · 4 unmodified lines
213207 }
214208
215209 static struct dvb_tuner_ops tda665x_ops = {
216−
217− .set_state = tda665x_set_state,
218− .get_state = tda665x_get_state,
219210 .get_status = tda665x_get_status,
211+ .set_params = tda665x_set_params,
212+ .get_frequency = tda665x_get_frequency,
220213 .release = tda665x_release
221214 };
222215
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
8383 static const u32 div_tab[] = { 2000, 1000, 500, 250, 125 }; /* kHz */
8484 static const u8 ref_div[] = { 0x00, 0x01, 0x02, 0x05, 0x07 };
8585
86−static int tda8261_get_state(struct dvb_frontend *fe,
87− enum tuner_param param,
88− struct tuner_state *tstate)
86+static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
8987 {
9088 struct tda8261_state *state = fe->tuner_priv;
91− int err = 0;
9289
93− switch (param) {
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− }
90+ *frequency = state->frequency;
10591
106− return err;
92+ return 0;
10793 }
10894
109−static int tda8261_set_state(struct dvb_frontend *fe,
110− enum tuner_param param,
111− struct tuner_state *tstate)
95+static int tda8261_set_params(struct dvb_frontend *fe)
11296 {
97+ struct dtv_frontend_properties *c = &fe->dtv_property_cache;
11398 struct tda8261_state *state = fe->tuner_priv;
11499 const struct tda8261_config *config = state->config;
115100 u32 frequency, N, status = 0;
116101 u8 buf[4];
117102 int err = 0;
118103
119− if (param & DVBFE_TUNER_FREQUENCY) {
120− /**
121− * N = Max VCO Frequency / Channel Spacing
122− * Max VCO Frequency = VCO frequency + (channel spacing - 1)
123− * (to account for half channel spacing on either side)
124− */
125− frequency = tstate->frequency;
126− if ((frequency < 950000) || (frequency > 2150000)) {
127− pr_warn("%s: Frequency beyond limits, frequency=%d\n", __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);
104+ /*
105+ * N = Max VCO Frequency / Channel Spacing
106+ * Max VCO Frequency = VCO frequency + (channel spacing - 1)
107+ * (to account for half channel spacing on either side)
108+ */
109+ frequency = c->frequency;
110+ if ((frequency < 950000) || (frequency > 2150000)) {
111+ pr_warn("%s: Frequency beyond limits, frequency=%d\n",
112+ __func__, frequency);
166113 return -EINVAL;
167114 }
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+ }
168151
169152 return 0;
170153 }
@@ -182,14 +165,13 @@ static struct dvb_tuner_ops tda8261_ops = { · 11 unmodified lines
182165
183166 .info = {
184167 .name = "TDA8261",
185−// .tuner_name = NULL,
186168 .frequency_min = 950000,
187169 .frequency_max = 2150000,
188170 .frequency_step = 0
189171 },
190172
191− .set_state = tda8261_set_state,
192− .get_state = tda8261_get_state,
173+ .set_params = tda8261_set_params,
174+ .get_frequency = tda8261_get_frequency,
193175 .get_status = tda8261_get_status,
194176 .release = tda8261_release
195177 };
@@ -210,10 +192,7 @@ struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, · 14 unmodified lines
210192 fe->ops.tuner_ops = tda8261_ops;
211193
212194 fe->ops.tuner_ops.info.frequency_step = div_tab[config->step_size];
213−// fe->ops.tuner_ops.tuner_name = &config->buf;
214195
215−// printk("%s: Attaching %s TDA8261 8PSK/QPSK tuner\n",
216−// __func__, fe->ops.tuner_ops.tuner_name);
217196 pr_info("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__);
218197
219198 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
2121 {
2222 struct dvb_frontend_ops *frontend_ops = &fe->ops;
2323 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
24− struct tuner_state t_state;
2524 int err = 0;
2625
27− if (tuner_ops->get_state) {
28− err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
26+ if (tuner_ops->get_frequency) {
27+ err = tuner_ops->get_frequency(fe, frequency);
2928 if (err < 0) {
30− printk("%s: Invalid parameter\n", __func__);
29+ pr_err("%s: Invalid parameter\n", __func__);
3130 return err;
3231 }
33− *frequency = t_state.frequency;
34− printk("%s: Frequency=%d\n", __func__, t_state.frequency);
32+ pr_debug("%s: Frequency=%d\n", __func__, *frequency);
3533 }
3634 return 0;
3735 }
@@ -40,37 +38,24 @@ static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency) · 2 unmodified lines
4038 {
4139 struct dvb_frontend_ops *frontend_ops = &fe->ops;
4240 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;
4442 int err = 0;
4543
46− t_state.frequency = frequency;
47−
48− if (tuner_ops->set_state) {
49− err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
44+ if (tuner_ops->set_params) {
45+ err = tuner_ops->set_params(fe);
5046 if (err < 0) {
51− printk("%s: Invalid parameter\n", __func__);
47+ pr_err("%s: Invalid parameter\n", __func__);
5248 return err;
5349 }
5450 }
55− printk("%s: Frequency=%d\n", __func__, t_state.frequency);
51+ pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
5652 return 0;
5753 }
5854
5955 static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
6056 {
61− struct dvb_frontend_ops *frontend_ops = &fe->ops;
62− struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
63− struct tuner_state t_state;
64− int err = 0;
57+ /* FIXME! need to calculate Bandwidth */
58+ *bandwidth = 40000000;
6559
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− }
7560 return 0;
7661 }
drivers/media/dvb-frontends/tdhd1.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2121 *
2222 *
23− * The project's page is at http://www.linuxtv.org
23+ * The project's page is at https://linuxtv.org
2424 */
2525
2626 #ifndef TDHD1_H
drivers/media/i2c/Kconfig+10−0
@@ -83,6 +83,16 @@ config VIDEO_MSP3400 · 82 unmodified lines
8383 To compile this driver as a module, choose M here: the
8484 module will be called msp3400.
8585
86+config 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+
8696 config VIDEO_CS5345
8797 tristate "Cirrus Logic CS5345 audio ADC"
8898 depends on VIDEO_V4L2 && I2C
drivers/media/i2c/Makefile+1−0
@@ -43,6 +43,7 @@ obj-$(CONFIG_VIDEO_TVP7002) += tvp7002.o · 42 unmodified lines
4343 obj-$(CONFIG_VIDEO_TW2804) += tw2804.o
4444 obj-$(CONFIG_VIDEO_TW9903) += tw9903.o
4545 obj-$(CONFIG_VIDEO_TW9906) += tw9906.o
46+obj-$(CONFIG_VIDEO_CS3308) += cs3308.o
4647 obj-$(CONFIG_VIDEO_CS5345) += cs5345.o
4748 obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o
4849 obj-$(CONFIG_VIDEO_M52790) += m52790.o
drivers/media/i2c/ad9389b.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 #include <media/v4l2-common.h>
3636 #include <media/v4l2-dv-timings.h>
3737 #include <media/v4l2-ctrls.h>
38−#include <media/ad9389b.h>
38+#include <media/i2c/ad9389b.h>
3939
4040 static int debug;
4141 module_param(debug, int, 0644);
drivers/media/i2c/adp1653.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #include <linux/slab.h>
3838 #include <linux/of.h>
3939 #include <linux/gpio/consumer.h>
40−#include <media/adp1653.h>
40+#include <media/i2c/adp1653.h>
4141 #include <media/v4l2-device.h>
4242
4343 #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
11121112 mutex_lock(&state->mutex);
11131113
11141114 adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES);
1115− usleep_range(2000, 10000);
1115+ usleep_range(5000, 10000);
11161116
11171117 ret = state->chip_info->init(state);
11181118 if (ret)
drivers/media/i2c/adv7183.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include <linux/types.h>
2828 #include <linux/videodev2.h>
2929
30−#include <media/adv7183.h>
30+#include <media/i2c/adv7183.h>
3131 #include <media/v4l2-ctrls.h>
3232 #include <media/v4l2-device.h>
3333
drivers/media/i2c/adv7343.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <linux/of.h>
2929 #include <linux/of_graph.h>
3030
31−#include <media/adv7343.h>
31+#include <media/i2c/adv7343.h>
3232 #include <media/v4l2-async.h>
3333 #include <media/v4l2-device.h>
3434 #include <media/v4l2-ctrls.h>
drivers/media/i2c/adv7393.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <linux/videodev2.h>
3232 #include <linux/uaccess.h>
3333
34−#include <media/adv7393.h>
34+#include <media/i2c/adv7393.h>
3535 #include <media/v4l2-device.h>
3636 #include <media/v4l2-ctrls.h>
3737
drivers/media/i2c/adv7511.c+2−2
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #include <media/v4l2-common.h>
3333 #include <media/v4l2-ctrls.h>
3434 #include <media/v4l2-dv-timings.h>
35−#include <media/adv7511.h>
35+#include <media/i2c/adv7511.h>
3636
3737 static int debug;
3838 module_param(debug, int, 0644);
@@ -1116,7 +1116,7 @@ static int adv7511_set_fmt(struct v4l2_subdev *sd, · 1077 unmodified lines
11161116 adv7511_wr_and_or(sd, 0x55, 0x9f, y << 5);
11171117 adv7511_wr_and_or(sd, 0x56, 0x3f, c << 6);
11181118 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);
11201120 adv7511_wr_and_or(sd, 0x4a, 0xff, 1);
11211121
11221122 return 0;
drivers/media/i2c/adv7604.c+4−4
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939 #include <linux/workqueue.h>
4040 #include <linux/regmap.h>
4141
42−#include <media/adv7604.h>
42+#include <media/i2c/adv7604.h>
4343 #include <media/v4l2-ctrls.h>
4444 #include <media/v4l2-device.h>
4545 #include <media/v4l2-event.h>
@@ -905,7 +905,7 @@ static int find_and_set_predefined_video_timings(struct v4l2_subdev *sd, · 859 unmodified lines
905905
906906 for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {
907907 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))
909909 continue;
910910 io_write(sd, 0x00, predef_vid_timings[i].vid_std); /* video std */
911911 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
14791479
14801480 for (i = 0; adv76xx_timings[i].bt.width; i++) {
14811481 if (v4l2_match_dv_timings(timings, &adv76xx_timings[i],
1482− is_digital_input(sd) ? 250000 : 1000000)) {
1482+ is_digital_input(sd) ? 250000 : 1000000, false)) {
14831483 *timings = adv76xx_timings[i];
14841484 break;
14851485 }
@@ -1644,7 +1644,7 @@ static int adv76xx_s_dv_timings(struct v4l2_subdev *sd, · 158 unmodified lines
16441644 if (!timings)
16451645 return -EINVAL;
16461646
1647− if (v4l2_match_dv_timings(&state->timings, timings, 0)) {
1647+ if (v4l2_match_dv_timings(&state->timings, timings, 0, false)) {
16481648 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
16491649 return 0;
16501650 }
drivers/media/i2c/adv7842.c+4−4
@@ -43,7 +43,7 @@ · 42 unmodified lines
4343 #include <media/v4l2-event.h>
4444 #include <media/v4l2-ctrls.h>
4545 #include <media/v4l2-dv-timings.h>
46−#include <media/adv7842.h>
46+#include <media/i2c/adv7842.h>
4747
4848 static int debug;
4949 module_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
155155 int i;
156156
157157 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))
159159 return false;
160160 return true;
161161 }
@@ -1008,7 +1008,7 @@ static int find_and_set_predefined_video_timings(struct v4l2_subdev *sd, · 846 unmodified lines
10081008
10091009 for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {
10101010 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))
10121012 continue;
10131013 /* video std */
10141014 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
16591659 if (state->mode == ADV7842_MODE_SDP)
16601660 return -ENODATA;
16611661
1662− if (v4l2_match_dv_timings(&state->timings, timings, 0)) {
1662+ if (v4l2_match_dv_timings(&state->timings, timings, 0, false)) {
16631663 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
16641664 return 0;
16651665 }
drivers/media/i2c/ak881x.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 #include <linux/videodev2.h>
1616 #include <linux/module.h>
1717
18−#include <media/ak881x.h>
18+#include <media/i2c/ak881x.h>
1919 #include <media/v4l2-common.h>
2020 #include <media/v4l2-device.h>
2121
drivers/media/i2c/as3645a.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <linux/mutex.h>
3232 #include <linux/slab.h>
3333
34−#include <media/as3645a.h>
34+#include <media/i2c/as3645a.h>
3535 #include <media/v4l2-ctrls.h>
3636 #include <media/v4l2-device.h>
3737
drivers/media/i2c/bt819.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #include <linux/slab.h>
3838 #include <media/v4l2-device.h>
3939 #include <media/v4l2-ctrls.h>
40−#include <media/bt819.h>
40+#include <media/i2c/bt819.h>
4141
4242 MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
4343 MODULE_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+
28+MODULE_DESCRIPTION("i2c device driver for cs3308 8-channel volume control");
29+MODULE_AUTHOR("Devin Heitmueller");
30+MODULE_LICENSE("GPL");
31+
32+static 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+
39+static 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
47+static 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+
54+static 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+
63+static 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+
70+static const struct v4l2_subdev_ops cs3308_ops = {
71+ .core = &cs3308_core_ops,
72+};
73+
74+/* ----------------------------------------------------------------------- */
75+
76+static 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+
111+static 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+
122+static const struct i2c_device_id cs3308_id[] = {
123+ { "cs3308", 0 },
124+ { }
125+};
126+MODULE_DEVICE_TABLE(i2c, cs3308_id);
127+
128+static 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+
138+module_i2c_driver(cs3308_driver);
drivers/media/i2c/cx25840/cx25840-audio.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <linux/videodev2.h>
2020 #include <linux/i2c.h>
2121 #include <media/v4l2-common.h>
22−#include <media/cx25840.h>
22+#include <media/drv-intf/cx25840.h>
2323
2424 #include "cx25840-core.h"
2525
drivers/media/i2c/cx25840/cx25840-core.c+61−56
@@ -45,7 +45,7 @@ · 44 unmodified lines
4545 #include <linux/delay.h>
4646 #include <linux/math64.h>
4747 #include <media/v4l2-common.h>
48−#include <media/cx25840.h>
48+#include <media/drv-intf/cx25840.h>
4949
5050 #include "cx25840-core.h"
5151
@@ -559,7 +559,10 @@ static void cx23885_initialize(struct i2c_client *client) · 507 unmodified lines
559559 cx25840_write4(client, 0x414, 0x00107d12);
560560
561561 /* 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);
563566
564567 /*
565568 * Aux PLL
@@ -666,14 +669,17 @@ static void cx23885_initialize(struct i2c_client *client) · 100 unmodified lines
666669 cx25840_write4(client, 0x404, 0x0010253e);
667670
668671 /* CC on - Undocumented Register */
669− cx25840_write(client, 0x42f, 0x66);
672+ cx25840_write(client, state->vbi_regs_offset + 0x42f, 0x66);
670673
671674 /* HVR-1250 / HVR1850 DIF related */
672675 /* Power everything up */
673676 cx25840_write4(client, 0x130, 0x0);
674677
675678 /* 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);
677683
678684 /* AFE_CLK_OUT_CTRL - Select the clock output source as output */
679685 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
11061112 cx25840_write4(client, 0x410, 0xffff0dbf);
11071113 cx25840_write4(client, 0x414, 0x00137d03);
11081114
1109− /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is
1110− CHROMA_CTRL */
1111− if (is_cx23888(state))
1112− cx25840_write4(client, 0x418, 0x01008080);
1113− else
1114− cx25840_write4(client, 0x418, 0x01000000);
1115+ cx25840_write4(client, state->vbi_regs_offset + 0x42c, 0x42600000);
1116+ cx25840_write4(client, state->vbi_regs_offset + 0x430, 0x0000039b);
1117+ cx25840_write4(client, state->vbi_regs_offset + 0x438, 0x00000000);
11151118
1116− cx25840_write4(client, 0x41c, 0x00000000);
1117−
1118− /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is
1119− CRUSH_CTRL */
1120− if (is_cx23888(state))
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);
1119+ cx25840_write4(client, state->vbi_regs_offset + 0x440, 0xF8E3E824);
1120+ cx25840_write4(client, state->vbi_regs_offset + 0x444, 0x401040dc);
1121+ cx25840_write4(client, state->vbi_regs_offset + 0x448, 0xcd3f02a0);
1122+ cx25840_write4(client, state->vbi_regs_offset + 0x44c, 0x161f1000);
1123+ cx25840_write4(client, state->vbi_regs_offset + 0x450, 0x00000802);
11341124
11351125 cx25840_write4(client, 0x91c, 0x01000000);
11361126 cx25840_write4(client, 0x8e0, 0x03063870);
@@ -1400,8 +1390,14 @@ static int cx25840_set_fmt(struct v4l2_subdev *sd, · 263 unmodified lines
14001390
14011391 Vlines = fmt->height + (is_50Hz ? 4 : 7);
14021392
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+ */
14031399 if ((fmt->width * 16 < Hsrc) || (Hsrc < fmt->width) ||
1404− (Vlines * 8 < Vsrc) || (Vsrc < Vlines)) {
1400+ (Vlines * 8 < Vsrc) || (Vsrc + 1 < Vlines)) {
14051401 v4l_err(client, "%dx%d is not a valid size!\n",
14061402 fmt->width, fmt->height);
14071403 return -ERANGE;
@@ -1426,14 +1422,20 @@ static int cx25840_set_fmt(struct v4l2_subdev *sd, · 18 unmodified lines
14261422 fmt->width, fmt->height, HSC, VSC);
14271423
14281424 /* HSCALE=HSC */
1429− cx25840_write(client, 0x418, HSC & 0xff);
1430− cx25840_write(client, 0x419, (HSC >> 8) & 0xff);
1431− cx25840_write(client, 0x41a, HSC >> 16);
1432− /* VSCALE=VSC */
1433− cx25840_write(client, 0x41c, VSC & 0xff);
1434− cx25840_write(client, 0x41d, VSC >> 8);
1435− /* VS_INTRLACE=1 VFILT=filter */
1436− cx25840_write(client, 0x41e, 0x8 | filter);
1425+ if (is_cx23888(state)) {
1426+ cx25840_write4(client, 0x434, HSC | (1 << 24));
1427+ /* VSCALE=VSC VS_INTRLACE=1 VFILT=filter */
1428+ cx25840_write4(client, 0x438, VSC | (1 << 19) | (filter << 16));
1429+ } else {
1430+ cx25840_write(client, 0x418, HSC & 0xff);
1431+ cx25840_write(client, 0x419, (HSC >> 8) & 0xff);
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+ }
14371439 return 0;
14381440 }
14391441
@@ -1714,26 +1716,27 @@ static int cx25840_s_stream(struct v4l2_subdev *sd, int enable) · 274 unmodified lines
17141716
17151717 v4l_dbg(1, cx25840_debug, client, "%s video output\n",
17161718 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+
17171730 if (enable) {
1718− if (is_cx2388x(state) || is_cx231xx(state)) {
1719− v = cx25840_read(client, 0x421) | 0x0b;
1720− cx25840_write(client, 0x421, v);
1721− } else {
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− }
1731+ v = cx25840_read(client, 0x115) | 0x0c;
1732+ cx25840_write(client, 0x115, v);
1733+ v = cx25840_read(client, 0x116) | 0x04;
1734+ cx25840_write(client, 0x116, v);
17271735 } else {
1728− if (is_cx2388x(state) || is_cx231xx(state)) {
1729− v = cx25840_read(client, 0x421) & ~(0x0b);
1730− cx25840_write(client, 0x421, v);
1731− } else {
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− }
1736+ v = cx25840_read(client, 0x115) & ~(0x0c);
1737+ cx25840_write(client, 0x115, v);
1738+ v = cx25840_read(client, 0x116) & ~(0x04);
1739+ cx25840_write(client, 0x116, v);
17371740 }
17381741 return 0;
17391742 }
@@ -4974,7 +4977,7 @@ static void cx23888_std_setup(struct i2c_client *client) · 3234 unmodified lines
49744977 cx25840_write4(client, 0x4b4, 0x20524030);
49754978 cx25840_write4(client, 0x47c, 0x010a8263);
49764979
4977− if (std & V4L2_STD_NTSC) {
4980+ if (std & V4L2_STD_525_60) {
49784981 v4l_dbg(1, cx25840_debug, client, "%s() Selecting NTSC",
49794982 __func__);
49804983
@@ -5264,6 +5267,8 @@ static int cx25840_probe(struct i2c_client *client, · 283 unmodified lines
52645267 state->vbi_line_offset = 8;
52655268 state->id = id;
52665269 state->rev = device_id;
5270+ state->vbi_regs_offset = id == CX23888_AV ? 0x500 - 0x424 : 0;
5271+ state->std = V4L2_STD_NTSC_M;
52675272 v4l2_ctrl_handler_init(&state->hdl, 9);
52685273 v4l2_ctrl_new_std(&state->hdl, &cx25840_ctrl_ops,
52695274 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
6969 enum cx25840_model id;
7070 u32 rev;
7171 int is_initialized;
72+ unsigned vbi_regs_offset;
7273 wait_queue_head_t fw_wait; /* wake up when the fw load is finished */
7374 struct work_struct fw_work; /* work entry for fw load */
7475 struct cx25840_ir_state *ir_state;
drivers/media/i2c/cx25840/cx25840-firmware.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <linux/i2c.h>
2020 #include <linux/firmware.h>
2121 #include <media/v4l2-common.h>
22−#include <media/cx25840.h>
22+#include <media/drv-intf/cx25840.h>
2323
2424 #include "cx25840-core.h"
2525
drivers/media/i2c/cx25840/cx25840-ir.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include <linux/slab.h>
2525 #include <linux/kfifo.h>
2626 #include <linux/module.h>
27−#include <media/cx25840.h>
27+#include <media/drv-intf/cx25840.h>
2828 #include <media/rc-core.h>
2929
3030 #include "cx25840-core.h"
drivers/media/i2c/cx25840/cx25840-vbi.c+24−10
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <linux/videodev2.h>
2020 #include <linux/i2c.h>
2121 #include <media/v4l2-common.h>
22−#include <media/cx25840.h>
22+#include <media/drv-intf/cx25840.h>
2323
2424 #include "cx25840-core.h"
2525
@@ -104,7 +104,8 @@ int cx25840_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format * · 78 unmodified lines
104104
105105 if (is_pal) {
106106 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);
108109
109110 svbi->service_lines[0][i] = lcr2vbi[v >> 4];
110111 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
113114 }
114115 } else {
115116 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);
117119
118120 svbi->service_lines[0][i] = lcr2vbi[v >> 4];
119121 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
135137 cx25840_std_setup(client);
136138
137139 /* 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);
139144 cx25840_write(client, 0x404, 0x2e);
140145 return 0;
141146 }
@@ -158,7 +163,10 @@ int cx25840_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format * · 16 unmodified lines
158163 /* Sliced VBI */
159164 cx25840_write(client, 0x404, 0x32); /* Ancillary data */
160165 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);
162170
163171 if (is_pal) {
164172 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
194202 }
195203
196204 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++)
198207 cx25840_write(client, i, lcr[6 + x]);
199208 } 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++)
201211 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++)
203214 cx25840_write(client, i, 0);
204215 }
205216
206− cx25840_write(client, 0x43c, 0x16);
207− cx25840_write(client, 0x474, is_pal ? 0x2a : 0x22);
217+ cx25840_write(client, state->vbi_regs_offset + 0x43c, 0x16);
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);
208222 return 0;
209223 }
210224
drivers/media/i2c/ir-kbd-i2c.c+1−1
@@ -47,7 +47,7 @@ · 46 unmodified lines
4747 #include <linux/workqueue.h>
4848
4949 #include <media/rc-core.h>
50−#include <media/ir-kbd-i2c.h>
50+#include <media/i2c/ir-kbd-i2c.h>
5151
5252 /* ----------------------------------------------------------------------- */
5353 /* insmod parameters */
drivers/media/i2c/lm3560.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include <linux/mutex.h>
2525 #include <linux/regmap.h>
2626 #include <linux/videodev2.h>
27−#include <media/lm3560.h>
27+#include <media/i2c/lm3560.h>
2828 #include <media/v4l2-ctrls.h>
2929 #include <media/v4l2-device.h>
3030
drivers/media/i2c/lm3646.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 #include <linux/slab.h>
1919 #include <linux/regmap.h>
2020 #include <linux/videodev2.h>
21−#include <media/lm3646.h>
21+#include <media/i2c/lm3646.h>
2222 #include <media/v4l2-ctrls.h>
2323 #include <media/v4l2-device.h>
2424
drivers/media/i2c/m52790.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include <asm/uaccess.h>
2828 #include <linux/i2c.h>
2929 #include <linux/videodev2.h>
30−#include <media/m52790.h>
30+#include <media/i2c/m52790.h>
3131 #include <media/v4l2-device.h>
3232
3333 MODULE_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
2525 #include <media/v4l2-ctrls.h>
2626 #include <media/v4l2-device.h>
2727 #include <media/v4l2-subdev.h>
28−#include <media/m5mols.h>
29−#include <media/exynos-fimc.h>
28+#include <media/i2c/m5mols.h>
29+#include <media/drv-intf/exynos-fimc.h>
3030
3131 #include "m5mols.h"
3232 #include "m5mols_reg.h"
drivers/media/i2c/m5mols/m5mols_core.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include <media/v4l2-ctrls.h>
2626 #include <media/v4l2-device.h>
2727 #include <media/v4l2-subdev.h>
28−#include <media/m5mols.h>
28+#include <media/i2c/m5mols.h>
2929
3030 #include "m5mols.h"
3131 #include "m5mols_reg.h"
drivers/media/i2c/msp3400-driver.c+2−2
@@ -56,8 +56,8 @@ · 55 unmodified lines
5656 #include <linux/videodev2.h>
5757 #include <media/v4l2-device.h>
5858 #include <media/v4l2-ioctl.h>
59−#include <media/msp3400.h>
60−#include <media/tvaudio.h>
59+#include <media/drv-intf/msp3400.h>
60+#include <media/i2c/tvaudio.h>
6161 #include "msp3400-driver.h"
6262
6363 /* ---------------------------------------------------------------------- */
drivers/media/i2c/msp3400-driver.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 #ifndef MSP3400_DRIVER_H
55 #define MSP3400_DRIVER_H
66
7−#include <media/msp3400.h>
7+#include <media/drv-intf/msp3400.h>
88 #include <media/v4l2-device.h>
99 #include <media/v4l2-ctrls.h>
1010
drivers/media/i2c/msp3400-kthreads.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/freezer.h>
2727 #include <linux/videodev2.h>
2828 #include <media/v4l2-common.h>
29−#include <media/msp3400.h>
29+#include <media/drv-intf/msp3400.h>
3030 #include <linux/kthread.h>
3131 #include <linux/suspend.h>
3232 #include "msp3400-driver.h"
drivers/media/i2c/mt9m032.c+2−2
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <linux/v4l2-mediabus.h>
3232
3333 #include <media/media-entity.h>
34−#include <media/mt9m032.h>
34+#include <media/i2c/mt9m032.h>
3535 #include <media/v4l2-ctrls.h>
3636 #include <media/v4l2-device.h>
3737 #include <media/v4l2-subdev.h>
@@ -671,7 +671,7 @@ static int mt9m032_set_ctrl(struct v4l2_ctrl *ctrl) · 633 unmodified lines
671671 return 0;
672672 }
673673
674−static struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
674+static const struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
675675 .s_ctrl = mt9m032_set_ctrl,
676676 .try_ctrl = mt9m032_try_ctrl,
677677 };
drivers/media/i2c/mt9p031.c+2−2
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/slab.h>
2727 #include <linux/videodev2.h>
2828
29−#include <media/mt9p031.h>
29+#include <media/i2c/mt9p031.h>
3030 #include <media/v4l2-async.h>
3131 #include <media/v4l2-ctrls.h>
3232 #include <media/v4l2-device.h>
@@ -817,7 +817,7 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl) · 784 unmodified lines
817817 return 0;
818818 }
819819
820−static struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
820+static const struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
821821 .s_ctrl = mt9p031_s_ctrl,
822822 };
823823
drivers/media/i2c/mt9t001.c+2−2
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include <linux/videodev2.h>
2222 #include <linux/v4l2-mediabus.h>
2323
24−#include <media/mt9t001.h>
24+#include <media/i2c/mt9t001.h>
2525 #include <media/v4l2-ctrls.h>
2626 #include <media/v4l2-device.h>
2727 #include <media/v4l2-subdev.h>
@@ -626,7 +626,7 @@ static int mt9t001_s_ctrl(struct v4l2_ctrl *ctrl) · 598 unmodified lines
626626 return 0;
627627 }
628628
629−static struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
629+static const struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
630630 .s_ctrl = mt9t001_s_ctrl,
631631 };
632632
drivers/media/i2c/mt9v011.c+2−2
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <asm/div64.h>
1414 #include <media/v4l2-device.h>
1515 #include <media/v4l2-ctrls.h>
16−#include <media/mt9v011.h>
16+#include <media/i2c/mt9v011.h>
1717
1818 MODULE_DESCRIPTION("Micron mt9v011 sensor driver");
1919 MODULE_AUTHOR("Mauro Carvalho Chehab");
@@ -454,7 +454,7 @@ static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl) · 434 unmodified lines
454454 return 0;
455455 }
456456
457−static struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
457+static const struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
458458 .s_ctrl = mt9v011_s_ctrl,
459459 };
460460
drivers/media/i2c/mt9v032.c+2−2
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include <linux/v4l2-mediabus.h>
2626 #include <linux/module.h>
2727
28−#include <media/mt9v032.h>
28+#include <media/i2c/mt9v032.h>
2929 #include <media/v4l2-ctrls.h>
3030 #include <media/v4l2-device.h>
3131 #include <media/v4l2-of.h>
@@ -703,7 +703,7 @@ static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl) · 671 unmodified lines
703703 return 0;
704704 }
705705
706−static struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
706+static const struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
707707 .s_ctrl = mt9v032_s_ctrl,
708708 };
709709
drivers/media/i2c/noon010pc30.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 #include <linux/i2c.h>
1919 #include <linux/slab.h>
2020 #include <linux/regulator/consumer.h>
21−#include <media/noon010pc30.h>
21+#include <media/i2c/noon010pc30.h>
2222 #include <linux/videodev2.h>
2323 #include <linux/module.h>
2424 #include <media/v4l2-ctrls.h>
drivers/media/i2c/ov2659.c+2−2
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #include <linux/videodev2.h>
3838
3939 #include <media/media-entity.h>
40−#include <media/ov2659.h>
40+#include <media/i2c/ov2659.h>
4141 #include <media/v4l2-common.h>
4242 #include <media/v4l2-ctrls.h>
4343 #include <media/v4l2-device.h>
@@ -1249,7 +1249,7 @@ static int ov2659_s_ctrl(struct v4l2_ctrl *ctrl) · 1205 unmodified lines
12491249 return 0;
12501250 }
12511251
1252−static struct v4l2_ctrl_ops ov2659_ctrl_ops = {
1252+static const struct v4l2_ctrl_ops ov2659_ctrl_ops = {
12531253 .s_ctrl = ov2659_s_ctrl,
12541254 };
12551255
drivers/media/i2c/ov7670.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include <media/v4l2-ctrls.h>
2121 #include <media/v4l2-mediabus.h>
2222 #include <media/v4l2-image-sizes.h>
23−#include <media/ov7670.h>
23+#include <media/i2c/ov7670.h>
2424
2525 MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");
2626 MODULE_DESCRIPTION("A low-level driver for OmniVision ov7670 sensors");
drivers/media/i2c/ov9650.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include <media/v4l2-image-sizes.h>
3030 #include <media/v4l2-subdev.h>
3131 #include <media/v4l2-mediabus.h>
32−#include <media/ov9650.h>
32+#include <media/i2c/ov9650.h>
3333
3434 static int debug;
3535 module_param(debug, int, 0644);
drivers/media/i2c/s5c73m3/s5c73m3-core.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #include <media/v4l2-device.h>
3535 #include <media/v4l2-subdev.h>
3636 #include <media/v4l2-mediabus.h>
37−#include <media/s5c73m3.h>
37+#include <media/i2c/s5c73m3.h>
3838 #include <media/v4l2-of.h>
3939
4040 #include "s5c73m3.h"
drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #include <media/v4l2-device.h>
3333 #include <media/v4l2-subdev.h>
3434 #include <media/v4l2-mediabus.h>
35−#include <media/s5c73m3.h>
35+#include <media/i2c/s5c73m3.h>
3636
3737 #include "s5c73m3.h"
3838
drivers/media/i2c/s5c73m3/s5c73m3-spi.c+1−0
@@ -37,6 +37,7 @@ enum spi_direction { · 36 unmodified lines
3737 SPI_DIR_RX,
3838 SPI_DIR_TX
3939 };
40+MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids);
4041
4142 static int spi_xmit(struct spi_device *spi_dev, void *addr, const int len,
4243 enum spi_direction dir)
drivers/media/i2c/s5c73m3/s5c73m3.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include <media/v4l2-common.h>
2424 #include <media/v4l2-ctrls.h>
2525 #include <media/v4l2-subdev.h>
26−#include <media/s5c73m3.h>
26+#include <media/i2c/s5c73m3.h>
2727
2828 #define DRIVER_NAME "S5C73M3"
2929
drivers/media/i2c/s5k4ecgx.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include <asm/unaligned.h>
2828
2929 #include <media/media-entity.h>
30−#include <media/s5k4ecgx.h>
30+#include <media/i2c/s5k4ecgx.h>
3131 #include <media/v4l2-ctrls.h>
3232 #include <media/v4l2-device.h>
3333 #include <media/v4l2-mediabus.h>
drivers/media/i2c/s5k6aa.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <media/v4l2-device.h>
2929 #include <media/v4l2-subdev.h>
3030 #include <media/v4l2-mediabus.h>
31−#include <media/s5k6aa.h>
31+#include <media/i2c/s5k6aa.h>
3232
3333 static int debug;
3434 module_param(debug, int, 0644);
drivers/media/i2c/saa6588.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <linux/wait.h>
3232 #include <asm/uaccess.h>
3333
34−#include <media/saa6588.h>
34+#include <media/i2c/saa6588.h>
3535 #include <media/v4l2-device.h>
3636
3737
drivers/media/i2c/saa7115.c+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 #include <linux/videodev2.h>
4747 #include <media/v4l2-device.h>
4848 #include <media/v4l2-ctrls.h>
49−#include <media/saa7115.h>
49+#include <media/i2c/saa7115.h>
5050 #include <asm/div64.h>
5151
5252 #define VRES_60HZ (480+16)
drivers/media/i2c/saa7127.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 #include <linux/i2c.h>
5555 #include <linux/videodev2.h>
5656 #include <media/v4l2-device.h>
57−#include <media/saa7127.h>
57+#include <media/i2c/saa7127.h>
5858
5959 static int debug;
6060 static int test_image;
drivers/media/i2c/smiapp/smiapp.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include <linux/mutex.h>
2323 #include <media/v4l2-ctrls.h>
2424 #include <media/v4l2-subdev.h>
25−#include <media/smiapp.h>
25+#include <media/i2c/smiapp.h>
2626
2727 #include "smiapp-pll.h"
2828 #include "smiapp-reg.h"
drivers/media/i2c/soc_camera/mt9m001.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 #include <linux/module.h>
1616
1717 #include <media/soc_camera.h>
18−#include <media/soc_mediabus.h>
18+#include <media/drv-intf/soc_mediabus.h>
1919 #include <media/v4l2-clk.h>
2020 #include <media/v4l2-subdev.h>
2121 #include <media/v4l2-ctrls.h>
drivers/media/i2c/soc_camera/mt9t112.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include <linux/v4l2-mediabus.h>
2626 #include <linux/videodev2.h>
2727
28−#include <media/mt9t112.h>
28+#include <media/i2c/mt9t112.h>
2929 #include <media/soc_camera.h>
3030 #include <media/v4l2-clk.h>
3131 #include <media/v4l2-common.h>
drivers/media/i2c/soc_camera/mt9v022.c+2−2
@@ -15,9 +15,9 @@ · 14 unmodified lines
1515 #include <linux/log2.h>
1616 #include <linux/module.h>
1717
18−#include <media/mt9v022.h>
18+#include <media/i2c/mt9v022.h>
1919 #include <media/soc_camera.h>
20−#include <media/soc_mediabus.h>
20+#include <media/drv-intf/soc_mediabus.h>
2121 #include <media/v4l2-subdev.h>
2222 #include <media/v4l2-clk.h>
2323 #include <media/v4l2-ctrls.h>
drivers/media/i2c/soc_camera/ov772x.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include <linux/v4l2-mediabus.h>
2525 #include <linux/videodev2.h>
2626
27−#include <media/ov772x.h>
27+#include <media/i2c/ov772x.h>
2828 #include <media/soc_camera.h>
2929 #include <media/v4l2-clk.h>
3030 #include <media/v4l2-ctrls.h>
drivers/media/i2c/soc_camera/rj54n1cb0c.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 #include <linux/videodev2.h>
1616 #include <linux/module.h>
1717
18−#include <media/rj54n1cb0c.h>
18+#include <media/i2c/rj54n1cb0c.h>
1919 #include <media/soc_camera.h>
2020 #include <media/v4l2-clk.h>
2121 #include <media/v4l2-subdev.h>
drivers/media/i2c/soc_camera/tw9910.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/videodev2.h>
2727
2828 #include <media/soc_camera.h>
29−#include <media/tw9910.h>
29+#include <media/i2c/tw9910.h>
3030 #include <media/v4l2-clk.h>
3131 #include <media/v4l2-subdev.h>
3232
drivers/media/i2c/sr030pc30.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include <media/v4l2-subdev.h>
2525 #include <media/v4l2-mediabus.h>
2626 #include <media/v4l2-ctrls.h>
27−#include <media/sr030pc30.h>
27+#include <media/i2c/sr030pc30.h>
2828
2929 static int debug;
3030 module_param(debug, int, 0644);
drivers/media/i2c/tc358743.c+3−3
@@ -42,7 +42,7 @@ · 41 unmodified lines
4242 #include <media/v4l2-ctrls.h>
4343 #include <media/v4l2-event.h>
4444 #include <media/v4l2-of.h>
45−#include <media/tc358743.h>
45+#include <media/i2c/tc358743.h>
4646
4747 #include "tc358743_regs.h"
4848
@@ -862,7 +862,7 @@ static void tc358743_format_change(struct v4l2_subdev *sd) · 813 unmodified lines
862862 v4l2_dbg(1, debug, sd, "%s: Format changed. No signal\n",
863863 __func__);
864864 } else {
865− if (!v4l2_match_dv_timings(&state->timings, &timings, 0))
865+ if (!v4l2_match_dv_timings(&state->timings, &timings, 0, false))
866866 enable_stream(sd, false);
867867
868868 v4l2_print_dv_timings(sd->name,
@@ -1366,7 +1366,7 @@ static int tc358743_s_dv_timings(struct v4l2_subdev *sd, · 497 unmodified lines
13661366 v4l2_print_dv_timings(sd->name, "tc358743_s_dv_timings: ",
13671367 timings, false);
13681368
1369− if (v4l2_match_dv_timings(&state->timings, timings, 0)) {
1369+ if (v4l2_match_dv_timings(&state->timings, timings, 0, false)) {
13701370 v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
13711371 return 0;
13721372 }
drivers/media/i2c/ths7303.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include <linux/module.h>
2626 #include <linux/slab.h>
2727
28−#include <media/ths7303.h>
28+#include <media/i2c/ths7303.h>
2929 #include <media/v4l2-device.h>
3030
3131 #define THS7303_CHANNEL_1 1
drivers/media/i2c/tvaudio.c+1−1
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #include <linux/kthread.h>
3737 #include <linux/freezer.h>
3838
39−#include <media/tvaudio.h>
39+#include <media/i2c/tvaudio.h>
4040 #include <media/v4l2-device.h>
4141 #include <media/v4l2-ctrls.h>
4242
drivers/media/i2c/tvp514x.c+1−1
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 #include <media/v4l2-mediabus.h>
4545 #include <media/v4l2-of.h>
4646 #include <media/v4l2-ctrls.h>
47−#include <media/tvp514x.h>
47+#include <media/i2c/tvp514x.h>
4848 #include <media/media-entity.h>
4949
5050 #include "tvp514x_regs.h"
drivers/media/i2c/tvp5150.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/module.h>
1313 #include <media/v4l2-async.h>
1414 #include <media/v4l2-device.h>
15−#include <media/tvp5150.h>
15+#include <media/i2c/tvp5150.h>
1616 #include <media/v4l2-ctrls.h>
1717
1818 #include "tvp5150_reg.h"
drivers/media/i2c/tvp7002.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #include <linux/of.h>
3333 #include <linux/of_graph.h>
3434 #include <linux/v4l2-dv-timings.h>
35−#include <media/tvp7002.h>
35+#include <media/i2c/tvp7002.h>
3636 #include <media/v4l2-async.h>
3737 #include <media/v4l2-device.h>
3838 #include <media/v4l2-common.h>
drivers/media/i2c/uda1342.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include <linux/i2c.h>
2121 #include <linux/videodev2.h>
2222 #include <media/v4l2-device.h>
23−#include <media/uda1342.h>
23+#include <media/i2c/uda1342.h>
2424 #include <linux/slab.h>
2525
2626 static 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
2727 #include <linux/videodev2.h>
2828 #include <linux/slab.h>
2929 #include <media/v4l2-device.h>
30−#include <media/upd64031a.h>
30+#include <media/i2c/upd64031a.h>
3131
3232 /* --------------------- read registers functions define -------------------- */
3333
drivers/media/i2c/upd64083.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include <linux/videodev2.h>
2828 #include <linux/slab.h>
2929 #include <media/v4l2-device.h>
30−#include <media/upd64083.h>
30+#include <media/i2c/upd64083.h>
3131
3232 MODULE_DESCRIPTION("uPD64083 driver");
3333 MODULE_AUTHOR("T. Adachi, Takeru KOMORIYA, Hans Verkuil");
drivers/media/i2c/wm8775.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #include <linux/videodev2.h>
3535 #include <media/v4l2-device.h>
3636 #include <media/v4l2-ctrls.h>
37−#include <media/wm8775.h>
37+#include <media/i2c/wm8775.h>
3838
3939 MODULE_DESCRIPTION("wm8775 driver");
4040 MODULE_AUTHOR("Ulf Eklund, Hans Verkuil");
drivers/media/pci/bt8xx/bttv-cards.c+2−2
@@ -41,7 +41,7 @@ · 40 unmodified lines
4141
4242 #include "bttvp.h"
4343 #include <media/v4l2-common.h>
44−#include <media/tvaudio.h>
44+#include <media/i2c/tvaudio.h>
4545 #include "bttv-audio-hook.h"
4646
4747 /* fwd decl */
@@ -3808,7 +3808,7 @@ static void bttv_tea575x_set_direction(struct snd_tea575x *tea, bool output) · 3760 unmodified lines
38083808 gpio_inout(mask, (1 << gpio.clk) | (1 << gpio.wren));
38093809 }
38103810
3811−static struct snd_tea575x_ops bttv_tea_ops = {
3811+static const struct snd_tea575x_ops bttv_tea_ops = {
38123812 .set_pins = bttv_tea575x_set_pins,
38133813 .get_pins = bttv_tea575x_get_pins,
38143814 .set_direction = bttv_tea575x_set_direction,
drivers/media/pci/bt8xx/bttv-driver.c+3−3
@@ -50,15 +50,15 @@ · 49 unmodified lines
5050 #include <media/v4l2-common.h>
5151 #include <media/v4l2-ioctl.h>
5252 #include <media/v4l2-event.h>
53−#include <media/tvaudio.h>
54−#include <media/msp3400.h>
53+#include <media/i2c/tvaudio.h>
54+#include <media/drv-intf/msp3400.h>
5555
5656 #include <linux/dma-mapping.h>
5757
5858 #include <asm/io.h>
5959 #include <asm/byteorder.h>
6060
61−#include <media/saa6588.h>
61+#include <media/i2c/saa6588.h>
6262
6363 #define BTTV_VERSION "0.9.19"
6464
drivers/media/pci/bt8xx/bttvp.h+2−2
@@ -41,8 +41,8 @@ · 40 unmodified lines
4141 #include <media/videobuf-dma-sg.h>
4242 #include <media/tveeprom.h>
4343 #include <media/rc-core.h>
44−#include <media/ir-kbd-i2c.h>
45−#include <media/tea575x.h>
44+#include <media/i2c/ir-kbd-i2c.h>
45+#include <media/drv-intf/tea575x.h>
4646
4747 #include "bt848.h"
4848 #include "bttv.h"
drivers/media/pci/cobalt/cobalt-driver.c+3−3
@@ -21,9 +21,9 @@ · 20 unmodified lines
2121 */
2222
2323 #include <linux/delay.h>
24−#include <media/adv7604.h>
25−#include <media/adv7842.h>
26−#include <media/adv7511.h>
24+#include <media/i2c/adv7604.h>
25+#include <media/i2c/adv7842.h>
26+#include <media/i2c/adv7511.h>
2727 #include <media/v4l2-event.h>
2828 #include <media/v4l2-ctrls.h>
2929
drivers/media/pci/cobalt/cobalt-irq.c+2−2
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 * SOFTWARE.
1919 */
2020
21−#include <media/adv7604.h>
21+#include <media/i2c/adv7604.h>
2222
2323 #include "cobalt-driver.h"
2424 #include "cobalt-irq.h"
@@ -134,7 +134,7 @@ done: · 109 unmodified lines
134134 skip = true;
135135 s->skip_first_frames--;
136136 }
137− v4l2_get_timestamp(&cb->vb.timestamp);
137+ cb->vb.vb2_buf.timestamp = ktime_get_ns();
138138 /* TODO: the sequence number should be read from the FPGA so we
139139 also know about dropped frames. */
140140 cb->vb.sequence = s->sequence++;
drivers/media/pci/cobalt/cobalt-v4l2.c+7−11
@@ -29,8 +29,8 @@ · 28 unmodified lines
2929 #include <media/v4l2-ctrls.h>
3030 #include <media/v4l2-event.h>
3131 #include <media/v4l2-dv-timings.h>
32−#include <media/adv7604.h>
33−#include <media/adv7842.h>
32+#include <media/i2c/adv7604.h>
33+#include <media/i2c/adv7842.h>
3434
3535 #include "cobalt-alsa.h"
3636 #include "cobalt-cpld.h"
@@ -43,11 +43,10 @@ static const struct v4l2_dv_timings cea1080p60 = V4L2_DV_BT_CEA_1920X1080P60; · 6 unmodified lines
4343
4444 /* vb2 DMA streaming ops */
4545
46−static int cobalt_queue_setup(struct vb2_queue *q, const void *parg,
46+static int cobalt_queue_setup(struct vb2_queue *q,
4747 unsigned int *num_buffers, unsigned int *num_planes,
4848 unsigned int sizes[], void *alloc_ctxs[])
4949 {
50− const struct v4l2_format *fmt = parg;
5150 struct cobalt_stream *s = q->drv_priv;
5251 unsigned size = s->stride * s->height;
5352
@@ -55,14 +54,11 @@ static int cobalt_queue_setup(struct vb2_queue *q, const void *parg, · 1 unmodified line
5554 *num_buffers = 3;
5655 if (*num_buffers > NR_BUFS)
5756 *num_buffers = NR_BUFS;
57+ alloc_ctxs[0] = s->cobalt->alloc_ctx;
58+ if (*num_planes)
59+ return sizes[0] < size ? -EINVAL : 0;
5860 *num_planes = 1;
59− if (fmt) {
60− if (fmt->fmt.pix.sizeimage < size)
61− return -EINVAL;
62− size = fmt->fmt.pix.sizeimage;
63− }
6461 sizes[0] = size;
65− alloc_ctxs[0] = s->cobalt->alloc_ctx;
6662 return 0;
6763 }
6864
@@ -649,7 +645,7 @@ static int cobalt_s_dv_timings(struct file *file, void *priv_fh, · 580 unmodified lines
649645 return 0;
650646 }
651647
652− if (v4l2_match_dv_timings(timings, &s->timings, 0))
648+ if (v4l2_match_dv_timings(timings, &s->timings, 0, false))
653649 return 0;
654650
655651 if (vb2_is_busy(&s->q))
drivers/media/pci/cx18/cx18-cards.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include "cx18-cards.h"
2727 #include "cx18-av-core.h"
2828 #include "cx18-i2c.h"
29−#include <media/cs5345.h>
29+#include <media/i2c/cs5345.h>
3030
3131 #define V4L2_STD_PAL_SECAM (V4L2_STD_PAL|V4L2_STD_SECAM)
3232
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
126126 return 0;
127127 }
128128
129−struct cx2341x_handler_ops cx18_cxhdl_ops = {
129+const struct cx2341x_handler_ops cx18_cxhdl_ops = {
130130 .s_audio_mode = cx18_s_audio_mode,
131131 .s_audio_sampling_freq = cx18_s_audio_sampling_freq,
132132 .s_video_encoding = cx18_s_video_encoding,
drivers/media/pci/cx18/cx18-controls.h+1−1
@@ -21,4 +21,4 @@ · 20 unmodified lines
2121 * 02111-1307 USA
2222 */
2323
24−extern struct cx2341x_handler_ops cx18_cxhdl_ops;
24+extern const struct cx2341x_handler_ops cx18_cxhdl_ops;
drivers/media/pci/cx18/cx18-driver.h+1−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
4949 #include <media/v4l2-device.h>
5050 #include <media/v4l2-fh.h>
5151 #include <media/tuner.h>
52−#include <media/ir-kbd-i2c.h>
52+#include <media/i2c/ir-kbd-i2c.h>
5353 #include "cx18-mailbox.h"
5454 #include "cx18-av-core.h"
5555 #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
453453
454454 if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
455455 return -EINVAL;
456− cropcap->pixelaspect.numerator = cx->is_50hz ? 59 : 10;
457− cropcap->pixelaspect.denominator = cx->is_50hz ? 54 : 11;
456+ cropcap->pixelaspect.numerator = cx->is_50hz ? 54 : 11;
457+ cropcap->pixelaspect.denominator = cx->is_50hz ? 59 : 10;
458458 return 0;
459459 }
460460
drivers/media/pci/cx18/cx23418.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #ifndef CX23418_H
2323 #define CX23418_H
2424
25−#include <media/cx2341x.h>
25+#include <media/drv-intf/cx2341x.h>
2626
2727 #define MGR_CMD_MASK 0x40000000
2828 /* 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
1010 select VIDEOBUF2_DMA_SG
1111 select VIDEO_CX25840
1212 select VIDEO_CX2341X
13+ select VIDEO_CS3308
1314 select DVB_DIB7000P if MEDIA_SUBDRV_AUTOSELECT
1415 select DVB_DRXK if MEDIA_SUBDRV_AUTOSELECT
1516 select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT
drivers/media/pci/cx23885/cx23885-417.c+2−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <linux/slab.h>
3131 #include <media/v4l2-common.h>
3232 #include <media/v4l2-ioctl.h>
33−#include <media/cx2341x.h>
33+#include <media/drv-intf/cx2341x.h>
3434
3535 #include "cx23885.h"
3636 #include "cx23885-ioctl.h"
@@ -1138,7 +1138,7 @@ static int cx23885_initialize_codec(struct cx23885_dev *dev, int startencoder) · 1101 unmodified lines
11381138
11391139 /* ------------------------------------------------------------------ */
11401140
1141−static int queue_setup(struct vb2_queue *q, const void *parg,
1141+static int queue_setup(struct vb2_queue *q,
11421142 unsigned int *num_buffers, unsigned int *num_planes,
11431143 unsigned int sizes[], void *alloc_ctxs[])
11441144 {
drivers/media/pci/cx23885/cx23885-cards.c+115−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <linux/module.h>
2020 #include <linux/pci.h>
2121 #include <linux/delay.h>
22−#include <media/cx25840.h>
22+#include <media/drv-intf/cx25840.h>
2323 #include <linux/firmware.h>
2424 #include <misc/altera.h>
2525
@@ -715,6 +715,56 @@ struct cx23885_board cx23885_boards[] = { · 689 unmodified lines
715715 .portb = CX23885_MPEG_DVB,
716716 .portc = CX23885_MPEG_DVB,
717717 },
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+ },
718768 };
719769 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
720770
@@ -1002,6 +1052,14 @@ struct cx23885_subid cx23885_subids[] = { · 281 unmodified lines
10021052 .subvendor = 0x0070,
10031053 .subdevice = 0xf038,
10041054 .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,
10051063 },
10061064 };
10071065 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -1034,6 +1092,28 @@ void cx23885_card_list(struct cx23885_dev *dev) · 26 unmodified lines
10341092 dev->name, i, cx23885_boards[i].name);
10351093 }
10361094
1095+static 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+
10371117 static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
10381118 {
10391119 struct tveeprom tv;
@@ -1671,6 +1751,12 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) · 631 unmodified lines
16711751 cx23885_gpio_set(dev, GPIO_8 | GPIO_9);
16721752 msleep(100);
16731753 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;
16741760 }
16751761 }
16761762
@@ -1917,6 +2003,14 @@ void cx23885_card_setup(struct cx23885_dev *dev) · 240 unmodified lines
19172003 if (dev->i2c_bus[0].i2c_rc == 0)
19182004 hauppauge_eeprom(dev, eeprom+0xc0);
19192005 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;
19202014 }
19212015
19222016 switch (dev->board) {
@@ -2120,6 +2214,8 @@ void cx23885_card_setup(struct cx23885_dev *dev) · 197 unmodified lines
21202214 case CX23885_BOARD_DVBSKY_S950:
21212215 case CX23885_BOARD_DVBSKY_S952:
21222216 case CX23885_BOARD_DVBSKY_T982:
2217+ case CX23885_BOARD_VIEWCAST_260E:
2218+ case CX23885_BOARD_VIEWCAST_460E:
21232219 dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
21242220 &dev->i2c_bus[2].i2c_adap,
21252221 "cx25840", 0x88 >> 1, NULL);
@@ -2130,6 +2226,24 @@ void cx23885_card_setup(struct cx23885_dev *dev) · 4 unmodified lines
21302226 break;
21312227 }
21322228
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+
21332247 /* AUX-PLL 27MHz CLK */
21342248 switch (dev->board) {
21352249 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
427427 buf = list_entry(q->active.next,
428428 struct cx23885_buffer, queue);
429429
430− v4l2_get_timestamp(&buf->vb.timestamp);
430+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
431431 buf->vb.sequence = q->count++;
432432 dprintk(1, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
433433 buf->vb.vb2_buf.index,
@@ -968,6 +968,16 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) · 534 unmodified lines
968968 call_all(dev, core, s_power, 0);
969969 cx23885_ir_init(dev);
970970
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+
971981 if (cx23885_boards[dev->board].porta == CX23885_ANALOG_VIDEO) {
972982 if (cx23885_video_register(dev) < 0) {
973983 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
9292
9393 /* ------------------------------------------------------------------ */
9494
95−static int queue_setup(struct vb2_queue *q, const void *parg,
95+static int queue_setup(struct vb2_queue *q,
9696 unsigned int *num_buffers, unsigned int *num_planes,
9797 unsigned int sizes[], void *alloc_ctxs[])
9898 {
@@ -2168,11 +2168,12 @@ static int dvb_register(struct cx23885_tsport *port) · 2069 unmodified lines
21682168 }
21692169 port->i2c_client_tuner = client_tuner;
21702170 break;
2171− case CX23885_BOARD_HAUPPAUGE_HVR5525:
2172− switch (port->nr) {
2171+ case CX23885_BOARD_HAUPPAUGE_HVR5525: {
21732172 struct m88rs6000t_config m88rs6000t_config;
21742173 struct a8293_platform_data a8293_pdata = {};
21752174
2175+ switch (port->nr) {
2176+
21762177 /* port b - satellite */
21772178 case 1:
21782179 /* attach frontend */
@@ -2267,6 +2268,7 @@ static int dvb_register(struct cx23885_tsport *port) · 88 unmodified lines
22672268 break;
22682269 }
22692270 break;
2271+ }
22702272 default:
22712273 printk(KERN_INFO "%s: The frontend of your DVB/ATSC card "
22722274 " 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
279279 [0x10 >> 1] = "tda10048",
280280 [0x12 >> 1] = "dib7000pc",
281281 [0x1c >> 1] = "lgdt3303",
282+ [0x80 >> 1] = "cs3308",
283+ [0x82 >> 1] = "cs3308",
282284 [0x86 >> 1] = "tda9887",
283285 [0x32 >> 1] = "cx24227",
284286 [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
268268 struct rc_dev *rc;
269269 char *rc_map;
270270 enum rc_driver_type driver_type;
271− unsigned long allowed_protos;
271+ u64 allowed_protos;
272272
273273 int ret;
274274
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
8383 if (status & VID_BC_MSK_VBI_RISCI1) {
8484 dprintk(1, "%s() VID_BC_MSK_VBI_RISCI1\n", __func__);
8585 spin_lock(&dev->slock);
86− count = cx_read(VID_A_GPCNT);
86+ count = cx_read(VBI_A_GPCNT);
8787 cx23885_video_wakeup(dev, &dev->vbiq, count);
8888 spin_unlock(&dev->slock);
8989 handled++;
@@ -103,7 +103,6 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev, · 13 unmodified lines
103103 VBI_LINE_LENGTH, buf->risc.dma);
104104
105105 /* reset counter */
106− cx_write(VID_A_GPCNT_CTL, 3);
107106 cx_write(VID_A_VBI_CTRL, 3);
108107 cx_write(VBI_A_GPCNT_CTL, 3);
109108 q->count = 0;
@@ -121,7 +120,7 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev, · 11 unmodified lines
121120
122121 /* ------------------------------------------------------------------ */
123122
124−static int queue_setup(struct vb2_queue *q, const void *parg,
123+static int queue_setup(struct vb2_queue *q,
125124 unsigned int *num_buffers, unsigned int *num_planes,
126125 unsigned int sizes[], void *alloc_ctxs[])
127126 {
drivers/media/pci/cx23885/cx23885-video.c+44−5
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 #include "cx23885-ioctl.h"
3636 #include "tuner-xc2028.h"
3737
38−#include <media/cx25840.h>
38+#include <media/drv-intf/cx25840.h>
3939
4040 MODULE_DESCRIPTION("v4l2 driver module for cx23885 based TV cards");
4141 MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>");
@@ -105,7 +105,7 @@ void cx23885_video_wakeup(struct cx23885_dev *dev, · 63 unmodified lines
105105 struct cx23885_buffer, queue);
106106
107107 buf->vb.sequence = q->count++;
108− v4l2_get_timestamp(&buf->vb.timestamp);
108+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
109109 dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf,
110110 buf->vb.vb2_buf.index, count, q->count);
111111 list_del(&buf->queue);
@@ -114,11 +114,19 @@ void cx23885_video_wakeup(struct cx23885_dev *dev, · 2 unmodified lines
114114
115115 int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm)
116116 {
117+ struct v4l2_subdev_format format = {
118+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
119+ .format.code = MEDIA_BUS_FMT_FIXED,
120+ };
121+
117122 dprintk(1, "%s(norm = 0x%08x) name: [%s]\n",
118123 __func__,
119124 (unsigned int)norm,
120125 v4l2_norm_to_name(norm));
121126
127+ if (dev->tvnorm == norm)
128+ return 0;
129+
122130 if (dev->tvnorm != norm) {
123131 if (vb2_is_busy(&dev->vb2_vidq) || vb2_is_busy(&dev->vb2_vbiq) ||
124132 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
126134 }
127135
128136 dev->tvnorm = norm;
137+ dev->width = 720;
138+ dev->height = norm_maxh(norm);
139+ dev->field = V4L2_FIELD_INTERLACED;
129140
130141 call_all(dev, video, s_std, norm);
131142
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+
132148 return 0;
133149 }
134150
@@ -247,7 +263,9 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) · 112 unmodified lines
247263 (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111) ||
248264 (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) ||
249265 (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)) {
251269 /* Configure audio routing */
252270 v4l2_subdev_call(dev->sd_cx25840, audio, s_routing,
253271 INPUT(input)->amux, 0, 0);
@@ -315,7 +333,7 @@ static int cx23885_start_video_dma(struct cx23885_dev *dev, · 61 unmodified lines
315333 return 0;
316334 }
317335
318−static int queue_setup(struct vb2_queue *q, const void *parg,
336+static int queue_setup(struct vb2_queue *q,
319337 unsigned int *num_buffers, unsigned int *num_planes,
320338 unsigned int sizes[], void *alloc_ctxs[])
321339 {
@@ -545,7 +563,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, · 223 unmodified lines
545563 return -EINVAL;
546564
547565 field = f->fmt.pix.field;
548− maxw = norm_maxw(dev->tvnorm);
566+ maxw = 720;
549567 maxh = norm_maxh(dev->tvnorm);
550568
551569 if (V4L2_FIELD_ANY == field) {
@@ -648,6 +666,26 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, · 96 unmodified lines
648666 return 0;
649667 }
650668
669+static 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+
651689 static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
652690 {
653691 struct cx23885_dev *dev = video_drvdata(file);
@@ -1082,6 +1120,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { · 428 unmodified lines
10821120 .vidioc_dqbuf = vb2_ioctl_dqbuf,
10831121 .vidioc_streamon = vb2_ioctl_streamon,
10841122 .vidioc_streamoff = vb2_ioctl_streamoff,
1123+ .vidioc_cropcap = vidioc_cropcap,
10851124 .vidioc_s_std = vidioc_s_std,
10861125 .vidioc_g_std = vidioc_g_std,
10871126 .vidioc_enum_input = vidioc_enum_input,
drivers/media/pci/cx23885/cx23885.h+3−6
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <media/rc-core.h>
3131
3232 #include "cx23885-reg.h"
33−#include "media/cx2341x.h"
33+#include "media/drv-intf/cx2341x.h"
3434
3535 #include <linux/mutex.h>
3636
@@ -101,6 +101,8 @@ · 64 unmodified lines
101101 #define CX23885_BOARD_DVBSKY_T982 51
102102 #define CX23885_BOARD_HAUPPAUGE_HVR5525 52
103103 #define CX23885_BOARD_HAUPPAUGE_STARBURST 53
104+#define CX23885_BOARD_VIEWCAST_260E 54
105+#define CX23885_BOARD_VIEWCAST_460E 55
104106
105107 #define GPIO_0 0x00000001
106108 #define GPIO_1 0x00000002
@@ -627,11 +629,6 @@ extern int cx23885_risc_databuffer(struct pci_dev *pci, · 520 unmodified lines
627629 /* ----------------------------------------------------------- */
628630 /* tv norms */
629631
630−static inline unsigned int norm_maxw(v4l2_std_id norm)
631−{
632− return (norm & V4L2_STD_525_60) ? 720 : 768;
633−}
634−
635632 static inline unsigned int norm_maxh(v4l2_std_id norm)
636633 {
637634 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
130130 buf = list_entry(dmaq->active.next,
131131 struct cx25821_buffer, queue);
132132
133− v4l2_get_timestamp(&buf->vb.timestamp);
133+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
134134 buf->vb.sequence = dmaq->count++;
135135 list_del(&buf->queue);
136136 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
141141 return handled;
142142 }
143143
144−static int cx25821_queue_setup(struct vb2_queue *q, const void *parg,
144+static int cx25821_queue_setup(struct vb2_queue *q,
145145 unsigned int *num_buffers, unsigned int *num_planes,
146146 unsigned int sizes[], void *alloc_ctxs[])
147147 {
148− const struct v4l2_format *fmt = parg;
149148 struct cx25821_channel *chan = q->drv_priv;
150149 unsigned size = (chan->fmt->depth * chan->width * chan->height) >> 3;
151150
152− if (fmt && fmt->fmt.pix.sizeimage < size)
153− return -EINVAL;
151+ alloc_ctxs[0] = chan->dev->alloc_ctx;
152+
153+ if (*num_planes)
154+ return sizes[0] < size ? -EINVAL : 0;
154155
155156 *num_planes = 1;
156− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : size;
157− alloc_ctxs[0] = chan->dev->alloc_ctx;
157+ sizes[0] = size;
158158 return 0;
159159 }
160160
drivers/media/pci/cx88/cx88-alsa.c+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #include <sound/control.h>
4141 #include <sound/initval.h>
4242 #include <sound/tlv.h>
43−#include <media/wm8775.h>
43+#include <media/i2c/wm8775.h>
4444
4545 #include "cx88.h"
4646 #include "cx88-reg.h"
drivers/media/pci/cx88/cx88-blackbird.c+2−2
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #include <media/v4l2-common.h>
3737 #include <media/v4l2-ioctl.h>
3838 #include <media/v4l2-event.h>
39−#include <media/cx2341x.h>
39+#include <media/drv-intf/cx2341x.h>
4040
4141 #include "cx88.h"
4242
@@ -637,7 +637,7 @@ static int blackbird_stop_codec(struct cx8802_dev *dev) · 594 unmodified lines
637637
638638 /* ------------------------------------------------------------------ */
639639
640−static int queue_setup(struct vb2_queue *q, const void *parg,
640+static int queue_setup(struct vb2_queue *q,
641641 unsigned int *num_buffers, unsigned int *num_planes,
642642 unsigned int sizes[], void *alloc_ctxs[])
643643 {
drivers/media/pci/cx88/cx88-core.c+1−1
@@ -518,7 +518,7 @@ void cx88_wakeup(struct cx88_core *core, · 517 unmodified lines
518518
519519 buf = list_entry(q->active.next,
520520 struct cx88_buffer, list);
521− v4l2_get_timestamp(&buf->vb.timestamp);
521+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
522522 buf->vb.field = core->field;
523523 buf->vb.sequence = q->count++;
524524 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
8282
8383 /* ------------------------------------------------------------------ */
8484
85−static int queue_setup(struct vb2_queue *q, const void *parg,
85+static int queue_setup(struct vb2_queue *q,
8686 unsigned int *num_buffers, unsigned int *num_planes,
8787 unsigned int sizes[], void *alloc_ctxs[])
8888 {
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
107107
108108 /* ------------------------------------------------------------------ */
109109
110−static int queue_setup(struct vb2_queue *q, const void *parg,
110+static int queue_setup(struct vb2_queue *q,
111111 unsigned int *num_buffers, unsigned int *num_planes,
112112 unsigned int sizes[], void *alloc_ctxs[])
113113 {
drivers/media/pci/cx88/cx88-video.c+2−2
@@ -41,7 +41,7 @@ · 40 unmodified lines
4141 #include <media/v4l2-common.h>
4242 #include <media/v4l2-ioctl.h>
4343 #include <media/v4l2-event.h>
44−#include <media/wm8775.h>
44+#include <media/i2c/wm8775.h>
4545
4646 MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");
4747 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
@@ -429,7 +429,7 @@ static int restart_video_queue(struct cx8800_dev *dev, · 381 unmodified lines
429429
430430 /* ------------------------------------------------------------------ */
431431
432−static int queue_setup(struct vb2_queue *q, const void *parg,
432+static int queue_setup(struct vb2_queue *q,
433433 unsigned int *num_buffers, unsigned int *num_planes,
434434 unsigned int sizes[], void *alloc_ctxs[])
435435 {
drivers/media/pci/cx88/cx88.h+3−3
@@ -30,10 +30,10 @@ · 29 unmodified lines
3030 #include <media/tuner.h>
3131 #include <media/tveeprom.h>
3232 #include <media/videobuf2-dma-sg.h>
33−#include <media/cx2341x.h>
33+#include <media/drv-intf/cx2341x.h>
3434 #include <media/videobuf2-dvb.h>
35−#include <media/ir-kbd-i2c.h>
36−#include <media/wm8775.h>
35+#include <media/i2c/ir-kbd-i2c.h>
36+#include <media/i2c/wm8775.h>
3737
3838 #include "cx88-reg.h"
3939 #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
8181 static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
8282 {
8383 struct ddb *dev = i2c->dev;
84− int stat;
84+ long stat;
8585 u32 val;
8686
8787 i2c->done = 0;
8888 ddbwritel((adr << 9) | cmd, i2c->regs + I2C_COMMAND);
8989 stat = wait_event_timeout(i2c->wq, i2c->done == 1, HZ);
90− if (stat <= 0) {
90+ if (stat == 0) {
9191 printk(KERN_ERR "I2C timeout\n");
9292 { /* MSI debugging*/
9393 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
12061206 i2c_del_adapter(&dev->i2c_adap);
12071207
12081208 dm1105_hw_exit(dev);
1209− synchronize_irq(pdev->irq);
12101209 free_irq(pdev->irq, dev);
12111210 pci_iounmap(pdev, dev->io_mem);
12121211 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
131131 }
132132
133133 static int
134−dt3155_queue_setup(struct vb2_queue *vq, const void *parg,
134+dt3155_queue_setup(struct vb2_queue *vq,
135135 unsigned int *nbuffers, unsigned int *num_planes,
136136 unsigned int sizes[], void *alloc_ctxs[])
137137
138138 {
139− const struct v4l2_format *fmt = parg;
140139 struct dt3155_priv *pd = vb2_get_drv_priv(vq);
141140 unsigned size = pd->width * pd->height;
142141
143142 if (vq->num_buffers + *nbuffers < 2)
144143 *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;
149144 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;
150149 return 0;
151150 }
152151
@@ -271,7 +270,7 @@ static irqreturn_t dt3155_irq_handler_even(int irq, void *dev_id) · 118 unmodified lines
271270
272271 spin_lock(&ipd->lock);
273272 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();
275274 ipd->curr_buf->sequence = ipd->sequence++;
276275 ipd->curr_buf->field = V4L2_FIELD_NONE;
277276 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
2222 #include "ivtv-cards.h"
2323 #include "ivtv-i2c.h"
2424
25−#include <media/msp3400.h>
26−#include <media/m52790.h>
27−#include <media/wm8775.h>
28−#include <media/cs53l32a.h>
29−#include <media/cx25840.h>
30−#include <media/upd64031a.h>
25+#include <media/drv-intf/msp3400.h>
26+#include <media/i2c/m52790.h>
27+#include <media/i2c/wm8775.h>
28+#include <media/i2c/cs53l32a.h>
29+#include <media/drv-intf/cx25840.h>
30+#include <media/i2c/upd64031a.h>
3131
3232 #define MSP_TUNER MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
3333 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
9696 return 0;
9797 }
9898
99−struct cx2341x_handler_ops ivtv_cxhdl_ops = {
99+const struct cx2341x_handler_ops ivtv_cxhdl_ops = {
100100 .s_audio_mode = ivtv_s_audio_mode,
101101 .s_audio_sampling_freq = ivtv_s_audio_sampling_freq,
102102 .s_video_encoding = ivtv_s_video_encoding,
drivers/media/pci/ivtv/ivtv-controls.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #ifndef IVTV_CONTROLS_H
2222 #define IVTV_CONTROLS_H
2323
24−extern struct cx2341x_handler_ops ivtv_cxhdl_ops;
24+extern const struct cx2341x_handler_ops ivtv_cxhdl_ops;
2525 extern const struct v4l2_ctrl_ops ivtv_hdl_out_ops;
2626 int ivtv_g_pts_frame(struct ivtv *itv, s64 *pts, s64 *frame);
2727
drivers/media/pci/ivtv/ivtv-driver.c+2−2
@@ -57,7 +57,7 @@ · 56 unmodified lines
5757 #include "ivtv-gpio.h"
5858 #include <linux/dma-mapping.h>
5959 #include <media/tveeprom.h>
60−#include <media/saa7115.h>
60+#include <media/i2c/saa7115.h>
6161 #include "tuner-xc2028.h"
6262
6363 /* 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
826826 IVTV_CARD_INPUT_VID_TUNER)
827827 break;
828828 }
829− if (i == itv->nof_inputs)
829+ if (i >= itv->nof_inputs)
830830 i = 0;
831831 itv->active_input = i;
832832 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
6464 #include <media/v4l2-device.h>
6565 #include <media/v4l2-fh.h>
6666 #include <media/tuner.h>
67−#include <media/cx2341x.h>
68−#include <media/ir-kbd-i2c.h>
67+#include <media/drv-intf/cx2341x.h>
68+#include <media/i2c/ir-kbd-i2c.h>
6969
7070 #include <linux/ivtv.h>
7171
drivers/media/pci/ivtv/ivtv-fileops.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #include "ivtv-cards.h"
3535 #include "ivtv-firmware.h"
3636 #include <media/v4l2-event.h>
37−#include <media/saa7115.h>
37+#include <media/i2c/saa7115.h>
3838
3939 /* This function tries to claim the stream for a specific file descriptor.
4040 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
2626 #include "ivtv-ioctl.h"
2727 #include "ivtv-cards.h"
2828 #include <linux/firmware.h>
29−#include <media/saa7127.h>
29+#include <media/i2c/saa7127.h>
3030
3131 #define IVTV_MASK_SPU_ENABLE 0xFFFFFFFE
3232 #define IVTV_MASK_VPU_ENABLE15 0xFFFFFFF6
drivers/media/pci/ivtv/ivtv-i2c.c+1−1
@@ -63,7 +63,7 @@ · 62 unmodified lines
6363 #include "ivtv-cards.h"
6464 #include "ivtv-gpio.h"
6565 #include "ivtv-i2c.h"
66−#include <media/cx25840.h>
66+#include <media/drv-intf/cx25840.h>
6767
6868 /* i2c implementation for cx23415/6 chip, ivtv project.
6969 * Author: Kevin Thayer (nufan_wfk at yahoo.com)
drivers/media/pci/ivtv/ivtv-ioctl.c+5−5
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #include "ivtv-gpio.h"
3333 #include "ivtv-controls.h"
3434 #include "ivtv-cards.h"
35−#include <media/saa7127.h>
35+#include <media/i2c/saa7127.h>
3636 #include <media/tveeprom.h>
3737 #include <media/v4l2-event.h>
3838 #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
831831 struct ivtv *itv = id->itv;
832832
833833 if (cropcap->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
834− cropcap->pixelaspect.numerator = itv->is_50hz ? 59 : 10;
835− cropcap->pixelaspect.denominator = itv->is_50hz ? 54 : 11;
834+ cropcap->pixelaspect.numerator = itv->is_50hz ? 54 : 11;
835+ cropcap->pixelaspect.denominator = itv->is_50hz ? 59 : 10;
836836 } else if (cropcap->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
837− cropcap->pixelaspect.numerator = itv->is_out_50hz ? 59 : 10;
838− cropcap->pixelaspect.denominator = itv->is_out_50hz ? 54 : 11;
837+ cropcap->pixelaspect.numerator = itv->is_out_50hz ? 54 : 11;
838+ cropcap->pixelaspect.denominator = itv->is_out_50hz ? 59 : 10;
839839 } else {
840840 return -EINVAL;
841841 }
drivers/media/pci/ivtv/ivtv-routing.c+4−4
@@ -24,10 +24,10 @@ · 23 unmodified lines
2424 #include "ivtv-gpio.h"
2525 #include "ivtv-routing.h"
2626
27−#include <media/msp3400.h>
28−#include <media/m52790.h>
29−#include <media/upd64031a.h>
30−#include <media/upd64083.h>
27+#include <media/drv-intf/msp3400.h>
28+#include <media/i2c/m52790.h>
29+#include <media/i2c/upd64031a.h>
30+#include <media/i2c/upd64083.h>
3131
3232 /* Selects the audio input and output according to the current
3333 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
277277 }
278278
279279 static int netup_unidvb_queue_setup(struct vb2_queue *vq,
280− const void *parg,
281280 unsigned int *nbuffers,
282281 unsigned int *nplanes,
283282 unsigned int sizes[],
@@ -580,7 +579,7 @@ static void netup_unidvb_dma_worker(struct work_struct *work) · 296 unmodified lines
580579 dev_dbg(&ndev->pci_dev->dev,
581580 "%s(): buffer %p done, size %d\n",
582581 __func__, buf, buf->size);
583− v4l2_get_timestamp(&buf->vb.timestamp);
582+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
584583 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->size);
585584 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
586585 }
drivers/media/pci/saa7134/saa7134-core.c+1−1
@@ -309,7 +309,7 @@ void saa7134_buffer_finish(struct saa7134_dev *dev, · 308 unmodified lines
309309 core_dbg("buffer_finish %p\n", q->curr);
310310
311311 /* finish current buffer */
312− v4l2_get_timestamp(&q->curr->vb2.timestamp);
312+ q->curr->vb2.vb2_buf.timestamp = ktime_get_ns();
313313 q->curr->vb2.sequence = q->seq_nr++;
314314 vb2_buffer_done(&q->curr->vb2.vb2_buf, state);
315315 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
116116 }
117117 EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare);
118118
119−int saa7134_ts_queue_setup(struct vb2_queue *q, const void *parg,
119+int saa7134_ts_queue_setup(struct vb2_queue *q,
120120 unsigned int *nbuffers, unsigned int *nplanes,
121121 unsigned int sizes[], void *alloc_ctxs[])
122122 {
drivers/media/pci/saa7134/saa7134-vbi.c+1−1
@@ -138,7 +138,7 @@ static int buffer_prepare(struct vb2_buffer *vb2) · 137 unmodified lines
138138 saa7134_buffer_startpage(buf));
139139 }
140140
141−static int queue_setup(struct vb2_queue *q, const void *parg,
141+static int queue_setup(struct vb2_queue *q,
142142 unsigned int *nbuffers, unsigned int *nplanes,
143143 unsigned int sizes[], void *alloc_ctxs[])
144144 {
drivers/media/pci/saa7134/saa7134-video.c+2−2
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232
3333 #include <media/v4l2-common.h>
3434 #include <media/v4l2-event.h>
35−#include <media/saa6588.h>
35+#include <media/i2c/saa6588.h>
3636
3737 /* ------------------------------------------------------------------ */
3838
@@ -904,7 +904,7 @@ static int buffer_prepare(struct vb2_buffer *vb2) · 865 unmodified lines
904904 saa7134_buffer_startpage(buf));
905905 }
906906
907−static int queue_setup(struct vb2_queue *q, const void *parg,
907+static int queue_setup(struct vb2_queue *q,
908908 unsigned int *nbuffers, unsigned int *nplanes,
909909 unsigned int sizes[], void *alloc_ctxs[])
910910 {
drivers/media/pci/saa7134/saa7134.h+2−2
@@ -42,7 +42,7 @@ · 41 unmodified lines
4242 #include <media/v4l2-ctrls.h>
4343 #include <media/tuner.h>
4444 #include <media/rc-core.h>
45−#include <media/ir-kbd-i2c.h>
45+#include <media/i2c/ir-kbd-i2c.h>
4646 #include <media/videobuf2-dma-sg.h>
4747 #include <sound/core.h>
4848 #include <sound/pcm.h>
@@ -820,7 +820,7 @@ void saa7134_video_fini(struct saa7134_dev *dev); · 771 unmodified lines
820820
821821 int saa7134_ts_buffer_init(struct vb2_buffer *vb2);
822822 int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2);
823−int saa7134_ts_queue_setup(struct vb2_queue *q, const void *parg,
823+int saa7134_ts_queue_setup(struct vb2_queue *q,
824824 unsigned int *nbuffers, unsigned int *nplanes,
825825 unsigned int sizes[], void *alloc_ctxs[]);
826826 int 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
2525
2626 #define DEBUG_VARIABLE debug
2727
28−#include <media/saa7146_vv.h>
28+#include <media/drv-intf/saa7146_vv.h>
2929 #include <linux/module.h>
3030
3131 static int debug;
drivers/media/pci/saa7146/hexium_orion.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 #define DEBUG_VARIABLE debug
2727
28−#include <media/saa7146_vv.h>
28+#include <media/drv-intf/saa7146_vv.h>
2929 #include <linux/module.h>
3030
3131 static int debug;
drivers/media/pci/saa7146/mxb.c+2−2
@@ -25,10 +25,10 @@ · 24 unmodified lines
2525
2626 #define DEBUG_VARIABLE debug
2727
28−#include <media/saa7146_vv.h>
28+#include <media/drv-intf/saa7146_vv.h>
2929 #include <media/tuner.h>
3030 #include <media/v4l2-common.h>
31−#include <media/saa7115.h>
31+#include <media/i2c/saa7115.h>
3232 #include <linux/module.h>
3333
3434 #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
531531
532532 if (!ret) {
533533 vbuf->sequence = solo_enc->sequence++;
534− vbuf->timestamp.tv_sec = vop_sec(vh);
535− vbuf->timestamp.tv_usec = vop_usec(vh);
534+ vb->timestamp = ktime_get_ns();
536535
537536 /* Check for motion flags */
538537 if (solo_is_motion_on(solo_enc) && enc_buf->motion) {
@@ -663,7 +662,6 @@ static int solo_ring_thread(void *data) · 124 unmodified lines
663662 }
664663
665664 static int solo_enc_queue_setup(struct vb2_queue *q,
666− const void *parg,
667665 unsigned int *num_buffers,
668666 unsigned int *num_planes, unsigned int sizes[],
669667 void *alloc_ctxs[])
drivers/media/pci/solo6x10/solo6x10-v4l2.c+2−2
@@ -225,7 +225,7 @@ finish_buf: · 224 unmodified lines
225225 vb2_set_plane_payload(vb, 0,
226226 solo_vlines(solo_dev) * solo_bytesperline(solo_dev));
227227 vbuf->sequence = solo_dev->sequence++;
228− v4l2_get_timestamp(&vbuf->timestamp);
228+ vb->timestamp = ktime_get_ns();
229229 }
230230
231231 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
313313 solo_dev->kthread = NULL;
314314 }
315315
316−static int solo_queue_setup(struct vb2_queue *q, const void *parg,
316+static int solo_queue_setup(struct vb2_queue *q,
317317 unsigned int *num_buffers, unsigned int *num_planes,
318318 unsigned int sizes[], void *alloc_ctxs[])
319319 {
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
265265
266266
267267 /* Videobuf2 Operations */
268−static int queue_setup(struct vb2_queue *vq, const void *parg,
268+static int queue_setup(struct vb2_queue *vq,
269269 unsigned int *nbuffers, unsigned int *nplanes,
270270 unsigned int sizes[], void *alloc_ctxs[])
271271 {
@@ -817,7 +817,7 @@ static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip) · 545 unmodified lines
817817 /* Disable acquisition */
818818 reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA);
819819 /* 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();
821821 vip->active->vb.sequence = vip->sequence++;
822822 vb2_buffer_done(&vip->active->vb.vb2_buf, VB2_BUF_STATE_DONE);
823823 }
drivers/media/pci/ttpci/av7110.c+3−3
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2727 *
2828 *
29− * the project's page is at http://www.linuxtv.org/
29+ * the project's page is at https://linuxtv.org
3030 */
3131
3232
@@ -1537,7 +1537,7 @@ static int get_firmware(struct av7110* av7110) · 1504 unmodified lines
15371537 printk(KERN_ERR "dvb-ttpci: usually this should be in "
15381538 "/usr/lib/hotplug/firmware or /lib/firmware\n");
15391539 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");
15411541 } else
15421542 printk(KERN_ERR "dvb-ttpci: cannot request firmware"
15431543 " (error %i)\n", ret);
@@ -2314,7 +2314,7 @@ static int frontend_init(struct av7110 *av7110) · 770 unmodified lines
23142314 /* Budgetpatch note:
23152315 * Original hardware design by Roberto Deza:
23162316 * There is a DVB_Wiki at
2317− * http://www.linuxtv.org/
2317+ * https://linuxtv.org
23182318 *
23192319 * New software triggering design by Emard that works on
23202320 * original Roberto Deza's hardware:
drivers/media/pci/ttpci/av7110.h+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #include "stv0297.h"
3333 #include "l64781.h"
3434
35−#include <media/saa7146_vv.h>
35+#include <media/drv-intf/saa7146_vv.h>
3636
3737
3838 #define ANALOG_TUNER_VES1820 1
drivers/media/pci/ttpci/av7110_av.c+8−3
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2626 *
2727 *
28− * the project's page is at http://www.linuxtv.org/
28+ * the project's page is at https://linuxtv.org
2929 */
3030
3131 #include <linux/types.h>
@@ -280,9 +280,11 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen) · 248 unmodified lines
280280 }
281281
282282
283−int av7110_set_volume(struct av7110 *av7110, int volleft, int volright)
283+int av7110_set_volume(struct av7110 *av7110, unsigned int volleft,
284+ unsigned int volright)
284285 {
285− int err, vol, val, balance = 0;
286+ unsigned int vol, val, balance = 0;
287+ int err;
286288
287289 dprintk(2, "av7110:%p, \n", av7110);
288290
@@ -1043,6 +1045,9 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len · 754 unmodified lines
10431045
10441046 dprintk(2, "av7110:%p, \n", av7110);
10451047
1048+ if (len == 0)
1049+ return 0;
1050+
10461051 if (!(av7110->playing & RP_VIDEO)) {
10471052 if (av7110_av_start_play(av7110, RP_VIDEO) < 0)
10481053 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
1010 extern int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen);
1111 extern int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len);
1212
13−extern int av7110_set_volume(struct av7110 *av7110, int volleft, int volright);
13+extern int av7110_set_volume(struct av7110 *av7110, unsigned int volleft,
14+ unsigned int volright);
1415 extern int av7110_av_stop(struct av7110 *av7110, int av);
1516 extern int av7110_av_start_record(struct av7110 *av7110, int av,
1617 struct dvb_demux_feed *dvbdmxfeed);
drivers/media/pci/ttpci/av7110_ca.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2626 *
2727 *
28− * the project's page is at http://www.linuxtv.org/
28+ * the project's page is at https://linuxtv.org
2929 */
3030
3131 #include <linux/kernel.h>
drivers/media/pci/ttpci/av7110_hw.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2323 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2424 *
25− * the project's page is at http://www.linuxtv.org/
25+ * the project's page is at https://linuxtv.org
2626 */
2727
2828 /* for debugging ARM communication: */
drivers/media/pci/ttpci/av7110_v4l.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2323 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2424 *
25− * the project's page is at http://www.linuxtv.org/
25+ * the project's page is at https://linuxtv.org
2626 */
2727
2828 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
drivers/media/pci/ttpci/budget-av.c+2−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
3131 *
3232 *
33− * the project's page is at http://www.linuxtv.org/
33+ * the project's page is at https://linuxtv.org
3434 */
3535
3636 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -46,7 +46,7 @@ · 9 unmodified lines
4646 #include "tda1004x.h"
4747 #include "tua6100.h"
4848 #include "dvb-pll.h"
49−#include <media/saa7146_vv.h>
49+#include <media/drv-intf/saa7146_vv.h>
5050 #include <linux/module.h>
5151 #include <linux/errno.h>
5252 #include <linux/slab.h>
drivers/media/pci/ttpci/budget-ci.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2727 *
2828 *
29− * the project's page is at http://www.linuxtv.org/
29+ * the project's page is at https://linuxtv.org
3030 */
3131
3232 #include <linux/module.h>
drivers/media/pci/ttpci/budget-core.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
3232 *
3333 *
34− * the project's page is at http://www.linuxtv.org/
34+ * the project's page is at https://linuxtv.org
3535 */
3636
3737
drivers/media/pci/ttpci/budget-patch.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
2828 *
2929 *
30− * the project's page is at http://www.linuxtv.org/
30+ * the project's page is at https://linuxtv.org
3131 */
3232
3333 #include "av7110.h"
drivers/media/pci/ttpci/budget.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
3232 *
3333 *
34− * the project's page is at http://www.linuxtv.org/
34+ * the project's page is at https://linuxtv.org
3535 */
3636
3737 #include "budget.h"
drivers/media/pci/ttpci/budget.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <linux/module.h>
1414 #include <linux/mutex.h>
1515
16−#include <media/saa7146.h>
16+#include <media/drv-intf/saa7146.h>
1717
1818 extern int budget_debug;
1919
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
376376 /* ------------------------------------------------------------- */
377377 /* vb2 queue operations */
378378
379−static int tw68_queue_setup(struct vb2_queue *q, const void *parg,
379+static int tw68_queue_setup(struct vb2_queue *q,
380380 unsigned int *num_buffers, unsigned int *num_planes,
381381 unsigned int sizes[], void *alloc_ctxs[])
382382 {
383− const struct v4l2_format *fmt = parg;
384383 struct tw68_dev *dev = vb2_get_drv_priv(q);
385384 unsigned tot_bufs = q->num_buffers + *num_buffers;
385+ unsigned size = (dev->fmt->depth * dev->width * dev->height) >> 3;
386386
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;
388391 alloc_ctxs[0] = dev->alloc_ctx;
389392 /*
390− * We allow create_bufs, but only if the sizeimage is the same as the
393+ * We allow create_bufs, but only if the sizeimage is >= as the
391394 * current sizeimage. The tw68_buffer_count calculation becomes quite
392395 * difficult otherwise.
393396 */
394− if (fmt && fmt->fmt.pix.sizeimage < sizes[0])
395− return -EINVAL;
397+ if (*num_planes)
398+ return sizes[0] < size ? -EINVAL : 0;
396399 *num_planes = 1;
397− if (tot_bufs < 2)
398− tot_bufs = 2;
399− tot_bufs = tw68_buffer_count(sizes[0], tot_bufs);
400− *num_buffers = tot_bufs - q->num_buffers;
400+ sizes[0] = size;
401401
402402 return 0;
403403 }
@@ -1016,7 +1016,7 @@ void tw68_irq_video_done(struct tw68_dev *dev, unsigned long status) · 612 unmodified lines
10161016 buf = list_entry(dev->active.next, struct tw68_buf, list);
10171017 list_del(&buf->list);
10181018 spin_unlock(&dev->slock);
1019− v4l2_get_timestamp(&buf->vb.timestamp);
1019+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
10201020 buf->vb.field = dev->field;
10211021 buf->vb.sequence = dev->seqnr++;
10221022 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
5050 #include <linux/mutex.h>
5151 #include <linux/io.h>
5252 #include <media/v4l2-common.h>
53−#include <media/bt819.h>
53+#include <media/i2c/bt819.h>
5454
5555 #include "videocodec.h"
5656 #include "zoran.h"
drivers/media/platform/Kconfig+1−1
@@ -38,7 +38,7 @@ config VIDEO_SH_VOU · 37 unmodified lines
3838 depends on MEDIA_CAMERA_SUPPORT
3939 depends on VIDEO_DEV && I2C && HAS_DMA
4040 depends on ARCH_SHMOBILE || COMPILE_TEST
41− select VIDEOBUF_DMA_CONTIG
41+ select VIDEOBUF2_DMA_CONTIG
4242 help
4343 Support for the Video Output Unit (VOU) on SuperH SoCs.
4444
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
12811281 */
12821282 static inline void vpfe_process_buffer_complete(struct vpfe_device *vpfe)
12831283 {
1284− v4l2_get_timestamp(&vpfe->cur_frm->vb.timestamp);
1284+ vpfe->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
12851285 vpfe->cur_frm->vb.field = vpfe->fmt.fmt.pix.field;
12861286 vpfe->cur_frm->vb.sequence = vpfe->sequence++;
12871287 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
18981898 /*
18991899 * vpfe_queue_setup - Callback function for buffer setup.
19001900 * @vq: vb2_queue ptr
1901− * @fmt: v4l2 format
19021901 * @nbuffers: ptr to number of buffers requested by application
19031902 * @nplanes:: contains number of distinct video planes needed to hold a frame
19041903 * @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
19081907 * the buffer count and buffer size
19091908 */
19101909 static int vpfe_queue_setup(struct vb2_queue *vq,
1911− const void *parg,
19121910 unsigned int *nbuffers, unsigned int *nplanes,
19131911 unsigned int sizes[], void *alloc_ctxs[])
19141912 {
1915− const struct v4l2_format *fmt = parg;
19161913 struct vpfe_device *vpfe = vb2_get_drv_priv(vq);
1917−
1918− if (fmt && fmt->fmt.pix.sizeimage < vpfe->fmt.fmt.pix.sizeimage)
1919− return -EINVAL;
1914+ unsigned size = vpfe->fmt.fmt.pix.sizeimage;
19201915
19211916 if (vq->num_buffers + *nbuffers < 3)
19221917 *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+ }
19231925
19241926 *nplanes = 1;
1925− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : vpfe->fmt.fmt.pix.sizeimage;
1926− alloc_ctxs[0] = vpfe->alloc_ctx;
1927+ sizes[0] = size;
19271928
19281929 vpfe_dbg(1, vpfe,
19291930 "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
202202 }
203203
204204 static int bcap_queue_setup(struct vb2_queue *vq,
205− const void *parg,
206205 unsigned int *nbuffers, unsigned int *nplanes,
207206 unsigned int sizes[], void *alloc_ctxs[])
208207 {
209− const struct v4l2_format *fmt = parg;
210208 struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
211209
212− if (fmt && fmt->fmt.pix.sizeimage < bcap_dev->fmt.sizeimage)
213− return -EINVAL;
214−
215210 if (vq->num_buffers + *nbuffers < 2)
216211 *nbuffers = 2;
212+ alloc_ctxs[0] = bcap_dev->alloc_ctx;
213+
214+ if (*nplanes)
215+ return sizes[0] < bcap_dev->fmt.sizeimage ? -EINVAL : 0;
217216
218217 *nplanes = 1;
219− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : bcap_dev->fmt.sizeimage;
220− alloc_ctxs[0] = bcap_dev->alloc_ctx;
218+ sizes[0] = bcap_dev->fmt.sizeimage;
221219
222220 return 0;
223221 }
@@ -406,7 +404,7 @@ static irqreturn_t bcap_isr(int irq, void *dev_id) · 182 unmodified lines
406404 spin_lock(&bcap_dev->lock);
407405
408406 if (!list_empty(&bcap_dev->dma_queue)) {
409− v4l2_get_timestamp(&vbuf->timestamp);
407+ vb->timestamp = ktime_get_ns();
410408 if (ppi->err) {
411409 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
412410 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
246246
247247 /* Drop frames that do not start/end with a SOI/EOI markers */
248248 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)) {
250250 v4l2_err(&ctx->dev->v4l2_dev,
251251 "dropping invalid JPEG frame %d\n",
252252 ctx->qsequence);
@@ -279,7 +279,7 @@ void coda_fill_bitstream(struct coda_ctx *ctx, bool streaming) · 26 unmodified lines
279279 if (meta) {
280280 meta->sequence = src_buf->sequence;
281281 meta->timecode = src_buf->timecode;
282− meta->timestamp = src_buf->timestamp;
282+ meta->timestamp = src_buf->vb2_buf.timestamp;
283283 meta->start = start;
284284 meta->end = ctx->bitstream_fifo.kfifo.in &
285285 ctx->bitstream_fifo.kfifo.mask;
@@ -1364,7 +1364,7 @@ static void coda_finish_encode(struct coda_ctx *ctx) · 1078 unmodified lines
13641364 dst_buf->flags &= ~V4L2_BUF_FLAG_KEYFRAME;
13651365 }
13661366
1367− dst_buf->timestamp = src_buf->timestamp;
1367+ dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
13681368 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
13691369 dst_buf->flags |=
13701370 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
20402040 dst_buf->flags |= ctx->frame_types[ctx->display_idx];
20412041 meta = &ctx->frame_metas[ctx->display_idx];
20422042 dst_buf->timecode = meta->timecode;
2043− dst_buf->timestamp = meta->timestamp;
2043+ dst_buf->vb2_buf.timestamp = meta->timestamp;
20442044
20452045 trace_coda_dec_rot_done(ctx, dst_buf, meta);
20462046
drivers/media/platform/coda/coda-common.c+12−13
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <linux/slab.h>
2929 #include <linux/videodev2.h>
3030 #include <linux/of.h>
31−#include <linux/platform_data/coda.h>
31+#include <linux/platform_data/media/coda.h>
3232 #include <linux/reset.h>
3333
3434 #include <media/v4l2-ctrls.h>
@@ -131,6 +131,7 @@ static const struct coda_codec coda7_codecs[] = { · 96 unmodified lines
131131 CODA_CODEC(CODA7_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1280, 720),
132132 CODA_CODEC(CODA7_MODE_ENCODE_MJPG, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_JPEG, 8192, 8192),
133133 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),
134135 CODA_CODEC(CODA7_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1920, 1088),
135136 CODA_CODEC(CODA7_MODE_DECODE_MJPG, V4L2_PIX_FMT_JPEG, V4L2_PIX_FMT_YUV420, 8192, 8192),
136137 };
@@ -139,6 +140,7 @@ static const struct coda_codec coda9_codecs[] = { · 2 unmodified lines
139140 CODA_CODEC(CODA9_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 1920, 1088),
140141 CODA_CODEC(CODA9_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1920, 1088),
141142 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),
142144 CODA_CODEC(CODA9_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1920, 1088),
143145 };
144146
@@ -187,6 +189,7 @@ static const struct coda_video_device coda_bit_decoder = { · 42 unmodified lines
187189 .ops = &coda_bit_decode_ops,
188190 .src_formats = {
189191 V4L2_PIX_FMT_H264,
192+ V4L2_PIX_FMT_MPEG2,
190193 V4L2_PIX_FMT_MPEG4,
191194 },
192195 .dst_formats = {
@@ -293,7 +296,8 @@ static void coda_get_max_dimensions(struct coda_dev *dev, · 100 unmodified lines
293296 *max_h = h;
294297 }
295298
296−const struct coda_video_device *to_coda_video_device(struct video_device *vdev)
299+static const struct coda_video_device *to_coda_video_device(struct video_device
300+ *vdev)
297301 {
298302 struct coda_dev *dev = video_get_drvdata(vdev);
299303 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
469473 /* fallthrough */
470474 case V4L2_PIX_FMT_H264:
471475 case V4L2_PIX_FMT_MPEG4:
476+ case V4L2_PIX_FMT_MPEG2:
472477 f->fmt.pix.bytesperline = 0;
473478 f->fmt.pix.sizeimage = coda_estimate_sizeimage(ctx,
474479 f->fmt.pix.sizeimage,
@@ -920,6 +925,7 @@ static const struct v4l2_ioctl_ops coda_ioctl_ops = { · 445 unmodified lines
920925 .vidioc_expbuf = v4l2_m2m_ioctl_expbuf,
921926 .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf,
922927 .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs,
928+ .vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf,
923929
924930 .vidioc_streamon = v4l2_m2m_ioctl_streamon,
925931 .vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
@@ -1131,7 +1137,7 @@ static void set_default_params(struct coda_ctx *ctx) · 205 unmodified lines
11311137 /*
11321138 * Queue operations
11331139 */
1134−static int coda_queue_setup(struct vb2_queue *vq, const void *parg,
1140+static int coda_queue_setup(struct vb2_queue *vq,
11351141 unsigned int *nbuffers, unsigned int *nplanes,
11361142 unsigned int sizes[], void *alloc_ctxs[])
11371143 {
@@ -1250,6 +1256,9 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count) · 112 unmodified lines
12501256 struct vb2_v4l2_buffer *buf;
12511257 int ret = 0;
12521258
1259+ if (count < 1)
1260+ return -EINVAL;
1261+
12531262 q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
12541263 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
12551264 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
12621271 ret = -EINVAL;
12631272 goto err;
12641273 }
1265− } else {
1266− if (count < 1) {
1267− ret = -EINVAL;
1268− goto err;
1269− }
12701274 }
12711275
12721276 ctx->streamon_out = 1;
12731277 } else {
1274− if (count < 1) {
1275− ret = -EINVAL;
1276− goto err;
1277− }
1278−
12791278 ctx->streamon_cap = 1;
12801279 }
12811280
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
178178 return 0;
179179 }
180180
181−bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_v4l2_buffer *vb)
181+bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_buffer *vb)
182182 {
183− void *vaddr = vb2_plane_vaddr(&vb->vb2_buf, 0);
184− u16 soi = be16_to_cpup((__be16 *)vaddr);
185− u16 eoi = be16_to_cpup((__be16 *)(vaddr +
186− vb2_get_plane_payload(&vb->vb2_buf, 0) - 2));
183+ void *vaddr = vb2_plane_vaddr(vb, 0);
184+ u16 soi, eoi;
185+ int len, i;
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+ }
187201
188− return soi == SOI_MARKER && eoi == EOI_MARKER;
202+ return false;
189203 }
190204
191205 /*
drivers/media/platform/coda/coda.h+2−2
@@ -138,7 +138,7 @@ struct coda_buffer_meta { · 137 unmodified lines
138138 struct list_head list;
139139 u32 sequence;
140140 struct v4l2_timecode timecode;
141− struct timeval timestamp;
141+ u64 timestamp;
142142 u32 start;
143143 u32 end;
144144 };
@@ -289,7 +289,7 @@ void coda_m2m_buf_done(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf, · 144 unmodified lines
289289
290290 int coda_h264_padding(int size, char *p);
291291
292−bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_v4l2_buffer *vb);
292+bool coda_jpeg_check_buffer(struct coda_ctx *ctx, struct vb2_buffer *vb);
293293 int coda_jpeg_write_tables(struct coda_ctx *ctx);
294294 void coda_set_jpeg_compression_quality(struct coda_ctx *ctx, int quality);
295295
drivers/media/platform/davinci/Kconfig+6−0
@@ -3,6 +3,7 @@ config VIDEO_DAVINCI_VPIF_DISPLAY · 2 unmodified lines
33 depends on VIDEO_V4L2
44 depends on ARCH_DAVINCI || COMPILE_TEST
55 depends on HAS_DMA
6+ depends on I2C
67 select VIDEOBUF2_DMA_CONTIG
78 select VIDEO_ADV7343 if MEDIA_SUBDRV_AUTOSELECT
89 select VIDEO_THS7303 if MEDIA_SUBDRV_AUTOSELECT
@@ -19,6 +20,7 @@ config VIDEO_DAVINCI_VPIF_CAPTURE · 10 unmodified lines
1920 depends on VIDEO_V4L2
2021 depends on ARCH_DAVINCI || COMPILE_TEST
2122 depends on HAS_DMA
23+ depends on I2C
2224 select VIDEOBUF2_DMA_CONTIG
2325 help
2426 Enables Davinci VPIF module used for capture devices.
@@ -33,6 +35,7 @@ config VIDEO_DM6446_CCDC · 8 unmodified lines
3335 depends on VIDEO_V4L2
3436 depends on ARCH_DAVINCI || COMPILE_TEST
3537 depends on HAS_DMA
38+ depends on I2C
3639 select VIDEOBUF_DMA_CONTIG
3740 help
3841 Enables DaVinci CCD hw module. DaVinci CCDC hw interfaces
@@ -49,6 +52,7 @@ config VIDEO_DM355_CCDC · 10 unmodified lines
4952 depends on VIDEO_V4L2
5053 depends on ARCH_DAVINCI || COMPILE_TEST
5154 depends on HAS_DMA
55+ depends on I2C
5256 select VIDEOBUF_DMA_CONTIG
5357 help
5458 Enables DM355 CCD hw module. DM355 CCDC hw interfaces
@@ -64,6 +68,7 @@ config VIDEO_DM365_ISIF · 9 unmodified lines
6468 tristate "TI DM365 ISIF video capture driver"
6569 depends on VIDEO_V4L2 && ARCH_DAVINCI
6670 depends on HAS_DMA
71+ depends on I2C
6772 select VIDEOBUF_DMA_CONTIG
6873 help
6974 Enables ISIF hw module. This is the hardware module for
@@ -77,6 +82,7 @@ config VIDEO_DAVINCI_VPBE_DISPLAY · 7 unmodified lines
7782 tristate "TI DaVinci VPBE V4L2-Display driver"
7883 depends on VIDEO_V4L2 && ARCH_DAVINCI
7984 depends on HAS_DMA
85+ depends on I2C
8086 select VIDEOBUF2_DMA_CONTIG
8187 help
8288 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
7474 if (layer->cur_frm == layer->next_frm)
7575 return;
7676
77− v4l2_get_timestamp(&layer->cur_frm->vb.timestamp);
77+ layer->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
7878 vb2_buffer_done(&layer->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
7979 /* Make cur_frm pointing to next_frm */
8080 layer->cur_frm = layer->next_frm;
@@ -228,28 +228,27 @@ static int vpbe_buffer_prepare(struct vb2_buffer *vb) · 147 unmodified lines
228228 * This function allocates memory for the buffers
229229 */
230230 static int
231−vpbe_buffer_queue_setup(struct vb2_queue *vq, const void *parg,
231+vpbe_buffer_queue_setup(struct vb2_queue *vq,
232232 unsigned int *nbuffers, unsigned int *nplanes,
233233 unsigned int sizes[], void *alloc_ctxs[])
234234
235235 {
236− const struct v4l2_format *fmt = parg;
237236 /* Get the file handle object and layer object */
238237 struct vpbe_layer *layer = vb2_get_drv_priv(vq);
239238 struct vpbe_device *vpbe_dev = layer->disp_dev->vpbe_dev;
240239
241240 v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev, "vpbe_buffer_setup\n");
242241
243− if (fmt && fmt->fmt.pix.sizeimage < layer->pix_fmt.sizeimage)
244− return -EINVAL;
245−
246242 /* Store number of buffers allocated in numbuffer member */
247243 if (vq->num_buffers + *nbuffers < VPBE_DEFAULT_NUM_BUFS)
248244 *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;
249249
250250 *nplanes = 1;
251− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : layer->pix_fmt.sizeimage;
252− alloc_ctxs[0] = layer->alloc_ctx;
251+ sizes[0] = layer->pix_fmt.sizeimage;
253252
254253 return 0;
255254 }
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
104104 /**
105105 * vpif_buffer_queue_setup : Callback function for buffer setup.
106106 * @vq: vb2_queue ptr
107− * @fmt: v4l2 format
108107 * @nbuffers: ptr to number of buffers requested by application
109108 * @nplanes:: contains number of distinct video planes needed to hold a frame
110109 * @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
114113 * the buffer count and buffer size
115114 */
116115 static int vpif_buffer_queue_setup(struct vb2_queue *vq,
117− const void *parg,
118116 unsigned int *nbuffers, unsigned int *nplanes,
119117 unsigned int sizes[], void *alloc_ctxs[])
120118 {
121− const struct v4l2_format *fmt = parg;
122119 struct channel_obj *ch = vb2_get_drv_priv(vq);
123− struct common_obj *common;
124−
125− common = &ch->common[VPIF_VIDEO_INDEX];
120+ struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
121+ unsigned size = common->fmt.fmt.pix.sizeimage;
126122
127123 vpif_dbg(2, debug, "vpif_buffer_setup\n");
128124
129− if (fmt && fmt->fmt.pix.sizeimage < common->fmt.fmt.pix.sizeimage)
130− return -EINVAL;
125+ if (*nplanes) {
126+ if (sizes[0] < size)
127+ return -EINVAL;
128+ size = sizes[0];
129+ }
131130
132131 if (vq->num_buffers + *nbuffers < 3)
133132 *nbuffers = 3 - vq->num_buffers;
134133
135134 *nplanes = 1;
136− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : common->fmt.fmt.pix.sizeimage;
135+ sizes[0] = size;
137136 alloc_ctxs[0] = common->alloc_ctx;
138137
139138 /* Calculate the offset for Y and C data in the buffer */
@@ -331,7 +330,7 @@ static struct vb2_ops video_qops = { · 191 unmodified lines
331330 */
332331 static void vpif_process_buffer_complete(struct common_obj *common)
333332 {
334− v4l2_get_timestamp(&common->cur_frm->vb.timestamp);
333+ common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
335334 vb2_buffer_done(&common->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
336335 /* Make curFrm pointing to nextFrm */
337336 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
9999 /**
100100 * vpif_buffer_queue_setup : Callback function for buffer setup.
101101 * @vq: vb2_queue ptr
102− * @fmt: v4l2 format
103102 * @nbuffers: ptr to number of buffers requested by application
104103 * @nplanes:: contains number of distinct video planes needed to hold a frame
105104 * @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
109108 * the buffer count and buffer size
110109 */
111110 static int vpif_buffer_queue_setup(struct vb2_queue *vq,
112− const void *parg,
113111 unsigned int *nbuffers, unsigned int *nplanes,
114112 unsigned int sizes[], void *alloc_ctxs[])
115113 {
116− const struct v4l2_format *fmt = parg;
117114 struct channel_obj *ch = vb2_get_drv_priv(vq);
118115 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
116+ unsigned size = common->fmt.fmt.pix.sizeimage;
119117
120− if (fmt && fmt->fmt.pix.sizeimage < common->fmt.fmt.pix.sizeimage)
121− return -EINVAL;
118+ if (*nplanes) {
119+ if (sizes[0] < size)
120+ return -EINVAL;
121+ size = sizes[0];
122+ }
122123
123124 if (vq->num_buffers + *nbuffers < 3)
124125 *nbuffers = 3 - vq->num_buffers;
125126
126127 *nplanes = 1;
127− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : common->fmt.fmt.pix.sizeimage;
128+ sizes[0] = size;
128129 alloc_ctxs[0] = common->alloc_ctx;
129130
130131 /* 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
330331 /* one frame is displayed If next frame is
331332 * available, release cur_frm and move on */
332333 /* Copy frame display time */
333− v4l2_get_timestamp(&common->cur_frm->vb.timestamp);
334+ common->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
334335 /* Change status of the cur_frm */
335336 vb2_buffer_done(&common->cur_frm->vb.vb2_buf,
336337 VB2_BUF_STATE_DONE);
@@ -386,8 +387,8 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id) · 49 unmodified lines
386387 if (!channel_first_int[i][channel_id]) {
387388 /* Mark status of the cur_frm to
388389 * done and unlock semaphore on it */
389− v4l2_get_timestamp(
390− &common->cur_frm->vb.timestamp);
390+ common->cur_frm->vb.vb2_buf.timestamp =
391+ ktime_get_ns();
391392 vb2_buffer_done(&common->cur_frm->vb.vb2_buf,
392393 VB2_BUF_STATE_DONE);
393394 /* 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
8686 dst_vb = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
8787
8888 if (src_vb && dst_vb) {
89− dst_vb->timestamp = src_vb->timestamp;
89+ dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
9090 dst_vb->timecode = src_vb->timecode;
9191 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
9292 dst_vb->flags |=
@@ -125,7 +125,7 @@ static int gsc_get_bufs(struct gsc_ctx *ctx) · 32 unmodified lines
125125 if (ret)
126126 return ret;
127127
128− dst_vb->timestamp = src_vb->timestamp;
128+ dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
129129
130130 return 0;
131131 }
@@ -212,7 +212,6 @@ put_device: · 80 unmodified lines
212212 }
213213
214214 static int gsc_m2m_queue_setup(struct vb2_queue *vq,
215− const void *parg,
216215 unsigned int *num_buffers, unsigned int *num_planes,
217216 unsigned int sizes[], void *allocators[])
218217 {
drivers/media/platform/exynos4-is/common.c+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 */
1111
1212 #include <linux/module.h>
13−#include <media/exynos-fimc.h>
13+#include <media/drv-intf/exynos-fimc.h>
1414 #include "common.h"
1515
1616 /* 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
193193 test_bit(ST_CAPT_RUN, &fimc->state) && deq_buf) {
194194 v_buf = fimc_active_queue_pop(cap);
195195
196− v4l2_get_timestamp(&v_buf->vb.timestamp);
196+ v_buf->vb.vb2_buf.timestamp = ktime_get_ns();
197197 v_buf->vb.sequence = cap->frame_count++;
198198
199199 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
338338
339339 }
340340
341−static int queue_setup(struct vb2_queue *vq, const void *parg,
341+static int queue_setup(struct vb2_queue *vq,
342342 unsigned int *num_buffers, unsigned int *num_planes,
343343 unsigned int sizes[], void *allocators[])
344344 {
345− const struct v4l2_format *pfmt = parg;
346− const struct v4l2_pix_format_mplane *pixm = NULL;
347345 struct fimc_ctx *ctx = vq->drv_priv;
348346 struct fimc_frame *frame = &ctx->d_frame;
349347 struct fimc_fmt *fmt = frame->fmt;
350− unsigned long wh;
348+ unsigned long wh = frame->f_width * frame->f_height;
351349 int i;
352350
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−
362351 if (fmt == NULL)
363352 return -EINVAL;
364353
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+
365365 *num_planes = fmt->memplanes;
366366
367367 for (i = 0; i < fmt->memplanes; i++) {
368368 unsigned int size = (wh * fmt->depth[i]) / 8;
369− if (pixm)
370− sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
371− else if (fimc_fmt_is_user_defined(fmt->color))
369+
370+ if (fimc_fmt_is_user_defined(fmt->color))
372371 sizes[i] = frame->payload[i];
373372 else
374373 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
2727 #include <media/v4l2-device.h>
2828 #include <media/v4l2-mem2mem.h>
2929 #include <media/v4l2-mediabus.h>
30−#include <media/exynos-fimc.h>
30+#include <media/drv-intf/exynos-fimc.h>
3131
3232 #define dbg(fmt, args...) \
3333 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
3030 #include <media/v4l2-ioctl.h>
3131 #include <media/videobuf2-v4l2.h>
3232 #include <media/videobuf2-dma-contig.h>
33−#include <media/exynos-fimc.h>
33+#include <media/drv-intf/exynos-fimc.h>
3434
3535 #include "common.h"
3636 #include "media-dev.h"
@@ -39,39 +39,36 @@ · 2 unmodified lines
3939 #include "fimc-is-param.h"
4040
4141 static int isp_video_capture_queue_setup(struct vb2_queue *vq,
42− const void *parg,
4342 unsigned int *num_buffers, unsigned int *num_planes,
4443 unsigned int sizes[], void *allocators[])
4544 {
46− const struct v4l2_format *pfmt = parg;
4745 struct fimc_isp *isp = vb2_get_drv_priv(vq);
4846 struct v4l2_pix_format_mplane *vid_fmt = &isp->video_capture.pixfmt;
49− const struct v4l2_pix_format_mplane *pixm = NULL;
50− const struct fimc_fmt *fmt;
47+ const struct fimc_fmt *fmt = isp->video_capture.format;
5148 unsigned int wh, i;
5249
53− if (pfmt) {
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− }
50+ wh = vid_fmt->width * vid_fmt->height;
6151
6252 if (fmt == NULL)
6353 return -EINVAL;
6454
6555 *num_buffers = clamp_t(u32, *num_buffers, FIMC_ISP_REQ_BUFS_MIN,
6656 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+
6768 *num_planes = fmt->memplanes;
6869
6970 for (i = 0; i < fmt->memplanes; i++) {
70− unsigned int size = (wh * fmt->depth[i]) / 8;
71− if (pixm)
72− sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
73− else
74− sizes[i] = size;
71+ sizes[i] = (wh * fmt->depth[i]) / 8;
7572 allocators[i] = isp->alloc_ctx;
7673 }
7774
@@ -254,7 +251,7 @@ void fimc_isp_video_irq_handler(struct fimc_is *is) · 176 unmodified lines
254251 buf_index = (is->i2h_cmd.args[1] - 1) % video->buf_count;
255252 vbuf = &video->buffers[buf_index]->vb;
256253
257− v4l2_get_timestamp(&vbuf->timestamp);
254+ vbuf->vb2_buf.timestamp = ktime_get_ns();
258255 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
259256
260257 video->buf_mask &= ~BIT(buf_index);
drivers/media/platform/exynos4-is/fimc-isp.h+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include <media/videobuf2-v4l2.h>
2525 #include <media/v4l2-device.h>
2626 #include <media/v4l2-mediabus.h>
27−#include <media/exynos-fimc.h>
27+#include <media/drv-intf/exynos-fimc.h>
2828
2929 extern int fimc_isp_debug;
3030
drivers/media/platform/exynos4-is/fimc-lite-reg.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/bitops.h>
1313 #include <linux/delay.h>
1414 #include <linux/io.h>
15−#include <media/exynos-fimc.h>
15+#include <media/drv-intf/exynos-fimc.h>
1616
1717 #include "fimc-lite-reg.h"
1818 #include "fimc-lite.h"
drivers/media/platform/exynos4-is/fimc-lite.c+16−19
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <media/v4l2-mem2mem.h>
3131 #include <media/videobuf2-v4l2.h>
3232 #include <media/videobuf2-dma-contig.h>
33−#include <media/exynos-fimc.h>
33+#include <media/drv-intf/exynos-fimc.h>
3434
3535 #include "common.h"
3636 #include "fimc-core.h"
@@ -292,7 +292,7 @@ static irqreturn_t flite_irq_handler(int irq, void *priv) · 255 unmodified lines
292292 test_bit(ST_FLITE_RUN, &fimc->state) &&
293293 !list_empty(&fimc->active_buf_q)) {
294294 vbuf = fimc_lite_active_queue_pop(fimc);
295− v4l2_get_timestamp(&vbuf->vb.timestamp);
295+ vbuf->vb.vb2_buf.timestamp = ktime_get_ns();
296296 vbuf->vb.sequence = fimc->frame_count++;
297297 flite_hw_mask_dma_buffer(fimc, vbuf->index);
298298 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
355355 fimc_lite_stop_capture(fimc, false);
356356 }
357357
358−static int queue_setup(struct vb2_queue *vq, const void *parg,
358+static int queue_setup(struct vb2_queue *vq,
359359 unsigned int *num_buffers, unsigned int *num_planes,
360360 unsigned int sizes[], void *allocators[])
361361 {
362− const struct v4l2_format *pfmt = parg;
363− const struct v4l2_pix_format_mplane *pixm = NULL;
364362 struct fimc_lite *fimc = vq->drv_priv;
365363 struct flite_frame *frame = &fimc->out_frame;
366364 const struct fimc_fmt *fmt = frame->fmt;
367− unsigned long wh;
365+ unsigned long wh = frame->f_width * frame->f_height;
368366 int i;
369367
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−
378368 if (fmt == NULL)
379369 return -EINVAL;
380370
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+
381382 *num_planes = fmt->memplanes;
382383
383384 for (i = 0; i < fmt->memplanes; i++) {
384− unsigned int size = (wh * fmt->depth[i]) / 8;
385− if (pixm)
386− sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
387− else
388− sizes[i] = size;
385+ sizes[i] = (wh * fmt->depth[i]) / 8;
389386 allocators[i] = fimc->alloc_ctx;
390387 }
391388
drivers/media/platform/exynos4-is/fimc-lite.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include <media/v4l2-ctrls.h>
2424 #include <media/v4l2-device.h>
2525 #include <media/v4l2-mediabus.h>
26−#include <media/exynos-fimc.h>
26+#include <media/drv-intf/exynos-fimc.h>
2727
2828 #define FIMC_LITE_DRV_NAME "exynos-fimc-lite"
2929 #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
132132 if (ret)
133133 goto dma_unlock;
134134
135− dst_vb->timestamp = src_vb->timestamp;
135+ dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
136136 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
137137 dst_vb->flags |=
138138 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
@@ -176,7 +176,7 @@ static void fimc_job_abort(void *priv) · 37 unmodified lines
176176 fimc_m2m_shutdown(priv);
177177 }
178178
179−static int fimc_queue_setup(struct vb2_queue *vq, const void *parg,
179+static int fimc_queue_setup(struct vb2_queue *vq,
180180 unsigned int *num_buffers, unsigned int *num_planes,
181181 unsigned int sizes[], void *allocators[])
182182 {
drivers/media/platform/exynos4-is/fimc-reg.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <linux/io.h>
1414 #include <linux/regmap.h>
1515
16−#include <media/exynos-fimc.h>
16+#include <media/drv-intf/exynos-fimc.h>
1717 #include "media-dev.h"
1818
1919 #include "fimc-reg.h"
drivers/media/platform/exynos4-is/media-dev.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <media/v4l2-ctrls.h>
3232 #include <media/v4l2-of.h>
3333 #include <media/media-device.h>
34−#include <media/exynos-fimc.h>
34+#include <media/drv-intf/exynos-fimc.h>
3535
3636 #include "media-dev.h"
3737 #include "fimc-core.h"
drivers/media/platform/exynos4-is/media-dev.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <media/media-entity.h>
2020 #include <media/v4l2-device.h>
2121 #include <media/v4l2-subdev.h>
22−#include <media/exynos-fimc.h>
22+#include <media/drv-intf/exynos-fimc.h>
2323
2424 #include "fimc-core.h"
2525 #include "fimc-lite.h"
drivers/media/platform/exynos4-is/mipi-csis.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include <linux/slab.h>
3030 #include <linux/spinlock.h>
3131 #include <linux/videodev2.h>
32−#include <media/exynos-fimc.h>
32+#include <media/drv-intf/exynos-fimc.h>
3333 #include <media/v4l2-of.h>
3434 #include <media/v4l2-subdev.h>
3535
drivers/media/platform/m2m-deinterlace.c+1−2
@@ -207,7 +207,7 @@ static void dma_callback(void *data) · 206 unmodified lines
207207 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);
208208 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);
209209
210− dst_vb->timestamp = src_vb->timestamp;
210+ dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
211211 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
212212 dst_vb->flags |=
213213 src_vb->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
@@ -798,7 +798,6 @@ struct vb2_dc_conf { · 584 unmodified lines
798798 };
799799
800800 static int deinterlace_queue_setup(struct vb2_queue *vq,
801− const void *parg,
802801 unsigned int *nbuffers, unsigned int *nplanes,
803802 unsigned int sizes[], void *alloc_ctxs[])
804803 {
drivers/media/platform/marvell-ccic/mcam-core.c+9−8
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include <media/v4l2-ioctl.h>
2626 #include <media/v4l2-ctrls.h>
2727 #include <media/v4l2-event.h>
28−#include <media/ov7670.h>
28+#include <media/i2c/ov7670.h>
2929 #include <media/videobuf2-vmalloc.h>
3030 #include <media/videobuf2-dma-contig.h>
3131 #include <media/videobuf2-dma-sg.h>
@@ -226,7 +226,7 @@ static void mcam_buffer_done(struct mcam_camera *cam, int frame, · 194 unmodified lines
226226 vbuf->vb2_buf.planes[0].bytesused = cam->pix_format.sizeimage;
227227 vbuf->sequence = cam->buf_seq[frame];
228228 vbuf->field = V4L2_FIELD_NONE;
229− v4l2_get_timestamp(&vbuf->timestamp);
229+ vbuf->vb2_buf.timestamp = ktime_get_ns();
230230 vb2_set_plane_payload(&vbuf->vb2_buf, 0, cam->pix_format.sizeimage);
231231 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
232232 }
@@ -1049,24 +1049,25 @@ static int mcam_read_setup(struct mcam_camera *cam) · 816 unmodified lines
10491049 */
10501050
10511051 static int mcam_vb_queue_setup(struct vb2_queue *vq,
1052− const void *parg, unsigned int *nbufs,
1052+ unsigned int *nbufs,
10531053 unsigned int *num_planes, unsigned int sizes[],
10541054 void *alloc_ctxs[])
10551055 {
1056− const struct v4l2_format *fmt = parg;
10571056 struct mcam_camera *cam = vb2_get_drv_priv(vq);
10581057 int minbufs = (cam->buffer_mode == B_DMA_contig) ? 3 : 2;
1058+ unsigned size = cam->pix_format.sizeimage;
10591059
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... */
10641060 if (*nbufs < minbufs)
10651061 *nbufs = minbufs;
10661062 if (cam->buffer_mode == B_DMA_contig)
10671063 alloc_ctxs[0] = cam->vb_alloc_ctx;
10681064 else if (cam->buffer_mode == B_DMA_sg)
10691065 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... */
10701071 return 0;
10711072 }
10721073
drivers/media/platform/marvell-ccic/mmp-driver.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 #include <linux/slab.h>
1919 #include <linux/videodev2.h>
2020 #include <media/v4l2-device.h>
21−#include <media/mmp-camera.h>
21+#include <linux/platform_data/media/mmp-camera.h>
2222 #include <linux/device.h>
2323 #include <linux/platform_device.h>
2424 #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
375375 src_vb = v4l2_m2m_src_buf_remove(curr_ctx->m2m_ctx);
376376 dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->m2m_ctx);
377377
378− dst_vb->timestamp = src_vb->timestamp;
378+ dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
379379 dst_vb->flags &=
380380 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
381381 dst_vb->flags |=
@@ -689,7 +689,6 @@ static const struct v4l2_ioctl_ops emmaprp_ioctl_ops = { · 307 unmodified lines
689689 * Queue operations
690690 */
691691 static int emmaprp_queue_setup(struct vb2_queue *vq,
692− const void *parg,
693692 unsigned int *nbuffers, unsigned int *nplanes,
694693 unsigned int sizes[], void *alloc_ctxs[])
695694 {
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
7979 int j;
8080
8181 for (j = 0; j < VRFB_NUM_BUFS; j++) {
82− omap_vout_free_buffer(vout->smsshado_virt_addr[j],
83− vout->smsshado_size);
84− vout->smsshado_virt_addr[j] = 0;
85− vout->smsshado_phy_addr[j] = 0;
82+ if (vout->smsshado_virt_addr[j]) {
83+ omap_vout_free_buffer(vout->smsshado_virt_addr[j],
84+ vout->smsshado_size);
85+ vout->smsshado_virt_addr[j] = 0;
86+ vout->smsshado_phy_addr[j] = 0;
87+ }
8688 }
8789 }
8890
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
320320 */
321321
322322 static int isp_video_queue_setup(struct vb2_queue *queue,
323− const void *parg,
324323 unsigned int *count, unsigned int *num_planes,
325324 unsigned int sizes[], void *alloc_ctxs[])
326325 {
@@ -467,7 +466,7 @@ struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video) · 140 unmodified lines
467466 list_del(&buf->irqlist);
468467 spin_unlock_irqrestore(&video->irqlock, flags);
469468
470− v4l2_get_timestamp(&buf->vb.timestamp);
469+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
471470
472471 /* Do frame number propagation only if this is the output video node.
473472 * 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
10151015 * ============================================================================
10161016 */
10171017 static int jpu_queue_setup(struct vb2_queue *vq,
1018− const void *parg,
10191018 unsigned int *nbuffers, unsigned int *nplanes,
10201019 unsigned int sizes[], void *alloc_ctxs[])
10211020 {
1022− const struct v4l2_format *fmt = parg;
10231021 struct jpu_ctx *ctx = vb2_get_drv_priv(vq);
10241022 struct jpu_q_data *q_data;
10251023 unsigned int i;
10261024
10271025 q_data = jpu_get_q_data(ctx, vq->type);
10281026
1029− *nplanes = q_data->format.num_planes;
1027+ if (*nplanes) {
1028+ if (*nplanes != q_data->format.num_planes)
1029+ return -EINVAL;
10301030
1031− for (i = 0; i < *nplanes; i++) {
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;
1031+ for (i = 0; i < *nplanes; i++) {
1032+ unsigned int q_size = q_data->format.plane_fmt[i].sizeimage;
10351033
1036− if (fmt && f_size < q_size)
1037− return -EINVAL;
1034+ if (sizes[i] < q_size)
1035+ return -EINVAL;
1036+ alloc_ctxs[i] = ctx->jpu->alloc_ctx;
1037+ }
1038+ return 0;
1039+ }
10381040
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;
10401045 alloc_ctxs[i] = ctx->jpu->alloc_ctx;
10411046 }
10421047
@@ -1300,17 +1305,17 @@ static int jpu_release(struct file *file) · 257 unmodified lines
13001305 struct jpu *jpu = video_drvdata(file);
13011306 struct jpu_ctx *ctx = fh_to_ctx(file->private_data);
13021307
1303− mutex_lock(&jpu->mutex);
1304− if (--jpu->ref_count == 0)
1305− clk_disable_unprepare(jpu->clk);
1306− mutex_unlock(&jpu->mutex);
1307−
13081308 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
13091309 v4l2_ctrl_handler_free(&ctx->ctrl_handler);
13101310 v4l2_fh_del(&ctx->fh);
13111311 v4l2_fh_exit(&ctx->fh);
13121312 kfree(ctx);
13131313
1314+ mutex_lock(&jpu->mutex);
1315+ if (--jpu->ref_count == 0)
1316+ clk_disable_unprepare(jpu->clk);
1317+ mutex_unlock(&jpu->mutex);
1318+
13141319 return 0;
13151320 }
13161321
@@ -1560,12 +1565,9 @@ static irqreturn_t jpu_irq_handler(int irq, void *dev_id) · 243 unmodified lines
15601565 }
15611566
15621567 dst_buf->field = src_buf->field;
1563− dst_buf->timestamp = src_buf->timestamp;
1568+ dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
15641569 if (src_buf->flags & V4L2_BUF_FLAG_TIMECODE)
15651570 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;
15691571 dst_buf->flags = src_buf->flags &
15701572 (V4L2_BUF_FLAG_TIMECODE | V4L2_BUF_FLAG_KEYFRAME |
15711573 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
338338
339339 if (!WARN_ON(vbuf == NULL)) {
340340 /* Dequeue a filled buffer */
341− v4l2_get_timestamp(&vbuf->vb.timestamp);
341+ vbuf->vb.vb2_buf.timestamp = ktime_get_ns();
342342 vbuf->vb.sequence = vp->frame_sequence++;
343343 vb2_buffer_done(&vbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
344344
@@ -435,39 +435,28 @@ static void stop_streaming(struct vb2_queue *vq) · 90 unmodified lines
435435 camif_stop_capture(vp);
436436 }
437437
438−static int queue_setup(struct vb2_queue *vq, const void *parg,
438+static int queue_setup(struct vb2_queue *vq,
439439 unsigned int *num_buffers, unsigned int *num_planes,
440440 unsigned int sizes[], void *allocators[])
441441 {
442− const struct v4l2_format *pfmt = parg;
443− const struct v4l2_pix_format *pix = NULL;
444442 struct camif_vp *vp = vb2_get_drv_priv(vq);
445443 struct camif_dev *camif = vp->camif;
446444 struct camif_frame *frame = &vp->out_frame;
447− const struct camif_fmt *fmt;
445+ const struct camif_fmt *fmt = vp->out_fmt;
448446 unsigned int size;
449447
450− if (pfmt) {
451− pix = &pfmt->fmt.pix;
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;
448+ if (fmt == NULL)
449+ return -EINVAL;
464450
465− if (pix)
466− sizes[0] = max(size, pix->sizeimage);
467− else
468− sizes[0] = size;
451+ size = (frame->f_width * frame->f_height * fmt->depth) / 8;
469452 allocators[0] = camif->alloc_ctx;
470453
454+ if (*num_planes)
455+ return sizes[0] < size ? -EINVAL : 0;
456+
457+ *num_planes = 1;
458+ sizes[0] = size;
459+
471460 pr_debug("size: %u\n", sizes[0]);
472461 return 0;
473462 }
drivers/media/platform/s3c-camif/camif-core.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <media/v4l2-device.h>
2727 #include <media/v4l2-mediabus.h>
2828 #include <media/videobuf2-v4l2.h>
29−#include <media/s3c_camif.h>
29+#include <media/drv-intf/s3c_camif.h>
3030
3131 #define S3C_CAMIF_DRIVER_NAME "s3c-camif"
3232 #define CAMIF_REQ_BUFS_MIN 3
drivers/media/platform/s3c-camif/camif-regs.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #define CAMIF_REGS_H_
1414
1515 #include "camif-core.h"
16−#include <media/s3c_camif.h>
16+#include <media/drv-intf/s3c_camif.h>
1717
1818 /*
1919 * 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
101101 }
102102 }
103103
104−static int g2d_queue_setup(struct vb2_queue *vq, const void *parg,
104+static int g2d_queue_setup(struct vb2_queue *vq,
105105 unsigned int *nbuffers, unsigned int *nplanes,
106106 unsigned int sizes[], void *alloc_ctxs[])
107107 {
@@ -552,7 +552,7 @@ static irqreturn_t g2d_isr(int irq, void *prv) · 444 unmodified lines
552552 BUG_ON(dst == NULL);
553553
554554 dst->timecode = src->timecode;
555− dst->timestamp = src->timestamp;
555+ dst->vb2_buf.timestamp = src->vb2_buf.timestamp;
556556 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
557557 dst->flags |=
558558 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
24302430 */
24312431
24322432 static int s5p_jpeg_queue_setup(struct vb2_queue *vq,
2433− const void *parg,
24342433 unsigned int *nbuffers, unsigned int *nplanes,
24352434 unsigned int sizes[], void *alloc_ctxs[])
24362435 {
@@ -2621,7 +2620,7 @@ static irqreturn_t s5p_jpeg_irq(int irq, void *dev_id) · 184 unmodified lines
26212620 }
26222621
26232622 dst_buf->timecode = src_buf->timecode;
2624− dst_buf->timestamp = src_buf->timestamp;
2623+ dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
26252624 dst_buf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
26262625 dst_buf->flags |=
26272626 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
27522751 dst_buf = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx);
27532752
27542753 dst_buf->timecode = src_buf->timecode;
2755− dst_buf->timestamp = src_buf->timestamp;
2754+ dst_buf->vb2_buf.timestamp = src_buf->vb2_buf.timestamp;
27562755
27572756 v4l2_m2m_buf_done(src_buf, state);
27582757 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
8585 spin_unlock_irqrestore(&dev->condlock, flags);
8686 }
8787
88+int 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+
88108 /* Wake up context wait_queue */
89109 static void wake_up_ctx(struct s5p_mfc_ctx *ctx, unsigned int reason,
90110 unsigned int err)
@@ -105,6 +125,20 @@ static void wake_up_dev(struct s5p_mfc_dev *dev, unsigned int reason, · 14 unmodified lines
105125 wake_up(&dev->queue);
106126 }
107127
128+void 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+
108142 static void s5p_mfc_watchdog(unsigned long arg)
109143 {
110144 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
150184 if (!ctx)
151185 continue;
152186 ctx->state = MFCINST_ERROR;
153− s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
154− &ctx->dst_queue, &ctx->vq_dst);
155− s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
156− &ctx->src_queue, &ctx->vq_src);
187+ s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
188+ s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
157189 clear_work_bit(ctx);
158190 wake_up_ctx(ctx, S5P_MFC_R2H_CMD_ERR_RET, 0);
159191 }
@@ -233,8 +265,8 @@ static void s5p_mfc_handle_frame_copy_time(struct s5p_mfc_ctx *ctx) · 73 unmodified lines
233265 == dec_y_addr) {
234266 dst_buf->b->timecode =
235267 src_buf->b->timecode;
236− dst_buf->b->timestamp =
237− src_buf->b->timestamp;
268+ dst_buf->b->vb2_buf.timestamp =
269+ src_buf->b->vb2_buf.timestamp;
238270 dst_buf->b->flags &=
239271 ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
240272 dst_buf->b->flags |=
@@ -327,7 +359,6 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx, · 86 unmodified lines
327359 unsigned int dst_frame_status;
328360 unsigned int dec_frame_status;
329361 struct s5p_mfc_buf *src_buf;
330− unsigned long flags;
331362 unsigned int res_change;
332363
333364 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
343374 if (res_change == S5P_FIMV_RES_INCREASE ||
344375 res_change == S5P_FIMV_RES_DECREASE) {
345376 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);
347378 wake_up_ctx(ctx, reason, err);
348379 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
349380 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);
351382 return;
352383 }
353384 if (ctx->dpb_flush_flag)
354385 ctx->dpb_flush_flag = 0;
355386
356− spin_lock_irqsave(&dev->irqlock, flags);
357387 /* All frames remaining in the buffer have been extracted */
358388 if (dst_frame_status == S5P_FIMV_DEC_STATUS_DECODING_EMPTY) {
359389 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
413443 }
414444 }
415445 leave_handle_frame:
416− spin_unlock_irqrestore(&dev->irqlock, flags);
417446 if ((ctx->src_queue_cnt == 0 && ctx->state != MFCINST_FINISHING)
418447 || ctx->dst_queue_cnt < ctx->pb_count)
419448 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);
421450 wake_up_ctx(ctx, reason, err);
422451 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
423452 s5p_mfc_clock_off();
@@ -425,15 +454,13 @@ leave_handle_frame: · 1 unmodified line
425454 if (test_bit(0, &dev->enter_suspend))
426455 wake_up_dev(dev, reason, err);
427456 else
428− s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev);
457+ s5p_mfc_hw_call(dev->mfc_ops, try_run, dev);
429458 }
430459
431460 /* Error handling for interrupt */
432461 static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev,
433462 struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err)
434463 {
435− unsigned long flags;
436−
437464 mfc_err("Interrupt Error: %08x\n", err);
438465
439466 if (ctx != NULL) {
@@ -450,13 +477,9 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, · 10 unmodified lines
450477 clear_work_bit(ctx);
451478 ctx->state = MFCINST_ERROR;
452479 /* Mark all dst buffers as having an error */
453− spin_lock_irqsave(&dev->irqlock, flags);
454− s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
455− &ctx->dst_queue, &ctx->vq_dst);
480+ s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
456481 /* Mark all src buffers as having an error */
457− s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
458− &ctx->src_queue, &ctx->vq_src);
459− spin_unlock_irqrestore(&dev->irqlock, flags);
482+ s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
460483 wake_up_ctx(ctx, reason, err);
461484 break;
462485 default:
@@ -467,7 +490,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, · 4 unmodified lines
467490 }
468491 }
469492 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);
471494 s5p_mfc_clock_off();
472495 wake_up_dev(dev, reason, err);
473496 return;
@@ -491,7 +514,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx, · 17 unmodified lines
491514 ctx->img_height = s5p_mfc_hw_call(dev->mfc_ops, get_img_height,
492515 dev);
493516
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);
495518
496519 ctx->pb_count = s5p_mfc_hw_call(dev->mfc_ops, get_dpb_count,
497520 dev);
@@ -518,11 +541,11 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx, · 20 unmodified lines
518541 ctx->head_processed = 1;
519542 }
520543 }
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);
522545 clear_work_bit(ctx);
523546 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
524547 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);
526549 wake_up_ctx(ctx, reason, err);
527550 }
528551
@@ -532,12 +555,11 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 3 unmodified lines
532555 {
533556 struct s5p_mfc_buf *src_buf;
534557 struct s5p_mfc_dev *dev;
535− unsigned long flags;
536558
537559 if (ctx == NULL)
538560 return;
539561 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);
541563 ctx->int_type = reason;
542564 ctx->int_err = err;
543565 ctx->int_cond = 1;
@@ -545,7 +567,6 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 1 unmodified line
545567 if (err == 0) {
546568 ctx->state = MFCINST_RUNNING;
547569 if (!ctx->dpb_flush_flag && ctx->head_processed) {
548− spin_lock_irqsave(&dev->irqlock, flags);
549570 if (!list_empty(&ctx->src_queue)) {
550571 src_buf = list_entry(ctx->src_queue.next,
551572 struct s5p_mfc_buf, list);
@@ -554,7 +575,6 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 2 unmodified lines
554575 vb2_buffer_done(&src_buf->b->vb2_buf,
555576 VB2_BUF_STATE_DONE);
556577 }
557− spin_unlock_irqrestore(&dev->irqlock, flags);
558578 } else {
559579 ctx->dpb_flush_flag = 0;
560580 }
@@ -563,7 +583,7 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, · 2 unmodified lines
563583 s5p_mfc_clock_off();
564584
565585 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);
567587 } else {
568588 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
569589
@@ -582,7 +602,6 @@ static void s5p_mfc_handle_stream_complete(struct s5p_mfc_ctx *ctx) · 12 unmodified lines
582602
583603 ctx->state = MFCINST_FINISHED;
584604
585− spin_lock(&dev->irqlock);
586605 if (!list_empty(&ctx->dst_queue)) {
587606 mb_entry = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf,
588607 list);
@@ -591,7 +610,6 @@ static void s5p_mfc_handle_stream_complete(struct s5p_mfc_ctx *ctx) · 2 unmodified lines
591610 vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, 0);
592611 vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE);
593612 }
594− spin_unlock(&dev->irqlock);
595613
596614 clear_work_bit(ctx);
597615
@@ -599,7 +617,7 @@ static void s5p_mfc_handle_stream_complete(struct s5p_mfc_ctx *ctx) · 1 unmodified line
599617
600618 s5p_mfc_clock_off();
601619 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);
603621 }
604622
605623 /* Interrupt processing */
@@ -613,6 +631,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 7 unmodified lines
613631 mfc_debug_enter();
614632 /* Reset the timeout watchdog */
615633 atomic_set(&dev->watchdog_cnt, 0);
634+ spin_lock(&dev->irqlock);
616635 ctx = dev->ctx[dev->curr_ctx];
617636 /* Get the reason of interrupt and the error code */
618637 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
639658
640659 if (ctx->state == MFCINST_FINISHING &&
641660 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);
643662 s5p_mfc_handle_stream_complete(ctx);
644663 break;
645664 }
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);
647666 wake_up_ctx(ctx, reason, err);
648667 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0);
649668 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);
651670 } else {
652671 s5p_mfc_handle_frame(ctx, reason, err);
653672 }
@@ -677,7 +696,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 23 unmodified lines
677696 case S5P_MFC_R2H_CMD_WAKEUP_RET:
678697 if (ctx)
679698 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);
681700 wake_up_dev(dev, reason, err);
682701 clear_bit(0, &dev->hw_lock);
683702 clear_bit(0, &dev->enter_suspend);
@@ -688,7 +707,7 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 4 unmodified lines
688707 break;
689708
690709 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);
692711 ctx->int_type = reason;
693712 ctx->int_err = err;
694713 s5p_mfc_handle_stream_complete(ctx);
@@ -702,12 +721,13 @@ static irqreturn_t s5p_mfc_irq(int irq, void *priv) · 7 unmodified lines
702721
703722 default:
704723 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);
706725 }
726+ spin_unlock(&dev->irqlock);
707727 mfc_debug_leave();
708728 return IRQ_HANDLED;
709729 irq_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);
711731 ctx->int_type = reason;
712732 ctx->int_err = err;
713733 ctx->int_cond = 1;
@@ -716,7 +736,8 @@ irq_cleanup_hw: · 2 unmodified lines
716736
717737 s5p_mfc_clock_off();
718738
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);
720741 mfc_debug(2, "Exit via irq_cleanup_hw\n");
721742 return IRQ_HANDLED;
722743 }
drivers/media/platform/s5p-mfc/s5p_mfc_common.h+5−9
@@ -308,7 +308,7 @@ struct s5p_mfc_dev { · 307 unmodified lines
308308 struct s5p_mfc_pm pm;
309309 struct s5p_mfc_variant *variant;
310310 int num_inst;
311− spinlock_t irqlock; /* lock when operating on videobuf2 queues */
311+ spinlock_t irqlock; /* lock when operating on context */
312312 spinlock_t condlock; /* lock when changing/checking if a context is
313313 ready to be processed */
314314 struct mutex mfc_mutex; /* video_device lock */
@@ -653,7 +653,7 @@ struct s5p_mfc_ctx { · 338 unmodified lines
653653 unsigned int bits;
654654 } slice_size;
655655
656− struct s5p_mfc_codec_ops *c_ops;
656+ const struct s5p_mfc_codec_ops *c_ops;
657657
658658 struct v4l2_ctrl *ctrls[MFC_MAX_CTRLS];
659659 struct v4l2_ctrl_handler ctrl_handler;
@@ -694,13 +694,7 @@ struct mfc_control { · 34 unmodified lines
694694
695695 /* Macro for making hardware specific calls */
696696 #define s5p_mfc_hw_call(f, op, args...) \
697− ((f && f->op) ? f->op(args) : -ENODEV)
698−
699−#define s5p_mfc_hw_call_void(f, op, args...) \
700−do { \
701− if (f && f->op) \
702− f->op(args); \
703−} while (0)
697+ ((f && f->op) ? f->op(args) : (typeof(f->op(args)))(-ENODEV))
704698
705699 #define fh_to_ctx(__fh) container_of(__fh, struct s5p_mfc_ctx, fh)
706700 #define ctrl_to_ctx(__ctrl) \
@@ -710,6 +704,8 @@ void clear_work_bit(struct s5p_mfc_ctx *ctx); · 3 unmodified lines
710704 void set_work_bit(struct s5p_mfc_ctx *ctx);
711705 void clear_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
712706 void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
707+int s5p_mfc_get_new_ctx(struct s5p_mfc_dev *dev);
708+void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq);
713709
714710 #define HAS_PORTNUM(dev) (dev ? (dev->variant ? \
715711 (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
319319 s5p_mfc_clock_on();
320320
321321 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);
323323
324324 s5p_mfc_clock_off();
325325 }
@@ -468,7 +468,7 @@ int s5p_mfc_open_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) · 142 unmodified lines
468468 }
469469
470470 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);
472472 if (s5p_mfc_wait_for_done_ctx(ctx,
473473 S5P_MFC_R2H_CMD_OPEN_INSTANCE_RET, 0)) {
474474 /* 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
482482
483483 err_free_desc_buf:
484484 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);
486486 err_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);
488488 err:
489489 return ret;
490490 }
@@ -493,17 +493,17 @@ void s5p_mfc_close_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) · 2 unmodified lines
493493 {
494494 ctx->state = MFCINST_RETURN_INST;
495495 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);
497497 /* Wait until instance is returned or timeout occurred */
498498 if (s5p_mfc_wait_for_done_ctx(ctx,
499499 S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0))
500500 mfc_err("Err returning instance\n");
501501
502502 /* Free resources */
503− s5p_mfc_hw_call_void(dev->mfc_ops, release_codec_buffers, ctx);
504− s5p_mfc_hw_call_void(dev->mfc_ops, release_instance_buffer, ctx);
503+ s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers, ctx);
504+ s5p_mfc_hw_call(dev->mfc_ops, release_instance_buffer, ctx);
505505 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);
507507
508508 ctx->inst_no = MFC_NO_INSTANCE_SET;
509509 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
252252 return 0;
253253 }
254254
255−static struct s5p_mfc_codec_ops decoder_codec_ops = {
255+static const struct s5p_mfc_codec_ops decoder_codec_ops = {
256256 .pre_seq_start = NULL,
257257 .post_seq_start = NULL,
258258 .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
523523 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs);
524524 if (ret)
525525 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);
527527 ctx->dst_bufs_cnt = 0;
528528 } else if (ctx->capture_state == QUEUE_FREE) {
529529 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
551551
552552 if (s5p_mfc_ctx_ready(ctx))
553553 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);
555555 s5p_mfc_wait_for_done_ctx(ctx, S5P_MFC_R2H_CMD_INIT_BUFFERS_RET,
556556 0);
557557 } else {
@@ -831,7 +831,7 @@ static int vidioc_decoder_cmd(struct file *file, void *priv, · 273 unmodified lines
831831 if (s5p_mfc_ctx_ready(ctx))
832832 set_work_bit_irqsave(ctx);
833833 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);
835835 } else {
836836 mfc_err("EOS: marking last buffer of stream");
837837 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
888888 };
889889
890890 static int s5p_mfc_queue_setup(struct vb2_queue *vq,
891− const void *parg, unsigned int *buf_count,
891+ unsigned int *buf_count,
892892 unsigned int *plane_count, unsigned int psize[],
893893 void *allocators[])
894894 {
@@ -1012,7 +1012,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count) · 117 unmodified lines
10121012 /* If context is ready then dev = work->data;schedule it to run */
10131013 if (s5p_mfc_ctx_ready(ctx))
10141014 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);
10161016 return 0;
10171017 }
10181018
@@ -1023,42 +1023,41 @@ static void s5p_mfc_stop_streaming(struct vb2_queue *q) · 4 unmodified lines
10231023 struct s5p_mfc_dev *dev = ctx->dev;
10241024 int aborted = 0;
10251025
1026+ spin_lock_irqsave(&dev->irqlock, flags);
10261027 if ((ctx->state == MFCINST_FINISHING ||
10271028 ctx->state == MFCINST_RUNNING) &&
10281029 dev->curr_ctx == ctx->num && dev->hw_lock) {
10291030 ctx->state = MFCINST_ABORT;
1031+ spin_unlock_irqrestore(&dev->irqlock, flags);
10301032 s5p_mfc_wait_for_done_ctx(ctx,
10311033 S5P_MFC_R2H_CMD_FRAME_DONE_RET, 0);
10321034 aborted = 1;
1035+ spin_lock_irqsave(&dev->irqlock, flags);
10331036 }
10341037 if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
1035− spin_lock_irqsave(&dev->irqlock, flags);
1036− s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
1037− &ctx->dst_queue, &ctx->vq_dst);
1038+ s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
10381039 INIT_LIST_HEAD(&ctx->dst_queue);
10391040 ctx->dst_queue_cnt = 0;
10401041 ctx->dpb_flush_flag = 1;
10411042 ctx->dec_dst_flag = 0;
1042− spin_unlock_irqrestore(&dev->irqlock, flags);
10431043 if (IS_MFCV6_PLUS(dev) && (ctx->state == MFCINST_RUNNING)) {
10441044 ctx->state = MFCINST_FLUSH;
10451045 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);
10471048 if (s5p_mfc_wait_for_done_ctx(ctx,
10481049 S5P_MFC_R2H_CMD_DPB_FLUSH_RET, 0))
10491050 mfc_err("Err flushing buffers\n");
1051+ spin_lock_irqsave(&dev->irqlock, flags);
10501052 }
1051− }
1052− if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
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);
1053+ } else if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
1054+ s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
10561055 INIT_LIST_HEAD(&ctx->src_queue);
10571056 ctx->src_queue_cnt = 0;
1058− spin_unlock_irqrestore(&dev->irqlock, flags);
10591057 }
10601058 if (aborted)
10611059 ctx->state = MFCINST_RUNNING;
1060+ spin_unlock_irqrestore(&dev->irqlock, flags);
10621061 }
10631062
10641063
@@ -1091,7 +1090,7 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) · 26 unmodified lines
10911090 }
10921091 if (s5p_mfc_ctx_ready(ctx))
10931092 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);
10951094 }
10961095
10971096 static struct vb2_ops s5p_mfc_dec_qops = {
@@ -1104,7 +1103,7 @@ static struct vb2_ops s5p_mfc_dec_qops = { · 6 unmodified lines
11041103 .buf_queue = s5p_mfc_buf_queue,
11051104 };
11061105
1107−struct s5p_mfc_codec_ops *get_dec_codec_ops(void)
1106+const struct s5p_mfc_codec_ops *get_dec_codec_ops(void)
11081107 {
11091108 return &decoder_codec_ops;
11101109 }
@@ -1119,7 +1118,7 @@ const struct v4l2_ioctl_ops *get_dec_v4l2_ioctl_ops(void) · 8 unmodified lines
11191118 return &s5p_mfc_dec_ioctl_ops;
11201119 }
11211120
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) \
11231122 && V4L2_CTRL_DRIVER_PRIV(x))
11241123
11251124 int 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
1313 #ifndef S5P_MFC_DEC_H_
1414 #define S5P_MFC_DEC_H_
1515
16−struct s5p_mfc_codec_ops *get_dec_codec_ops(void);
16+const struct s5p_mfc_codec_ops *get_dec_codec_ops(void);
1717 struct vb2_ops *get_dec_queue_ops(void);
1818 const struct v4l2_ioctl_ops *get_dec_v4l2_ioctl_ops(void);
1919 struct 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
769769 struct s5p_mfc_buf *dst_mb;
770770 unsigned long dst_addr;
771771 unsigned int dst_size;
772− unsigned long flags;
773772
774− spin_lock_irqsave(&dev->irqlock, flags);
775773 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
776774 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
777775 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,
779777 dst_size);
780− spin_unlock_irqrestore(&dev->irqlock, flags);
781778 return 0;
782779 }
783780
@@ -786,11 +783,9 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx) · 2 unmodified lines
786783 struct s5p_mfc_dev *dev = ctx->dev;
787784 struct s5p_mfc_enc_params *p = &ctx->enc_params;
788785 struct s5p_mfc_buf *dst_mb;
789− unsigned long flags;
790786 unsigned int enc_pb_count;
791787
792788 if (p->seq_hdr_mode == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) {
793− spin_lock_irqsave(&dev->irqlock, flags);
794789 if (!list_empty(&ctx->dst_queue)) {
795790 dst_mb = list_entry(ctx->dst_queue.next,
796791 struct s5p_mfc_buf, list);
@@ -802,14 +797,13 @@ static int enc_post_seq_start(struct s5p_mfc_ctx *ctx) · 5 unmodified lines
802797 vb2_buffer_done(&dst_mb->b->vb2_buf,
803798 VB2_BUF_STATE_DONE);
804799 }
805− spin_unlock_irqrestore(&dev->irqlock, flags);
806800 }
807801
808802 if (!IS_MFCV6_PLUS(dev)) {
809803 ctx->state = MFCINST_RUNNING;
810804 if (s5p_mfc_ctx_ready(ctx))
811805 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);
813807 } else {
814808 enc_pb_count = s5p_mfc_hw_call(dev->mfc_ops,
815809 get_enc_dpb_count, dev);
@@ -826,25 +820,20 @@ static int enc_pre_frame_start(struct s5p_mfc_ctx *ctx) · 10 unmodified lines
826820 struct s5p_mfc_dev *dev = ctx->dev;
827821 struct s5p_mfc_buf *dst_mb;
828822 struct s5p_mfc_buf *src_mb;
829− unsigned long flags;
830823 unsigned long src_y_addr, src_c_addr, dst_addr;
831824 unsigned int dst_size;
832825
833− spin_lock_irqsave(&dev->irqlock, flags);
834826 src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
835827 src_y_addr = vb2_dma_contig_plane_dma_addr(&src_mb->b->vb2_buf, 0);
836828 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,
838830 src_y_addr, src_c_addr);
839− spin_unlock_irqrestore(&dev->irqlock, flags);
840831
841− spin_lock_irqsave(&dev->irqlock, flags);
842832 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
843833 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
844834 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,
846836 dst_size);
847− spin_unlock_irqrestore(&dev->irqlock, flags);
848837
849838 return 0;
850839 }
@@ -857,7 +846,6 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) · 6 unmodified lines
857846 unsigned long mb_y_addr, mb_c_addr;
858847 int slice_type;
859848 unsigned int strm_size;
860− unsigned long flags;
861849
862850 slice_type = s5p_mfc_hw_call(dev->mfc_ops, get_enc_slice_type, dev);
863851 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
865853 mfc_debug(2, "Encoded stream size: %d\n", strm_size);
866854 mfc_debug(2, "Display order: %d\n",
867855 mfc_read(dev, S5P_FIMV_ENC_SI_PIC_CNT));
868− spin_lock_irqsave(&dev->irqlock, flags);
869856 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,
871858 &enc_y_addr, &enc_c_addr);
872859 list_for_each_entry(mb_entry, &ctx->src_queue, list) {
873860 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
929916 vb2_set_plane_payload(&mb_entry->b->vb2_buf, 0, strm_size);
930917 vb2_buffer_done(&mb_entry->b->vb2_buf, VB2_BUF_STATE_DONE);
931918 }
932− spin_unlock_irqrestore(&dev->irqlock, flags);
933919 if ((ctx->src_queue_cnt == 0) || (ctx->dst_queue_cnt == 0))
934920 clear_work_bit(ctx);
935921
936922 return 0;
937923 }
938924
939−static struct s5p_mfc_codec_ops encoder_codec_ops = {
925+static const struct s5p_mfc_codec_ops encoder_codec_ops = {
940926 .pre_seq_start = enc_pre_seq_start,
941927 .post_seq_start = enc_post_seq_start,
942928 .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
11201106 pix_fmt_mp->width, pix_fmt_mp->height,
11211107 ctx->img_width, ctx->img_height);
11221108
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);
11241110 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size;
11251111 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width;
11261112 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
11781164 if (reqbufs->count == 0) {
11791165 mfc_debug(2, "Freeing buffers\n");
11801166 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,
11821168 ctx);
11831169 ctx->output_state = QUEUE_FREE;
11841170 return ret;
@@ -1741,7 +1727,7 @@ static int vidioc_encoder_cmd(struct file *file, void *priv, · 556 unmodified lines
17411727 if (s5p_mfc_ctx_ready(ctx))
17421728 set_work_bit_irqsave(ctx);
17431729 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);
17451731 } else {
17461732 mfc_debug(2, "EOS: marking last buffer of stream\n");
17471733 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
18181804 }
18191805
18201806 static int s5p_mfc_queue_setup(struct vb2_queue *vq,
1821− const void *parg,
18221807 unsigned int *buf_count, unsigned int *plane_count,
18231808 unsigned int psize[], void *allocators[])
18241809 {
@@ -1969,7 +1954,7 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count) · 144 unmodified lines
19691954 /* If context is ready then dev = work->data;schedule it to run */
19701955 if (s5p_mfc_ctx_ready(ctx))
19711956 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);
19731958
19741959 return 0;
19751960 }
@@ -1990,15 +1975,13 @@ static void s5p_mfc_stop_streaming(struct vb2_queue *q) · 14 unmodified lines
19901975 ctx->state = MFCINST_FINISHED;
19911976 spin_lock_irqsave(&dev->irqlock, flags);
19921977 if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
1993− s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue,
1994− &ctx->dst_queue, &ctx->vq_dst);
1978+ s5p_mfc_cleanup_queue(&ctx->dst_queue, &ctx->vq_dst);
19951979 INIT_LIST_HEAD(&ctx->dst_queue);
19961980 ctx->dst_queue_cnt = 0;
19971981 }
19981982 if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
19991983 cleanup_ref_queue(ctx);
2000− s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, &ctx->src_queue,
2001− &ctx->vq_src);
1984+ s5p_mfc_cleanup_queue(&ctx->src_queue, &ctx->vq_src);
20021985 INIT_LIST_HEAD(&ctx->src_queue);
20031986 ctx->src_queue_cnt = 0;
20041987 }
@@ -2038,7 +2021,7 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) · 33 unmodified lines
20382021 }
20392022 if (s5p_mfc_ctx_ready(ctx))
20402023 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);
20422025 }
20432026
20442027 static struct vb2_ops s5p_mfc_enc_qops = {
@@ -2052,7 +2035,7 @@ static struct vb2_ops s5p_mfc_enc_qops = { · 7 unmodified lines
20522035 .buf_queue = s5p_mfc_buf_queue,
20532036 };
20542037
2055−struct s5p_mfc_codec_ops *get_enc_codec_ops(void)
2038+const struct s5p_mfc_codec_ops *get_enc_codec_ops(void)
20562039 {
20572040 return &encoder_codec_ops;
20582041 }
@@ -2067,7 +2050,7 @@ const struct v4l2_ioctl_ops *get_enc_v4l2_ioctl_ops(void) · 8 unmodified lines
20672050 return &s5p_mfc_enc_ioctl_ops;
20682051 }
20692052
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) \
20712054 && V4L2_CTRL_DRIVER_PRIV(x))
20722055
20732056 int 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
1313 #ifndef S5P_MFC_ENC_H_
1414 #define S5P_MFC_ENC_H_
1515
16−struct s5p_mfc_codec_ops *get_enc_codec_ops(void);
16+const struct s5p_mfc_codec_ops *get_enc_codec_ops(void);
1717 struct vb2_ops *get_enc_queue_ops(void);
1818 const struct v4l2_ioctl_ops *get_enc_v4l2_ioctl_ops(void);
1919 struct 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
2020 struct s5p_mfc_regs {
2121
2222 /* codec common registers */
23− volatile void __iomem *risc_on;
24− volatile void __iomem *risc2host_int;
25− volatile void __iomem *host2risc_int;
26− volatile void __iomem *risc_base_address;
27− volatile void __iomem *mfc_reset;
28− volatile void __iomem *host2risc_command;
29− volatile void __iomem *risc2host_command;
30− volatile void __iomem *mfc_bus_reset_ctrl;
31− volatile void __iomem *firmware_version;
32− volatile void __iomem *instance_id;
33− volatile void __iomem *codec_type;
34− volatile void __iomem *context_mem_addr;
35− volatile void __iomem *context_mem_size;
36− volatile void __iomem *pixel_format;
37− volatile void __iomem *metadata_enable;
38− volatile void __iomem *mfc_version;
39− volatile void __iomem *dbg_info_enable;
40− volatile void __iomem *dbg_buffer_addr;
41− volatile void __iomem *dbg_buffer_size;
42− volatile void __iomem *hed_control;
43− volatile void __iomem *mfc_timeout_value;
44− volatile void __iomem *hed_shared_mem_addr;
45− volatile void __iomem *dis_shared_mem_addr;/* only v7 */
46− volatile void __iomem *ret_instance_id;
47− volatile void __iomem *error_code;
48− volatile void __iomem *dbg_buffer_output_size;
49− volatile void __iomem *metadata_status;
50− volatile void __iomem *metadata_addr_mb_info;
51− volatile void __iomem *metadata_size_mb_info;
52− volatile void __iomem *dbg_info_stage_counter;
23+ void __iomem *risc_on;
24+ void __iomem *risc2host_int;
25+ void __iomem *host2risc_int;
26+ void __iomem *risc_base_address;
27+ void __iomem *mfc_reset;
28+ void __iomem *host2risc_command;
29+ void __iomem *risc2host_command;
30+ void __iomem *mfc_bus_reset_ctrl;
31+ void __iomem *firmware_version;
32+ void __iomem *instance_id;
33+ void __iomem *codec_type;
34+ void __iomem *context_mem_addr;
35+ void __iomem *context_mem_size;
36+ void __iomem *pixel_format;
37+ void __iomem *metadata_enable;
38+ void __iomem *mfc_version;
39+ void __iomem *dbg_info_enable;
40+ void __iomem *dbg_buffer_addr;
41+ void __iomem *dbg_buffer_size;
42+ void __iomem *hed_control;
43+ void __iomem *mfc_timeout_value;
44+ void __iomem *hed_shared_mem_addr;
45+ void __iomem *dis_shared_mem_addr;/* only v7 */
46+ void __iomem *ret_instance_id;
47+ void __iomem *error_code;
48+ void __iomem *dbg_buffer_output_size;
49+ void __iomem *metadata_status;
50+ void __iomem *metadata_addr_mb_info;
51+ void __iomem *metadata_size_mb_info;
52+ void __iomem *dbg_info_stage_counter;
5353
5454 /* decoder registers */
55− volatile void __iomem *d_crc_ctrl;
56− volatile void __iomem *d_dec_options;
57− volatile void __iomem *d_display_delay;
58− volatile void __iomem *d_set_frame_width;
59− volatile void __iomem *d_set_frame_height;
60− volatile void __iomem *d_sei_enable;
61− volatile void __iomem *d_min_num_dpb;
62− volatile void __iomem *d_min_first_plane_dpb_size;
63− volatile void __iomem *d_min_second_plane_dpb_size;
64− volatile void __iomem *d_min_third_plane_dpb_size;/* only v8 */
65− volatile void __iomem *d_min_num_mv;
66− volatile void __iomem *d_mvc_num_views;
67− volatile void __iomem *d_min_num_dis;/* only v7 */
68− volatile void __iomem *d_min_first_dis_size;/* only v7 */
69− volatile void __iomem *d_min_second_dis_size;/* only v7 */
70− volatile void __iomem *d_min_third_dis_size;/* only v7 */
71− volatile void __iomem *d_post_filter_luma_dpb0;/* v7 and v8 */
72− volatile void __iomem *d_post_filter_luma_dpb1;/* v7 and v8 */
73− volatile void __iomem *d_post_filter_luma_dpb2;/* only v7 */
74− volatile void __iomem *d_post_filter_chroma_dpb0;/* v7 and v8 */
75− volatile void __iomem *d_post_filter_chroma_dpb1;/* v7 and v8 */
76− volatile void __iomem *d_post_filter_chroma_dpb2;/* only v7 */
77− volatile void __iomem *d_num_dpb;
78− volatile void __iomem *d_num_mv;
79− volatile void __iomem *d_init_buffer_options;
80− volatile void __iomem *d_first_plane_dpb_stride_size;/* only v8 */
81− volatile void __iomem *d_second_plane_dpb_stride_size;/* only v8 */
82− volatile void __iomem *d_third_plane_dpb_stride_size;/* only v8 */
83− volatile void __iomem *d_first_plane_dpb_size;
84− volatile void __iomem *d_second_plane_dpb_size;
85− volatile void __iomem *d_third_plane_dpb_size;/* only v8 */
86− volatile void __iomem *d_mv_buffer_size;
87− volatile void __iomem *d_first_plane_dpb;
88− volatile void __iomem *d_second_plane_dpb;
89− volatile void __iomem *d_third_plane_dpb;
90− volatile void __iomem *d_mv_buffer;
91− volatile void __iomem *d_scratch_buffer_addr;
92− volatile void __iomem *d_scratch_buffer_size;
93− volatile void __iomem *d_metadata_buffer_addr;
94− volatile void __iomem *d_metadata_buffer_size;
95− volatile void __iomem *d_nal_start_options;/* v7 and v8 */
96− volatile void __iomem *d_cpb_buffer_addr;
97− volatile void __iomem *d_cpb_buffer_size;
98− volatile void __iomem *d_available_dpb_flag_upper;
99− volatile void __iomem *d_available_dpb_flag_lower;
100− volatile void __iomem *d_cpb_buffer_offset;
101− volatile void __iomem *d_slice_if_enable;
102− volatile void __iomem *d_picture_tag;
103− volatile void __iomem *d_stream_data_size;
104− volatile void __iomem *d_dynamic_dpb_flag_upper;/* v7 and v8 */
105− volatile void __iomem *d_dynamic_dpb_flag_lower;/* v7 and v8 */
106− volatile void __iomem *d_display_frame_width;
107− volatile void __iomem *d_display_frame_height;
108− volatile void __iomem *d_display_status;
109− volatile void __iomem *d_display_first_plane_addr;
110− volatile void __iomem *d_display_second_plane_addr;
111− volatile void __iomem *d_display_third_plane_addr;/* only v8 */
112− volatile void __iomem *d_display_frame_type;
113− volatile void __iomem *d_display_crop_info1;
114− volatile void __iomem *d_display_crop_info2;
115− volatile void __iomem *d_display_picture_profile;
116− volatile void __iomem *d_display_luma_crc;/* v7 and v8 */
117− volatile void __iomem *d_display_chroma0_crc;/* v7 and v8 */
118− volatile void __iomem *d_display_chroma1_crc;/* only v8 */
119− volatile void __iomem *d_display_luma_crc_top;/* only v6 */
120− volatile void __iomem *d_display_chroma_crc_top;/* only v6 */
121− volatile void __iomem *d_display_luma_crc_bot;/* only v6 */
122− volatile void __iomem *d_display_chroma_crc_bot;/* only v6 */
123− volatile void __iomem *d_display_aspect_ratio;
124− volatile void __iomem *d_display_extended_ar;
125− volatile void __iomem *d_decoded_frame_width;
126− volatile void __iomem *d_decoded_frame_height;
127− volatile void __iomem *d_decoded_status;
128− volatile void __iomem *d_decoded_first_plane_addr;
129− volatile void __iomem *d_decoded_second_plane_addr;
130− volatile void __iomem *d_decoded_third_plane_addr;/* only v8 */
131− volatile void __iomem *d_decoded_frame_type;
132− volatile void __iomem *d_decoded_crop_info1;
133− volatile void __iomem *d_decoded_crop_info2;
134− volatile void __iomem *d_decoded_picture_profile;
135− volatile void __iomem *d_decoded_nal_size;
136− volatile void __iomem *d_decoded_luma_crc;
137− volatile void __iomem *d_decoded_chroma0_crc;
138− volatile void __iomem *d_decoded_chroma1_crc;/* only v8 */
139− volatile void __iomem *d_ret_picture_tag_top;
140− volatile void __iomem *d_ret_picture_tag_bot;
141− volatile void __iomem *d_ret_picture_time_top;
142− volatile void __iomem *d_ret_picture_time_bot;
143− volatile void __iomem *d_chroma_format;
144− volatile void __iomem *d_vc1_info;/* v7 and v8 */
145− volatile void __iomem *d_mpeg4_info;
146− volatile void __iomem *d_h264_info;
147− volatile void __iomem *d_metadata_addr_concealed_mb;
148− volatile void __iomem *d_metadata_size_concealed_mb;
149− volatile void __iomem *d_metadata_addr_vc1_param;
150− volatile void __iomem *d_metadata_size_vc1_param;
151− volatile void __iomem *d_metadata_addr_sei_nal;
152− volatile void __iomem *d_metadata_size_sei_nal;
153− volatile void __iomem *d_metadata_addr_vui;
154− volatile void __iomem *d_metadata_size_vui;
155− volatile void __iomem *d_metadata_addr_mvcvui;/* v7 and v8 */
156− volatile void __iomem *d_metadata_size_mvcvui;/* v7 and v8 */
157− volatile void __iomem *d_mvc_view_id;
158− volatile void __iomem *d_frame_pack_sei_avail;
159− volatile void __iomem *d_frame_pack_arrgment_id;
160− volatile void __iomem *d_frame_pack_sei_info;
161− volatile void __iomem *d_frame_pack_grid_pos;
162− volatile void __iomem *d_display_recovery_sei_info;/* v7 and v8 */
163− volatile void __iomem *d_decoded_recovery_sei_info;/* v7 and v8 */
164− volatile void __iomem *d_display_first_addr;/* only v7 */
165− volatile void __iomem *d_display_second_addr;/* only v7 */
166− volatile void __iomem *d_display_third_addr;/* only v7 */
167− volatile void __iomem *d_decoded_first_addr;/* only v7 */
168− volatile void __iomem *d_decoded_second_addr;/* only v7 */
169− volatile void __iomem *d_decoded_third_addr;/* only v7 */
170− volatile void __iomem *d_used_dpb_flag_upper;/* v7 and v8 */
171− volatile void __iomem *d_used_dpb_flag_lower;/* v7 and v8 */
55+ void __iomem *d_crc_ctrl;
56+ void __iomem *d_dec_options;
57+ void __iomem *d_display_delay;
58+ void __iomem *d_set_frame_width;
59+ void __iomem *d_set_frame_height;
60+ void __iomem *d_sei_enable;
61+ void __iomem *d_min_num_dpb;
62+ void __iomem *d_min_first_plane_dpb_size;
63+ void __iomem *d_min_second_plane_dpb_size;
64+ void __iomem *d_min_third_plane_dpb_size;/* only v8 */
65+ void __iomem *d_min_num_mv;
66+ void __iomem *d_mvc_num_views;
67+ void __iomem *d_min_num_dis;/* only v7 */
68+ void __iomem *d_min_first_dis_size;/* only v7 */
69+ void __iomem *d_min_second_dis_size;/* only v7 */
70+ void __iomem *d_min_third_dis_size;/* only v7 */
71+ void __iomem *d_post_filter_luma_dpb0;/* v7 and v8 */
72+ void __iomem *d_post_filter_luma_dpb1;/* v7 and v8 */
73+ void __iomem *d_post_filter_luma_dpb2;/* only v7 */
74+ void __iomem *d_post_filter_chroma_dpb0;/* v7 and v8 */
75+ void __iomem *d_post_filter_chroma_dpb1;/* v7 and v8 */
76+ void __iomem *d_post_filter_chroma_dpb2;/* only v7 */
77+ void __iomem *d_num_dpb;
78+ void __iomem *d_num_mv;
79+ void __iomem *d_init_buffer_options;
80+ void __iomem *d_first_plane_dpb_stride_size;/* only v8 */
81+ void __iomem *d_second_plane_dpb_stride_size;/* only v8 */
82+ void __iomem *d_third_plane_dpb_stride_size;/* only v8 */
83+ void __iomem *d_first_plane_dpb_size;
84+ void __iomem *d_second_plane_dpb_size;
85+ void __iomem *d_third_plane_dpb_size;/* only v8 */
86+ void __iomem *d_mv_buffer_size;
87+ void __iomem *d_first_plane_dpb;
88+ void __iomem *d_second_plane_dpb;
89+ void __iomem *d_third_plane_dpb;
90+ void __iomem *d_mv_buffer;
91+ void __iomem *d_scratch_buffer_addr;
92+ void __iomem *d_scratch_buffer_size;
93+ void __iomem *d_metadata_buffer_addr;
94+ void __iomem *d_metadata_buffer_size;
95+ void __iomem *d_nal_start_options;/* v7 and v8 */
96+ void __iomem *d_cpb_buffer_addr;
97+ void __iomem *d_cpb_buffer_size;
98+ void __iomem *d_available_dpb_flag_upper;
99+ void __iomem *d_available_dpb_flag_lower;
100+ void __iomem *d_cpb_buffer_offset;
101+ void __iomem *d_slice_if_enable;
102+ void __iomem *d_picture_tag;
103+ void __iomem *d_stream_data_size;
104+ void __iomem *d_dynamic_dpb_flag_upper;/* v7 and v8 */
105+ void __iomem *d_dynamic_dpb_flag_lower;/* v7 and v8 */
106+ void __iomem *d_display_frame_width;
107+ void __iomem *d_display_frame_height;
108+ void __iomem *d_display_status;
109+ void __iomem *d_display_first_plane_addr;
110+ void __iomem *d_display_second_plane_addr;
111+ void __iomem *d_display_third_plane_addr;/* only v8 */
112+ void __iomem *d_display_frame_type;
113+ void __iomem *d_display_crop_info1;
114+ void __iomem *d_display_crop_info2;
115+ void __iomem *d_display_picture_profile;
116+ void __iomem *d_display_luma_crc;/* v7 and v8 */
117+ void __iomem *d_display_chroma0_crc;/* v7 and v8 */
118+ void __iomem *d_display_chroma1_crc;/* only v8 */
119+ void __iomem *d_display_luma_crc_top;/* only v6 */
120+ void __iomem *d_display_chroma_crc_top;/* only v6 */
121+ void __iomem *d_display_luma_crc_bot;/* only v6 */
122+ void __iomem *d_display_chroma_crc_bot;/* only v6 */
123+ void __iomem *d_display_aspect_ratio;
124+ void __iomem *d_display_extended_ar;
125+ void __iomem *d_decoded_frame_width;
126+ void __iomem *d_decoded_frame_height;
127+ void __iomem *d_decoded_status;
128+ void __iomem *d_decoded_first_plane_addr;
129+ void __iomem *d_decoded_second_plane_addr;
130+ void __iomem *d_decoded_third_plane_addr;/* only v8 */
131+ void __iomem *d_decoded_frame_type;
132+ void __iomem *d_decoded_crop_info1;
133+ void __iomem *d_decoded_crop_info2;
134+ void __iomem *d_decoded_picture_profile;
135+ void __iomem *d_decoded_nal_size;
136+ void __iomem *d_decoded_luma_crc;
137+ void __iomem *d_decoded_chroma0_crc;
138+ void __iomem *d_decoded_chroma1_crc;/* only v8 */
139+ void __iomem *d_ret_picture_tag_top;
140+ void __iomem *d_ret_picture_tag_bot;
141+ void __iomem *d_ret_picture_time_top;
142+ void __iomem *d_ret_picture_time_bot;
143+ void __iomem *d_chroma_format;
144+ void __iomem *d_vc1_info;/* v7 and v8 */
145+ void __iomem *d_mpeg4_info;
146+ void __iomem *d_h264_info;
147+ void __iomem *d_metadata_addr_concealed_mb;
148+ void __iomem *d_metadata_size_concealed_mb;
149+ void __iomem *d_metadata_addr_vc1_param;
150+ void __iomem *d_metadata_size_vc1_param;
151+ void __iomem *d_metadata_addr_sei_nal;
152+ void __iomem *d_metadata_size_sei_nal;
153+ void __iomem *d_metadata_addr_vui;
154+ void __iomem *d_metadata_size_vui;
155+ void __iomem *d_metadata_addr_mvcvui;/* v7 and v8 */
156+ void __iomem *d_metadata_size_mvcvui;/* v7 and v8 */
157+ void __iomem *d_mvc_view_id;
158+ void __iomem *d_frame_pack_sei_avail;
159+ void __iomem *d_frame_pack_arrgment_id;
160+ void __iomem *d_frame_pack_sei_info;
161+ void __iomem *d_frame_pack_grid_pos;
162+ void __iomem *d_display_recovery_sei_info;/* v7 and v8 */
163+ void __iomem *d_decoded_recovery_sei_info;/* v7 and v8 */
164+ void __iomem *d_display_first_addr;/* only v7 */
165+ void __iomem *d_display_second_addr;/* only v7 */
166+ void __iomem *d_display_third_addr;/* only v7 */
167+ void __iomem *d_decoded_first_addr;/* only v7 */
168+ void __iomem *d_decoded_second_addr;/* only v7 */
169+ void __iomem *d_decoded_third_addr;/* only v7 */
170+ void __iomem *d_used_dpb_flag_upper;/* v7 and v8 */
171+ void __iomem *d_used_dpb_flag_lower;/* v7 and v8 */
172172
173173 /* encoder registers */
174− volatile void __iomem *e_frame_width;
175− volatile void __iomem *e_frame_height;
176− volatile void __iomem *e_cropped_frame_width;
177− volatile void __iomem *e_cropped_frame_height;
178− volatile void __iomem *e_frame_crop_offset;
179− volatile void __iomem *e_enc_options;
180− volatile void __iomem *e_picture_profile;
181− volatile void __iomem *e_vbv_buffer_size;
182− volatile void __iomem *e_vbv_init_delay;
183− volatile void __iomem *e_fixed_picture_qp;
184− volatile void __iomem *e_rc_config;
185− volatile void __iomem *e_rc_qp_bound;
186− volatile void __iomem *e_rc_qp_bound_pb;/* v7 and v8 */
187− volatile void __iomem *e_rc_mode;
188− volatile void __iomem *e_mb_rc_config;
189− volatile void __iomem *e_padding_ctrl;
190− volatile void __iomem *e_air_threshold;
191− volatile void __iomem *e_mv_hor_range;
192− volatile void __iomem *e_mv_ver_range;
193− volatile void __iomem *e_num_dpb;
194− volatile void __iomem *e_luma_dpb;
195− volatile void __iomem *e_chroma_dpb;
196− volatile void __iomem *e_me_buffer;
197− volatile void __iomem *e_scratch_buffer_addr;
198− volatile void __iomem *e_scratch_buffer_size;
199− volatile void __iomem *e_tmv_buffer0;
200− volatile void __iomem *e_tmv_buffer1;
201− volatile void __iomem *e_ir_buffer_addr;/* v7 and v8 */
202− volatile void __iomem *e_source_first_plane_addr;
203− volatile void __iomem *e_source_second_plane_addr;
204− volatile void __iomem *e_source_third_plane_addr;/* v7 and v8 */
205− volatile void __iomem *e_source_first_plane_stride;/* v7 and v8 */
206− volatile void __iomem *e_source_second_plane_stride;/* v7 and v8 */
207− volatile void __iomem *e_source_third_plane_stride;/* v7 and v8 */
208− volatile void __iomem *e_stream_buffer_addr;
209− volatile void __iomem *e_stream_buffer_size;
210− volatile void __iomem *e_roi_buffer_addr;
211− volatile void __iomem *e_param_change;
212− volatile void __iomem *e_ir_size;
213− volatile void __iomem *e_gop_config;
214− volatile void __iomem *e_mslice_mode;
215− volatile void __iomem *e_mslice_size_mb;
216− volatile void __iomem *e_mslice_size_bits;
217− volatile void __iomem *e_frame_insertion;
218− volatile void __iomem *e_rc_frame_rate;
219− volatile void __iomem *e_rc_bit_rate;
220− volatile void __iomem *e_rc_roi_ctrl;
221− volatile void __iomem *e_picture_tag;
222− volatile void __iomem *e_bit_count_enable;
223− volatile void __iomem *e_max_bit_count;
224− volatile void __iomem *e_min_bit_count;
225− volatile void __iomem *e_metadata_buffer_addr;
226− volatile void __iomem *e_metadata_buffer_size;
227− volatile void __iomem *e_encoded_source_first_plane_addr;
228− volatile void __iomem *e_encoded_source_second_plane_addr;
229− volatile void __iomem *e_encoded_source_third_plane_addr;/* v7 and v8 */
230− volatile void __iomem *e_stream_size;
231− volatile void __iomem *e_slice_type;
232− volatile void __iomem *e_picture_count;
233− volatile void __iomem *e_ret_picture_tag;
234− volatile void __iomem *e_stream_buffer_write_pointer; /* only v6 */
235− volatile void __iomem *e_recon_luma_dpb_addr;
236− volatile void __iomem *e_recon_chroma_dpb_addr;
237− volatile void __iomem *e_metadata_addr_enc_slice;
238− volatile void __iomem *e_metadata_size_enc_slice;
239− volatile void __iomem *e_mpeg4_options;
240− volatile void __iomem *e_mpeg4_hec_period;
241− volatile void __iomem *e_aspect_ratio;
242− volatile void __iomem *e_extended_sar;
243− volatile void __iomem *e_h264_options;
244− volatile void __iomem *e_h264_options_2;/* v7 and v8 */
245− volatile void __iomem *e_h264_lf_alpha_offset;
246− volatile void __iomem *e_h264_lf_beta_offset;
247− volatile void __iomem *e_h264_i_period;
248− volatile void __iomem *e_h264_fmo_slice_grp_map_type;
249− volatile void __iomem *e_h264_fmo_num_slice_grp_minus1;
250− volatile void __iomem *e_h264_fmo_slice_grp_change_dir;
251− volatile void __iomem *e_h264_fmo_slice_grp_change_rate_minus1;
252− volatile void __iomem *e_h264_fmo_run_length_minus1_0;
253− volatile void __iomem *e_h264_aso_slice_order_0;
254− volatile void __iomem *e_h264_chroma_qp_offset;
255− volatile void __iomem *e_h264_num_t_layer;
256− volatile void __iomem *e_h264_hierarchical_qp_layer0;
257− volatile void __iomem *e_h264_frame_packing_sei_info;
258− volatile void __iomem *e_h264_nal_control;/* v7 and v8 */
259− volatile void __iomem *e_mvc_frame_qp_view1;
260− volatile void __iomem *e_mvc_rc_bit_rate_view1;
261− volatile void __iomem *e_mvc_rc_qbound_view1;
262− volatile void __iomem *e_mvc_rc_mode_view1;
263− volatile void __iomem *e_mvc_inter_view_prediction_on;
264− volatile void __iomem *e_vp8_options;/* v7 and v8 */
265− volatile void __iomem *e_vp8_filter_options;/* v7 and v8 */
266− volatile void __iomem *e_vp8_golden_frame_option;/* v7 and v8 */
267− volatile void __iomem *e_vp8_num_t_layer;/* v7 and v8 */
268− volatile void __iomem *e_vp8_hierarchical_qp_layer0;/* v7 and v8 */
269− volatile void __iomem *e_vp8_hierarchical_qp_layer1;/* v7 and v8 */
270− volatile void __iomem *e_vp8_hierarchical_qp_layer2;/* v7 and v8 */
174+ void __iomem *e_frame_width;
175+ void __iomem *e_frame_height;
176+ void __iomem *e_cropped_frame_width;
177+ void __iomem *e_cropped_frame_height;
178+ void __iomem *e_frame_crop_offset;
179+ void __iomem *e_enc_options;
180+ void __iomem *e_picture_profile;
181+ void __iomem *e_vbv_buffer_size;
182+ void __iomem *e_vbv_init_delay;
183+ void __iomem *e_fixed_picture_qp;
184+ void __iomem *e_rc_config;
185+ void __iomem *e_rc_qp_bound;
186+ void __iomem *e_rc_qp_bound_pb;/* v7 and v8 */
187+ void __iomem *e_rc_mode;
188+ void __iomem *e_mb_rc_config;
189+ void __iomem *e_padding_ctrl;
190+ void __iomem *e_air_threshold;
191+ void __iomem *e_mv_hor_range;
192+ void __iomem *e_mv_ver_range;
193+ void __iomem *e_num_dpb;
194+ void __iomem *e_luma_dpb;
195+ void __iomem *e_chroma_dpb;
196+ void __iomem *e_me_buffer;
197+ void __iomem *e_scratch_buffer_addr;
198+ void __iomem *e_scratch_buffer_size;
199+ void __iomem *e_tmv_buffer0;
200+ void __iomem *e_tmv_buffer1;
201+ void __iomem *e_ir_buffer_addr;/* v7 and v8 */
202+ void __iomem *e_source_first_plane_addr;
203+ void __iomem *e_source_second_plane_addr;
204+ void __iomem *e_source_third_plane_addr;/* v7 and v8 */
205+ void __iomem *e_source_first_plane_stride;/* v7 and v8 */
206+ void __iomem *e_source_second_plane_stride;/* v7 and v8 */
207+ void __iomem *e_source_third_plane_stride;/* v7 and v8 */
208+ void __iomem *e_stream_buffer_addr;
209+ void __iomem *e_stream_buffer_size;
210+ void __iomem *e_roi_buffer_addr;
211+ void __iomem *e_param_change;
212+ void __iomem *e_ir_size;
213+ void __iomem *e_gop_config;
214+ void __iomem *e_mslice_mode;
215+ void __iomem *e_mslice_size_mb;
216+ void __iomem *e_mslice_size_bits;
217+ void __iomem *e_frame_insertion;
218+ void __iomem *e_rc_frame_rate;
219+ void __iomem *e_rc_bit_rate;
220+ void __iomem *e_rc_roi_ctrl;
221+ void __iomem *e_picture_tag;
222+ void __iomem *e_bit_count_enable;
223+ void __iomem *e_max_bit_count;
224+ void __iomem *e_min_bit_count;
225+ void __iomem *e_metadata_buffer_addr;
226+ void __iomem *e_metadata_buffer_size;
227+ void __iomem *e_encoded_source_first_plane_addr;
228+ void __iomem *e_encoded_source_second_plane_addr;
229+ void __iomem *e_encoded_source_third_plane_addr;/* v7 and v8 */
230+ void __iomem *e_stream_size;
231+ void __iomem *e_slice_type;
232+ void __iomem *e_picture_count;
233+ void __iomem *e_ret_picture_tag;
234+ void __iomem *e_stream_buffer_write_pointer; /* only v6 */
235+ void __iomem *e_recon_luma_dpb_addr;
236+ void __iomem *e_recon_chroma_dpb_addr;
237+ void __iomem *e_metadata_addr_enc_slice;
238+ void __iomem *e_metadata_size_enc_slice;
239+ void __iomem *e_mpeg4_options;
240+ void __iomem *e_mpeg4_hec_period;
241+ void __iomem *e_aspect_ratio;
242+ void __iomem *e_extended_sar;
243+ void __iomem *e_h264_options;
244+ void __iomem *e_h264_options_2;/* v7 and v8 */
245+ void __iomem *e_h264_lf_alpha_offset;
246+ void __iomem *e_h264_lf_beta_offset;
247+ void __iomem *e_h264_i_period;
248+ void __iomem *e_h264_fmo_slice_grp_map_type;
249+ void __iomem *e_h264_fmo_num_slice_grp_minus1;
250+ void __iomem *e_h264_fmo_slice_grp_change_dir;
251+ void __iomem *e_h264_fmo_slice_grp_change_rate_minus1;
252+ void __iomem *e_h264_fmo_run_length_minus1_0;
253+ void __iomem *e_h264_aso_slice_order_0;
254+ void __iomem *e_h264_chroma_qp_offset;
255+ void __iomem *e_h264_num_t_layer;
256+ void __iomem *e_h264_hierarchical_qp_layer0;
257+ void __iomem *e_h264_frame_packing_sei_info;
258+ void __iomem *e_h264_nal_control;/* v7 and v8 */
259+ void __iomem *e_mvc_frame_qp_view1;
260+ void __iomem *e_mvc_rc_bit_rate_view1;
261+ void __iomem *e_mvc_rc_qbound_view1;
262+ void __iomem *e_mvc_rc_mode_view1;
263+ void __iomem *e_mvc_inter_view_prediction_on;
264+ void __iomem *e_vp8_options;/* v7 and v8 */
265+ void __iomem *e_vp8_filter_options;/* v7 and v8 */
266+ void __iomem *e_vp8_golden_frame_option;/* v7 and v8 */
267+ void __iomem *e_vp8_num_t_layer;/* v7 and v8 */
268+ void __iomem *e_vp8_hierarchical_qp_layer0;/* v7 and v8 */
269+ void __iomem *e_vp8_hierarchical_qp_layer1;/* v7 and v8 */
270+ void __iomem *e_vp8_hierarchical_qp_layer2;/* v7 and v8 */
271271 };
272272
273273 struct s5p_mfc_hw_ops {
@@ -281,28 +281,14 @@ struct s5p_mfc_hw_ops { · 7 unmodified lines
281281 void (*release_dev_context_buffer)(struct s5p_mfc_dev *dev);
282282 void (*dec_calc_dpb_size)(struct s5p_mfc_ctx *ctx);
283283 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);
288284 int (*set_enc_stream_buffer)(struct s5p_mfc_ctx *ctx,
289285 unsigned long addr, unsigned int size);
290286 void (*set_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
291287 unsigned long y_addr, unsigned long c_addr);
292288 void (*get_enc_frame_buffer)(struct s5p_mfc_ctx *ctx,
293289 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);
298290 void (*try_run)(struct s5p_mfc_dev *dev);
299− void (*cleanup_queue)(struct list_head *lh,
300− struct vb2_queue *vq);
301291 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);
306292 int (*get_dspl_y_adr)(struct s5p_mfc_dev *dev);
307293 int (*get_dec_y_adr)(struct s5p_mfc_dev *dev);
308294 int (*get_dspl_status)(struct s5p_mfc_dev *dev);
@@ -313,7 +299,6 @@ struct s5p_mfc_hw_ops { · 4 unmodified lines
313299 int (*get_int_reason)(struct s5p_mfc_dev *dev);
314300 int (*get_int_err)(struct s5p_mfc_dev *dev);
315301 int (*err_dec)(unsigned int err);
316− int (*err_dspl)(unsigned int err);
317302 int (*get_img_width)(struct s5p_mfc_dev *dev);
318303 int (*get_img_height)(struct s5p_mfc_dev *dev);
319304 int (*get_dpb_count)(struct s5p_mfc_dev *dev);
@@ -322,10 +307,6 @@ struct s5p_mfc_hw_ops { · 2 unmodified lines
322307 int (*get_enc_strm_size)(struct s5p_mfc_dev *dev);
323308 int (*get_enc_slice_type)(struct s5p_mfc_dev *dev);
324309 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);
329310 unsigned int (*get_pic_type_top)(struct s5p_mfc_ctx *ctx);
330311 unsigned int (*get_pic_type_bot)(struct s5p_mfc_ctx *ctx);
331312 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
11531153 return 0;
11541154 }
11551155
1156−static 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−
11771156 static void s5p_mfc_run_res_change(struct s5p_mfc_ctx *ctx)
11781157 {
11791158 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
11871166 {
11881167 struct s5p_mfc_dev *dev = ctx->dev;
11891168 struct s5p_mfc_buf *temp_vb;
1190− unsigned long flags;
11911169
11921170 if (ctx->state == MFCINST_FINISHING) {
11931171 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
11971175 return 0;
11981176 }
11991177
1200− spin_lock_irqsave(&dev->irqlock, flags);
12011178 /* Frames are being decoded */
12021179 if (list_empty(&ctx->src_queue)) {
12031180 mfc_debug(2, "No src buffers\n");
1204− spin_unlock_irqrestore(&dev->irqlock, flags);
12051181 return -EAGAIN;
12061182 }
12071183 /* 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
12101186 s5p_mfc_set_dec_stream_buffer_v5(ctx,
12111187 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
12121188 ctx->consumed_stream, temp_vb->b->vb2_buf.planes[0].bytesused);
1213− spin_unlock_irqrestore(&dev->irqlock, flags);
12141189 dev->curr_ctx = ctx->num;
12151190 if (temp_vb->b->vb2_buf.planes[0].bytesused == 0) {
12161191 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
12241199 static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx)
12251200 {
12261201 struct s5p_mfc_dev *dev = ctx->dev;
1227− unsigned long flags;
12281202 struct s5p_mfc_buf *dst_mb;
12291203 struct s5p_mfc_buf *src_mb;
12301204 unsigned long src_y_addr, src_c_addr, dst_addr;
12311205 unsigned int dst_size;
12321206
1233− spin_lock_irqsave(&dev->irqlock, flags);
12341207 if (list_empty(&ctx->src_queue) && ctx->state != MFCINST_FINISHING) {
12351208 mfc_debug(2, "no src buffers\n");
1236− spin_unlock_irqrestore(&dev->irqlock, flags);
12371209 return -EAGAIN;
12381210 }
12391211 if (list_empty(&ctx->dst_queue)) {
12401212 mfc_debug(2, "no dst buffers\n");
1241− spin_unlock_irqrestore(&dev->irqlock, flags);
12421213 return -EAGAIN;
12431214 }
12441215 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
12701241 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
12711242 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
12721243 s5p_mfc_set_enc_stream_buffer_v5(ctx, dst_addr, dst_size);
1273− spin_unlock_irqrestore(&dev->irqlock, flags);
12741244 dev->curr_ctx = ctx->num;
12751245 mfc_debug(2, "encoding buffer with index=%d state=%d\n",
12761246 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
12811251 static void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx)
12821252 {
12831253 struct s5p_mfc_dev *dev = ctx->dev;
1284− unsigned long flags;
12851254 struct s5p_mfc_buf *temp_vb;
12861255
12871256 /* Initializing decoding - parsing header */
1288− spin_lock_irqsave(&dev->irqlock, flags);
12891257 mfc_debug(2, "Preparing to init decoding\n");
12901258 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
12911259 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
12941262 s5p_mfc_set_dec_stream_buffer_v5(ctx,
12951263 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
12961264 0, temp_vb->b->vb2_buf.planes[0].bytesused);
1297− spin_unlock_irqrestore(&dev->irqlock, flags);
12981265 dev->curr_ctx = ctx->num;
12991266 s5p_mfc_init_decode_v5(ctx);
13001267 }
@@ -1302,18 +1269,15 @@ static void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx) · 1 unmodified line
13021269 static void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx)
13031270 {
13041271 struct s5p_mfc_dev *dev = ctx->dev;
1305− unsigned long flags;
13061272 struct s5p_mfc_buf *dst_mb;
13071273 unsigned long dst_addr;
13081274 unsigned int dst_size;
13091275
13101276 s5p_mfc_set_enc_ref_buffer_v5(ctx);
1311− spin_lock_irqsave(&dev->irqlock, flags);
13121277 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
13131278 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
13141279 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
13151280 s5p_mfc_set_enc_stream_buffer_v5(ctx, dst_addr, dst_size);
1316− spin_unlock_irqrestore(&dev->irqlock, flags);
13171281 dev->curr_ctx = ctx->num;
13181282 s5p_mfc_init_encode_v5(ctx);
13191283 }
@@ -1321,7 +1285,6 @@ static void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx) · 1 unmodified line
13211285 static int s5p_mfc_run_init_dec_buffers(struct s5p_mfc_ctx *ctx)
13221286 {
13231287 struct s5p_mfc_dev *dev = ctx->dev;
1324− unsigned long flags;
13251288 struct s5p_mfc_buf *temp_vb;
13261289 int ret;
13271290
@@ -1335,11 +1298,9 @@ static int s5p_mfc_run_init_dec_buffers(struct s5p_mfc_ctx *ctx) · 7 unmodified lines
13351298 "before starting processing\n");
13361299 return -EAGAIN;
13371300 }
1338− spin_lock_irqsave(&dev->irqlock, flags);
13391301 if (list_empty(&ctx->src_queue)) {
13401302 mfc_err("Header has been deallocated in the middle of"
13411303 " initialization\n");
1342− spin_unlock_irqrestore(&dev->irqlock, flags);
13431304 return -EIO;
13441305 }
13451306 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
13481309 s5p_mfc_set_dec_stream_buffer_v5(ctx,
13491310 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
13501311 0, temp_vb->b->vb2_buf.planes[0].bytesused);
1351− spin_unlock_irqrestore(&dev->irqlock, flags);
13521312 dev->curr_ctx = ctx->num;
13531313 ret = s5p_mfc_set_dec_frame_buffer_v5(ctx);
13541314 if (ret) {
@@ -1472,21 +1432,6 @@ static void s5p_mfc_try_run_v5(struct s5p_mfc_dev *dev) · 117 unmodified lines
14721432 }
14731433 }
14741434
1475−
1476−static 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−
14901435 static void s5p_mfc_clear_int_flags_v5(struct s5p_mfc_dev *dev)
14911436 {
14921437 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
15901535 return (err & S5P_FIMV_ERR_DEC_MASK) >> S5P_FIMV_ERR_DEC_SHIFT;
15911536 }
15921537
1593−static 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−
15981538 static int s5p_mfc_get_img_width_v5(struct s5p_mfc_dev *dev)
15991539 {
16001540 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
16361576 return -1;
16371577 }
16381578
1639−static 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−
1644−static 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−
1649−static int s5p_mfc_get_mvc_num_views_v5(struct s5p_mfc_dev *dev)
1650−{
1651− return -1;
1652−}
1653−
1654−static int s5p_mfc_get_mvc_view_id_v5(struct s5p_mfc_dev *dev)
1655−{
1656− return -1;
1657−}
1658−
16591579 static unsigned int s5p_mfc_get_pic_type_top_v5(struct s5p_mfc_ctx *ctx)
16601580 {
16611581 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
16881608 .release_dev_context_buffer = s5p_mfc_release_dev_context_buffer_v5,
16891609 .dec_calc_dpb_size = s5p_mfc_dec_calc_dpb_size_v5,
16901610 .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,
16931611 .set_enc_stream_buffer = s5p_mfc_set_enc_stream_buffer_v5,
16941612 .set_enc_frame_buffer = s5p_mfc_set_enc_frame_buffer_v5,
16951613 .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,
17001614 .try_run = s5p_mfc_try_run_v5,
1701− .cleanup_queue = s5p_mfc_cleanup_queue_v5,
17021615 .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,
17051616 .get_dspl_y_adr = s5p_mfc_get_dspl_y_adr_v5,
17061617 .get_dec_y_adr = s5p_mfc_get_dec_y_adr_v5,
17071618 .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
17121623 .get_int_reason = s5p_mfc_get_int_reason_v5,
17131624 .get_int_err = s5p_mfc_get_int_err_v5,
17141625 .err_dec = s5p_mfc_err_dec_v5,
1715− .err_dspl = s5p_mfc_err_dspl_v5,
17161626 .get_img_width = s5p_mfc_get_img_width_v5,
17171627 .get_img_height = s5p_mfc_get_img_height_v5,
17181628 .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
17211631 .get_enc_strm_size = s5p_mfc_get_enc_strm_size_v5,
17221632 .get_enc_slice_type = s5p_mfc_get_enc_slice_type_v5,
17231633 .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,
17281634 .get_pic_type_top = s5p_mfc_get_pic_type_top_v5,
17291635 .get_pic_type_bot = s5p_mfc_get_pic_type_bot_v5,
17301636 .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
505505 }
506506
507507 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,
509509 S5P_FIMV_CH_INIT_BUFS_V6, NULL);
510510
511511 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
603603 }
604604
605605 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,
607607 S5P_FIMV_CH_INIT_BUFS_V6, NULL);
608608
609609 mfc_debug_leave();
@@ -1378,7 +1378,7 @@ static int s5p_mfc_init_decode_v6(struct s5p_mfc_ctx *ctx) · 768 unmodified lines
13781378 writel(ctx->sei_fp_parse & 0x1, mfc_regs->d_sei_enable);
13791379
13801380 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,
13821382 S5P_FIMV_CH_SEQ_HEADER_V6, NULL);
13831383
13841384 mfc_debug_leave();
@@ -1393,7 +1393,7 @@ static inline void s5p_mfc_set_flush(struct s5p_mfc_ctx *ctx, int flush) · 8 unmodified lines
13931393 if (flush) {
13941394 dev->curr_ctx = ctx->num;
13951395 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,
13971397 S5P_FIMV_H2R_CMD_FLUSH_V6, NULL);
13981398 }
13991399 }
@@ -1413,11 +1413,11 @@ static int s5p_mfc_decode_one_frame_v6(struct s5p_mfc_ctx *ctx, · 13 unmodified lines
14131413 * is the last frame or not. */
14141414 switch (last_frame) {
14151415 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,
14171417 S5P_FIMV_CH_FRAME_START_V6, NULL);
14181418 break;
14191419 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,
14211421 S5P_FIMV_CH_LAST_FRAME_V6, NULL);
14221422 break;
14231423 default:
@@ -1455,7 +1455,7 @@ static int s5p_mfc_init_encode_v6(struct s5p_mfc_ctx *ctx) · 31 unmodified lines
14551455 }
14561456
14571457 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,
14591459 S5P_FIMV_CH_SEQ_HEADER_V6, NULL);
14601460
14611461 return 0;
@@ -1500,37 +1500,13 @@ static int s5p_mfc_encode_one_frame_v6(struct s5p_mfc_ctx *ctx) · 38 unmodified lines
15001500 cmd = S5P_FIMV_CH_LAST_FRAME_V6;
15011501
15021502 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);
15041504
15051505 mfc_debug(2, "--\n");
15061506
15071507 return 0;
15081508 }
15091509
1510−static 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−
15341510 static inline void s5p_mfc_run_dec_last_frames(struct s5p_mfc_ctx *ctx)
15351511 {
15361512 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
15441520 {
15451521 struct s5p_mfc_dev *dev = ctx->dev;
15461522 struct s5p_mfc_buf *temp_vb;
1547− unsigned long flags;
15481523 int last_frame = 0;
15491524
15501525 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
15561531 return 0;
15571532 }
15581533
1559− spin_lock_irqsave(&dev->irqlock, flags);
15601534 /* Frames are being decoded */
15611535 if (list_empty(&ctx->src_queue)) {
15621536 mfc_debug(2, "No src buffers.\n");
1563− spin_unlock_irqrestore(&dev->irqlock, flags);
15641537 return -EAGAIN;
15651538 }
15661539 /* 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
15701543 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0),
15711544 ctx->consumed_stream,
15721545 temp_vb->b->vb2_buf.planes[0].bytesused);
1573− spin_unlock_irqrestore(&dev->irqlock, flags);
15741546
15751547 dev->curr_ctx = ctx->num;
15761548 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
15861558 static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx)
15871559 {
15881560 struct s5p_mfc_dev *dev = ctx->dev;
1589− unsigned long flags;
15901561 struct s5p_mfc_buf *dst_mb;
15911562 struct s5p_mfc_buf *src_mb;
15921563 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
15951566 */
15961567 unsigned int dst_size;
15971568
1598− spin_lock_irqsave(&dev->irqlock, flags);
1599−
16001569 if (list_empty(&ctx->src_queue) && ctx->state != MFCINST_FINISHING) {
16011570 mfc_debug(2, "no src buffers.\n");
1602− spin_unlock_irqrestore(&dev->irqlock, flags);
16031571 return -EAGAIN;
16041572 }
16051573
16061574 if (list_empty(&ctx->dst_queue)) {
16071575 mfc_debug(2, "no dst buffers.\n");
1608− spin_unlock_irqrestore(&dev->irqlock, flags);
16091576 return -EAGAIN;
16101577 }
16111578
@@ -1639,8 +1606,6 @@ static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) · 27 unmodified lines
16391606
16401607 s5p_mfc_set_enc_stream_buffer_v6(ctx, dst_addr, dst_size);
16411608
1642− spin_unlock_irqrestore(&dev->irqlock, flags);
1643−
16441609 dev->curr_ctx = ctx->num;
16451610 s5p_mfc_encode_one_frame_v6(ctx);
16461611
@@ -1650,18 +1615,15 @@ static inline int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) · 3 unmodified lines
16501615 static inline void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx)
16511616 {
16521617 struct s5p_mfc_dev *dev = ctx->dev;
1653− unsigned long flags;
16541618 struct s5p_mfc_buf *temp_vb;
16551619
16561620 /* Initializing decoding - parsing header */
1657− spin_lock_irqsave(&dev->irqlock, flags);
16581621 mfc_debug(2, "Preparing to init decoding.\n");
16591622 temp_vb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
16601623 mfc_debug(2, "Header size: %d\n", temp_vb->b->vb2_buf.planes[0].bytesused);
16611624 s5p_mfc_set_dec_stream_buffer_v6(ctx,
16621625 vb2_dma_contig_plane_dma_addr(&temp_vb->b->vb2_buf, 0), 0,
16631626 temp_vb->b->vb2_buf.planes[0].bytesused);
1664− spin_unlock_irqrestore(&dev->irqlock, flags);
16651627 dev->curr_ctx = ctx->num;
16661628 s5p_mfc_init_decode_v6(ctx);
16671629 }
@@ -1669,18 +1631,14 @@ static inline void s5p_mfc_run_init_dec(struct s5p_mfc_ctx *ctx) · 1 unmodified line
16691631 static inline void s5p_mfc_run_init_enc(struct s5p_mfc_ctx *ctx)
16701632 {
16711633 struct s5p_mfc_dev *dev = ctx->dev;
1672− unsigned long flags;
16731634 struct s5p_mfc_buf *dst_mb;
16741635 unsigned long dst_addr;
16751636 unsigned int dst_size;
16761637
1677− spin_lock_irqsave(&dev->irqlock, flags);
1678−
16791638 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list);
16801639 dst_addr = vb2_dma_contig_plane_dma_addr(&dst_mb->b->vb2_buf, 0);
16811640 dst_size = vb2_plane_size(&dst_mb->b->vb2_buf, 0);
16821641 s5p_mfc_set_enc_stream_buffer_v6(ctx, dst_addr, dst_size);
1683− spin_unlock_irqrestore(&dev->irqlock, flags);
16841642 dev->curr_ctx = ctx->num;
16851643 s5p_mfc_init_encode_v6(ctx);
16861644 }
@@ -1846,21 +1804,6 @@ static void s5p_mfc_try_run_v6(struct s5p_mfc_dev *dev) · 159 unmodified lines
18461804 }
18471805 }
18481806
1849−
1850−static 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−
18641807 static void s5p_mfc_clear_int_flags_v6(struct s5p_mfc_dev *dev)
18651808 {
18661809 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
18681811 writel(0, mfc_regs->risc2host_int);
18691812 }
18701813
1871−static 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−
18791814 static unsigned int
18801815 s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned long ofs)
18811816 {
@@ -1942,11 +1877,6 @@ static int s5p_mfc_err_dec_v6(unsigned int err) · 60 unmodified lines
19421877 return (err & S5P_FIMV_ERR_DEC_MASK_V6) >> S5P_FIMV_ERR_DEC_SHIFT_V6;
19431878 }
19441879
1945−static 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−
19501880 static int s5p_mfc_get_img_width_v6(struct s5p_mfc_dev *dev)
19511881 {
19521882 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
19871917 return readl(dev->mfc_regs->e_slice_type);
19881918 }
19891919
1990−static 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−
1995−static 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−
2001−static 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−
2006−static 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−
20111920 static unsigned int s5p_mfc_get_pic_type_top_v6(struct s5p_mfc_ctx *ctx)
20121921 {
20131922 return s5p_mfc_read_info_v6(ctx,
@@ -2282,20 +2191,11 @@ static struct s5p_mfc_hw_ops s5p_mfc_ops_v6 = { · 268 unmodified lines
22822191 s5p_mfc_release_dev_context_buffer_v6,
22832192 .dec_calc_dpb_size = s5p_mfc_dec_calc_dpb_size_v6,
22842193 .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,
22872194 .set_enc_stream_buffer = s5p_mfc_set_enc_stream_buffer_v6,
22882195 .set_enc_frame_buffer = s5p_mfc_set_enc_frame_buffer_v6,
22892196 .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,
22942197 .try_run = s5p_mfc_try_run_v6,
2295− .cleanup_queue = s5p_mfc_cleanup_queue_v6,
22962198 .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,
22992199 .get_dspl_y_adr = s5p_mfc_get_dspl_y_adr_v6,
23002200 .get_dec_y_adr = s5p_mfc_get_dec_y_adr_v6,
23012201 .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
23062206 .get_int_reason = s5p_mfc_get_int_reason_v6,
23072207 .get_int_err = s5p_mfc_get_int_err_v6,
23082208 .err_dec = s5p_mfc_err_dec_v6,
2309− .err_dspl = s5p_mfc_err_dspl_v6,
23102209 .get_img_width = s5p_mfc_get_img_width_v6,
23112210 .get_img_height = s5p_mfc_get_img_height_v6,
23122211 .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
23152214 .get_enc_strm_size = s5p_mfc_get_enc_strm_size_v6,
23162215 .get_enc_slice_type = s5p_mfc_get_enc_slice_type_v6,
23172216 .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,
23222217 .get_pic_type_top = s5p_mfc_get_pic_type_top_v6,
23232218 .get_pic_type_bot = s5p_mfc_get_pic_type_bot_v6,
23242219 .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
3333 #include <linux/regulator/consumer.h>
3434 #include <linux/v4l2-dv-timings.h>
3535
36−#include <media/s5p_hdmi.h>
36+#include <linux/platform_data/media/s5p_hdmi.h>
3737 #include <media/v4l2-common.h>
3838 #include <media/v4l2-dev.h>
3939 #include <media/v4l2-device.h>
@@ -627,7 +627,7 @@ static int hdmi_s_dv_timings(struct v4l2_subdev *sd, · 587 unmodified lines
627627
628628 for (i = 0; i < ARRAY_SIZE(hdmi_timings); i++)
629629 if (v4l2_match_dv_timings(&hdmi_timings[i].dv_timings,
630− timings, 0))
630+ timings, 0, false))
631631 break;
632632 if (i == ARRAY_SIZE(hdmi_timings)) {
633633 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
881881 .unlocked_ioctl = video_ioctl2,
882882 };
883883
884−static int queue_setup(struct vb2_queue *vq, const void *parg,
884+static int queue_setup(struct vb2_queue *vq,
885885 unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[],
886886 void *alloc_ctxs[])
887887 {
drivers/media/platform/s5p-tv/sii9234_drv.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include <linux/regulator/machine.h>
2424 #include <linux/slab.h>
2525
26−#include <media/sii9234.h>
26+#include <linux/platform_data/media/sii9234.h>
2727 #include <media/v4l2-subdev.h>
2828
2929 MODULE_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
865865 /* ========== Queue operations ========== */
866866
867867 static int sh_veu_queue_setup(struct vb2_queue *vq,
868− const void *parg,
869868 unsigned int *nbuffers, unsigned int *nplanes,
870869 unsigned int sizes[], void *alloc_ctxs[])
871870 {
872− const struct v4l2_format *f = parg;
873871 struct sh_veu_dev *veu = vb2_get_drv_priv(vq);
874− struct sh_veu_vfmt *vfmt;
875− unsigned int size, count = *nbuffers;
876−
877− if (f) {
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− }
872+ struct sh_veu_vfmt *vfmt = sh_veu_get_vfmt(veu, vq->type);
873+ unsigned int count = *nbuffers;
874+ unsigned int size = vfmt->bytesperline * vfmt->frame.height *
875+ vfmt->fmt->depth / vfmt->fmt->ydepth;
894876
895877 if (count < 2)
896878 *nbuffers = count = 2;
@@ -900,6 +882,11 @@ static int sh_veu_queue_setup(struct vb2_queue *vq, · 3 unmodified lines
900882 *nbuffers = count;
901883 }
902884
885+ if (*nplanes) {
886+ alloc_ctxs[0] = veu->alloc_ctx;
887+ return sizes[0] < size ? -EINVAL : 0;
888+ }
889+
903890 *nplanes = 1;
904891 sizes[0] = size;
905892 alloc_ctxs[0] = veu->alloc_ctx;
@@ -1107,7 +1094,7 @@ static irqreturn_t sh_veu_isr(int irq, void *dev_id) · 201 unmodified lines
11071094 if (!src || !dst)
11081095 return IRQ_NONE;
11091096
1110− dst->timestamp = src->timestamp;
1097+ dst->vb2_buf.timestamp = src->vb2_buf.timestamp;
11111098 dst->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
11121099 dst->flags |=
11131100 src->flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
drivers/media/platform/sh_vou.c+7−8
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include <linux/videodev2.h>
2323 #include <linux/module.h>
2424
25−#include <media/sh_vou.h>
25+#include <media/drv-intf/sh_vou.h>
2626 #include <media/v4l2-common.h>
2727 #include <media/v4l2-device.h>
2828 #include <media/v4l2-ioctl.h>
@@ -243,22 +243,21 @@ static void sh_vou_stream_config(struct sh_vou_device *vou_dev) · 214 unmodified lines
243243 }
244244
245245 /* Locking: caller holds fop_lock mutex */
246−static int sh_vou_queue_setup(struct vb2_queue *vq, const void *parg,
246+static int sh_vou_queue_setup(struct vb2_queue *vq,
247247 unsigned int *nbuffers, unsigned int *nplanes,
248248 unsigned int sizes[], void *alloc_ctxs[])
249249 {
250− const struct v4l2_format *fmt = parg;
251250 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq);
252251 struct v4l2_pix_format *pix = &vou_dev->pix;
253252 int bytes_per_line = vou_fmt[vou_dev->pix_idx].bpp * pix->width / 8;
254253
255254 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__);
256255
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;
261256 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;
262261 return 0;
263262 }
264263
@@ -1071,7 +1070,7 @@ static irqreturn_t sh_vou_isr(int irq, void *dev_id) · 806 unmodified lines
10711070
10721071 list_del(&vb->list);
10731072
1074− v4l2_get_timestamp(&vb->vb.timestamp);
1073+ vb->vb.vb2_buf.timestamp = ktime_get_ns();
10751074 vb->vb.sequence = vou_dev->sequence++;
10761075 vb->vb.field = V4L2_FIELD_INTERLACED;
10771076 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
2424 #include <linux/slab.h>
2525
2626 #include <media/soc_camera.h>
27−#include <media/soc_mediabus.h>
27+#include <media/drv-intf/soc_mediabus.h>
2828 #include <media/v4l2-of.h>
2929 #include <media/videobuf2-dma-contig.h>
3030
@@ -79,6 +79,7 @@ struct atmel_isi { · 48 unmodified lines
7979 dma_addr_t fb_descriptors_phys;
8080 struct list_head dma_desc_head;
8181 struct isi_dma_desc dma_desc[MAX_BUFFER_NUM];
82+ bool enable_preview_path;
8283
8384 struct completion complete;
8485 /* ISI peripherial clock */
@@ -103,13 +104,55 @@ static u32 isi_readl(struct atmel_isi *isi, u32 reg) · 18 unmodified lines
103104 return readl(isi->regs + reg);
104105 }
105106
107+static 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+
106145 static void configure_geometry(struct atmel_isi *isi, u32 width,
107− u32 height, u32 code)
146+ u32 height, const struct soc_camera_format_xlate *xlate)
108147 {
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;
110153
111154 /* According to sensor's output format to set cfg2 */
112− switch (code) {
155+ switch (xlate->code) {
113156 default:
114157 /* Grey */
115158 case MEDIA_BUS_FMT_Y8_1X8:
@@ -117,16 +160,11 @@ static void configure_geometry(struct atmel_isi *isi, u32 width, · 1 unmodified line
117160 break;
118161 /* YUV */
119162 case MEDIA_BUS_FMT_VYUY8_2X8:
120− cfg2 = ISI_CFG2_YCC_SWAP_MODE_3 | ISI_CFG2_COL_SPACE_YCbCr;
121− break;
122163 case MEDIA_BUS_FMT_UYVY8_2X8:
123− cfg2 = ISI_CFG2_YCC_SWAP_MODE_2 | ISI_CFG2_COL_SPACE_YCbCr;
124− break;
125164 case MEDIA_BUS_FMT_YVYU8_2X8:
126− cfg2 = ISI_CFG2_YCC_SWAP_MODE_1 | ISI_CFG2_COL_SPACE_YCbCr;
127− break;
128165 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);
130168 break;
131169 /* RGB, TODO */
132170 }
@@ -139,6 +177,16 @@ static void configure_geometry(struct atmel_isi *isi, u32 width, · 6 unmodified lines
139177 cfg2 |= ((height - 1) << ISI_CFG2_IM_VSIZE_OFFSET)
140178 & ISI_CFG2_IM_VSIZE_MASK;
141179 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;
142190 }
143191
144192 static bool is_supported(struct soc_camera_device *icd,
@@ -151,8 +199,9 @@ static bool is_supported(struct soc_camera_device *icd, · 6 unmodified lines
151199 case V4L2_PIX_FMT_UYVY:
152200 case V4L2_PIX_FMT_YVYU:
153201 case V4L2_PIX_FMT_VYUY:
202+ /* RGB */
203+ case V4L2_PIX_FMT_RGB565:
154204 return true;
155− /* RGB, TODO */
156205 default:
157206 return false;
158207 }
@@ -165,7 +214,7 @@ static irqreturn_t atmel_isi_handle_streaming(struct atmel_isi *isi) · 6 unmodified lines
165214 struct frame_buffer *buf = isi->active;
166215
167216 list_del_init(&buf->list);
168− v4l2_get_timestamp(&vbuf->timestamp);
217+ vbuf->vb2_buf.timestamp = ktime_get_ns();
169218 vbuf->sequence = isi->sequence++;
170219 vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
171220 }
@@ -176,11 +225,19 @@ static irqreturn_t atmel_isi_handle_streaming(struct atmel_isi *isi) · 4 unmodified lines
176225 /* start next dma frame. */
177226 isi->active = list_entry(isi->video_buffer_list.next,
178227 struct frame_buffer, list);
179− isi_writel(isi, ISI_DMA_C_DSCR,
180− (u32)isi->active->p_dma_desc->fbd_phys);
181− isi_writel(isi, ISI_DMA_C_CTRL,
182− ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);
183− isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH);
228+ if (!isi->enable_preview_path) {
229+ isi_writel(isi, ISI_DMA_C_DSCR,
230+ (u32)isi->active->p_dma_desc->fbd_phys);
231+ isi_writel(isi, ISI_DMA_C_CTRL,
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+ }
184241 }
185242 return IRQ_HANDLED;
186243 }
@@ -207,7 +264,8 @@ static irqreturn_t isi_interrupt(int irq, void *dev_id) · 20 unmodified lines
207264 isi_writel(isi, ISI_INTDIS, ISI_CTRL_DIS);
208265 ret = IRQ_HANDLED;
209266 } else {
210− if (likely(pending & ISI_SR_CXFR_DONE))
267+ if (likely(pending & ISI_SR_CXFR_DONE) ||
268+ likely(pending & ISI_SR_PXFR_DONE))
211269 ret = atmel_isi_handle_streaming(isi);
212270 }
213271
@@ -245,7 +303,7 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset) · 31 unmodified lines
245303 /* ------------------------------------------------------------------
246304 Videobuf operations
247305 ------------------------------------------------------------------*/
248−static int queue_setup(struct vb2_queue *vq, const void *parg,
306+static int queue_setup(struct vb2_queue *vq,
249307 unsigned int *nbuffers, unsigned int *nplanes,
250308 unsigned int sizes[], void *alloc_ctxs[])
251309 {
@@ -352,21 +410,35 @@ static void start_dma(struct atmel_isi *isi, struct frame_buffer *buffer) · 100 unmodified lines
352410 ISI_SR_CXFR_DONE | ISI_SR_PXFR_DONE);
353411
354412 /* Check if already in a frame */
355− if (isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) {
356− dev_err(isi->soc_host.icd->parent, "Already in frame handling.\n");
357− return;
358− }
413+ if (!isi->enable_preview_path) {
414+ if (isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) {
415+ dev_err(isi->soc_host.icd->parent, "Already in frame handling.\n");
416+ return;
417+ }
359418
360− isi_writel(isi, ISI_DMA_C_DSCR, (u32)buffer->p_dma_desc->fbd_phys);
361− isi_writel(isi, ISI_DMA_C_CTRL, ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE);
362− isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH);
419+ isi_writel(isi, ISI_DMA_C_DSCR,
420+ (u32)buffer->p_dma_desc->fbd_phys);
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+ }
363431
364432 cfg1 &= ~ISI_CFG1_FRATE_DIV_MASK;
365433 /* Enable linked list */
366434 cfg1 |= isi->pdata.frate | ISI_CFG1_DISCR;
367435
368− /* Enable codec path and ISI */
369− ctrl = ISI_CTRL_CDC | ISI_CTRL_EN;
436+ /* Enable ISI */
437+ ctrl = ISI_CTRL_EN;
438+
439+ if (!isi->enable_preview_path)
440+ ctrl |= ISI_CTRL_CDC;
441+
370442 isi_writel(isi, ISI_CTRL, ctrl);
371443 isi_writel(isi, ISI_CFG1, cfg1);
372444 }
@@ -411,7 +483,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) · 38 unmodified lines
411483 isi_writel(isi, ISI_INTDIS, (u32)~0UL);
412484
413485 configure_geometry(isi, icd->user_width, icd->user_height,
414− icd->current_fmt->code);
486+ icd->current_fmt);
415487
416488 spin_lock_irq(&isi->lock);
417489 /* Clear any pending interrupt */
@@ -443,15 +515,17 @@ static void stop_streaming(struct vb2_queue *vq) · 25 unmodified lines
443515 }
444516 spin_unlock_irq(&isi->lock);
445517
446− timeout = jiffies + FRAME_INTERVAL_MILLI_SEC * HZ;
447− /* Wait until the end of the current frame. */
448− while ((isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) &&
449− time_before(jiffies, timeout))
450− msleep(1);
518+ if (!isi->enable_preview_path) {
519+ timeout = jiffies + FRAME_INTERVAL_MILLI_SEC * HZ;
520+ /* Wait until the end of the current frame. */
521+ while ((isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) &&
522+ time_before(jiffies, timeout))
523+ msleep(1);
451524
452− if (time_after(jiffies, timeout))
453− dev_err(icd->parent,
454− "Timeout waiting for finishing codec request\n");
525+ if (time_after(jiffies, timeout))
526+ dev_err(icd->parent,
527+ "Timeout waiting for finishing codec request\n");
528+ }
455529
456530 /* Disable interrupts */
457531 isi_writel(isi, ISI_INTDIS,
@@ -617,6 +691,14 @@ static const struct soc_mbus_pixelfmt isi_camera_formats[] = { · 159 unmodified lines
617691 .order = SOC_MBUS_ORDER_LE,
618692 .layout = SOC_MBUS_LAYOUT_PACKED,
619693 },
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+ },
620702 };
621703
622704 /* 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
673755 struct soc_camera_format_xlate *xlate)
674756 {
675757 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
676− int formats = 0, ret;
758+ int formats = 0, ret, i, n;
677759 /* sensor format */
678760 struct v4l2_subdev_mbus_code_enum code = {
679761 .which = V4L2_SUBDEV_FORMAT_ACTIVE,
@@ -707,11 +789,11 @@ static int isi_camera_get_formats(struct soc_camera_device *icd, · 27 unmodified lines
707789 case MEDIA_BUS_FMT_VYUY8_2X8:
708790 case MEDIA_BUS_FMT_YUYV8_2X8:
709791 case MEDIA_BUS_FMT_YVYU8_2X8:
710− formats++;
711− if (xlate) {
712− xlate->host_fmt = &isi_camera_formats[0];
792+ n = ARRAY_SIZE(isi_camera_formats);
793+ formats += n;
794+ for (i = 0; xlate && i < n; i++, xlate++) {
795+ xlate->host_fmt = &isi_camera_formats[i];
713796 xlate->code = code.code;
714− xlate++;
715797 dev_dbg(icd->parent, "Providing format %s using code %d\n",
716798 isi_camera_formats[0].name, code.code);
717799 }
drivers/media/platform/soc_camera/atmel-isi.h+10−0
@@ -79,6 +79,16 @@ · 78 unmodified lines
7979 #define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET)
8080 #define ISI_CFG2_IM_HSIZE_MASK (0x7FF << ISI_CFG2_IM_HSIZE_OFFSET)
8181
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+
8292 /* Bitfields in CTRL */
8393 /* Also using in SR(ISI_V2) */
8494 #define ISI_CTRL_EN (1 << 0)
drivers/media/platform/soc_camera/mx2_camera.c+3−9
@@ -35,11 +35,11 @@ · 34 unmodified lines
3535 #include <media/videobuf2-v4l2.h>
3636 #include <media/videobuf2-dma-contig.h>
3737 #include <media/soc_camera.h>
38−#include <media/soc_mediabus.h>
38+#include <media/drv-intf/soc_mediabus.h>
3939
4040 #include <linux/videodev2.h>
4141
42−#include <linux/platform_data/camera-mx2.h>
42+#include <linux/platform_data/media/camera-mx2.h>
4343
4444 #include <asm/dma.h>
4545
@@ -469,21 +469,15 @@ static void mx2_camera_clock_stop(struct soc_camera_host *ici) · 423 unmodified lines
469469 * Videobuf operations
470470 */
471471 static int mx2_videobuf_setup(struct vb2_queue *vq,
472− const void *parg,
473472 unsigned int *count, unsigned int *num_planes,
474473 unsigned int sizes[], void *alloc_ctxs[])
475474 {
476− const struct v4l2_format *fmt = parg;
477475 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
478476 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
479477 struct mx2_camera_dev *pcdev = ici->priv;
480478
481479 dev_dbg(icd->parent, "count=%d, size=%d\n", *count, sizes[0]);
482480
483− /* TODO: support for VIDIOC_CREATE_BUFS not ready */
484− if (fmt != NULL)
485− return -ENOTTY;
486−
487481 alloc_ctxs[0] = pcdev->alloc_ctx;
488482
489483 sizes[0] = icd->sizeimage;
@@ -1351,7 +1345,7 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev, · 861 unmodified lines
13511345 vb2_get_plane_payload(vb, 0));
13521346
13531347 list_del_init(&buf->internal.queue);
1354− v4l2_get_timestamp(&vbuf->timestamp);
1348+ vb->timestamp = ktime_get_ns();
13551349 vbuf->sequence = pcdev->frame_count;
13561350 if (err)
13571351 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
2323 #include <media/v4l2-dev.h>
2424 #include <media/videobuf2-dma-contig.h>
2525 #include <media/soc_camera.h>
26−#include <media/soc_mediabus.h>
26+#include <media/drv-intf/soc_mediabus.h>
2727
28−#include <linux/platform_data/camera-mx3.h>
28+#include <linux/platform_data/media/camera-mx3.h>
2929 #include <linux/platform_data/dma-imx.h>
3030
3131 #define MX3_CAM_DRV_NAME "mx3-camera"
@@ -155,7 +155,7 @@ static void mx3_cam_dma_done(void *arg) · 123 unmodified lines
155155 struct mx3_camera_buffer *buf = to_mx3_vb(vb);
156156
157157 list_del_init(&buf->queue);
158− v4l2_get_timestamp(&vb->timestamp);
158+ vb->vb2_buf.timestamp = ktime_get_ns();
159159 vb->field = mx3_cam->field;
160160 vb->sequence = mx3_cam->sequence++;
161161 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
185185 * Calculate the __buffer__ (not data) size and number of buffers.
186186 */
187187 static int mx3_videobuf_setup(struct vb2_queue *vq,
188− const void *parg,
189188 unsigned int *count, unsigned int *num_planes,
190189 unsigned int sizes[], void *alloc_ctxs[])
191190 {
192− const struct v4l2_format *fmt = parg;
193191 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
194192 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
195193 struct mx3_camera_dev *mx3_cam = ici->priv;
@@ -197,33 +195,6 @@ static int mx3_videobuf_setup(struct vb2_queue *vq, · 1 unmodified line
197195 if (!mx3_cam->idmac_channel[0])
198196 return -EINVAL;
199197
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−
227198 alloc_ctxs[0] = mx3_cam->alloc_ctx;
228199
229200 if (!vq->num_buffers)
@@ -232,9 +203,14 @@ static int mx3_videobuf_setup(struct vb2_queue *vq, · 2 unmodified lines
232203 if (!*count)
233204 *count = 2;
234205
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+
235212 /* If *num_planes != 0, we have already verified *count. */
236− if (!*num_planes &&
237− sizes[0] * *count + mx3_cam->buf_total > MAX_VIDEO_MEM * 1024 * 1024)
213+ if (sizes[0] * *count + mx3_cam->buf_total > MAX_VIDEO_MEM * 1024 * 1024)
238214 *count = (MAX_VIDEO_MEM * 1024 * 1024 - mx3_cam->buf_total) /
239215 sizes[0];
240216
drivers/media/platform/soc_camera/omap1_camera.c+2−2
@@ -28,9 +28,9 @@ · 27 unmodified lines
2828 #include <linux/platform_device.h>
2929 #include <linux/slab.h>
3030
31−#include <media/omap1_camera.h>
31+#include <linux/platform_data/media/omap1_camera.h>
3232 #include <media/soc_camera.h>
33−#include <media/soc_mediabus.h>
33+#include <media/drv-intf/soc_mediabus.h>
3434 #include <media/videobuf-dma-contig.h>
3535 #include <media/videobuf-dma-sg.h>
3636
drivers/media/platform/soc_camera/pxa_camera.c+2−2
@@ -33,13 +33,13 @@ · 32 unmodified lines
3333 #include <media/v4l2-dev.h>
3434 #include <media/videobuf-dma-sg.h>
3535 #include <media/soc_camera.h>
36−#include <media/soc_mediabus.h>
36+#include <media/drv-intf/soc_mediabus.h>
3737 #include <media/v4l2-of.h>
3838
3939 #include <linux/videodev2.h>
4040
4141 #include <mach/dma.h>
42−#include <linux/platform_data/camera-pxa.h>
42+#include <linux/platform_data/media/camera-pxa.h>
4343
4444 #define PXA_CAM_VERSION "0.0.6"
4545 #define PXA_CAM_DRV_NAME "pxa27x-camera"
drivers/media/platform/soc_camera/rcar_vin.c+37−82
@@ -21,14 +21,13 @@ · 20 unmodified lines
2121 #include <linux/module.h>
2222 #include <linux/of.h>
2323 #include <linux/of_device.h>
24−#include <linux/platform_data/camera-rcar.h>
2524 #include <linux/platform_device.h>
2625 #include <linux/pm_runtime.h>
2726 #include <linux/slab.h>
2827 #include <linux/videodev2.h>
2928
3029 #include <media/soc_camera.h>
31−#include <media/soc_mediabus.h>
30+#include <media/drv-intf/soc_mediabus.h>
3231 #include <media/v4l2-common.h>
3332 #include <media/v4l2-dev.h>
3433 #include <media/v4l2-device.h>
@@ -138,6 +137,11 @@ · 103 unmodified lines
138137
139138 #define TIMEOUT_MS 100
140139
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+
141145 enum chip_id {
142146 RCAR_GEN2,
143147 RCAR_H1,
@@ -527,46 +531,14 @@ struct rcar_vin_cam { · 383 unmodified lines
527531 * required
528532 */
529533 static int rcar_vin_videobuf_setup(struct vb2_queue *vq,
530− const void *parg,
531534 unsigned int *count,
532535 unsigned int *num_planes,
533536 unsigned int sizes[], void *alloc_ctxs[])
534537 {
535− const struct v4l2_format *fmt = parg;
536538 struct soc_camera_device *icd = soc_camera_from_vb2q(vq);
537539 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
538540 struct rcar_vin_priv *priv = ici->priv;
539541
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−
570542 alloc_ctxs[0] = priv->alloc_ctx;
571543
572544 if (!vq->num_buffers)
@@ -576,14 +548,18 @@ static int rcar_vin_videobuf_setup(struct vb2_queue *vq, · 3 unmodified lines
576548 *count = 2;
577549 priv->vb_count = *count;
578550
579− *num_planes = 1;
580−
581551 /* Number of hardware slots */
582552 if (is_continuous_transfer(priv))
583553 priv->nr_hw_slots = MAX_BUFFER_NUM;
584554 else
585555 priv->nr_hw_slots = 1;
586556
557+ if (*num_planes)
558+ return sizes[0] < icd->sizeimage ? -EINVAL : 0;
559+
560+ sizes[0] = icd->sizeimage;
561+ *num_planes = 1;
562+
587563 dev_dbg(icd->parent, "count=%d, size=%u\n", *count, sizes[0]);
588564
589565 return 0;
@@ -912,7 +888,7 @@ static irqreturn_t rcar_vin_irq(int irq, void *data) · 322 unmodified lines
912888
913889 priv->queue_buf[slot]->field = priv->field;
914890 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();
916892 vb2_buffer_done(&priv->queue_buf[slot]->vb2_buf,
917893 VB2_BUF_STATE_DONE);
918894 priv->queue_buf[slot] = NULL;
@@ -1853,63 +1829,43 @@ static const struct of_device_id rcar_vin_of_table[] = { · 934 unmodified lines
18531829 MODULE_DEVICE_TABLE(of, rcar_vin_of_table);
18541830 #endif
18551831
1856−static 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−};
1862−MODULE_DEVICE_TABLE(platform, rcar_vin_id_table);
1863−
18641832 static int rcar_vin_probe(struct platform_device *pdev)
18651833 {
18661834 const struct of_device_id *match = NULL;
18671835 struct rcar_vin_priv *priv;
1836+ struct v4l2_of_endpoint ep;
1837+ struct device_node *np;
18681838 struct resource *mem;
1869− struct rcar_vin_platform_data *pdata;
18701839 unsigned int pdata_flags;
18711840 int irq, ret;
18721841
1873− if (pdev->dev.of_node) {
1874− struct v4l2_of_endpoint ep;
1875− struct device_node *np;
1842+ match = of_match_device(of_match_ptr(rcar_vin_of_table), &pdev->dev);
18761843
1877− match = of_match_device(of_match_ptr(rcar_vin_of_table),
1878− &pdev->dev);
1879−
1880− np = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
1881− if (!np) {
1882− dev_err(&pdev->dev, "could not find endpoint\n");
1883− return -EINVAL;
1884− }
1844+ np = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
1845+ if (!np) {
1846+ dev_err(&pdev->dev, "could not find endpoint\n");
1847+ return -EINVAL;
1848+ }
18851849
1886− ret = v4l2_of_parse_endpoint(np, &ep);
1887− if (ret) {
1888− dev_err(&pdev->dev, "could not parse endpoint\n");
1889− return ret;
1890− }
1850+ ret = v4l2_of_parse_endpoint(np, &ep);
1851+ if (ret) {
1852+ dev_err(&pdev->dev, "could not parse endpoint\n");
1853+ return ret;
1854+ }
18911855
1892− if (ep.bus_type == V4L2_MBUS_BT656)
1893− pdata_flags = RCAR_VIN_BT656;
1894− else {
1895− pdata_flags = 0;
1896− if (ep.bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
1897− pdata_flags |= RCAR_VIN_HSYNC_ACTIVE_LOW;
1898− if (ep.bus.parallel.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
1899− pdata_flags |= RCAR_VIN_VSYNC_ACTIVE_LOW;
1900− }
1856+ if (ep.bus_type == V4L2_MBUS_BT656)
1857+ pdata_flags = RCAR_VIN_BT656;
1858+ else {
1859+ pdata_flags = 0;
1860+ if (ep.bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
1861+ pdata_flags |= RCAR_VIN_HSYNC_ACTIVE_LOW;
1862+ if (ep.bus.parallel.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
1863+ pdata_flags |= RCAR_VIN_VSYNC_ACTIVE_LOW;
1864+ }
19011865
1902− of_node_put(np);
1866+ of_node_put(np);
19031867
1904− 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− }
1868+ dev_dbg(&pdev->dev, "pdata_flags = %08x\n", pdata_flags);
19131869
19141870 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
19151871 if (mem == NULL)
@@ -1992,7 +1948,6 @@ static struct platform_driver rcar_vin_driver = { · 76 unmodified lines
19921948 .name = DRV_NAME,
19931949 .of_match_table = of_match_ptr(rcar_vin_of_table),
19941950 },
1995− .id_table = rcar_vin_id_table,
19961951 };
19971952
19981953 module_platform_driver(rcar_vin_driver);
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c+11−34
@@ -40,11 +40,11 @@ · 39 unmodified lines
4040 #include <media/v4l2-common.h>
4141 #include <media/v4l2-dev.h>
4242 #include <media/soc_camera.h>
43−#include <media/sh_mobile_ceu.h>
44−#include <media/sh_mobile_csi2.h>
43+#include <media/drv-intf/sh_mobile_ceu.h>
44+#include <media/drv-intf/sh_mobile_csi2.h>
4545 #include <media/videobuf2-dma-contig.h>
4646 #include <media/v4l2-mediabus.h>
47−#include <media/soc_mediabus.h>
47+#include <media/drv-intf/soc_mediabus.h>
4848
4949 #include "soc_scale_crop.h"
5050
@@ -210,43 +210,14 @@ static int sh_mobile_ceu_soft_reset(struct sh_mobile_ceu_dev *pcdev) · 159 unmodified lines
210210 * for the current frame format if required
211211 */
212212 static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq,
213− const void *parg,
214213 unsigned int *count, unsigned int *num_planes,
215214 unsigned int sizes[], void *alloc_ctxs[])
216215 {
217− const struct v4l2_format *fmt = parg;
218216 struct soc_camera_device *icd = container_of(vq,
219217 struct soc_camera_device, vb2_vidq);
220218 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
221219 struct sh_mobile_ceu_dev *pcdev = ici->priv;
222220
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−
250221 alloc_ctxs[0] = pcdev->alloc_ctx;
251222
252223 if (!vq->num_buffers)
@@ -255,8 +226,14 @@ static int sh_mobile_ceu_videobuf_setup(struct vb2_queue *vq, · 2 unmodified lines
255226 if (!*count)
256227 *count = 2;
257228
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+
258235 /* If *num_planes != 0, we have already verified *count. */
259− if (pcdev->video_limit && !*num_planes) {
236+ if (pcdev->video_limit) {
260237 size_t size = PAGE_ALIGN(sizes[0]) * *count;
261238
262239 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
533510 pcdev->active = NULL;
534511
535512 ret = sh_mobile_ceu_capture(pcdev);
536− v4l2_get_timestamp(&vbuf->timestamp);
513+ vbuf->vb2_buf.timestamp = ktime_get_ns();
537514 if (!ret) {
538515 vbuf->field = pcdev->field;
539516 vbuf->sequence = pcdev->sequence++;
drivers/media/platform/soc_camera/sh_mobile_csi2.c+3−3
@@ -18,10 +18,10 @@ · 17 unmodified lines
1818 #include <linux/videodev2.h>
1919 #include <linux/module.h>
2020
21−#include <media/sh_mobile_ceu.h>
22−#include <media/sh_mobile_csi2.h>
21+#include <media/drv-intf/sh_mobile_ceu.h>
22+#include <media/drv-intf/sh_mobile_csi2.h>
2323 #include <media/soc_camera.h>
24−#include <media/soc_mediabus.h>
24+#include <media/drv-intf/soc_mediabus.h>
2525 #include <media/v4l2-common.h>
2626 #include <media/v4l2-dev.h>
2727 #include <media/v4l2-device.h>
drivers/media/platform/soc_camera/soc_camera.c+13−12
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <linux/vmalloc.h>
3131
3232 #include <media/soc_camera.h>
33−#include <media/soc_mediabus.h>
33+#include <media/drv-intf/soc_mediabus.h>
3434 #include <media/v4l2-async.h>
3535 #include <media/v4l2-clk.h>
3636 #include <media/v4l2-common.h>
@@ -1360,7 +1360,7 @@ static int soc_camera_i2c_init(struct soc_camera_device *icd, · 1323 unmodified lines
13601360 struct soc_camera_host_desc *shd = &sdesc->host_desc;
13611361 struct i2c_adapter *adap;
13621362 struct v4l2_subdev *subdev;
1363− char clk_name[V4L2_SUBDEV_NAME_SIZE];
1363+ char clk_name[V4L2_CLK_NAME_SIZE];
13641364 int ret;
13651365
13661366 /* 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
13911391 ssdd->sd_pdata.regulators = NULL;
13921392 shd->board_info->platform_data = ssdd;
13931393
1394− snprintf(clk_name, sizeof(clk_name), "%d-%04x",
1395− shd->i2c_adapter_id, shd->board_info->addr);
1394+ v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
1395+ shd->i2c_adapter_id, shd->board_info->addr);
13961396
13971397 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);
13981398 if (IS_ERR(icd->clk)) {
@@ -1526,7 +1526,7 @@ static int scan_async_group(struct soc_camera_host *ici, · 127 unmodified lines
15261526 struct soc_camera_async_client *sasc;
15271527 struct soc_camera_device *icd;
15281528 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];
15301530 unsigned int i;
15311531 int ret;
15321532
@@ -1572,8 +1572,9 @@ static int scan_async_group(struct soc_camera_host *ici, · 39 unmodified lines
15721572 icd->sasc = sasc;
15731573 icd->parent = ici->v4l2_dev.dev;
15741574
1575− snprintf(clk_name, sizeof(clk_name), "%d-%04x",
1576− sasd->asd.match.i2c.adapter_id, sasd->asd.match.i2c.address);
1575+ v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
1576+ sasd->asd.match.i2c.adapter_id,
1577+ sasd->asd.match.i2c.address);
15771578
15781579 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);
15791580 if (IS_ERR(icd->clk)) {
@@ -1631,7 +1632,7 @@ static int soc_of_bind(struct soc_camera_host *ici, · 51 unmodified lines
16311632 struct soc_camera_async_client *sasc;
16321633 struct soc_of_info *info;
16331634 struct i2c_client *client;
1634− char clk_name[V4L2_SUBDEV_NAME_SIZE + 32];
1635+ char clk_name[V4L2_CLK_NAME_SIZE];
16351636 int ret;
16361637
16371638 /* 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
16741675 client = of_find_i2c_device_by_node(remote);
16751676
16761677 if (client)
1677− snprintf(clk_name, sizeof(clk_name), "%d-%04x",
1678− client->adapter->nr, client->addr);
1678+ v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
1679+ client->adapter->nr, client->addr);
16791680 else
1680− snprintf(clk_name, sizeof(clk_name), "of-%s",
1681− of_node_full_name(remote));
1681+ v4l2_clk_name_of(clk_name, sizeof(clk_name),
1682+ of_node_full_name(remote));
16821683
16831684 icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);
16841685 if (IS_ERR(icd->clk)) {
drivers/media/platform/soc_camera/soc_camera_platform.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 #include <linux/videodev2.h>
1919 #include <media/v4l2-subdev.h>
2020 #include <media/soc_camera.h>
21−#include <media/soc_camera_platform.h>
21+#include <linux/platform_data/media/soc_camera_platform.h>
2222
2323 struct soc_camera_platform_priv {
2424 struct v4l2_subdev subdev;
drivers/media/platform/soc_camera/soc_mediabus.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313
1414 #include <media/v4l2-device.h>
1515 #include <media/v4l2-mediabus.h>
16−#include <media/soc_mediabus.h>
16+#include <media/drv-intf/soc_mediabus.h>
1717
1818 static const struct soc_mbus_lookup mbus_fmt[] = {
1919 {
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
191191 dst_vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
192192
193193 if (src_vb && dst_vb) {
194− dst_vb->timestamp = src_vb->timestamp;
194+ dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
195195 dst_vb->timecode = src_vb->timecode;
196196 dst_vb->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
197197 dst_vb->flags |= src_vb->flags &
@@ -297,7 +297,7 @@ static int bdisp_get_bufs(struct bdisp_ctx *ctx) · 99 unmodified lines
297297 if (ret)
298298 return ret;
299299
300− dst_vb->timestamp = src_vb->timestamp;
300+ dst_vb->vb2_buf.timestamp = src_vb->vb2_buf.timestamp;
301301
302302 return 0;
303303 }
@@ -438,11 +438,9 @@ static void bdisp_ctrls_delete(struct bdisp_ctx *ctx) · 134 unmodified lines
438438 }
439439
440440 static int bdisp_queue_setup(struct vb2_queue *vq,
441− const void *parg,
442441 unsigned int *nb_buf, unsigned int *nb_planes,
443442 unsigned int sizes[], void *allocators[])
444443 {
445− const struct v4l2_format *fmt = parg;
446444 struct bdisp_ctx *ctx = vb2_get_drv_priv(vq);
447445 struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type);
448446
@@ -455,13 +453,13 @@ static int bdisp_queue_setup(struct vb2_queue *vq, · 6 unmodified lines
455453 dev_err(ctx->bdisp_dev->dev, "Invalid format\n");
456454 return -EINVAL;
457455 }
456+ allocators[0] = ctx->bdisp_dev->alloc_ctx;
458457
459− if (fmt && fmt->fmt.pix.sizeimage < frame->sizeimage)
460− return -EINVAL;
458+ if (*nb_planes)
459+ return sizes[0] < frame->sizeimage ? -EINVAL : 0;
461460
462461 *nb_planes = 1;
463− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : frame->sizeimage;
464− allocators[0] = ctx->bdisp_dev->alloc_ctx;
462+ sizes[0] = frame->sizeimage;
465463
466464 return 0;
467465 }
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
209209
210210 tsin = fei->channel_data[n];
211211
212− if (tsin && tsin->frontend) {
213− dvb_unregister_frontend(tsin->frontend);
214− dvb_frontend_detach(tsin->frontend);
215− }
212+ if (tsin) {
213+ if (tsin->frontend) {
214+ dvb_unregister_frontend(tsin->frontend);
215+ dvb_frontend_detach(tsin->frontend);
216+ }
216217
217− if (tsin && tsin->i2c_adapter)
218218 i2c_put_adapter(tsin->i2c_adapter);
219219
220− if (tsin && tsin->i2c_client) {
221− if (tsin->i2c_client->dev.driver->owner)
220+ if (tsin->i2c_client) {
222221 module_put(tsin->i2c_client->dev.driver->owner);
223− i2c_unregister_device(tsin->i2c_client);
222+ i2c_unregister_device(tsin->i2c_client);
223+ }
224224 }
225225 }
226226
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
823823 }
824824 of_node_put(i2c_bus);
825825
826− tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0);
826+ tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0);
827827
828828 ret = gpio_is_valid(tsin->rst_gpio);
829829 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
12881288 d_vb = ctx->dst_vb;
12891289
12901290 d_vb->flags = s_vb->flags;
1291− d_vb->timestamp = s_vb->timestamp;
1291+ d_vb->vb2_buf.timestamp = s_vb->vb2_buf.timestamp;
12921292
12931293 if (s_vb->flags & V4L2_BUF_FLAG_TIMECODE)
12941294 d_vb->timecode = s_vb->timecode;
@@ -1796,7 +1796,6 @@ static const struct v4l2_ioctl_ops vpe_ioctl_ops = { · 501 unmodified lines
17961796 * Queue operations
17971797 */
17981798 static int vpe_queue_setup(struct vb2_queue *vq,
1799− const void *parg,
18001799 unsigned int *nbuffers, unsigned int *nplanes,
18011800 unsigned int sizes[], void *alloc_ctxs[])
18021801 {
drivers/media/platform/timblogiw.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <media/v4l2-ioctl.h>
3232 #include <media/v4l2-device.h>
3333 #include <media/videobuf-dma-contig.h>
34−#include <media/timb_video.h>
34+#include <linux/platform_data/media/timb_video.h>
3535
3636 #define DRIVER_NAME "timb-video"
3737
drivers/media/platform/via-camera.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <media/v4l2-ioctl.h>
2020 #include <media/v4l2-ctrls.h>
2121 #include <media/v4l2-image-sizes.h>
22−#include <media/ov7670.h>
22+#include <media/i2c/ov7670.h>
2323 #include <media/videobuf-dma-sg.h>
2424 #include <linux/delay.h>
2525 #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
235235 out_vb->sequence =
236236 get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)->sequence++;
237237 in_vb->sequence = q_data->sequence++;
238− out_vb->timestamp = in_vb->timestamp;
238+ out_vb->vb2_buf.timestamp = in_vb->vb2_buf.timestamp;
239239
240240 if (in_vb->flags & V4L2_BUF_FLAG_TIMECODE)
241241 out_vb->timecode = in_vb->timecode;
@@ -710,11 +710,9 @@ static const struct v4l2_ioctl_ops vim2m_ioctl_ops = { · 468 unmodified lines
710710 */
711711
712712 static int vim2m_queue_setup(struct vb2_queue *vq,
713− const void *parg,
714713 unsigned int *nbuffers, unsigned int *nplanes,
715714 unsigned int sizes[], void *alloc_ctxs[])
716715 {
717− const struct v4l2_format *fmt = parg;
718716 struct vim2m_ctx *ctx = vb2_get_drv_priv(vq);
719717 struct vim2m_q_data *q_data;
720718 unsigned int size, count = *nbuffers;
@@ -723,17 +721,14 @@ static int vim2m_queue_setup(struct vb2_queue *vq, · 2 unmodified lines
723721
724722 size = q_data->width * q_data->height * q_data->fmt->depth >> 3;
725723
726− if (fmt) {
727− if (fmt->fmt.pix.sizeimage < size)
728− return -EINVAL;
729− size = fmt->fmt.pix.sizeimage;
730− }
731−
732724 while (size * count > MEM2MEM_VID_MEM_LIMIT)
733725 (count)--;
726+ *nbuffers = count;
727+
728+ if (*nplanes)
729+ return sizes[0] < size ? -EINVAL : 0;
734730
735731 *nplanes = 1;
736− *nbuffers = count;
737732 sizes[0] = size;
738733
739734 /*
drivers/media/platform/vivid/vivid-core.h+2−1
@@ -264,6 +264,7 @@ struct vivid_dev { · 263 unmodified lines
264264 bool vflip;
265265 bool vbi_cap_interlaced;
266266 bool loop_video;
267+ bool reduced_fps;
267268
268269 /* Framebuffer */
269270 unsigned long video_pbase;
@@ -285,7 +286,7 @@ struct vivid_dev { · 15 unmodified lines
285286 bool dqbuf_error;
286287 bool seq_wrap;
287288 bool time_wrap;
288− __kernel_time_t time_wrap_offset;
289+ u64 time_wrap_offset;
289290 unsigned perc_dropped_buffers;
290291 enum vivid_signal_mode std_signal_mode;
291292 unsigned query_std_last;
drivers/media/platform/vivid/vivid-ctrls.c+30−5
@@ -78,6 +78,7 @@ · 77 unmodified lines
7878 #define VIVID_CID_TIME_WRAP (VIVID_CID_VIVID_BASE + 39)
7979 #define VIVID_CID_MAX_EDID_BLOCKS (VIVID_CID_VIVID_BASE + 40)
8080 #define VIVID_CID_PERCENTAGE_FILL (VIVID_CID_VIVID_BASE + 41)
81+#define VIVID_CID_REDUCED_FPS (VIVID_CID_VIVID_BASE + 42)
8182
8283 #define VIVID_CID_STD_SIGNAL_MODE (VIVID_CID_VIVID_BASE + 60)
8384 #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
424425 dev->sensor_vflip = ctrl->val;
425426 tpg_s_vflip(&dev->tpg, dev->sensor_vflip ^ dev->vflip);
426427 break;
428+ case VIVID_CID_REDUCED_FPS:
429+ dev->reduced_fps = ctrl->val;
430+ vivid_update_format_cap(dev, true);
431+ break;
427432 case VIVID_CID_HAS_CROP_CAP:
428433 dev->has_crop_cap = ctrl->val;
429434 vivid_update_format_cap(dev, true);
@@ -601,6 +606,15 @@ static const struct v4l2_ctrl_config vivid_ctrl_vflip = { · 171 unmodified lines
601606 .step = 1,
602607 };
603608
609+static 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+
604618 static const struct v4l2_ctrl_config vivid_ctrl_has_crop_cap = {
605619 .ops = &vivid_vid_cap_ctrl_ops,
606620 .id = VIVID_CID_HAS_CROP_CAP,
@@ -940,7 +954,7 @@ static const struct v4l2_ctrl_config vivid_ctrl_has_scaler_out = { · 333 unmodified lines
940954 static int vivid_streaming_s_ctrl(struct v4l2_ctrl *ctrl)
941955 {
942956 struct vivid_dev *dev = container_of(ctrl->handler, struct vivid_dev, ctrl_hdl_streaming);
943− struct timeval tv;
957+ u64 rem;
944958
945959 switch (ctrl->id) {
946960 case VIVID_CID_DQBUF_ERROR:
@@ -979,8 +993,16 @@ static int vivid_streaming_s_ctrl(struct v4l2_ctrl *ctrl) · 32 unmodified lines
979993 dev->time_wrap_offset = 0;
980994 break;
981995 }
982− v4l2_get_timestamp(&tv);
983− dev->time_wrap_offset = -tv.tv_sec - 16;
996+ /*
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;
9841006 break;
9851007 }
9861008 return 0;
@@ -1340,11 +1362,13 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap, · 353 unmodified lines
13401362 v4l2_ctrl_handler_init(hdl_vid_cap, 55);
13411363 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_class, NULL);
13421364 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);
13441367 v4l2_ctrl_handler_init(hdl_vbi_cap, 21);
13451368 v4l2_ctrl_new_custom(hdl_vbi_cap, &vivid_ctrl_class, NULL);
13461369 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);
13481372 v4l2_ctrl_handler_init(hdl_radio_rx, 17);
13491373 v4l2_ctrl_new_custom(hdl_radio_rx, &vivid_ctrl_class, NULL);
13501374 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
14141438 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_vflip, NULL);
14151439 v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_sav, NULL);
14161440 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);
14171442 if (show_ccs_cap) {
14181443 dev->ctrl_has_crop_cap = v4l2_ctrl_new_custom(hdl_vid_cap,
14191444 &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
441441 * "Start of Exposure".
442442 */
443443 if (dev->tstamp_src_is_soe)
444− v4l2_get_timestamp(&buf->vb.timestamp);
444+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
445445 if (dev->field_cap == V4L2_FIELD_ALTERNATE) {
446446 /*
447447 * 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
558558 * the timestamp now.
559559 */
560560 if (!dev->tstamp_src_is_soe)
561− v4l2_get_timestamp(&buf->vb.timestamp);
562− buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
561+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
562+ buf->vb.vb2_buf.timestamp += dev->time_wrap_offset;
563563 }
564564
565565 /*
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
9595 */
9696 vid_out_buf->vb.sequence /= 2;
9797 }
98− v4l2_get_timestamp(&vid_out_buf->vb.timestamp);
99− vid_out_buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
98+ vid_out_buf->vb.vb2_buf.timestamp =
99+ ktime_get_ns() + dev->time_wrap_offset;
100100 vb2_buffer_done(&vid_out_buf->vb.vb2_buf, dev->dqbuf_error ?
101101 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
102102 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
108108 vivid_sliced_vbi_out_process(dev, vbi_out_buf);
109109
110110 vbi_out_buf->vb.sequence = dev->vbi_out_seq_count;
111− v4l2_get_timestamp(&vbi_out_buf->vb.timestamp);
112− vbi_out_buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
111+ vbi_out_buf->vb.vb2_buf.timestamp =
112+ ktime_get_ns() + dev->time_wrap_offset;
113113 vb2_buffer_done(&vbi_out_buf->vb.vb2_buf, dev->dqbuf_error ?
114114 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
115115 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
117117 if (sdr_cap_buf) {
118118 sdr_cap_buf->vb.sequence = dev->sdr_cap_seq_count;
119119 vivid_sdr_cap_process(dev, sdr_cap_buf);
120− v4l2_get_timestamp(&sdr_cap_buf->vb.timestamp);
121− sdr_cap_buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
120+ sdr_cap_buf->vb.vb2_buf.timestamp =
121+ ktime_get_ns() + dev->time_wrap_offset;
122122 vb2_buffer_done(&sdr_cap_buf->vb.vb2_buf, dev->dqbuf_error ?
123123 VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
124124 dev->dqbuf_error = false;
@@ -213,7 +213,7 @@ static int vivid_thread_sdr_cap(void *data) · 88 unmodified lines
213213 return 0;
214214 }
215215
216−static int sdr_cap_queue_setup(struct vb2_queue *vq, const void *parg,
216+static int sdr_cap_queue_setup(struct vb2_queue *vq,
217217 unsigned *nbuffers, unsigned *nplanes,
218218 unsigned sizes[], void *alloc_ctxs[])
219219 {
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
108108 if (!VIVID_INVALID_SIGNAL(dev->std_signal_mode))
109109 vivid_vbi_gen_raw(&dev->vbi_gen, &vbi, vbuf);
110110
111− v4l2_get_timestamp(&buf->vb.timestamp);
112− buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
111+ buf->vb.vb2_buf.timestamp = ktime_get_ns() + dev->time_wrap_offset;
113112 }
114113
115114
@@ -133,11 +132,10 @@ void vivid_sliced_vbi_cap_process(struct vivid_dev *dev, · 17 unmodified lines
133132 vbuf[i] = dev->vbi_gen.data[i];
134133 }
135134
136− v4l2_get_timestamp(&buf->vb.timestamp);
137− buf->vb.timestamp.tv_sec += dev->time_wrap_offset;
135+ buf->vb.vb2_buf.timestamp = ktime_get_ns() + dev->time_wrap_offset;
138136 }
139137
140−static int vbi_cap_queue_setup(struct vb2_queue *vq, const void *parg,
138+static int vbi_cap_queue_setup(struct vb2_queue *vq,
141139 unsigned *nbuffers, unsigned *nplanes,
142140 unsigned sizes[], void *alloc_ctxs[])
143141 {
drivers/media/platform/vivid/vivid-vbi-out.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include "vivid-vbi-out.h"
2828 #include "vivid-vbi-cap.h"
2929
30−static int vbi_out_queue_setup(struct vb2_queue *vq, const void *parg,
30+static int vbi_out_queue_setup(struct vb2_queue *vq,
3131 unsigned *nbuffers, unsigned *nplanes,
3232 unsigned sizes[], void *alloc_ctxs[])
3333 {
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
9595 VIVID_WEBCAM_SIZES
9696 };
9797
98−static int vid_cap_queue_setup(struct vb2_queue *vq, const void *parg,
98+static int vid_cap_queue_setup(struct vb2_queue *vq,
9999 unsigned *nbuffers, unsigned *nplanes,
100100 unsigned sizes[], void *alloc_ctxs[])
101101 {
102− const struct v4l2_format *fmt = parg;
103102 struct vivid_dev *dev = vb2_get_drv_priv(vq);
104103 unsigned buffers = tpg_g_buffers(&dev->tpg);
105104 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
122121 dev->queue_setup_error = false;
123122 return -EINVAL;
124123 }
125− if (fmt) {
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;
124+ if (*nplanes) {
135125 /*
136− * Check if the number of planes in the specified format match
126+ * Check if the number of requested planes match
137127 * the number of buffers in the current format. You can't mix that.
138128 */
139− if (mp->num_planes != buffers)
129+ if (*nplanes != buffers)
140130 return -EINVAL;
141− vfmt = vivid_get_format(dev, mp->pixelformat);
142131 for (p = 0; p < buffers; p++) {
143− sizes[p] = mp->plane_fmt[p].sizeimage;
144132 if (sizes[p] < tpg_g_line_width(&dev->tpg, p) * h +
145− vfmt->data_offset[p])
133+ dev->fmt_cap->data_offset[p])
146134 return -EINVAL;
147135 }
148136 } else {
@@ -405,6 +393,7 @@ void vivid_update_format_cap(struct vivid_dev *dev, bool keep_controls) · 256 unmodified lines
405393 {
406394 struct v4l2_bt_timings *bt = &dev->dv_timings_cap.bt;
407395 unsigned size;
396+ u64 pixelclock;
408397
409398 switch (dev->input_type[dev->input]) {
410399 case WEBCAM:
@@ -434,8 +423,15 @@ void vivid_update_format_cap(struct vivid_dev *dev, bool keep_controls) · 23 unmodified lines
434423 dev->src_rect.width = bt->width;
435424 dev->src_rect.height = bt->height;
436425 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+ }
437433 dev->timeperframe_vid_cap = (struct v4l2_fract) {
438− size / 100, (u32)bt->pixelclock / 100
434+ size / 100, (u32)pixelclock / 100
439435 };
440436 if (bt->interlaced)
441437 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
16621658 !valid_cvt_gtf_timings(timings))
16631659 return -EINVAL;
16641660
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))
16661662 return 0;
16671663 if (vb2_is_busy(&dev->vb_vid_cap_q))
16681664 return -EBUSY;
drivers/media/platform/vivid/vivid-vid-out.c+13−17
@@ -31,11 +31,10 @@ · 30 unmodified lines
3131 #include "vivid-kthread-out.h"
3232 #include "vivid-vid-out.h"
3333
34−static int vid_out_queue_setup(struct vb2_queue *vq, const void *parg,
34+static int vid_out_queue_setup(struct vb2_queue *vq,
3535 unsigned *nbuffers, unsigned *nplanes,
3636 unsigned sizes[], void *alloc_ctxs[])
3737 {
38− const struct v4l2_format *fmt = parg;
3938 struct vivid_dev *dev = vb2_get_drv_priv(vq);
4039 const struct vivid_fmt *vfmt = dev->fmt_out;
4140 unsigned planes = vfmt->buffers;
@@ -64,26 +63,16 @@ static int vid_out_queue_setup(struct vb2_queue *vq, const void *parg, · 22 unmodified lines
6463 return -EINVAL;
6564 }
6665
67− if (fmt) {
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;
66+ if (*nplanes) {
7667 /*
77− * Check if the number of planes in the specified format match
68+ * Check if the number of requested planes match
7869 * the number of planes in the current format. You can't mix that.
7970 */
80− if (mp->num_planes != planes)
71+ if (*nplanes != planes)
8172 return -EINVAL;
82− sizes[0] = mp->plane_fmt[0].sizeimage;
8373 if (sizes[0] < size)
8474 return -EINVAL;
8575 for (p = 1; p < planes; p++) {
86− sizes[p] = mp->plane_fmt[p].sizeimage;
8776 if (sizes[p] < dev->bytesperline_out[p] * h)
8877 return -EINVAL;
8978 }
@@ -224,6 +213,7 @@ void vivid_update_format_out(struct vivid_dev *dev) · 134 unmodified lines
224213 {
225214 struct v4l2_bt_timings *bt = &dev->dv_timings_out.bt;
226215 unsigned size, p;
216+ u64 pixelclock;
227217
228218 switch (dev->output_type[dev->output]) {
229219 case SVID:
@@ -245,8 +235,14 @@ void vivid_update_format_out(struct vivid_dev *dev) · 15 unmodified lines
245235 dev->sink_rect.width = bt->width;
246236 dev->sink_rect.height = bt->height;
247237 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+
248244 dev->timeperframe_vid_out = (struct v4l2_fract) {
249− size / 100, (u32)bt->pixelclock / 100
245+ size / 100, (u32)pixelclock / 100
250246 };
251247 if (bt->interlaced)
252248 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
11491145 0, NULL, NULL) &&
11501146 !valid_cvt_gtf_timings(timings))
11511147 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))
11531149 return 0;
11541150 if (vb2_is_busy(&dev->vb_vid_out_q))
11551151 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
274274 return 0;
275275 }
276276
277−static bool
278−vsp1_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−
306277 /* -----------------------------------------------------------------------------
307278 * Pipeline Management
308279 */
@@ -611,7 +582,7 @@ vsp1_video_complete_buffer(struct vsp1_video *video) · 302 unmodified lines
611582 spin_unlock_irqrestore(&video->irqlock, flags);
612583
613584 done->buf.sequence = video->sequence++;
614− v4l2_get_timestamp(&done->buf.timestamp);
585+ done->buf.vb2_buf.timestamp = ktime_get_ns();
615586 for (i = 0; i < done->buf.vb2_buf.num_planes; ++i)
616587 vb2_set_plane_payload(&done->buf.vb2_buf, i, done->length[i]);
617588 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
787758 */
788759
789760 static int
790−vsp1_video_queue_setup(struct vb2_queue *vq, const void *parg,
761+vsp1_video_queue_setup(struct vb2_queue *vq,
791762 unsigned int *nbuffers, unsigned int *nplanes,
792763 unsigned int sizes[], void *alloc_ctxs[])
793764 {
794− const struct v4l2_format *fmt = parg;
795765 struct vsp1_video *video = vb2_get_drv_priv(vq);
796− const struct v4l2_pix_format_mplane *format;
797− struct v4l2_pix_format_mplane pix_mp;
766+ const struct v4l2_pix_format_mplane *format = &video->format;
798767 unsigned int i;
799768
800− if (fmt) {
801− /* Make sure the format is valid and adjust the sizeimage field
802− * if needed.
803− */
804− if (!vsp1_video_format_adjust(video, &fmt->fmt.pix_mp, &pix_mp))
769+ if (*nplanes) {
770+ if (*nplanes != format->num_planes)
805771 return -EINVAL;
806772
807− format = &pix_mp;
808− } else {
809− format = &video->format;
773+ for (i = 0; i < *nplanes; i++) {
774+ if (sizes[i] < format->plane_fmt[i].sizeimage)
775+ return -EINVAL;
776+ alloc_ctxs[i] = video->alloc_ctx;
777+ }
778+ return 0;
810779 }
811780
812781 *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
303303
304304 buf->buf.field = V4L2_FIELD_NONE;
305305 buf->buf.sequence = dma->sequence++;
306− v4l2_get_timestamp(&buf->buf.timestamp);
306+ buf->buf.vb2_buf.timestamp = ktime_get_ns();
307307 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, dma->format.sizeimage);
308308 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);
309309 }
310310
311311 static int
312−xvip_dma_queue_setup(struct vb2_queue *vq, const void *parg,
312+xvip_dma_queue_setup(struct vb2_queue *vq,
313313 unsigned int *nbuffers, unsigned int *nplanes,
314314 unsigned int sizes[], void *alloc_ctxs[])
315315 {
316− const struct v4l2_format *fmt = parg;
317316 struct xvip_dma *dma = vb2_get_drv_priv(vq);
318317
318+ alloc_ctxs[0] = dma->alloc_ctx;
319319 /* Make sure the image size is large enough. */
320− if (fmt && fmt->fmt.pix.sizeimage < dma->format.sizeimage)
321− return -EINVAL;
320+ if (*nplanes)
321+ return sizes[0] < dma->format.sizeimage ? -EINVAL : 0;
322322
323323 *nplanes = 1;
324−
325− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : dma->format.sizeimage;
326− alloc_ctxs[0] = dma->alloc_ctx;
324+ sizes[0] = dma->format.sizeimage;
327325
328326 return 0;
329327 }
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
731731 format = xvip_of_get_format(port);
732732 if (IS_ERR(format)) {
733733 dev_err(dev, "invalid format in DT");
734+ of_node_put(port);
734735 return PTR_ERR(format);
735736 }
736737
@@ -739,6 +740,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) · 2 unmodified lines
739740 xtpg->vip_format = format;
740741 } else if (xtpg->vip_format != format) {
741742 dev_err(dev, "in/out format mismatch in DT");
743+ of_node_put(port);
742744 return -EINVAL;
743745 }
744746
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
476476
477477 for_each_child_of_node(ports, port) {
478478 ret = xvip_graph_dma_init_one(xdev, port);
479− if (ret < 0)
479+ if (ret < 0) {
480+ of_node_put(port);
480481 return ret;
482+ }
481483 }
482484
483485 return 0;
drivers/media/radio/radio-maxiradio.c+2−2
@@ -42,7 +42,7 @@ · 41 unmodified lines
4242 #include <linux/videodev2.h>
4343 #include <linux/io.h>
4444 #include <linux/slab.h>
45−#include <media/tea575x.h>
45+#include <media/drv-intf/tea575x.h>
4646 #include <media/v4l2-device.h>
4747 #include <media/v4l2-ioctl.h>
4848 #include <media/v4l2-fh.h>
@@ -108,7 +108,7 @@ static void maxiradio_tea575x_set_direction(struct snd_tea575x *tea, bool output · 59 unmodified lines
108108 {
109109 }
110110
111−static struct snd_tea575x_ops maxiradio_tea_ops = {
111+static const struct snd_tea575x_ops maxiradio_tea_ops = {
112112 .set_pins = maxiradio_tea575x_set_pins,
113113 .get_pins = maxiradio_tea575x_get_pins,
114114 .set_direction = maxiradio_tea575x_set_direction,
drivers/media/radio/radio-sf16fmr2.c+2−2
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #include <linux/io.h> /* outb, outb_p */
1515 #include <linux/isa.h>
1616 #include <linux/pnp.h>
17−#include <media/tea575x.h>
17+#include <media/drv-intf/tea575x.h>
1818
1919 MODULE_AUTHOR("Ondrej Zary");
2020 MODULE_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
8282 {
8383 }
8484
85−static struct snd_tea575x_ops fmr2_tea_ops = {
85+static const struct snd_tea575x_ops fmr2_tea_ops = {
8686 .set_pins = fmr2_tea575x_set_pins,
8787 .get_pins = fmr2_tea575x_get_pins,
8888 .set_direction = fmr2_tea575x_set_direction,
drivers/media/radio/radio-shark.c+2−2
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #include <linux/usb.h>
3434 #include <linux/workqueue.h>
3535 #include <media/v4l2-device.h>
36−#include <media/tea575x.h>
36+#include <media/drv-intf/tea575x.h>
3737
3838 #if defined(CONFIG_LEDS_CLASS) || \
3939 (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
150150 return val;
151151 }
152152
153−static struct snd_tea575x_ops shark_tea_ops = {
153+static const struct snd_tea575x_ops shark_tea_ops = {
154154 .write_val = shark_write_val,
155155 .read_val = shark_read_val,
156156 };
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
137137 return 0;
138138 }
139139
140−static struct radio_tea5777_ops shark_tea_ops = {
140+static const struct radio_tea5777_ops shark_tea_ops = {
141141 .write_reg = shark_write_reg,
142142 .read_reg = shark_read_reg,
143143 };
drivers/media/radio/radio-si476x.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <media/v4l2-event.h>
3232 #include <media/v4l2-device.h>
3333
34−#include <media/si476x.h>
34+#include <media/drv-intf/si476x.h>
3535 #include <linux/mfd/si476x-core.h>
3636
3737 #define FM_FREQ_RANGE_LOW 64000000
drivers/media/radio/radio-tea5777.h+1−1
@@ -76,7 +76,7 @@ struct radio_tea5777 { · 75 unmodified lines
7676 u32 read_reg;
7777 u64 write_reg;
7878 struct mutex mutex;
79− struct radio_tea5777_ops *ops;
79+ const struct radio_tea5777_ops *ops;
8080 void *private_data;
8181 u8 card[32];
8282 u8 bus_info[32];
drivers/media/radio/radio-timb.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <linux/slab.h>
2727 #include <linux/i2c.h>
2828 #include <linux/module.h>
29−#include <media/timb_radio.h>
29+#include <linux/platform_data/media/timb_radio.h>
3030
3131 #define DRIVER_NAME "timb-radio"
3232
drivers/media/radio/si4713/radio-usb-si4713.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <media/v4l2-device.h>
3232 #include <media/v4l2-ioctl.h>
3333 #include <media/v4l2-event.h>
34−#include <media/si4713.h>
34+#include <linux/platform_data/media/si4713.h>
3535
3636 #include "si4713.h"
3737
drivers/media/radio/si4713/si4713.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include <linux/gpio/consumer.h>
2121 #include <media/v4l2-subdev.h>
2222 #include <media/v4l2-ctrls.h>
23−#include <media/si4713.h>
23+#include <linux/platform_data/media/si4713.h>
2424
2525 #define SI4713_PRODUCT_NUMBER 0x0D
2626
drivers/media/radio/tea575x.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <media/v4l2-fh.h>
3232 #include <media/v4l2-ioctl.h>
3333 #include <media/v4l2-event.h>
34−#include <media/tea575x.h>
34+#include <media/drv-intf/tea575x.h>
3535
3636 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
3737 MODULE_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
101101
102102 ---help---
103103 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.
105106
106107 config IR_MCE_KBD_DECODER
107108 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
2121 #include <linux/platform_device.h>
2222 #include <linux/irq.h>
2323 #include <media/rc-core.h>
24−#include <media/gpio-ir-recv.h>
24+#include <linux/platform_data/media/gpio-ir-recv.h>
2525
2626 #define GPIO_IR_DRIVER_NAME "gpio-rc-recv"
2727 #define GPIO_IR_DEVICE_NAME "gpio_ir_recv"
@@ -30,6 +30,7 @@ struct gpio_rc_dev { · 2 unmodified lines
3030 struct rc_dev *rcdev;
3131 int gpio_nr;
3232 bool active_low;
33+ struct timer_list flush_timer;
3334 };
3435
3536 #ifdef CONFIG_OF
@@ -93,12 +94,26 @@ static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) · 57 unmodified lines
9394 if (rc < 0)
9495 goto err_get_value;
9596
97+ mod_timer(&gpio_dev->flush_timer,
98+ jiffies + nsecs_to_jiffies(gpio_dev->rcdev->timeout));
99+
96100 ir_raw_event_handle(gpio_dev->rcdev);
97101
98102 err_get_value:
99103 return IRQ_HANDLED;
100104 }
101105
106+static 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+
102117 static int gpio_ir_recv_probe(struct platform_device *pdev)
103118 {
104119 struct gpio_rc_dev *gpio_dev;
@@ -144,6 +159,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) · 39 unmodified lines
144159 rcdev->input_id.version = 0x0100;
145160 rcdev->dev.parent = &pdev->dev;
146161 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;
147165 if (pdata->allowed_protos)
148166 rcdev->allowed_protocols = pdata->allowed_protos;
149167 else
@@ -154,6 +172,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) · 4 unmodified lines
154172 gpio_dev->gpio_nr = pdata->gpio_nr;
155173 gpio_dev->active_low = pdata->active_low;
156174
175+ setup_timer(&gpio_dev->flush_timer, flush_timer,
176+ (unsigned long)gpio_dev);
177+
157178 rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv");
158179 if (rc < 0)
159180 goto err_gpio_request;
@@ -196,6 +217,7 @@ static int gpio_ir_recv_remove(struct platform_device *pdev) · 36 unmodified lines
196217 struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
197218
198219 free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev);
220+ del_timer_sync(&gpio_dev->flush_timer);
199221 rc_unregister_device(gpio_dev->rcdev);
200222 gpio_free(gpio_dev->gpio_nr);
201223 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
4747 {
4848 struct jvc_dec *data = &dev->raw->jvc;
4949
50− if (!(dev->enabled_protocols & RC_BIT_JVC))
51− return 0;
52−
5350 if (!is_timing_event(ev)) {
5451 if (ev.reset)
5552 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
415415
416416 lirc_unregister_driver(lirc->drv->minor);
417417 lirc_buffer_free(lirc->drv->rbuf);
418+ kfree(lirc->drv->rbuf);
418419 kfree(lirc->drv);
419420
420421 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
216216 u32 scancode;
217217 unsigned long delay;
218218
219− if (!(dev->enabled_protocols & RC_BIT_MCE_KBD))
220− return 0;
221−
222219 if (!is_timing_event(ev)) {
223220 if (ev.reset)
224221 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
5252 u8 address, not_address, command, not_command;
5353 bool send_32bits = false;
5454
55− if (!(dev->enabled_protocols & RC_BIT_NEC))
56− return 0;
57−
5855 if (!is_timing_event(ev)) {
5956 if (ev.reset)
6057 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
5353 u32 scancode;
5454 enum rc_type protocol;
5555
56− if (!(dev->enabled_protocols & (RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ)))
57− return 0;
58−
5956 if (!is_timing_event(ev)) {
6057 if (ev.reset)
6158 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
9090 u8 toggle;
9191 enum rc_type protocol;
9292
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−
9893 if (!is_timing_event(ev)) {
9994 if (ev.reset)
10095 data->state = STATE_INACTIVE;
drivers/media/rc/ir-rx51.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131
3232 #include <media/lirc.h>
3333 #include <media/lirc_dev.h>
34−#include <media/ir-rx51.h>
34+#include <linux/platform_data/media/ir-rx51.h>
3535
3636 #define LIRC_RX51_DRIVER_FEATURES (LIRC_CAN_SET_SEND_DUTY_CYCLE | \
3737 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
5858 u32 scancode;
5959 u8 address, command, not_command;
6060
61− if (!(dev->enabled_protocols & RC_BIT_SANYO))
62− return 0;
63−
6461 if (!is_timing_event(ev)) {
6562 if (ev.reset) {
6663 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
4848 struct sharp_dec *data = &dev->raw->sharp;
4949 u32 msg, echo, address, command, scancode;
5050
51− if (!(dev->enabled_protocols & RC_BIT_SHARP))
52− return 0;
53−
5451 if (!is_timing_event(ev)) {
5552 if (ev.reset)
5653 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
118115
119116 if (data->count == SHARP_NBITS) {
120117 /* 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)
122121 break;
123122 data->state = STATE_ECHO_SPACE;
124123 } 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
4646 u32 scancode;
4747 u8 device, subdevice, function;
4848
49− if (!(dev->enabled_protocols &
50− (RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20)))
51− return 0;
52−
5349 if (!is_timing_event(ev)) {
5450 if (ev.reset)
5551 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
4343 {
4444 struct xmp_dec *data = &dev->raw->xmp;
4545
46− if (!(dev->enabled_protocols & RC_BIT_XMP))
47− return 0;
48−
4946 if (!is_timing_event(ev)) {
5047 if (ev.reset)
5148 data->state = STATE_INACTIVE;
drivers/media/rc/nuvoton-cir.c+69−87
@@ -39,6 +39,18 @@ · 38 unmodified lines
3939
4040 #include "nuvoton-cir.h"
4141
42+static const struct nvt_chip nvt_chips[] = {
43+ { "w83667hg", NVT_W83667HG },
44+ { "NCT6775F", NVT_6775F },
45+ { "NCT6776F", NVT_6776F },
46+ { "NCT6779D", NVT_6779D },
47+};
48+
49+static inline bool is_w83667hg(struct nvt_dev *nvt)
50+{
51+ return nvt->chip_ver == NVT_W83667HG;
52+}
53+
4254 /* write val to config reg */
4355 static inline void nvt_cr_write(struct nvt_dev *nvt, u8 val, u8 reg)
4456 {
@@ -224,74 +236,60 @@ static void cir_wake_dump_regs(struct nvt_dev *nvt) · 179 unmodified lines
224236 pr_cont("\n");
225237 }
226238
239+static 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+
227253 /* detect hardware features */
228−static int nvt_hw_detect(struct nvt_dev *nvt)
254+static void nvt_hw_detect(struct nvt_dev *nvt)
229255 {
230− unsigned long flags;
231− u8 chip_major, chip_minor;
232− char chip_id[12];
233− bool chip_unknown = false;
256+ const char *chip_name;
257+ int chip_id;
234258
235259 nvt_efm_enable(nvt);
236260
237261 /* Check if we're wired for the alternate EFER setup */
238− chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI);
239− if (chip_major == 0xff) {
262+ nvt->chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI);
263+ if (nvt->chip_major == 0xff) {
240264 nvt->cr_efir = CR_EFIR2;
241265 nvt->cr_efdr = CR_EFDR2;
242266 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);
244268 }
245269
246− chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO);
247−
248− /* these are the known working chip revisions... */
249− switch (chip_major) {
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− }
270+ nvt->chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO);
271+
272+ chip_id = nvt->chip_major << 8 | nvt->chip_minor;
273+ chip_name = nvt_find_chip(nvt, chip_id);
271274
272275 /* warn, but still let the driver load, if we don't know this chip */
273− if (chip_unknown)
274− nvt_pr(KERN_WARNING, "%s: unknown chip, id: 0x%02x 0x%02x, "
275− "it may not work...", chip_id, chip_major, chip_minor);
276+ if (!chip_name)
277+ dev_warn(&nvt->pdev->dev,
278+ "unknown chip, id: 0x%02x 0x%02x, it may not work...",
279+ nvt->chip_major, nvt->chip_minor);
276280 else
277− nvt_dbg("%s: chip id: 0x%02x 0x%02x",
278− chip_id, chip_major, chip_minor);
281+ dev_info(&nvt->pdev->dev,
282+ "found %s or compatible: chip id: 0x%02x 0x%02x",
283+ chip_name, nvt->chip_major, nvt->chip_minor);
279284
280285 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;
288286 }
289287
290288 static void nvt_cir_ldev_init(struct nvt_dev *nvt)
291289 {
292290 u8 val, psreg, psmask, psval;
293291
294− if (nvt->chip_major == CHIP_ID_HIGH_667) {
292+ if (is_w83667hg(nvt)) {
295293 psreg = CR_MULTIFUNC_PIN_SEL;
296294 psmask = MULTIFUNC_PIN_SEL_MASK;
297295 psval = MULTIFUNC_ENABLE_CIR | MULTIFUNC_ENABLE_CIRWB;
@@ -485,8 +483,9 @@ static u32 nvt_rx_carrier_detect(struct nvt_dev *nvt) · 187 unmodified lines
485483 duration *= SAMPLE_PERIOD;
486484
487485 if (!count || !duration) {
488− nvt_pr(KERN_NOTICE, "Unable to determine carrier! (c:%u, d:%u)",
489− count, duration);
486+ dev_notice(&nvt->pdev->dev,
487+ "Unable to determine carrier! (c:%u, d:%u)",
488+ count, duration);
490489 return 0;
491490 }
492491
@@ -661,7 +660,7 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) · 168 unmodified lines
661660
662661 static void nvt_handle_rx_fifo_overrun(struct nvt_dev *nvt)
663662 {
664− nvt_pr(KERN_WARNING, "RX FIFO overrun detected, flushing data!");
663+ dev_warn(&nvt->pdev->dev, "RX FIFO overrun detected, flushing data!");
665664
666665 nvt->pkts = 0;
667666 nvt_clear_cir_fifo(nvt);
@@ -719,7 +718,7 @@ static void nvt_get_rx_ir_data(struct nvt_dev *nvt) · 51 unmodified lines
719718
720719 static void nvt_cir_log_irqs(u8 status, u8 iren)
721720 {
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",
723722 status, iren,
724723 status & CIR_IRSTS_RDR ? " RDR" : "",
725724 status & CIR_IRSTS_RTR ? " RTR" : "",
@@ -779,7 +778,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) · 53 unmodified lines
779778 if (!status) {
780779 nvt_dbg_verbose("%s exiting, IRSTS 0x0", __func__);
781780 nvt_cir_reg_write(nvt, 0xff, CIR_IRSTS);
782− return IRQ_RETVAL(IRQ_NONE);
781+ return IRQ_NONE;
783782 }
784783
785784 /* 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
790789 iren = nvt_cir_reg_read(nvt, CIR_IREN);
791790 if (!iren) {
792791 nvt_dbg_verbose("%s exiting, CIR not enabled", __func__);
793− return IRQ_RETVAL(IRQ_NONE);
792+ return IRQ_NONE;
794793 }
795794
796− if (debug)
797− nvt_cir_log_irqs(status, iren);
795+ nvt_cir_log_irqs(status, iren);
798796
799797 if (status & CIR_IRSTS_RTR) {
800798 /* FIXME: add code for study/learn mode */
@@ -853,7 +851,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) · 52 unmodified lines
853851 }
854852
855853 nvt_dbg_verbose("%s done", __func__);
856− return IRQ_RETVAL(IRQ_HANDLED);
854+ return IRQ_HANDLED;
857855 }
858856
859857 /* Interrupt service routine for CIR Wake */
@@ -867,7 +865,7 @@ static irqreturn_t nvt_cir_wake_isr(int irq, void *data) · 7 unmodified lines
867865
868866 status = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRSTS);
869867 if (!status)
870− return IRQ_RETVAL(IRQ_NONE);
868+ return IRQ_NONE;
871869
872870 if (status & CIR_WAKE_IRSTS_IR_PENDING)
873871 nvt_clear_cir_wake_fifo(nvt);
@@ -879,7 +877,7 @@ static irqreturn_t nvt_cir_wake_isr(int irq, void *data) · 5 unmodified lines
879877 iren = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IREN);
880878 if (!iren) {
881879 nvt_dbg_wake("%s exiting, wake not enabled", __func__);
882− return IRQ_RETVAL(IRQ_HANDLED);
880+ return IRQ_HANDLED;
883881 }
884882
885883 if ((status & CIR_WAKE_IRSTS_PE) &&
@@ -896,7 +894,7 @@ static irqreturn_t nvt_cir_wake_isr(int irq, void *data) · 10 unmodified lines
896894 }
897895
898896 nvt_dbg_wake("%s done", __func__);
899− return IRQ_RETVAL(IRQ_HANDLED);
897+ return IRQ_HANDLED;
900898 }
901899
902900 static 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
974972 struct rc_dev *rdev;
975973 int ret = -ENOMEM;
976974
977− nvt = kzalloc(sizeof(struct nvt_dev), GFP_KERNEL);
975+ nvt = devm_kzalloc(&pdev->dev, sizeof(struct nvt_dev), GFP_KERNEL);
978976 if (!nvt)
979977 return ret;
980978
@@ -1026,9 +1024,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) · 45 unmodified lines
10261024
10271025 init_waitqueue_head(&nvt->tx.queue);
10281026
1029− ret = nvt_hw_detect(nvt);
1030− if (ret)
1031− goto exit_free_dev_rdev;
1027+ nvt_hw_detect(nvt);
10321028
10331029 /* Initialize CIR & CIR Wake Logical Devices */
10341030 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
10741070
10751071 ret = -EBUSY;
10761072 /* now claim resources */
1077− if (!request_region(nvt->cir_addr,
1073+ if (!devm_request_region(&pdev->dev, nvt->cir_addr,
10781074 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
10791075 goto exit_unregister_device;
10801076
1081− if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
1082− NVT_DRIVER_NAME, (void *)nvt))
1083− goto exit_release_cir_addr;
1077+ if (devm_request_irq(&pdev->dev, nvt->cir_irq, nvt_cir_isr,
1078+ IRQF_SHARED, NVT_DRIVER_NAME, (void *)nvt))
1079+ goto exit_unregister_device;
10841080
1085− if (!request_region(nvt->cir_wake_addr,
1081+ if (!devm_request_region(&pdev->dev, nvt->cir_wake_addr,
10861082 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1087− goto exit_free_irq;
1083+ goto exit_unregister_device;
10881084
1089− if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
1090− NVT_DRIVER_NAME, (void *)nvt))
1091− goto exit_release_cir_wake_addr;
1085+ if (devm_request_irq(&pdev->dev, nvt->cir_wake_irq,
1086+ nvt_cir_wake_isr, IRQF_SHARED,
1087+ NVT_DRIVER_NAME, (void *)nvt))
1088+ goto exit_unregister_device;
10921089
10931090 device_init_wakeup(&pdev->dev, true);
10941091
1095− nvt_pr(KERN_NOTICE, "driver has been successfully loaded\n");
1092+ dev_notice(&pdev->dev, "driver has been successfully loaded\n");
10961093 if (debug) {
10971094 cir_dump_regs(nvt);
10981095 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
11001097
11011098 return 0;
11021099
1103−exit_release_cir_wake_addr:
1104− release_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH);
1105−exit_free_irq:
1106− free_irq(nvt->cir_irq, nvt);
1107−exit_release_cir_addr:
1108− release_region(nvt->cir_addr, CIR_IOREG_LENGTH);
11091100 exit_unregister_device:
11101101 rc_unregister_device(rdev);
11111102 rdev = NULL;
11121103 exit_free_dev_rdev:
11131104 rc_free_device(rdev);
1114− kfree(nvt);
11151105
11161106 return ret;
11171107 }
@@ -1129,15 +1119,7 @@ static void nvt_remove(struct pnp_dev *pdev) · 11 unmodified lines
11291119 nvt_enable_wake(nvt);
11301120 spin_unlock_irqrestore(&nvt->nvt_lock, flags);
11311121
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−
11381122 rc_unregister_device(nvt->rdev);
1139−
1140− kfree(nvt);
11411123 }
11421124
11431125 static 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
3535 static int debug;
3636
3737
38−#define nvt_pr(level, text, ...) \
39− printk(level KBUILD_MODNAME ": " text, ## __VA_ARGS__)
40−
4138 #define nvt_dbg(text, ...) \
4239 if (debug) \
4340 printk(KERN_DEBUG \
@@ -64,6 +61,21 @@ static int debug; · 20 unmodified lines
6461 #define TX_BUF_LEN 256
6562 #define RX_BUF_LEN 32
6663
64+#define SIO_ID_MASK 0xfff0
65+
66+enum 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+
74+struct nvt_chip {
75+ const char *name;
76+ enum nvt_chip_ver chip_ver;
77+};
78+
6779 struct nvt_dev {
6880 struct pnp_dev *pdev;
6981 struct rc_dev *rdev;
@@ -93,6 +105,7 @@ struct nvt_dev { · 23 unmodified lines
93105 int cir_irq;
94106 int cir_wake_irq;
95107
108+ enum nvt_chip_ver chip_ver;
96109 /* hardware id */
97110 u8 chip_major;
98111 u8 chip_minor;
@@ -326,15 +339,6 @@ struct nvt_dev { · 227 unmodified lines
326339 #define EFER_EFM_ENABLE 0x87
327340 #define EFER_EFM_DISABLE 0xaa
328341
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−
338342 /* Config regs we need to care about */
339343 #define CR_SOFTWARE_RESET 0x02
340344 #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
167167 * loads the compiled decoders for their usage with IR raw events
168168 */
169169
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
174−static 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
181−static 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
188−static 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
195−static 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
202−static 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
209−static 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
216−static 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
223−static 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
230−static 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
237−static inline void load_xmp_decode(void) { }
238−#endif
239−
240−
241170 #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
5959
6060 mutex_lock(&ir_raw_handler_lock);
6161 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);
6365 raw->prev_ev = ev;
6466 mutex_unlock(&ir_raw_handler_lock);
6567 }
@@ -246,6 +248,14 @@ static int change_protocol(struct rc_dev *dev, u64 *rc_type) · 180 unmodified lines
246248 return 0;
247249 }
248250
251+static 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+
249259 /*
250260 * Used to (un)register raw event clients
251261 */
@@ -337,33 +347,16 @@ EXPORT_SYMBOL(ir_raw_handler_register); · 85 unmodified lines
337347 void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler)
338348 {
339349 struct ir_raw_event_ctrl *raw;
350+ u64 protocols = ir_raw_handler->protocols;
340351
341352 mutex_lock(&ir_raw_handler_lock);
342353 list_del(&ir_raw_handler->list);
343− if (ir_raw_handler->raw_unregister)
344− list_for_each_entry(raw, &ir_raw_client_list, list)
354+ 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)
345357 ir_raw_handler->raw_unregister(raw->dev);
346− available_protocols &= ~ir_raw_handler->protocols;
358+ }
359+ available_protocols &= ~protocols;
347360 mutex_unlock(&ir_raw_handler_lock);
348361 }
349362 EXPORT_SYMBOL(ir_raw_handler_unregister);
350−
351−void 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
6161 struct rc_map_list *map;
6262
6363 map = seek_rc_map(name);
64−#ifdef MODULE
64+#ifdef CONFIG_MODULES
6565 if (!map) {
6666 int rc = request_module("%s", name);
6767 if (rc < 0) {
@@ -777,30 +777,31 @@ static struct class rc_class = { · 709 unmodified lines
777777 * used by the sysfs protocols file. Note that the order
778778 * of the entries is relevant.
779779 */
780−static struct {
780+static const struct {
781781 u64 type;
782− char *name;
782+ const char *name;
783+ const char *module_name;
783784 } proto_names[] = {
784− { RC_BIT_NONE, "none" },
785− { RC_BIT_OTHER, "other" },
786− { RC_BIT_UNKNOWN, "unknown" },
785+ { RC_BIT_NONE, "none", NULL },
786+ { RC_BIT_OTHER, "other", NULL },
787+ { RC_BIT_UNKNOWN, "unknown", NULL },
787788 { RC_BIT_RC5 |
788− RC_BIT_RC5X, "rc-5" },
789− { RC_BIT_NEC, "nec" },
789+ RC_BIT_RC5X, "rc-5", "ir-rc5-decoder" },
790+ { RC_BIT_NEC, "nec", "ir-nec-decoder" },
790791 { RC_BIT_RC6_0 |
791792 RC_BIT_RC6_6A_20 |
792793 RC_BIT_RC6_6A_24 |
793794 RC_BIT_RC6_6A_32 |
794− RC_BIT_RC6_MCE, "rc-6" },
795− { RC_BIT_JVC, "jvc" },
795+ RC_BIT_RC6_MCE, "rc-6", "ir-rc6-decoder" },
796+ { RC_BIT_JVC, "jvc", "ir-jvc-decoder" },
796797 { RC_BIT_SONY12 |
797798 RC_BIT_SONY15 |
798− RC_BIT_SONY20, "sony" },
799− { RC_BIT_RC5_SZ, "rc-5-sz" },
800− { RC_BIT_SANYO, "sanyo" },
801− { RC_BIT_SHARP, "sharp" },
802− { RC_BIT_MCE_KBD, "mce_kbd" },
803− { RC_BIT_XMP, "xmp" },
799+ RC_BIT_SONY20, "sony", "ir-sony-decoder" },
800+ { RC_BIT_RC5_SZ, "rc-5-sz", "ir-rc5-decoder" },
801+ { RC_BIT_SANYO, "sanyo", "ir-sanyo-decoder" },
802+ { RC_BIT_SHARP, "sharp", "ir-sharp-decoder" },
803+ { RC_BIT_MCE_KBD, "mce_kbd", "ir-mce_kbd-decoder" },
804+ { RC_BIT_XMP, "xmp", "ir-xmp-decoder" },
804805 };
805806
806807 /**
@@ -979,6 +980,48 @@ static int parse_protocol_change(u64 *protocols, const char *buf) · 172 unmodified lines
979980 return count;
980981 }
981982
983+static 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+
9821025 /**
9831026 * store_protocols() - changes the current/wakeup IR protocol(s)
9841027 * @device: the device descriptor
@@ -1045,6 +1088,9 @@ static ssize_t store_protocols(struct device *device, · 60 unmodified lines
10451088 goto out;
10461089 }
10471090
1091+ if (dev->driver_type == RC_DRIVER_IR_RAW)
1092+ ir_raw_load_modules(&new_protocols);
1093+
10481094 if (new_protocols != old_protocols) {
10491095 *current_protocols = new_protocols;
10501096 IR_dprintk(1, "Protocols changed to 0x%llx\n",
@@ -1420,17 +1466,13 @@ int rc_register_device(struct rc_dev *dev) · 369 unmodified lines
14201466 dev->input_dev->rep[REP_PERIOD] = 125;
14211467
14221468 path = kobject_get_path(&dev->dev.kobj, GFP_KERNEL);
1423− printk(KERN_INFO "%s: %s as %s\n",
1424− dev_name(&dev->dev),
1425− dev->input_name ? dev->input_name : "Unspecified device",
1426− path ? path : "N/A");
1469+ dev_info(&dev->dev, "%s as %s\n",
1470+ dev->input_name ?: "Unspecified device", path ?: "N/A");
14271471 kfree(path);
14281472
14291473 if (dev->driver_type == RC_DRIVER_IR_RAW) {
1430− /* Load raw decoders, if they aren't already */
14311474 if (!raw_init) {
1432− IR_dprintk(1, "Loading raw decoders\n");
1433− ir_raw_init();
1475+ request_module_nowait("ir-lirc-codec");
14341476 raw_init = true;
14351477 }
14361478 /* calls ir_register_device so unlock mutex here*/
drivers/media/rc/st_rc.c+9−5
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/reset.h>
1717 #include <media/rc-core.h>
1818 #include <linux/pinctrl/consumer.h>
19+#include <linux/pm_wakeirq.h>
1920
2021 struct st_rc_device {
2122 struct device *dev;
@@ -190,6 +191,9 @@ static void st_rc_hardware_init(struct st_rc_device *dev) · 168 unmodified lines
190191 static int st_rc_remove(struct platform_device *pdev)
191192 {
192193 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);
193197 clk_disable_unprepare(rc_dev->sys_clock);
194198 rc_unregister_device(rc_dev->rdev);
195199 return 0;
@@ -298,22 +302,22 @@ static int st_rc_probe(struct platform_device *pdev) · 102 unmodified lines
298302 rdev->map_name = RC_MAP_LIRC;
299303 rdev->input_name = "ST Remote Control Receiver";
300304
301− /* enable wake via this device */
302− device_set_wakeup_capable(dev, true);
303− device_set_wakeup_enable(dev, true);
304−
305305 ret = rc_register_device(rdev);
306306 if (ret < 0)
307307 goto clkerr;
308308
309309 rc_dev->rdev = rdev;
310310 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) {
312312 dev_err(dev, "IRQ %d register failed\n", rc_dev->irq);
313313 ret = -EINVAL;
314314 goto rcerr;
315315 }
316316
317+ /* enable wake via this device */
318+ device_init_wakeup(dev, true);
319+ dev_pm_set_wake_irq(dev, rc_dev->irq);
320+
317321 /**
318322 * for LIRC_MODE_MODE2 or LIRC_MODE_PULSE or LIRC_MODE_RAW
319323 * 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
3434 #include <linux/device.h>
3535 #include <linux/module.h>
3636 #include <linux/slab.h>
37+#include <linux/ktime.h>
3738 #include <linux/usb.h>
3839 #include <linux/usb/input.h>
3940 #include <media/rc-core.h>
@@ -96,8 +97,8 @@ struct streamzap_ir { · 56 unmodified lines
9697 /* sum of signal lengths received since signal start */
9798 unsigned long sum;
9899 /* start time of signal; necessary for gap tracking */
99− struct timeval signal_last;
100− struct timeval signal_start;
100+ ktime_t signal_last;
101+ ktime_t signal_start;
101102 bool timeout_enabled;
102103
103104 char name[128];
@@ -136,20 +137,18 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, · 32 unmodified lines
136137 DEFINE_IR_RAW_EVENT(rawir);
137138
138139 if (sz->idle) {
139− long deltv;
140+ int delta;
140141
141142 sz->signal_last = sz->signal_start;
142− do_gettimeofday(&sz->signal_start);
143+ sz->signal_start = ktime_get_real();
143144
144− deltv = sz->signal_start.tv_sec - sz->signal_last.tv_sec;
145+ delta = ktime_us_delta(sz->signal_start, sz->signal_last);
145146 rawir.pulse = false;
146− if (deltv > 15) {
147+ if (delta > (15 * USEC_PER_SEC)) {
147148 /* really long time */
148149 rawir.duration = IR_MAX_DURATION;
149150 } else {
150− rawir.duration = (int)(deltv * 1000000 +
151− sz->signal_start.tv_usec -
152− sz->signal_last.tv_usec);
151+ rawir.duration = delta;
153152 rawir.duration -= sz->sum;
154153 rawir.duration = US_TO_NS(rawir.duration);
155154 rawir.duration = (rawir.duration > IR_MAX_DURATION) ?
@@ -428,7 +427,7 @@ static int streamzap_probe(struct usb_interface *intf, · 272 unmodified lines
428427 sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION);
429428 #endif
430429
431− do_gettimeofday(&sz->signal_start);
430+ sz->signal_start = ktime_get_real();
432431
433432 /* Complete final initialisations */
434433 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
153153 if (!ir)
154154 return -ENOMEM;
155155
156+ spin_lock_init(&ir->ir_lock);
157+
156158 if (of_device_is_compatible(dn, "allwinner,sun5i-a13-ir"))
157159 ir->fifo_size = 64;
158160 else
drivers/media/tuners/max2165.c+1−1
@@ -385,7 +385,7 @@ static const struct dvb_tuner_ops max2165_tuner_ops = { · 384 unmodified lines
385385 .info = {
386386 .name = "Maxim MAX2165",
387387 .frequency_min = 470000000,
388− .frequency_max = 780000000,
388+ .frequency_max = 862000000,
389389 .frequency_step = 50000,
390390 },
391391
drivers/media/tuners/mt2063.c+0−1
@@ -225,7 +225,6 @@ struct mt2063_state { · 224 unmodified lines
225225 const struct mt2063_config *config;
226226 struct dvb_tuner_ops ops;
227227 struct dvb_frontend *frontend;
228− struct tuner_state status;
229228
230229 u32 frequency;
231230 u32 srate;
drivers/media/tuners/si2157.c+1−0
@@ -168,6 +168,7 @@ static int si2157_init(struct dvb_frontend *fe) · 167 unmodified lines
168168 len = fw->data[fw->size - remaining];
169169 if (len > SI2157_ARGLEN) {
170170 dev_err(&client->dev, "Bad firmware length\n");
171+ ret = -EINVAL;
171172 goto err_release_firmware;
172173 }
173174 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
316316 len = airspy_convert_stream(s, ptr, urb->transfer_buffer,
317317 urb->actual_length);
318318 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();
320320 fbuf->vb.sequence = s->sequence++;
321321 vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
322322 }
@@ -488,7 +488,7 @@ static void airspy_disconnect(struct usb_interface *intf) · 165 unmodified lines
488488
489489 /* Videobuf2 operations */
490490 static int airspy_queue_setup(struct vb2_queue *vq,
491− const void *parg, unsigned int *nbuffers,
491+ unsigned int *nbuffers,
492492 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
493493 {
494494 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
198198 pr_info("%s: firmware: %s loaded with success\n",
199199 DRIVER_NAME, fw1);
200200 release_firmware(firmware);
201+ firmware = NULL;
201202
202203 /* wait for boot to complete */
203204 mdelay(100);
drivers/media/usb/au0828/au0828-vbi.c+4−10
@@ -30,23 +30,17 @@ · 29 unmodified lines
3030
3131 /* ------------------------------------------------------------------ */
3232
33−static int vbi_queue_setup(struct vb2_queue *vq, const void *parg,
33+static int vbi_queue_setup(struct vb2_queue *vq,
3434 unsigned int *nbuffers, unsigned int *nplanes,
3535 unsigned int sizes[], void *alloc_ctxs[])
3636 {
37− const struct v4l2_format *fmt = parg;
3837 struct au0828_dev *dev = vb2_get_drv_priv(vq);
39− unsigned long img_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;
38+ unsigned long size = dev->vbi_width * dev->vbi_height * 2;
4639
40+ if (*nplanes)
41+ return sizes[0] < size ? -EINVAL : 0;
4742 *nplanes = 1;
4843 sizes[0] = size;
49−
5044 return 0;
5145 }
5246
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
314314 vb->sequence = dev->vbi_frame_count++;
315315
316316 vb->field = V4L2_FIELD_INTERLACED;
317− v4l2_get_timestamp(&vb->timestamp);
317+ vb->vb2_buf.timestamp = ktime_get_ns();
318318 vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE);
319319 }
320320
@@ -638,19 +638,15 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb) · 317 unmodified lines
638638 return rc;
639639 }
640640
641−static int queue_setup(struct vb2_queue *vq, const void *parg,
641+static int queue_setup(struct vb2_queue *vq,
642642 unsigned int *nbuffers, unsigned int *nplanes,
643643 unsigned int sizes[], void *alloc_ctxs[])
644644 {
645− const struct v4l2_format *fmt = parg;
646645 struct au0828_dev *dev = vb2_get_drv_priv(vq);
647− unsigned long img_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;
646+ unsigned long size = dev->height * dev->bytesperline;
653647
648+ if (*nplanes)
649+ return sizes[0] < size ? -EINVAL : 0;
654650 *nplanes = 1;
655651 sizes[0] = size;
656652
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
890890 DBG("Wakeup waiting processes\n");
891891 cam->curbuff->status = FRAME_READY;
892892 cam->curbuff->length = 0;
893− if (waitqueue_active(&cam->wq_stream))
894− wake_up_interruptible(&cam->wq_stream);
893+ wake_up_interruptible(&cam->wq_stream);
895894 }
896895
897896 DBG("Releasing interface\n");
drivers/media/usb/cx231xx/cx231xx-417.c+24−2
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #include <media/v4l2-common.h>
3838 #include <media/v4l2-ioctl.h>
3939 #include <media/v4l2-event.h>
40−#include <media/cx2341x.h>
40+#include <media/drv-intf/cx2341x.h>
4141 #include <media/tuner.h>
4242
4343 #define CX231xx_FIRM_IMAGE_SIZE 376836
@@ -1492,6 +1492,27 @@ static struct videobuf_queue_ops cx231xx_qops = { · 1448 unmodified lines
14921492
14931493 /* ------------------------------------------------------------------ */
14941494
1495+static 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+
14951516 static int vidioc_g_std(struct file *file, void *fh0, v4l2_std_id *norm)
14961517 {
14971518 struct cx231xx_fh *fh = file->private_data;
@@ -1834,6 +1855,7 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { · 336 unmodified lines
18341855 .vidioc_g_input = cx231xx_g_input,
18351856 .vidioc_s_input = cx231xx_s_input,
18361857 .vidioc_s_ctrl = vidioc_s_ctrl,
1858+ .vidioc_cropcap = vidioc_cropcap,
18371859 .vidioc_querycap = cx231xx_querycap,
18381860 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
18391861 .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
19011923 return 0;
19021924 }
19031925
1904−static struct cx2341x_handler_ops cx231xx_ops = {
1926+static const struct cx2341x_handler_ops cx231xx_ops = {
19051927 /* needed for the video clock freq */
19061928 .s_audio_sampling_freq = cx231xx_s_audio_sampling_freq,
19071929 /* needed for setting up the video resolution */
drivers/media/usb/cx231xx/cx231xx-cards.c+5−5
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <media/tveeprom.h>
3131 #include <media/v4l2-common.h>
3232
33−#include <media/cx25840.h>
33+#include <media/drv-intf/cx25840.h>
3434 #include "dvb-usb-ids.h"
3535 #include "xc5000.h"
3636 #include "tda18271.h"
@@ -352,7 +352,7 @@ struct cx231xx_board cx231xx_boards[] = { · 315 unmodified lines
352352 .agc_analog_digital_select_gpio = 0x0c,
353353 .gpio_pin_status_mask = 0x4001000,
354354 .tuner_i2c_master = I2C_1_MUX_1,
355− .demod_i2c_master = I2C_2,
355+ .demod_i2c_master = I2C_1_MUX_1,
356356 .has_dvb = 1,
357357 .demod_addr = 0x0e,
358358 .norm = V4L2_STD_NTSC,
@@ -713,7 +713,7 @@ struct cx231xx_board cx231xx_boards[] = { · 354 unmodified lines
713713 .agc_analog_digital_select_gpio = 0x0c,
714714 .gpio_pin_status_mask = 0x4001000,
715715 .tuner_i2c_master = I2C_1_MUX_3,
716− .demod_i2c_master = I2C_2,
716+ .demod_i2c_master = I2C_1_MUX_3,
717717 .has_dvb = 1,
718718 .demod_addr = 0x0e,
719719 .norm = V4L2_STD_PAL,
@@ -752,7 +752,7 @@ struct cx231xx_board cx231xx_boards[] = { · 32 unmodified lines
752752 .agc_analog_digital_select_gpio = 0x0c,
753753 .gpio_pin_status_mask = 0x4001000,
754754 .tuner_i2c_master = I2C_1_MUX_3,
755− .demod_i2c_master = I2C_2,
755+ .demod_i2c_master = I2C_1_MUX_3,
756756 .has_dvb = 1,
757757 .demod_addr = 0x0e,
758758 .norm = V4L2_STD_PAL,
@@ -791,7 +791,7 @@ struct cx231xx_board cx231xx_boards[] = { · 32 unmodified lines
791791 .agc_analog_digital_select_gpio = 0x0c,
792792 .gpio_pin_status_mask = 0x4001000,
793793 .tuner_i2c_master = I2C_1_MUX_3,
794− .demod_i2c_master = I2C_2,
794+ .demod_i2c_master = I2C_1_MUX_3,
795795 .has_dvb = 1,
796796 .demod_addr = 0x0e,
797797 .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
914914 */
915915 void cx231xx_uninit_bulk(struct cx231xx *dev)
916916 {
917+ struct cx231xx_dmaqueue *dma_q = &dev->video_mode.vidq;
917918 struct urb *urb;
918919 int i;
919920
@@ -931,7 +932,7 @@ void cx231xx_uninit_bulk(struct cx231xx *dev) · 11 unmodified lines
931932 if (dev->video_mode.bulk_ctl.transfer_buffer[i]) {
932933 usb_free_coherent(dev->udev,
933934 urb->transfer_buffer_length,
934− dev->video_mode.isoc_ctl.
935+ dev->video_mode.bulk_ctl.
935936 transfer_buffer[i],
936937 urb->transfer_dma);
937938 }
@@ -943,10 +944,12 @@ void cx231xx_uninit_bulk(struct cx231xx *dev) · 5 unmodified lines
943944
944945 kfree(dev->video_mode.bulk_ctl.urb);
945946 kfree(dev->video_mode.bulk_ctl.transfer_buffer);
947+ kfree(dma_q->p_left_data);
946948
947949 dev->video_mode.bulk_ctl.urb = NULL;
948950 dev->video_mode.bulk_ctl.transfer_buffer = NULL;
949951 dev->video_mode.bulk_ctl.num_bufs = 0;
952+ dma_q->p_left_data = NULL;
950953
951954 if (dev->mode_tv == 0)
952955 cx231xx_capture_start(dev, 0, Raw_Video);
@@ -1196,6 +1199,16 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets, · 243 unmodified lines
11961199 sb_size, cx231xx_bulk_irq_callback, dma_q);
11971200 }
11981201
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+
11991212 init_waitqueue_head(&dma_q->wq);
12001213
12011214 /* 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
725725
726726 dev->dvb->frontend = dvb_attach(lgdt3305_attach,
727727 &hcw_lgdt3305_config,
728− tuner_i2c);
728+ demod_i2c);
729729
730730 if (dev->dvb->frontend == NULL) {
731731 dev_err(dev->dev,
@@ -746,7 +746,7 @@ static int dvb_init(struct cx231xx *dev) · 14 unmodified lines
746746
747747 dev->dvb->frontend = dvb_attach(si2165_attach,
748748 &hauppauge_930C_HD_1113xx_si2165_config,
749− tuner_i2c
749+ demod_i2c
750750 );
751751
752752 if (dev->dvb->frontend == NULL) {
@@ -779,7 +779,7 @@ static int dvb_init(struct cx231xx *dev) · 26 unmodified lines
779779
780780 dev->dvb->frontend = dvb_attach(si2165_attach,
781781 &pctv_quatro_stick_1114xx_si2165_config,
782− tuner_i2c
782+ demod_i2c
783783 );
784784
785785 if (dev->dvb->frontend == NULL) {
@@ -835,7 +835,7 @@ static int dvb_init(struct cx231xx *dev) · 49 unmodified lines
835835
836836 dev->dvb->frontend = dvb_attach(lgdt3306a_attach,
837837 &hauppauge_955q_lgdt3306a_config,
838− tuner_i2c
838+ demod_i2c
839839 );
840840
841841 if (dev->dvb->frontend == NULL) {
drivers/media/usb/cx231xx/cx231xx-vbi.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232
3333 #include <media/v4l2-common.h>
3434 #include <media/v4l2-ioctl.h>
35−#include <media/msp3400.h>
35+#include <media/drv-intf/msp3400.h>
3636 #include <media/tuner.h>
3737
3838 #include "cx231xx-vbi.h"
drivers/media/usb/cx231xx/cx231xx-video.c+4−3
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #include <media/v4l2-common.h>
3737 #include <media/v4l2-ioctl.h>
3838 #include <media/v4l2-event.h>
39−#include <media/msp3400.h>
39+#include <media/drv-intf/msp3400.h>
4040 #include <media/tuner.h>
4141
4242 #include "dvb_frontend.h"
@@ -1444,6 +1444,7 @@ static int vidioc_cropcap(struct file *file, void *priv, · 1401 unmodified lines
14441444 {
14451445 struct cx231xx_fh *fh = priv;
14461446 struct cx231xx *dev = fh->dev;
1447+ bool is_50hz = dev->norm & V4L2_STD_625_50;
14471448
14481449 if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
14491450 return -EINVAL;
@@ -1453,8 +1454,8 @@ static int vidioc_cropcap(struct file *file, void *priv, · 3 unmodified lines
14531454 cc->bounds.width = dev->width;
14541455 cc->bounds.height = dev->height;
14551456 cc->defrect = cc->bounds;
1456− cc->pixelaspect.numerator = 54; /* 4:3 FIXME: remove magic numbers */
1457− cc->pixelaspect.denominator = 59;
1457+ cc->pixelaspect.numerator = is_50hz ? 54 : 11;
1458+ cc->pixelaspect.denominator = is_50hz ? 59 : 10;
14581459
14591460 return 0;
14601461 }
drivers/media/usb/cx231xx/cx231xx.h+2−2
@@ -30,14 +30,14 @@ · 29 unmodified lines
3030 #include <linux/mutex.h>
3131 #include <linux/usb.h>
3232
33−#include <media/cx2341x.h>
33+#include <media/drv-intf/cx2341x.h>
3434
3535 #include <media/videobuf-vmalloc.h>
3636 #include <media/v4l2-device.h>
3737 #include <media/v4l2-ctrls.h>
3838 #include <media/v4l2-fh.h>
3939 #include <media/rc-core.h>
40−#include <media/ir-kbd-i2c.h>
40+#include <media/i2c/ir-kbd-i2c.h>
4141 #include <media/videobuf-dvb.h>
4242
4343 #include "cx231xx-reg.h"
drivers/media/usb/dvb-usb-v2/Kconfig+1−1
@@ -9,7 +9,7 @@ config DVB_USB_V2 · 8 unmodified lines
99 <file:Documentation/dvb/README.dvb-usb>.
1010
1111 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>
1313
1414 Say Y if you own a USB DVB device.
1515
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
3535 struct mxl111sf_demod_state {
3636 struct mxl111sf_state *mxl_state;
3737
38− struct mxl111sf_demod_config *cfg;
38+ const struct mxl111sf_demod_config *cfg;
3939
4040 struct dvb_frontend fe;
4141 };
@@ -579,7 +579,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = { · 537 unmodified lines
579579 };
580580
581581 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
582− struct mxl111sf_demod_config *cfg)
582+ const struct mxl111sf_demod_config *cfg)
583583 {
584584 struct mxl111sf_demod_state *state = NULL;
585585
drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h+2−2
@@ -35,11 +35,11 @@ struct mxl111sf_demod_config { · 34 unmodified lines
3535 #if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
3636 extern
3737 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
38− struct mxl111sf_demod_config *cfg);
38+ const struct mxl111sf_demod_config *cfg);
3939 #else
4040 static inline
4141 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
42− struct mxl111sf_demod_config *cfg)
42+ const struct mxl111sf_demod_config *cfg)
4343 {
4444 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
4545 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
288288 err = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
289289
290290 mxl_fail(err);
291− mxl111sf_enable_usb_output(state);
291+ err = mxl111sf_enable_usb_output(state);
292292 mxl_fail(err);
293− mxl1x1sf_top_master_ctrl(state, 1);
293+ err = mxl1x1sf_top_master_ctrl(state, 1);
294294 mxl_fail(err);
295295
296296 if ((MXL111SF_GPIO_MOD_DVBT != adap_state->gpio_mode) &&
@@ -731,7 +731,7 @@ fail: · 434 unmodified lines
731731 return ret;
732732 }
733733
734−static struct mxl111sf_demod_config mxl_demod_config = {
734+static const struct mxl111sf_demod_config mxl_demod_config = {
735735 .read_reg = mxl111sf_read_reg,
736736 .write_reg = mxl111sf_write_reg,
737737 .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
181181 goto err_mutex_unlock;
182182 } else if (msg[0].addr == 0x10) {
183183 /* method 1 - integrated demod */
184− req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);
185− req.index = CMD_DEMOD_RD | dev->page;
186− req.size = msg[1].len;
187− req.data = &msg[1].buf[0];
188− ret = rtl28xxu_ctrl_msg(d, &req);
184+ if (msg[0].buf[0] == 0x00) {
185+ /* return demod page from driver cache */
186+ msg[1].buf[0] = dev->page;
187+ ret = 0;
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+ }
189195 } else if (msg[0].len < 2) {
190196 /* method 2 - old I2C */
191197 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
99 <file:Documentation/dvb/README.dvb-usb>.
1010
1111 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>
1313
1414 Say Y if you own a USB DVB device.
1515
drivers/media/usb/em28xx/em28xx-camera.c+2−2
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121
2222 #include <linux/i2c.h>
2323 #include <media/soc_camera.h>
24−#include <media/mt9v011.h>
24+#include <media/i2c/mt9v011.h>
2525 #include <media/v4l2-clk.h>
2626 #include <media/v4l2-common.h>
2727
@@ -322,7 +322,7 @@ int em28xx_detect_sensor(struct em28xx *dev) · 294 unmodified lines
322322
323323 int em28xx_init_camera(struct em28xx *dev)
324324 {
325− char clk_name[V4L2_SUBDEV_NAME_SIZE];
325+ char clk_name[V4L2_CLK_NAME_SIZE];
326326 struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus];
327327 struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus];
328328 struct em28xx_v4l2 *v4l2 = dev->v4l2;
drivers/media/usb/em28xx/em28xx-cards.c+12−6
@@ -30,10 +30,10 @@ · 29 unmodified lines
3030 #include <linux/i2c.h>
3131 #include <linux/usb.h>
3232 #include <media/tuner.h>
33−#include <media/msp3400.h>
34−#include <media/saa7115.h>
35−#include <media/tvp5150.h>
36−#include <media/tvaudio.h>
33+#include <media/drv-intf/msp3400.h>
34+#include <media/i2c/saa7115.h>
35+#include <media/i2c/tvp5150.h>
36+#include <media/i2c/tvaudio.h>
3737 #include <media/i2c-addr.h>
3838 #include <media/tveeprom.h>
3939 #include <media/v4l2-common.h>
@@ -1051,8 +1051,12 @@ struct em28xx_board em28xx_boards[] = { · 1011 unmodified lines
10511051 },
10521052 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
10531053 .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,
10551057 .tuner_type = TUNER_ABSENT, /* MT2060 */
1058+ .has_dvb = 1,
1059+ .tuner_gpio = default_tuner_gpio,
10561060 },
10571061 [EM2870_BOARD_KWORLD_350U] = {
10581062 .name = "Kworld 350 U DVB-T",
@@ -2368,7 +2372,7 @@ struct usb_device_id em28xx_id_table[] = { · 1309 unmodified lines
23682372 { USB_DEVICE(0x0ccd, 0x0042),
23692373 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
23702374 { USB_DEVICE(0x0ccd, 0x0043),
2371− .driver_info = EM2870_BOARD_TERRATEC_XS },
2375+ .driver_info = EM2870_BOARD_TERRATEC_XS_MT2060 },
23722376 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
23732377 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
23742378 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
@@ -2471,6 +2475,8 @@ struct usb_device_id em28xx_id_table[] = { · 96 unmodified lines
24712475 .driver_info = EM28178_BOARD_PCTV_461E },
24722476 { USB_DEVICE(0x2013, 0x025f),
24732477 .driver_info = EM28178_BOARD_PCTV_292E },
2478+ { USB_DEVICE(0x2040, 0x0264), /* Hauppauge WinTV-soloHD */
2479+ .driver_info = EM28178_BOARD_PCTV_292E },
24742480 { USB_DEVICE(0x0413, 0x6f07),
24752481 .driver_info = EM2861_BOARD_LEADTEK_VC100 },
24762482 { USB_DEVICE(0xeb1a, 0x8179),
drivers/media/usb/em28xx/em28xx-dvb.c+15−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #include "lgdt3305.h"
3939 #include "zl10353.h"
4040 #include "s5h1409.h"
41+#include "mt2060.h"
4142 #include "mt352.h"
4243 #include "mt352_priv.h" /* FIXME */
4344 #include "tda1002x.h"
@@ -815,6 +816,10 @@ static struct zl10353_config em28xx_zl10353_no_i2c_gate_dev = { · 771 unmodified lines
815816 .parallel_ts = 1,
816817 };
817818
819+static struct mt2060_config em28xx_mt2060_config = {
820+ .i2c_address = 0x60,
821+};
822+
818823 static struct qt1010_config em28xx_qt1010_config = {
819824 .i2c_address = 0x62
820825 };
@@ -1142,6 +1147,16 @@ static int em28xx_dvb_init(struct em28xx *dev) · 321 unmodified lines
11421147 goto out_free;
11431148 }
11441149 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;
11451160 case EM2870_BOARD_KWORLD_355U:
11461161 dvb->fe[0] = dvb_attach(zl10353_attach,
11471162 &em28xx_zl10353_no_i2c_gate_dev,
drivers/media/usb/em28xx/em28xx-vbi.c+8−12
@@ -31,26 +31,22 @@ · 30 unmodified lines
3131
3232 /* ------------------------------------------------------------------ */
3333
34−static int vbi_queue_setup(struct vb2_queue *vq, const void *parg,
34+static int vbi_queue_setup(struct vb2_queue *vq,
3535 unsigned int *nbuffers, unsigned int *nplanes,
3636 unsigned int sizes[], void *alloc_ctxs[])
3737 {
38− const struct v4l2_format *fmt = parg;
3938 struct em28xx *dev = vb2_get_drv_priv(vq);
4039 struct em28xx_v4l2 *v4l2 = dev->v4l2;
41− unsigned long size;
40+ unsigned long size = v4l2->vbi_width * v4l2->vbi_height * 2;
4241
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;
5042 if (*nbuffers < 2)
5143 *nbuffers = 2;
52− if (*nbuffers > 32)
53− *nbuffers = 32;
44+
45+ if (*nplanes) {
46+ if (sizes[0] < size)
47+ return -EINVAL;
48+ size = sizes[0];
49+ }
5450
5551 *nplanes = 1;
5652 sizes[0] = size;
drivers/media/usb/em28xx/em28xx-video.c+6−17
@@ -43,7 +43,7 @@ · 42 unmodified lines
4343 #include <media/v4l2-ioctl.h>
4444 #include <media/v4l2-event.h>
4545 #include <media/v4l2-clk.h>
46−#include <media/msp3400.h>
46+#include <media/drv-intf/msp3400.h>
4747 #include <media/tuner.h>
4848
4949 #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \
@@ -438,7 +438,7 @@ static inline void finish_buffer(struct em28xx *dev, · 388 unmodified lines
438438 buf->vb.field = V4L2_FIELD_NONE;
439439 else
440440 buf->vb.field = V4L2_FIELD_INTERLACED;
441− v4l2_get_timestamp(&buf->vb.timestamp);
441+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
442442
443443 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
444444 }
@@ -871,30 +871,19 @@ static void res_free(struct em28xx *dev, enum v4l2_buf_type f_type) · 426 unmodified lines
871871 Videobuf2 operations
872872 ------------------------------------------------------------------*/
873873
874−static int queue_setup(struct vb2_queue *vq, const void *parg,
874+static int queue_setup(struct vb2_queue *vq,
875875 unsigned int *nbuffers, unsigned int *nplanes,
876876 unsigned int sizes[], void *alloc_ctxs[])
877877 {
878− const struct v4l2_format *fmt = parg;
879878 struct em28xx *dev = vb2_get_drv_priv(vq);
880879 struct em28xx_v4l2 *v4l2 = dev->v4l2;
881− unsigned long size;
882−
883− if (fmt)
884− size = fmt->fmt.pix.sizeimage;
885− else
886− size =
880+ unsigned long size =
887881 (v4l2->width * v4l2->height * v4l2->format->depth + 7) >> 3;
888882
889− if (size == 0)
890− return -EINVAL;
891−
892− if (0 == *nbuffers)
893− *nbuffers = 32;
894−
883+ if (*nplanes)
884+ return sizes[0] < size ? -EINVAL : 0;
895885 *nplanes = 1;
896886 sizes[0] = size;
897−
898887 return 0;
899888 }
900889
drivers/media/usb/em28xx/em28xx.h+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #include <media/v4l2-device.h>
4141 #include <media/v4l2-ctrls.h>
4242 #include <media/v4l2-fh.h>
43−#include <media/ir-kbd-i2c.h>
43+#include <media/i2c/ir-kbd-i2c.h>
4444 #include <media/rc-core.h>
4545 #include "tuner-xc2028.h"
4646 #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
466466 else
467467 go7007_set_motion_regions(go, vb, 0);
468468
469− v4l2_get_timestamp(&vb->vb.timestamp);
469+ vb->vb.vb2_buf.timestamp = ktime_get_ns();
470470 vb_tmp = vb;
471471 spin_lock(&go->spinlock);
472472 list_del(&vb->list);
drivers/media/usb/go7007/go7007-usb.c+3−3
@@ -23,9 +23,9 @@ · 22 unmodified lines
2323 #include <linux/usb.h>
2424 #include <linux/i2c.h>
2525 #include <asm/byteorder.h>
26−#include <media/saa7115.h>
26+#include <media/i2c/saa7115.h>
2727 #include <media/tuner.h>
28−#include <media/uda1342.h>
28+#include <media/i2c/uda1342.h>
2929
3030 #include "go7007-priv.h"
3131
@@ -1289,7 +1289,7 @@ static int go7007_usb_probe(struct usb_interface *intf, · 1257 unmodified lines
12891289
12901290 /* Allocate the URBs and buffers for receiving the audio stream */
12911291 if ((board->flags & GO7007_USB_EZUSB) &&
1292− (board->flags & GO7007_BOARD_HAS_AUDIO)) {
1292+ (board->main_info.flags & GO7007_BOARD_HAS_AUDIO)) {
12931293 for (i = 0; i < 8; ++i) {
12941294 usb->audio_urbs[i] = usb_alloc_urb(0, GFP_KERNEL);
12951295 if (usb->audio_urbs[i] == NULL)
drivers/media/usb/go7007/go7007-v4l2.c+1−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <media/v4l2-subdev.h>
3131 #include <media/v4l2-event.h>
3232 #include <media/videobuf2-vmalloc.h>
33−#include <media/saa7115.h>
33+#include <media/i2c/saa7115.h>
3434
3535 #include "go7007-priv.h"
3636
@@ -369,7 +369,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, · 332 unmodified lines
369369 }
370370
371371 static int go7007_queue_setup(struct vb2_queue *q,
372− const void *parg,
373372 unsigned int *num_buffers, unsigned int *num_planes,
374373 unsigned int sizes[], void *alloc_ctxs[])
375374 {
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
14911491 struct v4l2_fract *tpf = &cp->timeperframe;
14921492 struct sd *sd = (struct sd *) gspca_dev;
14931493
1494− /* Set requested framerate */
1495− sd->frame_rate = tpf->denominator / tpf->numerator;
1494+ if (tpf->numerator == 0 || tpf->denominator == 0)
1495+ /* Set default framerate */
1496+ sd->frame_rate = 30;
1497+ else
1498+ /* Set requested framerate */
1499+ sd->frame_rate = tpf->denominator / tpf->numerator;
1500+
14961501 if (gspca_dev->streaming)
14971502 set_frame_rate(gspca_dev);
14981503
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
48024802 struct v4l2_fract *tpf = &cp->timeperframe;
48034803 int fr, i;
48044804
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+
48064810 if (gspca_dev->streaming)
48074811 setframerate(gspca_dev, v4l2_ctrl_g_ctrl(gspca_dev->exposure));
48084812
drivers/media/usb/hackrf/hackrf.c+3−3
@@ -526,7 +526,7 @@ static void hackrf_urb_complete_in(struct urb *urb) · 525 unmodified lines
526526 urb->transfer_buffer, len);
527527 vb2_set_plane_payload(&buffer->vb.vb2_buf, 0, len);
528528 buffer->vb.sequence = dev->sequence++;
529− v4l2_get_timestamp(&buffer->vb.timestamp);
529+ buffer->vb.vb2_buf.timestamp = ktime_get_ns();
530530 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE);
531531 exit_usb_submit_urb:
532532 usb_submit_urb(urb, GFP_ATOMIC);
@@ -571,7 +571,7 @@ static void hackrf_urb_complete_out(struct urb *urb) · 38 unmodified lines
571571 vb2_plane_vaddr(&buffer->vb.vb2_buf, 0), len);
572572 urb->actual_length = len;
573573 buffer->vb.sequence = dev->sequence++;
574− v4l2_get_timestamp(&buffer->vb.timestamp);
574+ buffer->vb.vb2_buf.timestamp = ktime_get_ns();
575575 vb2_buffer_done(&buffer->vb.vb2_buf, VB2_BUF_STATE_DONE);
576576 exit_usb_submit_urb:
577577 usb_submit_urb(urb, GFP_ATOMIC);
@@ -759,7 +759,7 @@ static void hackrf_return_all_buffers(struct vb2_queue *vq, · 181 unmodified lines
759759 }
760760
761761 static int hackrf_queue_setup(struct vb2_queue *vq,
762− const void *parg, unsigned int *nbuffers,
762+ unsigned int *nbuffers,
763763 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
764764 {
765765 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
642642 if (dev->status != STATUS_IDLE)
643643 return -EBUSY;
644644 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))
646646 break;
647647 if (i == ARRAY_SIZE(hdpvr_dv_timings))
648648 return -EINVAL;
drivers/media/usb/hdpvr/hdpvr.h+1−1
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717
1818 #include <media/v4l2-device.h>
1919 #include <media/v4l2-ctrls.h>
20−#include <media/ir-kbd-i2c.h>
20+#include <media/i2c/ir-kbd-i2c.h>
2121
2222 #define HDPVR_MAX 8
2323 #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
616616
617617 /* Videobuf2 operations */
618618 static int msi2500_queue_setup(struct vb2_queue *vq,
619− const void *parg,
620619 unsigned int *nbuffers,
621620 unsigned int *nplanes, unsigned int sizes[],
622621 void *alloc_ctxs[])
drivers/media/usb/pvrusb2/pvrusb2-audio.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include "pvrusb2-hdw-internal.h"
2424 #include "pvrusb2-debug.h"
2525 #include <linux/videodev2.h>
26−#include <media/msp3400.h>
26+#include <media/drv-intf/msp3400.h>
2727 #include <media/v4l2-common.h>
2828
2929
drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232
3333 #include "pvrusb2-hdw-internal.h"
3434 #include "pvrusb2-debug.h"
35−#include <media/cx25840.h>
35+#include <media/drv-intf/cx25840.h>
3636 #include <linux/videodev2.h>
3737 #include <media/v4l2-common.h>
3838 #include <linux/errno.h>
drivers/media/usb/pvrusb2/pvrusb2-hdw-internal.h+2−2
@@ -39,8 +39,8 @@ · 38 unmodified lines
3939 #include "pvrusb2-hdw.h"
4040 #include "pvrusb2-io.h"
4141 #include <media/v4l2-device.h>
42−#include <media/cx2341x.h>
43−#include <media/ir-kbd-i2c.h>
42+#include <media/drv-intf/cx2341x.h>
43+#include <media/i2c/ir-kbd-i2c.h>
4444 #include "pvrusb2-devattr.h"
4545
4646 /* Legal values for PVR2_CID_HSM */
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020
2121 #include <linux/i2c.h>
2222 #include <linux/module.h>
23−#include <media/ir-kbd-i2c.h>
23+#include <media/i2c/ir-kbd-i2c.h>
2424 #include "pvrusb2-i2c-core.h"
2525 #include "pvrusb2-hdw-internal.h"
2626 #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
628628 struct pvr2_v4l2_fh *fh = file->private_data;
629629 struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
630630 struct v4l2_ext_control *ctrl;
631+ struct pvr2_ctrl *cptr;
631632 unsigned int idx;
632633 int val;
633634 int ret;
@@ -635,8 +636,15 @@ static int pvr2_g_ext_ctrls(struct file *file, void *priv, · 1 unmodified line
635636 ret = 0;
636637 for (idx = 0; idx < ctls->count; idx++) {
637638 ctrl = ctls->controls + idx;
638− ret = pvr2_ctrl_get_value(
639− pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id), &val);
639+ cptr = pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id);
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+
640648 if (ret) {
641649 ctls->error_idx = idx;
642650 return ret;
@@ -658,6 +666,10 @@ static int pvr2_s_ext_ctrls(struct file *file, void *priv, · 15 unmodified lines
658666 unsigned int idx;
659667 int ret;
660668
669+ /* Default value cannot be changed */
670+ if (ctls->which == V4L2_CTRL_WHICH_DEF_VAL)
671+ return -EINVAL;
672+
661673 ret = 0;
662674 for (idx = 0; idx < ctls->count; idx++) {
663675 ctrl = ctls->controls + idx;
drivers/media/usb/pvrusb2/pvrusb2-video-v4l.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 #include "pvrusb2-debug.h"
3636 #include <linux/videodev2.h>
3737 #include <media/v4l2-common.h>
38−#include <media/saa7115.h>
38+#include <media/i2c/saa7115.h>
3939 #include <linux/errno.h>
4040
4141 struct 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
316316 struct pwc_frame_buf *fbuf = pdev->fill_buf;
317317
318318 if (pdev->vsync == 1) {
319− v4l2_get_timestamp(
320− &fbuf->vb.timestamp);
319+ fbuf->vb.vb2_buf.timestamp = ktime_get_ns();
321320 pdev->vsync = 2;
322321 }
323322
@@ -571,7 +570,7 @@ static void pwc_video_release(struct v4l2_device *v) · 247 unmodified lines
571570 /***************************************************************************/
572571 /* Videobuf2 operations */
573572
574−static int queue_setup(struct vb2_queue *vq, const void *parg,
573+static int queue_setup(struct vb2_queue *vq,
575574 unsigned int *nbuffers, unsigned int *nplanes,
576575 unsigned int sizes[], void *alloc_ctxs[])
577576 {
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
574574 buf = list_entry(vc->buf_list.next,
575575 struct s2255_buffer, list);
576576 list_del(&buf->list);
577− v4l2_get_timestamp(&buf->vb.timestamp);
577+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
578578 buf->vb.field = vc->field;
579579 buf->vb.sequence = vc->frame_count;
580580 spin_unlock_irqrestore(&vc->qlock, flags);
@@ -660,7 +660,7 @@ static void s2255_fillbuff(struct s2255_vc *vc, · 79 unmodified lines
660660 Videobuf operations
661661 ------------------------------------------------------------------*/
662662
663−static int queue_setup(struct vb2_queue *vq, const void *parg,
663+static int queue_setup(struct vb2_queue *vq,
664664 unsigned int *nbuffers, unsigned int *nplanes,
665665 unsigned int sizes[], void *alloc_ctxs[])
666666 {
drivers/media/usb/stk1160/stk1160-core.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #include <linux/usb.h>
3535 #include <linux/mm.h>
3636 #include <linux/vmalloc.h>
37−#include <media/saa7115.h>
37+#include <media/i2c/saa7115.h>
3838
3939 #include "stk1160.h"
4040 #include "stk1160-reg.h"
drivers/media/usb/stk1160/stk1160-v4l.c+2−2
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #include <media/v4l2-event.h>
3434 #include <media/videobuf2-vmalloc.h>
3535
36−#include <media/saa7115.h>
36+#include <media/i2c/saa7115.h>
3737
3838 #include "stk1160.h"
3939 #include "stk1160-reg.h"
@@ -664,7 +664,7 @@ static const struct v4l2_ioctl_ops stk1160_ioctl_ops = { · 624 unmodified lines
664664 /*
665665 * Videobuf2 operations
666666 */
667−static int queue_setup(struct vb2_queue *vq, const void *parg,
667+static int queue_setup(struct vb2_queue *vq,
668668 unsigned int *nbuffers, unsigned int *nplanes,
669669 unsigned int sizes[], void *alloc_ctxs[])
670670 {
drivers/media/usb/stk1160/stk1160-video.c+1−1
@@ -99,7 +99,7 @@ void stk1160_buffer_done(struct stk1160 *dev) · 98 unmodified lines
9999 buf->vb.sequence = dev->sequence++;
100100 buf->vb.field = V4L2_FIELD_INTERLACED;
101101 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();
103103
104104 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, buf->bytesused);
105105 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
2626 #include <linux/slab.h>
2727 #include <media/v4l2-common.h>
2828 #include <media/tuner.h>
29−#include <media/tvaudio.h>
29+#include <media/i2c/tvaudio.h>
3030 #include <media/i2c-addr.h>
3131 #include <media/rc-map.h>
3232
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
16061606 return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
16071607 }
16081608
1609−static struct ttusbdecfe_config fe_config = {
1609+static const struct ttusbdecfe_config fe_config = {
16101610 .send_command = fe_send_command
16111611 };
16121612
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
322322
323323 buf->vb.field = V4L2_FIELD_INTERLACED;
324324 buf->vb.sequence = usbtv->sequence++;
325− v4l2_get_timestamp(&buf->vb.timestamp);
325+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
326326 vb2_set_plane_payload(&buf->vb.vb2_buf, 0, size);
327327 vb2_buffer_done(&buf->vb.vb2_buf, state);
328328 list_del(&buf->list);
@@ -599,19 +599,18 @@ static struct v4l2_file_operations usbtv_fops = { · 270 unmodified lines
599599 };
600600
601601 static int usbtv_queue_setup(struct vb2_queue *vq,
602− const void *parg, unsigned int *nbuffers,
602+ unsigned int *nbuffers,
603603 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
604604 {
605− const struct v4l2_format *fmt = parg;
606605 struct usbtv *usbtv = vb2_get_drv_priv(vq);
607606 unsigned size = USBTV_CHUNK * usbtv->n_chunks * 2 * sizeof(u32);
608607
609608 if (vq->num_buffers + *nbuffers < 2)
610609 *nbuffers = 2 - vq->num_buffers;
610+ if (*nplanes)
611+ return sizes[0] < size ? -EINVAL : 0;
611612 *nplanes = 1;
612− if (fmt && fmt->fmt.pix.sizeimage < size)
613− return -EINVAL;
614− sizes[0] = fmt ? fmt->fmt.pix.sizeimage : size;
613+ sizes[0] = size;
615614
616615 return 0;
617616 }
drivers/media/usb/usbvision/usbvision-core.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #include <linux/videodev2.h>
3838 #include <linux/i2c.h>
3939
40−#include <media/saa7115.h>
40+#include <media/i2c/saa7115.h>
4141 #include <media/v4l2-common.h>
4242 #include <media/tuner.h>
4343
drivers/media/usb/usbvision/usbvision-video.c+23−2
@@ -59,7 +59,7 @@ · 58 unmodified lines
5959 #include <linux/videodev2.h>
6060 #include <linux/i2c.h>
6161
62−#include <media/saa7115.h>
62+#include <media/i2c/saa7115.h>
6363 #include <media/v4l2-common.h>
6464 #include <media/v4l2-ioctl.h>
6565 #include <media/v4l2-event.h>
@@ -1461,11 +1461,32 @@ static int usbvision_probe(struct usb_interface *intf, · 1395 unmodified lines
14611461 printk(KERN_INFO "%s: %s found\n", __func__,
14621462 usbvision_device_data[model].model_string);
14631463
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+
14641471 if (usbvision_device_data[model].interface >= 0)
14651472 interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
1466− else
1473+ else if (ifnum < dev->actconfig->desc.bNumInterfaces)
14671474 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+ }
14681488 endpoint = &interface->endpoint[1].desc;
1489+
14691490 if (!usb_endpoint_xfer_isoc(endpoint)) {
14701491 dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
14711492 __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
227227 .size = 4,
228228 .flags = UVC_CTRL_FLAG_SET_CUR
229229 | UVC_CTRL_FLAG_GET_RANGE
230− | UVC_CTRL_FLAG_RESTORE,
230+ | UVC_CTRL_FLAG_RESTORE
231+ | UVC_CTRL_FLAG_AUTO_UPDATE,
231232 },
232233 {
233234 .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
25402540 .bInterfaceProtocol = 0,
25412541 .driver_info = UVC_QUIRK_FORCE_Y8 },
25422542 /* 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) },
25442545 {}
25452546 };
25462547
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
6969 * videobuf2 queue operations
7070 */
7171
72−static int uvc_queue_setup(struct vb2_queue *vq, const void *parg,
72+static int uvc_queue_setup(struct vb2_queue *vq,
7373 unsigned int *nbuffers, unsigned int *nplanes,
7474 unsigned int sizes[], void *alloc_ctxs[])
7575 {
76− const struct v4l2_format *fmt = parg;
7776 struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
7877 struct uvc_streaming *stream = uvc_queue_to_stream(queue);
78+ unsigned size = stream->ctrl.dwMaxVideoFrameSize;
7979
8080 /* Make sure the image size is large enough. */
81− if (fmt && fmt->fmt.pix.sizeimage < stream->ctrl.dwMaxVideoFrameSize)
82− return -EINVAL;
83−
81+ if (*nplanes)
82+ return sizes[0] < size ? -EINVAL : 0;
8483 *nplanes = 1;
85−
86− sizes[0] = fmt ? fmt->fmt.pix.sizeimage
87− : stream->ctrl.dwMaxVideoFrameSize;
88−
84+ sizes[0] = size;
8985 return 0;
9086 }
9187
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
983983 unsigned int i;
984984 int ret;
985985
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+
9861002 ret = uvc_ctrl_begin(chain);
9871003 if (ret < 0)
9881004 return ret;
@@ -1010,6 +1026,10 @@ static int uvc_ioctl_s_try_ext_ctrls(struct uvc_fh *handle, · 21 unmodified lines
10101026 unsigned int i;
10111027 int ret;
10121028
1029+ /* Default value cannot be changed */
1030+ if (ctrls->which == V4L2_CTRL_WHICH_DEF_VAL)
1031+ return -EINVAL;
1032+
10131033 ret = uvc_ctrl_begin(chain);
10141034 if (ret < 0)
10151035 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
694694 ts.tv_nsec -= NSEC_PER_SEC;
695695 }
696696
697− uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %lu.%06lu "
698− "buf ts %lu.%06lu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n",
697+ uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %llu "
698+ "buf ts %llu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n",
699699 stream->dev->name,
700700 sof >> 16, div_u64(((u64)sof & 0xffff) * 1000000LLU, 65536),
701− y, ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC,
702− vbuf->timestamp.tv_sec,
703− (unsigned long)vbuf->timestamp.tv_usec,
701+ y, timespec_to_ns(&ts), vbuf->vb2_buf.timestamp,
704702 x1, first->host_sof, first->dev_sof,
705703 x2, last->host_sof, last->dev_sof, y1, y2);
706704
707705 /* Update the V4L2 buffer. */
708− vbuf->timestamp.tv_sec = ts.tv_sec;
709− vbuf->timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
706+ vbuf->vb2_buf.timestamp = timespec_to_ns(&ts);
710707
711708 done:
712− spin_unlock_irqrestore(&stream->clock.lock, flags);
709+ spin_unlock_irqrestore(&clock->lock, flags);
713710 }
714711
715712 /* ------------------------------------------------------------------------
@@ -1034,9 +1031,7 @@ static int uvc_video_decode_start(struct uvc_streaming *stream, · 318 unmodified lines
10341031
10351032 buf->buf.field = V4L2_FIELD_NONE;
10361033 buf->buf.sequence = stream->sequence;
1037− buf->buf.timestamp.tv_sec = ts.tv_sec;
1038− buf->buf.timestamp.tv_usec =
1039− ts.tv_nsec / NSEC_PER_USEC;
1034+ buf->buf.vb2_buf.timestamp = timespec_to_ns(&ts);
10401035
10411036 /* TODO: Handle PTS and SCR. */
10421037 buf->state = UVC_BUF_STATE_ACTIVE;
drivers/media/v4l2-core/v4l2-clk.c+9−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/list.h>
1616 #include <linux/module.h>
1717 #include <linux/mutex.h>
18+#include <linux/of.h>
1819 #include <linux/slab.h>
1920 #include <linux/string.h>
2021
@@ -39,6 +40,7 @@ struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) · 18 unmodified lines
3940 {
4041 struct v4l2_clk *clk;
4142 struct clk *ccf_clk = clk_get(dev, id);
43+ char clk_name[V4L2_CLK_NAME_SIZE];
4244
4345 if (PTR_ERR(ccf_clk) == -EPROBE_DEFER)
4446 return ERR_PTR(-EPROBE_DEFER);
@@ -57,6 +59,13 @@ struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id) · 12 unmodified lines
5759 mutex_lock(&clk_lock);
5860 clk = v4l2_clk_find(dev_name(dev));
5961
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+
6069 if (!IS_ERR(clk))
6170 atomic_inc(&clk->use_count);
6271 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
630630 }
631631
632632 struct v4l2_ext_controls32 {
633− __u32 ctrl_class;
633+ __u32 which;
634634 __u32 count;
635635 __u32 error_idx;
636636 __u32 reserved[2];
@@ -673,7 +673,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext · 36 unmodified lines
673673 compat_caddr_t p;
674674
675675 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) ||
677677 get_user(kp->count, &up->count) ||
678678 get_user(kp->error_idx, &up->error_idx) ||
679679 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
723723 compat_caddr_t p;
724724
725725 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) ||
727727 put_user(kp->count, &up->count) ||
728728 put_user(kp->error_idx, &up->error_idx) ||
729729 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
14911491 return ptr_to_user(c, ctrl, ctrl->p_new);
14921492 }
14931493
1494+/* Helper function: copy the initial control value back to the caller */
1495+static 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+
14941505 /* Helper function: copy the caller-provider value to the given control value */
14951506 static int user_to_ptr(struct v4l2_ext_control *c,
14961507 struct v4l2_ctrl *ctrl,
@@ -1762,7 +1773,7 @@ static struct v4l2_ctrl_ref *find_private_ref( · 265 unmodified lines
17621773 list_for_each_entry(ref, &hdl->ctrl_refs, node) {
17631774 /* Search for private user controls that are compatible with
17641775 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 &&
17661777 V4L2_CTRL_DRIVER_PRIV(ref->ctrl->id)) {
17671778 if (!ref->ctrl->is_int)
17681779 continue;
@@ -1831,7 +1842,7 @@ static int handler_new_ref(struct v4l2_ctrl_handler *hdl, · 62 unmodified lines
18311842 struct v4l2_ctrl_ref *ref;
18321843 struct v4l2_ctrl_ref *new_ref;
18331844 u32 id = ctrl->id;
1834− u32 class_ctrl = V4L2_CTRL_ID2CLASS(id) | 1;
1845+ u32 class_ctrl = V4L2_CTRL_ID2WHICH(id) | 1;
18351846 int bucket = id % hdl->nr_of_buckets; /* which bucket to use */
18361847
18371848 /*
@@ -2253,9 +2264,9 @@ EXPORT_SYMBOL(v4l2_ctrl_add_handler); · 415 unmodified lines
22532264
22542265 bool v4l2_ctrl_radio_filter(const struct v4l2_ctrl *ctrl)
22552266 {
2256− if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_FM_TX)
2267+ if (V4L2_CTRL_ID2WHICH(ctrl->id) == V4L2_CTRL_CLASS_FM_TX)
22572268 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)
22592270 return true;
22602271 switch (ctrl->id) {
22612272 case V4L2_CID_AUDIO_MUTE:
@@ -2710,7 +2721,9 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler *hdl, · 448 unmodified lines
27102721
27112722 cs->error_idx = i;
27122723
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)
27142727 return -EINVAL;
27152728
27162729 /* 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
27872800 /* Handles the corner case where cs->count == 0. It checks whether the
27882801 specified control class exists. If that class ID is 0, then it checks
27892802 whether there are any controls at all. */
2790−static int class_check(struct v4l2_ctrl_handler *hdl, u32 ctrl_class)
2803+static int class_check(struct v4l2_ctrl_handler *hdl, u32 which)
27912804 {
2792− if (ctrl_class == 0)
2805+ if (which == 0 || which == V4L2_CTRL_WHICH_DEF_VAL)
27932806 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;
27952808 }
27962809
27972810
@@ -2803,15 +2816,18 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs · 5 unmodified lines
28032816 struct v4l2_ctrl_helper *helpers = helper;
28042817 int ret;
28052818 int i, j;
2819+ bool def_value;
2820+
2821+ def_value = (cs->which == V4L2_CTRL_WHICH_DEF_VAL);
28062822
28072823 cs->error_idx = cs->count;
2808− cs->ctrl_class = V4L2_CTRL_ID2CLASS(cs->ctrl_class);
2824+ cs->which = V4L2_CTRL_ID2WHICH(cs->which);
28092825
28102826 if (hdl == NULL)
28112827 return -EINVAL;
28122828
28132829 if (cs->count == 0)
2814− return class_check(hdl, cs->ctrl_class);
2830+ return class_check(hdl, cs->which);
28152831
28162832 if (cs->count > ARRAY_SIZE(helper)) {
28172833 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
28292845
28302846 for (i = 0; !ret && i < cs->count; i++) {
28312847 int (*ctrl_to_user)(struct v4l2_ext_control *c,
2832− struct v4l2_ctrl *ctrl) = cur_to_user;
2848+ struct v4l2_ctrl *ctrl);
28332849 struct v4l2_ctrl *master;
28342850
2851+ ctrl_to_user = def_value ? def_to_user : cur_to_user;
2852+
28352853 if (helpers[i].mref == NULL)
28362854 continue;
28372855
@@ -2841,8 +2859,9 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs · 3 unmodified lines
28412859 v4l2_ctrl_lock(master);
28422860
28432861 /* g_volatile_ctrl will update the new control values */
2844− if ((master->flags & V4L2_CTRL_FLAG_VOLATILE) ||
2845− (master->has_volatiles && !is_cur_manual(master))) {
2862+ if (!def_value &&
2863+ ((master->flags & V4L2_CTRL_FLAG_VOLATILE) ||
2864+ (master->has_volatiles && !is_cur_manual(master)))) {
28462865 for (j = 0; j < master->ncontrols; j++)
28472866 cur_to_new(master->cluster[j]);
28482867 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
30643083 int ret;
30653084
30663085 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);
30683092
30693093 if (hdl == NULL)
30703094 return -EINVAL;
30713095
30723096 if (cs->count == 0)
3073− return class_check(hdl, cs->ctrl_class);
3097+ return class_check(hdl, cs->which);
30743098
30753099 if (cs->count > ARRAY_SIZE(helper)) {
30763100 helpers = kmalloc_array(cs->count, sizeof(helper[0]),
@@ -3300,7 +3324,8 @@ EXPORT_SYMBOL(v4l2_ctrl_notify); · 223 unmodified lines
33003324 int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
33013325 s64 min, s64 max, u64 step, s64 def)
33023326 {
3303− bool changed;
3327+ bool value_changed;
3328+ bool range_changed = false;
33043329 int ret;
33053330
33063331 lockdep_assert_held(ctrl->handler->lock);
@@ -3324,10 +3349,14 @@ int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, · 17 unmodified lines
33243349 default:
33253350 return -EINVAL;
33263351 }
3327− ctrl->minimum = min;
3328− ctrl->maximum = max;
3329− ctrl->step = step;
3330− ctrl->default_value = def;
3352+ if ((ctrl->minimum != min) || (ctrl->maximum != max) ||
3353+ (ctrl->step != step) || ctrl->default_value != def) {
3354+ range_changed = true;
3355+ ctrl->minimum = min;
3356+ ctrl->maximum = max;
3357+ ctrl->step = step;
3358+ ctrl->default_value = def;
3359+ }
33313360 cur_to_new(ctrl);
33323361 if (validate_new(ctrl, ctrl->p_new)) {
33333362 if (ctrl->type == V4L2_CTRL_TYPE_INTEGER64)
@@ -3337,12 +3366,12 @@ int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, · 3 unmodified lines
33373366 }
33383367
33393368 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;
33413370 else
3342− changed = *ctrl->p_new.p_s32 != *ctrl->p_cur.p_s32;
3343− if (changed)
3371+ value_changed = *ctrl->p_new.p_s32 != *ctrl->p_cur.p_s32;
3372+ if (value_changed)
33443373 ret = set_ctrl(NULL, ctrl, V4L2_EVENT_CTRL_CH_RANGE);
3345− else
3374+ else if (range_changed)
33463375 send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_RANGE);
33473376 return ret;
33483377 }
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
118118 if (sd->flags & V4L2_SUBDEV_FL_IS_I2C) {
119119 struct i2c_client *client = v4l2_get_subdevdata(sd);
120120
121− /* We need to unregister the i2c client explicitly.
122− We cannot rely on i2c_del_adapter to always
123− unregister clients for us, since if the i2c bus
124− is a platform bus, then it is never deleted. */
125− if (client)
121+ /*
122+ * We need to unregister the i2c client
123+ * explicitly. We cannot rely on
124+ * i2c_del_adapter to always unregister
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)
126135 i2c_unregister_device(client);
127136 continue;
128137 }
@@ -131,7 +140,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev) · 2 unmodified lines
131140 if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) {
132141 struct spi_device *spi = v4l2_get_subdevdata(sd);
133142
134− if (spi)
143+ if (spi && !spi->dev.of_node && !spi->dev.fwnode)
135144 spi_unregister_device(spi);
136145 continue;
137146 }
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
209209 if (v4l2_valid_dv_timings(v4l2_dv_timings_presets + i, cap,
210210 fnc, fnc_handle) &&
211211 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+
213215 *t = v4l2_dv_timings_presets[i];
216+ if (can_reduce_fps(&t->bt))
217+ t->bt.flags |= flags;
218+
214219 return true;
215220 }
216221 }
@@ -223,12 +228,14 @@ EXPORT_SYMBOL_GPL(v4l2_find_dv_timings_cap); · 6 unmodified lines
223228 * @t1 - compare this v4l2_dv_timings struct...
224229 * @t2 - with this struct.
225230 * @pclock_delta - the allowed pixelclock deviation.
231+ * @match_reduced_fps - if true, then fail if V4L2_DV_FL_REDUCED_FPS does not
232+ * match.
226233 *
227234 * Compare t1 with t2 with a given margin of error for the pixelclock.
228235 */
229236 bool v4l2_match_dv_timings(const struct v4l2_dv_timings *t1,
230237 const struct v4l2_dv_timings *t2,
231− unsigned pclock_delta)
238+ unsigned pclock_delta, bool match_reduced_fps)
232239 {
233240 if (t1->type != t2->type || t1->type != V4L2_DV_BT_656_1120)
234241 return false;
@@ -239,9 +246,14 @@ bool v4l2_match_dv_timings(const struct v4l2_dv_timings *t1, · 4 unmodified lines
239246 t1->bt.pixelclock >= t2->bt.pixelclock - pclock_delta &&
240247 t1->bt.pixelclock <= t2->bt.pixelclock + pclock_delta &&
241248 t1->bt.hfrontporch == t2->bt.hfrontporch &&
249+ t1->bt.hsync == t2->bt.hsync &&
250+ t1->bt.hbackporch == t2->bt.hbackporch &&
242251 t1->bt.vfrontporch == t2->bt.vfrontporch &&
243252 t1->bt.vsync == t2->bt.vsync &&
244253 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)) &&
245257 (!t1->bt.interlaced ||
246258 (t1->bt.il_vfrontporch == t2->bt.il_vfrontporch &&
247259 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
565565 const struct v4l2_ext_controls *p = arg;
566566 int i;
567567
568− pr_cont("class=0x%x, count=%d, error_idx=%d",
569− p->ctrl_class, p->count, p->error_idx);
568+ pr_cont("which=0x%x, count=%d, error_idx=%d",
569+ p->which, p->count, p->error_idx);
570570 for (i = 0; i < p->count; i++) {
571571 if (!p->controls[i].size)
572572 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
902902 Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL
903903 is it allowed for backwards compatibility.
904904 */
905− if (!allow_priv && c->ctrl_class == V4L2_CID_PRIVATE_BASE)
905+ if (!allow_priv && c->which == V4L2_CID_PRIVATE_BASE)
906906 return 0;
907− if (c->ctrl_class == 0)
907+ if (!c->which)
908908 return 1;
909909 /* Check that all controls are from the same control class. */
910910 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) {
912912 c->error_idx = i;
913913 return 0;
914914 }
@@ -1969,7 +1969,7 @@ static int v4l_g_ctrl(const struct v4l2_ioctl_ops *ops, · 1054 unmodified lines
19691969 if (ops->vidioc_g_ext_ctrls == NULL)
19701970 return -ENOTTY;
19711971
1972− ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id);
1972+ ctrls.which = V4L2_CTRL_ID2WHICH(p->id);
19731973 ctrls.count = 1;
19741974 ctrls.controls = &ctrl;
19751975 ctrl.id = p->id;
@@ -2003,7 +2003,7 @@ static int v4l_s_ctrl(const struct v4l2_ioctl_ops *ops, · 27 unmodified lines
20032003 if (ops->vidioc_s_ext_ctrls == NULL)
20042004 return -ENOTTY;
20052005
2006− ctrls.ctrl_class = V4L2_CTRL_ID2CLASS(p->id);
2006+ ctrls.which = V4L2_CTRL_ID2WHICH(p->id);
20072007 ctrls.count = 1;
20082008 ctrls.controls = &ctrl;
20092009 ctrl.id = p->id;
drivers/media/v4l2-core/videobuf2-core.c+836−90
@@ -28,11 +28,161 @@ · 27 unmodified lines
2828
2929 #include <trace/events/vb2.h>
3030
31−#include "videobuf2-internal.h"
31+static int debug;
32+module_param(debug, int, 0644);
3233
33−int vb2_debug;
34−EXPORT_SYMBOL_GPL(vb2_debug);
35−module_param_named(debug, vb2_debug, int, 0644);
34+#define dprintk(level, fmt, arg...) \
35+ do { \
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+})
36186
37187 static void __vb2_queue_cancel(struct vb2_queue *q);
38188 static 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
53203 * NOTE: mmapped areas should be page aligned
54204 */
55205 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);
57207
58208 mem_priv = call_ptr_memop(vb, alloc, q->alloc_ctx[plane],
59209 size, dma_dir, q->gfp_flags);
@@ -62,7 +212,6 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb) · 2 unmodified lines
62212
63213 /* Associate allocator private data with this plane */
64214 vb->planes[plane].mem_priv = mem_priv;
65− vb->planes[plane].length = q->plane_sizes[plane];
66215 }
67216
68217 return 0;
@@ -136,58 +285,31 @@ static void __vb2_buf_dmabuf_put(struct vb2_buffer *vb) · 67 unmodified lines
136285 __vb2_plane_dmabuf_put(vb, &vb->planes[plane]);
137286 }
138287
139−/**
140− * __setup_lengths() - setup initial lengths for every plane in
141− * every buffer on the queue
142− */
143−static 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−
158288 /**
159289 * __setup_offsets() - setup unique offsets ("cookies") for every plane in
160− * every buffer on the queue
290+ * the buffer.
161291 */
162−static void __setup_offsets(struct vb2_queue *q, unsigned int n)
292+static void __setup_offsets(struct vb2_buffer *vb)
163293 {
164− unsigned int buffer, plane;
165− struct vb2_buffer *vb;
166− unsigned long off;
294+ struct vb2_queue *q = vb->vb2_queue;
295+ unsigned int plane;
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];
167301
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];
172302 off = PAGE_ALIGN(p->m.offset + p->length);
173− } else {
174− off = 0;
175303 }
176304
177− for (buffer = q->num_buffers; buffer < q->num_buffers + n; ++buffer) {
178− vb = q->bufs[buffer];
179− if (!vb)
180− continue;
181−
182− for (plane = 0; plane < vb->num_planes; ++plane) {
183− vb->planes[plane].m.offset = off;
305+ for (plane = 0; plane < vb->num_planes; ++plane) {
306+ vb->planes[plane].m.offset = off;
184307
185− dprintk(3, "buffer %d, plane %d offset 0x%08lx\n",
186− buffer, plane, off);
308+ dprintk(3, "buffer %d, plane %d offset 0x%08lx\n",
309+ vb->index, plane, off);
187310
188− off += vb->planes[plane].length;
189− off = PAGE_ALIGN(off);
190− }
311+ off += vb->planes[plane].length;
312+ off = PAGE_ALIGN(off);
191313 }
192314 }
193315
@@ -199,9 +321,10 @@ static void __setup_offsets(struct vb2_queue *q, unsigned int n) · 5 unmodified lines
199321 * Returns the number of buffers successfully allocated.
200322 */
201323 static 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])
203326 {
204− unsigned int buffer;
327+ unsigned int buffer, plane;
205328 struct vb2_buffer *vb;
206329 int ret;
207330
@@ -219,6 +342,11 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory, · 11 unmodified lines
219342 vb->index = q->num_buffers + buffer;
220343 vb->type = q->type;
221344 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;
222350
223351 /* Allocate video buffer memory for the MMAP type */
224352 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
226354 if (ret) {
227355 dprintk(1, "failed allocating memory for "
228356 "buffer %d\n", buffer);
357+ q->bufs[vb->index] = NULL;
229358 kfree(vb);
230359 break;
231360 }
361+ __setup_offsets(vb);
232362 /*
233363 * Call the driver-provided buffer initialization
234364 * 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
239369 dprintk(1, "buffer %d %p initialization"
240370 " failed\n", buffer, vb);
241371 __vb2_buf_mem_free(vb);
372+ q->bufs[vb->index] = NULL;
242373 kfree(vb);
243374 break;
244375 }
245376 }
246−
247− q->bufs[q->num_buffers + buffer] = vb;
248377 }
249378
250− __setup_lengths(q, buffer);
251− if (memory == VB2_MEMORY_MMAP)
252− __setup_offsets(q, buffer);
253−
254379 dprintk(1, "allocated %d buffers, %d plane(s) each\n",
255380 buffer, num_planes);
256381
@@ -330,7 +455,7 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned int buffers) · 73 unmodified lines
330455 bool unbalanced = q->cnt_start_streaming != q->cnt_stop_streaming ||
331456 q->cnt_wait_prepare != q->cnt_wait_finish;
332457
333− if (unbalanced || vb2_debug) {
458+ if (unbalanced || debug) {
334459 pr_info("vb2: counters for queue %p:%s\n", q,
335460 unbalanced ? " UNBALANCED!" : "");
336461 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
356481 vb->cnt_buf_prepare != vb->cnt_buf_finish ||
357482 vb->cnt_buf_init != vb->cnt_buf_cleanup;
358483
359− if (unbalanced || vb2_debug) {
484+ if (unbalanced || debug) {
360485 pr_info("vb2: counters for queue %p, buffer %d:%s\n",
361486 q, buffer, unbalanced ? " UNBALANCED!" : "");
362487 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
442567 * Should be called from vidioc_querybuf ioctl handler in driver.
443568 * The passed buffer should have been verified.
444569 * 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.
448570 */
449−int vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb)
571+void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb)
450572 {
451− return call_bufop(q, fill_user_buffer, q->bufs[index], pb);
573+ call_void_bufop(q, fill_user_buffer, q->bufs[index], pb);
452574 }
453575 EXPORT_SYMBOL_GPL(vb2_core_querybuf);
454576
@@ -570,6 +692,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 115 unmodified lines
570692 unsigned int *count)
571693 {
572694 unsigned int num_buffers, allocated_buffers, num_planes = 0;
695+ unsigned plane_sizes[VB2_MAX_PLANES] = { };
573696 int ret;
574697
575698 if (q->streaming) {
@@ -613,7 +736,6 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 37 unmodified lines
613736 */
614737 num_buffers = min_t(unsigned int, *count, VB2_MAX_FRAME);
615738 num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed);
616− memset(q->plane_sizes, 0, sizeof(q->plane_sizes));
617739 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
618740 q->memory = memory;
619741
@@ -621,14 +743,14 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 1 unmodified line
621743 * Ask the driver how many buffers and planes per buffer it requires.
622744 * Driver also sets the size and allocator context for each plane.
623745 */
624− ret = call_qop(q, queue_setup, q, NULL, &num_buffers, &num_planes,
625− q->plane_sizes, q->alloc_ctx);
746+ ret = call_qop(q, queue_setup, q, &num_buffers, &num_planes,
747+ plane_sizes, q->alloc_ctx);
626748 if (ret)
627749 return ret;
628750
629751 /* Finally, allocate buffers and video memory */
630752 allocated_buffers =
631− __vb2_queue_alloc(q, memory, num_buffers, num_planes);
753+ __vb2_queue_alloc(q, memory, num_buffers, num_planes, plane_sizes);
632754 if (allocated_buffers == 0) {
633755 dprintk(1, "memory allocation failed\n");
634756 return -ENOMEM;
@@ -646,9 +768,16 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, · 11 unmodified lines
646768 */
647769 if (!ret && allocated_buffers < num_buffers) {
648770 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;
649778
650− ret = call_qop(q, queue_setup, q, NULL, &num_buffers,
651− &num_planes, q->plane_sizes, q->alloc_ctx);
779+ ret = call_qop(q, queue_setup, q, &num_buffers,
780+ &num_planes, plane_sizes, q->alloc_ctx);
652781
653782 if (!ret && allocated_buffers < num_buffers)
654783 ret = -ENOMEM;
@@ -701,9 +830,11 @@ EXPORT_SYMBOL_GPL(vb2_core_reqbufs); · 46 unmodified lines
701830 * from vidioc_create_bufs handler in driver.
702831 */
703832 int 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[])
705835 {
706836 unsigned int num_planes = 0, num_buffers, allocated_buffers;
837+ unsigned plane_sizes[VB2_MAX_PLANES] = { };
707838 int ret;
708839
709840 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
712843 }
713844
714845 if (!q->num_buffers) {
715− memset(q->plane_sizes, 0, sizeof(q->plane_sizes));
716846 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
717847 q->memory = memory;
718848 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
720850
721851 num_buffers = min(*count, VB2_MAX_FRAME - q->num_buffers);
722852
853+ if (requested_planes && requested_sizes) {
854+ num_planes = requested_planes;
855+ memcpy(plane_sizes, requested_sizes, sizeof(plane_sizes));
856+ }
857+
723858 /*
724859 * Ask the driver, whether the requested number of buffers, planes per
725860 * buffer and their sizes are acceptable
726861 */
727− ret = call_qop(q, queue_setup, q, parg, &num_buffers,
728− &num_planes, q->plane_sizes, q->alloc_ctx);
862+ ret = call_qop(q, queue_setup, q, &num_buffers,
863+ &num_planes, plane_sizes, q->alloc_ctx);
729864 if (ret)
730865 return ret;
731866
732867 /* Finally, allocate buffers and video memory */
733868 allocated_buffers = __vb2_queue_alloc(q, memory, num_buffers,
734− num_planes);
869+ num_planes, plane_sizes);
735870 if (allocated_buffers == 0) {
736871 dprintk(1, "memory allocation failed\n");
737872 return -ENOMEM;
@@ -747,8 +882,8 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory, · 9 unmodified lines
747882 * q->num_buffers contains the total number of buffers, that the
748883 * queue driver has set up
749884 */
750− ret = call_qop(q, queue_setup, q, parg, &num_buffers,
751− &num_planes, q->plane_sizes, q->alloc_ctx);
885+ ret = call_qop(q, queue_setup, q, &num_buffers,
886+ &num_planes, plane_sizes, q->alloc_ctx);
752887
753888 if (!ret && allocated_buffers < num_buffers)
754889 ret = -ENOMEM;
@@ -964,11 +1099,12 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb) · 209 unmodified lines
9641099 "reacquiring memory\n", plane);
9651100
9661101 /* 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) {
9681103 dprintk(1, "provided buffer size %u is less than "
9691104 "setup size %u for plane %d\n",
9701105 planes[plane].length,
971− q->plane_sizes[plane], plane);
1106+ vb->planes[plane].min_length,
1107+ plane);
9721108 ret = -EINVAL;
9731109 goto err;
9741110 }
@@ -1081,7 +1217,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb) · 106 unmodified lines
10811217 if (planes[plane].length == 0)
10821218 planes[plane].length = dbuf->size;
10831219
1084− if (planes[plane].length < q->plane_sizes[plane]) {
1220+ if (planes[plane].length < vb->planes[plane].min_length) {
10851221 dprintk(1, "invalid dmabuf length for plane %d\n",
10861222 plane);
10871223 ret = -EINVAL;
@@ -1263,9 +1399,7 @@ int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb) · 175 unmodified lines
12631399 return ret;
12641400
12651401 /* Fill buffer information for the userspace */
1266− ret = call_bufop(q, fill_user_buffer, vb, pb);
1267− if (ret)
1268− return ret;
1402+ call_void_bufop(q, fill_user_buffer, vb, pb);
12691403
12701404 dprintk(1, "prepare of buffer %d succeeded\n", vb->index);
12711405
@@ -1386,7 +1520,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb) · 114 unmodified lines
13861520 q->waiting_for_buffers = false;
13871521 vb->state = VB2_BUF_STATE_QUEUED;
13881522
1389− call_bufop(q, set_timestamp, vb, pb);
1523+ call_void_bufop(q, copy_timestamp, vb, pb);
13901524
13911525 trace_vb2_qbuf(q, vb);
13921526
@@ -1398,9 +1532,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb) · 5 unmodified lines
13981532 __enqueue_in_driver(vb);
13991533
14001534 /* Fill buffer information for the userspace */
1401− ret = call_bufop(q, fill_user_buffer, vb, pb);
1402− if (ret)
1403− return ret;
1535+ call_void_bufop(q, fill_user_buffer, vb, pb);
14041536
14051537 /*
14061538 * 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
16231755 call_void_vb_qop(vb, buf_finish, vb);
16241756
16251757 /* Fill buffer information for the userspace */
1626− ret = call_bufop(q, fill_user_buffer, vb, pb);
1627− if (ret)
1628− return ret;
1758+ call_void_bufop(q, fill_user_buffer, vb, pb);
16291759
16301760 /* Remove from videobuf queue */
16311761 list_del(&vb->queued_entry);
@@ -2073,6 +2203,8 @@ int vb2_core_queue_init(struct vb2_queue *q) · 441 unmodified lines
20732203 }
20742204 EXPORT_SYMBOL_GPL(vb2_core_queue_init);
20752205
2206+static int __vb2_init_fileio(struct vb2_queue *q, int read);
2207+static int __vb2_cleanup_fileio(struct vb2_queue *q);
20762208 /**
20772209 * vb2_core_queue_release() - stop streaming, release the queue and free memory
20782210 * @q: videobuf2 queue
@@ -2083,6 +2215,7 @@ EXPORT_SYMBOL_GPL(vb2_core_queue_init); · 4 unmodified lines
20832215 */
20842216 void vb2_core_queue_release(struct vb2_queue *q)
20852217 {
2218+ __vb2_cleanup_fileio(q);
20862219 __vb2_queue_cancel(q);
20872220 mutex_lock(&q->mmap_lock);
20882221 __vb2_queue_free(q, q->num_buffers);
@@ -2090,6 +2223,619 @@ void vb2_core_queue_release(struct vb2_queue *q) · 1 unmodified line
20902223 }
20912224 EXPORT_SYMBOL_GPL(vb2_core_queue_release);
20922225
2093−MODULE_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+ */
2242+unsigned 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+}
2316+EXPORT_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+ */
2325+struct 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+ */
2356+struct 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+ */
2375+static 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+
2491+err_reqbufs:
2492+ fileio->count = 0;
2493+ vb2_core_reqbufs(q, fileio->memory, &fileio->count);
2494+
2495+err_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+ */
2505+static 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+ */
2530+static 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+
2690+size_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+}
2695+EXPORT_SYMBOL_GPL(vb2_read);
2696+
2697+size_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+}
2703+EXPORT_SYMBOL_GPL(vb2_write);
2704+
2705+struct vb2_threadio_data {
2706+ struct task_struct *thread;
2707+ vb2_thread_fnc fnc;
2708+ void *priv;
2709+ bool stop;
2710+};
2711+
2712+static 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+ */
2780+int 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+
2812+nothread:
2813+ __vb2_cleanup_fileio(q);
2814+nomem:
2815+ kfree(threadio);
2816+ return ret;
2817+}
2818+EXPORT_SYMBOL_GPL(vb2_thread_start);
2819+
2820+int 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+}
2837+EXPORT_SYMBOL_GPL(vb2_thread_stop);
2838+
2839+MODULE_DESCRIPTION("Media buffer core framework");
20942840 MODULE_AUTHOR("Pawel Osciak <pawel@osciak.com>, Marek Szyprowski");
20952841 MODULE_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−
9−extern 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−
158−bool vb2_buffer_in_use(struct vb2_queue *q, struct vb2_buffer *vb);
159−int 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
3131
3232 #include <media/videobuf2-v4l2.h>
3333
34−#include "videobuf2-internal.h"
34+static int debug;
35+module_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)
3542
3643 /* Flags that are set by the vb2 core */
3744 #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
5259 return 0;
5360
5461 /* Is memory for copying plane information present? */
55− if (NULL == b->m.planes) {
62+ if (b->m.planes == NULL) {
5663 dprintk(1, "multi-planar buffer passed but "
5764 "planes array not provided\n");
5865 return -EINVAL;
@@ -107,7 +114,7 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b) · 48 unmodified lines
107114 return 0;
108115 }
109116
110−static int __set_timestamp(struct vb2_buffer *vb, const void *pb)
117+static void __copy_timestamp(struct vb2_buffer *vb, const void *pb)
111118 {
112119 const struct v4l2_buffer *b = pb;
113120 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
118125 * For output buffers copy the timestamp if needed,
119126 * and the timecode field and flag if needed.
120127 */
121− if ((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) ==
122− V4L2_BUF_FLAG_TIMESTAMP_COPY)
123− vbuf->timestamp = b->timestamp;
128+ if (q->copy_timestamp)
129+ vb->timestamp = timeval_to_ns(&b->timestamp);
124130 vbuf->flags |= b->flags & V4L2_BUF_FLAG_TIMECODE;
125131 if (b->flags & V4L2_BUF_FLAG_TIMECODE)
126132 vbuf->timecode = b->timecode;
127133 }
128− return 0;
129134 };
130135
131136 static 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
176181 * __fill_v4l2_buffer() - fill in a struct v4l2_buffer with information to be
177182 * returned to userspace
178183 */
179−static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
184+static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
180185 {
181186 struct v4l2_buffer *b = pb;
182187 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
191196
192197 b->flags = vbuf->flags;
193198 b->field = vbuf->field;
194− b->timestamp = vbuf->timestamp;
199+ b->timestamp = ns_to_timeval(vb->timestamp);
195200 b->timecode = vbuf->timecode;
196201 b->sequence = vbuf->sequence;
197202 b->reserved2 = 0;
@@ -238,8 +243,7 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) · 40 unmodified lines
238243 */
239244 b->flags &= ~V4L2_BUFFER_MASK_FLAGS;
240245 b->flags |= q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK;
241− if ((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) !=
242− V4L2_BUF_FLAG_TIMESTAMP_COPY) {
246+ if (!q->copy_timestamp) {
243247 /*
244248 * For non-COPY timestamps, drop timestamp source bits
245249 * 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
272276 if (vb2_buffer_in_use(q, vb))
273277 b->flags |= V4L2_BUF_FLAG_MAPPED;
274278
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;
276283 }
277284
278285 /**
@@ -308,8 +315,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, · 29 unmodified lines
308315 "for an output buffer\n");
309316 return -EINVAL;
310317 }
311− vbuf->timestamp.tv_sec = 0;
312− vbuf->timestamp.tv_usec = 0;
318+ vb->timestamp = 0;
313319 vbuf->sequence = 0;
314320
315321 if (V4L2_TYPE_IS_MULTIPLANAR(b->type)) {
@@ -404,8 +410,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, · 88 unmodified lines
404410
405411 /* Zero flags that the vb2 core handles */
406412 vbuf->flags = b->flags & ~V4L2_BUFFER_MASK_FLAGS;
407− if ((vb->vb2_queue->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) !=
408− V4L2_BUF_FLAG_TIMESTAMP_COPY || !V4L2_TYPE_IS_OUTPUT(b->type)) {
413+ if (!vb->vb2_queue->copy_timestamp || !V4L2_TYPE_IS_OUTPUT(b->type)) {
409414 /*
410415 * Non-COPY timestamps and non-OUTPUT queues will get
411416 * their timestamp and timestamp source flags from the
@@ -434,7 +439,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, · 22 unmodified lines
434439 static const struct vb2_buf_ops v4l2_buf_ops = {
435440 .fill_user_buffer = __fill_v4l2_buffer,
436441 .fill_vb2_buffer = __fill_vb2_buffer,
437− .set_timestamp = __set_timestamp,
442+ .copy_timestamp = __copy_timestamp,
438443 };
439444
440445 /**
@@ -466,8 +471,9 @@ int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b) · 25 unmodified lines
466471 }
467472 vb = q->bufs[b->index];
468473 ret = __verify_planes_array(vb, b);
469−
470− return ret ? ret : vb2_core_querybuf(q, b->index, b);
474+ if (!ret)
475+ vb2_core_querybuf(q, b->index, b);
476+ return ret;
471477 }
472478 EXPORT_SYMBOL(vb2_querybuf);
473479
@@ -525,14 +531,52 @@ EXPORT_SYMBOL_GPL(vb2_prepare_buf); · 51 unmodified lines
525531 */
526532 int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
527533 {
528− int ret = vb2_verify_memory_type(q, create->memory,
529− create->format.type);
534+ unsigned requested_planes = 1;
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;
530539
531540 create->index = q->num_buffers;
532541 if (create->count == 0)
533542 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;
534578 return ret ? ret : vb2_core_create_bufs(q, create->memory,
535− &create->count, &create->format);
579+ &create->count, requested_planes, requested_sizes);
536580 }
537581 EXPORT_SYMBOL_GPL(vb2_create_bufs);
538582
@@ -583,10 +627,6 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, · 44 unmodified lines
583627
584628 ret = vb2_core_dqbuf(q, b, nonblocking);
585629
586− if (!ret && !q->is_output &&
587− b->flags & V4L2_BUF_FLAG_LAST)
588− q->last_buffer_dequeued = true;
589−
590630 return ret;
591631 }
592632
@@ -723,14 +763,13 @@ int vb2_queue_init(struct vb2_queue *q) · 130 unmodified lines
723763 q->buf_ops = &v4l2_buf_ops;
724764 q->is_multiplanar = V4L2_TYPE_IS_MULTIPLANAR(q->type);
725765 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;
726768
727769 return vb2_core_queue_init(q);
728770 }
729771 EXPORT_SYMBOL_GPL(vb2_queue_init);
730772
731−static int __vb2_init_fileio(struct vb2_queue *q, int read);
732−static int __vb2_cleanup_fileio(struct vb2_queue *q);
733−
734773 /**
735774 * vb2_queue_release() - stop streaming, release the queue and free memory
736775 * @q: videobuf2 queue
@@ -741,7 +780,6 @@ static int __vb2_cleanup_fileio(struct vb2_queue *q); · 4 unmodified lines
741780 */
742781 void vb2_queue_release(struct vb2_queue *q)
743782 {
744− __vb2_cleanup_fileio(q);
745783 vb2_core_queue_release(q);
746784 }
747785 EXPORT_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
769807 {
770808 struct video_device *vfd = video_devdata(file);
771809 unsigned long req_events = poll_requested_events(wait);
772− struct vb2_buffer *vb = NULL;
773810 unsigned int res = 0;
774− unsigned long flags;
775811
776812 if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {
777813 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
782818 poll_wait(file, &fh->wait, wait);
783819 }
784820
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;
816821 /*
817822 * For compatibility with vb1: if QBUF hasn't been called yet, then
818823 * return POLLERR as well. This only affects capture queues, output
819824 * queues will always initialize waiting_for_buffers to false.
820825 */
821− if (q->waiting_for_buffers)
822− return res | 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− }
826+ if (q->waiting_for_buffers && (req_events & (POLLIN | POLLRDNORM)))
827+ return POLLERR;
841828
842− /*
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;
829+ return res | vb2_core_poll(q, file, wait);
858830 }
859831 EXPORT_SYMBOL_GPL(vb2_poll);
860832
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− */
868−struct 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− */
899−struct 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− */
917−static 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−
1034−err_reqbufs:
1035− fileio->req.count = 0;
1036− vb2_core_reqbufs(q, fileio->req.memory, &fileio->req.count);
1037−
1038−err_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− */
1048−static 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− */
1072−static 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−
1240−size_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−}
1245−EXPORT_SYMBOL_GPL(vb2_read);
1246−
1247−size_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−}
1253−EXPORT_SYMBOL_GPL(vb2_write);
1254−
1255−struct vb2_threadio_data {
1256− struct task_struct *thread;
1257− vb2_thread_fnc fnc;
1258− void *priv;
1259− bool stop;
1260−};
1261−
1262−static 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− */
1331−int 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−
1363−nothread:
1364− __vb2_cleanup_fileio(q);
1365−nomem:
1366− kfree(threadio);
1367− return ret;
1368−}
1369−EXPORT_SYMBOL_GPL(vb2_thread_start);
1370−
1371−int 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−}
1388−EXPORT_SYMBOL_GPL(vb2_thread_stop);
1389−
1390833 /*
1391834 * The following functions are not part of the vb2 core API, but are helper
1392835 * 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
1440883 return res;
1441884 if (vb2_queue_is_busy(vdev, file))
1442885 return -EBUSY;
1443− res = vb2_core_create_bufs(vdev->queue, p->memory, &p->count,
1444− &p->format);
886+
887+ res = vb2_create_bufs(vdev->queue, p);
1445888 if (res == 0)
1446889 vdev->queue->owner = file->private_data;
1447890 return res;
drivers/mfd/timberdale.c+2−2
@@ -39,8 +39,8 @@ · 38 unmodified lines
3939 #include <linux/spi/max7301.h>
4040 #include <linux/spi/mc33880.h>
4141
42−#include <media/timb_radio.h>
43−#include <media/timb_video.h>
42+#include <linux/platform_data/media/timb_radio.h>
43+#include <linux/platform_data/media/timb_video.h>
4444
4545 #include <linux/timb_dma.h>
4646
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
10001000 timeout = BCM2048_AUTO_SEARCH_TIMEOUT;
10011001
10021002 if (!wait_for_completion_timeout(&bdev->compl,
1003− msecs_to_jiffies(timeout)))
1004− dev_err(&bdev->client->dev, "IRQ timeout.\n");
1003+ msecs_to_jiffies(timeout)))
1004+ dev_err(&bdev->client->dev, "IRQ timeout.\n");
10051005
10061006 if (value)
10071007 if (!bdev->scan_state)
drivers/staging/media/davinci_vpfe/Kconfig+2−0
@@ -2,6 +2,8 @@ config VIDEO_DM365_VPFE · 1 unmodified line
22 tristate "DM365 VPFE Media Controller Capture Driver"
33 depends on VIDEO_V4L2 && ARCH_DAVINCI_DM365 && !VIDEO_DM365_ISIF
44 depends on HAS_DMA
5+ depends on VIDEO_V4L2_SUBDEV_API
6+ depends on VIDEO_DAVINCI_VPBE_DISPLAY
57 select VIDEOBUF2_DMA_CONTIG
68 help
79 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
15361536 * @fse: pointer to v4l2_subdev_frame_size_enum structure.
15371537 */
15381538 static int
1539−ipipe_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
1540− struct v4l2_subdev_frame_size_enum *fse)
1539+ipipe_enum_frame_size(struct v4l2_subdev *sd,
1540+ struct v4l2_subdev_pad_config *cfg,
1541+ struct v4l2_subdev_frame_size_enum *fse)
15411542 {
15421543 struct vpfe_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
15431544 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
254254 void __iomem *ipipe_base = ipipe->base_addr;
255255 struct v4l2_mbus_framefmt *outformat;
256256 u32 color_pat;
257− u32 ipipe_mode;
257+ int ipipe_mode;
258258 u32 data_path;
259259
260260 /* 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
6363 if (pix == MEDIA_BUS_FMT_UYVY8_2X8 ||
6464 pix == MEDIA_BUS_FMT_SGRBG12_1X12) {
6565 *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;
7066 } else {
71− /* YUV 420 */
72− /* round width to upper 32 byte boundary */
7367 *line_len = width;
7468 *line_len_c = width;
7569 }
70+
7671 /* adjust the line len to be a multiple of 32 */
7772 *line_len += 31;
7873 *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
227227 return 0;
228228
229229 vpfe_dev->clks = kcalloc(vpfe_cfg->num_clocks,
230− sizeof(struct clock *), GFP_KERNEL);
230+ sizeof(*vpfe_dev->clks), GFP_KERNEL);
231231 if (vpfe_dev->clks == NULL)
232232 return -ENOMEM;
233233
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
470470 {
471471 struct vpfe_pipeline *pipe = &video->pipe;
472472
473− v4l2_get_timestamp(&video->cur_frm->vb.timestamp);
473+ video->cur_frm->vb.vb2_buf.timestamp = ktime_get_ns();
474474 vb2_buffer_done(&video->cur_frm->vb.vb2_buf, VB2_BUF_STATE_DONE);
475475 if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS)
476476 video->cur_frm = video->next_frm;
@@ -1078,7 +1078,7 @@ vpfe_g_dv_timings(struct file *file, void *fh, · 601 unmodified lines
10781078 * the buffer nbuffers and buffer size
10791079 */
10801080 static int
1081−vpfe_buffer_queue_setup(struct vb2_queue *vq, const void *parg,
1081+vpfe_buffer_queue_setup(struct vb2_queue *vq,
10821082 unsigned int *nbuffers, unsigned int *nplanes,
10831083 unsigned int sizes[], void *alloc_ctxs[])
10841084 {
drivers/staging/media/lirc/lirc_imon.c+2−0
@@ -885,12 +885,14 @@ static int imon_probe(struct usb_interface *interface, · 884 unmodified lines
885885 vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);
886886
887887 /* Everything went fine. Just unlock and return retval (with is 0) */
888+ mutex_unlock(&context->ctx_lock);
888889 goto driver_unlock;
889890
890891 unregister_lirc:
891892 lirc_unregister_driver(driver->minor);
892893
893894 free_tx_urb:
895+ mutex_unlock(&context->ctx_lock);
894896 usb_free_urb(tx_urb);
895897
896898 free_rx_urb:
drivers/staging/media/lirc/lirc_parallel.c+15−20
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #include <linux/fs.h>
3434 #include <linux/kernel.h>
3535 #include <linux/ioport.h>
36−#include <linux/time.h>
36+#include <linux/ktime.h>
3737 #include <linux/mm.h>
3838 #include <linux/delay.h>
3939
@@ -144,25 +144,22 @@ static void lirc_off(void) · 104 unmodified lines
144144
145145 static unsigned int init_lirc_timer(void)
146146 {
147− struct timeval tv, now;
147+ ktime_t kt, now, timeout;
148148 unsigned int level, newlevel, timeelapsed, newtimer;
149149 int count = 0;
150150
151− do_gettimeofday(&tv);
152− tv.tv_sec++; /* wait max. 1 sec. */
151+ kt = ktime_get();
152+ /* wait max. 1 sec. */
153+ timeout = ktime_add_ns(kt, NSEC_PER_SEC);
153154 level = lirc_get_timer();
154155 do {
155156 newlevel = lirc_get_timer();
156157 if (level == 0 && newlevel != 0)
157158 count++;
158159 level = newlevel;
159− do_gettimeofday(&now);
160− } while (count < 1000 && (now.tv_sec < tv.tv_sec
161− || (now.tv_sec == tv.tv_sec
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);
160+ now = ktime_get();
161+ } while (count < 1000 && (ktime_before(now, timeout)));
162+ timeelapsed = ktime_us_delta(now, kt);
166163 if (count >= 1000 && timeelapsed > 0) {
167164 if (default_timer == 0) {
168165 /* autodetect timer */
@@ -220,8 +217,8 @@ static void rbuf_write(int signal) · 51 unmodified lines
220217
221218 static void lirc_lirc_irq_handler(void *blah)
222219 {
223− struct timeval tv;
224− static struct timeval lasttv;
220+ ktime_t kt, delkt;
221+ static ktime_t lastkt;
225222 static int init;
226223 long signal;
227224 int data;
@@ -244,16 +241,14 @@ static void lirc_lirc_irq_handler(void *blah) · 16 unmodified lines
244241
245242 #ifdef LIRC_TIMER
246243 if (init) {
247− do_gettimeofday(&tv);
244+ kt = ktime_get();
248245
249− signal = tv.tv_sec - lasttv.tv_sec;
250− if (signal > 15)
246+ delkt = ktime_sub(kt, lastkt);
247+ if (ktime_compare(delkt, ktime_set(15, 0)) > 0)
251248 /* really long time */
252249 data = PULSE_MASK;
253250 else
254− data = (int) (signal*1000000 +
255− tv.tv_usec - lasttv.tv_usec +
256− LIRC_SFH506_DELAY);
251+ data = (int)(ktime_to_us(delkt) + LIRC_SFH506_DELAY);
257252
258253 rbuf_write(data); /* space */
259254 } else {
@@ -301,7 +296,7 @@ static void lirc_lirc_irq_handler(void *blah) · 41 unmodified lines
301296 data = 1;
302297 rbuf_write(PULSE_BIT|data); /* pulse */
303298 }
304− do_gettimeofday(&lasttv);
299+ lastkt = ktime_get();
305300 #else
306301 /* add your code here */
307302 #endif
drivers/staging/media/lirc/lirc_sasem.c+9−11
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include <linux/slab.h>
4343 #include <linux/uaccess.h>
4444 #include <linux/usb.h>
45+#include <linux/ktime.h>
4546
4647 #include <media/lirc.h>
4748 #include <media/lirc_dev.h>
@@ -111,7 +112,7 @@ struct sasem_context { · 63 unmodified lines
111112 } tx;
112113
113114 /* for dealing with repeat codes (wish there was a toggle bit!) */
114− struct timeval presstime;
115+ ktime_t presstime;
115116 char lastcode[8];
116117 int codesaved;
117118 };
@@ -566,8 +567,8 @@ static void incoming_packet(struct sasem_context *context, · 448 unmodified lines
566567 {
567568 int len = urb->actual_length;
568569 unsigned char *buf = urb->transfer_buffer;
569− long ms;
570− struct timeval tv;
570+ u64 ns;
571+ ktime_t kt;
571572
572573 if (len != 8) {
573574 dev_warn(&context->dev->dev,
@@ -584,9 +585,8 @@ static void incoming_packet(struct sasem_context *context, · 10 unmodified lines
584585 */
585586
586587 /* get the time since the last button press */
587− do_gettimeofday(&tv);
588− ms = (tv.tv_sec - context->presstime.tv_sec) * 1000 +
589− (tv.tv_usec - context->presstime.tv_usec) / 1000;
588+ kt = ktime_get();
589+ ns = ktime_to_ns(ktime_sub(kt, context->presstime));
590590
591591 if (memcmp(buf, "\x08\0\0\0\0\0\0\0", 8) == 0) {
592592 /*
@@ -600,10 +600,9 @@ static void incoming_packet(struct sasem_context *context, · 7 unmodified lines
600600 * in that time and then get a false repeat of the previous
601601 * press but it is long enough for a genuine repeat
602602 */
603− if ((ms < 250) && (context->codesaved != 0)) {
603+ if ((ns < 250 * NSEC_PER_MSEC) && (context->codesaved != 0)) {
604604 memcpy(buf, &context->lastcode, 8);
605− context->presstime.tv_sec = tv.tv_sec;
606− context->presstime.tv_usec = tv.tv_usec;
605+ context->presstime = kt;
607606 }
608607 } else {
609608 /* save the current valid code for repeats */
@@ -613,8 +612,7 @@ static void incoming_packet(struct sasem_context *context, · 3 unmodified lines
613612 * just for safety reasons
614613 */
615614 context->codesaved = 1;
616− context->presstime.tv_sec = tv.tv_sec;
617− context->presstime.tv_usec = tv.tv_usec;
615+ context->presstime = kt;
618616 }
619617
620618 lirc_buffer_write(context->driver->rbuf, buf);
drivers/staging/media/lirc/lirc_serial.c+17−33
@@ -59,7 +59,7 @@ · 58 unmodified lines
5959 #include <linux/ioport.h>
6060 #include <linux/kernel.h>
6161 #include <linux/serial_reg.h>
62−#include <linux/time.h>
62+#include <linux/ktime.h>
6363 #include <linux/string.h>
6464 #include <linux/types.h>
6565 #include <linux/wait.h>
@@ -204,7 +204,7 @@ static struct lirc_serial hardware[] = { · 138 unmodified lines
204204
205205 #define RBUF_LEN 256
206206
207−static struct timeval lasttv = {0, 0};
207+static ktime_t lastkt;
208208
209209 static struct lirc_buffer rbuf;
210210
@@ -542,10 +542,10 @@ static void frbwrite(int l) · 331 unmodified lines
542542
543543 static irqreturn_t lirc_irq_handler(int i, void *blah)
544544 {
545− struct timeval tv;
545+ ktime_t kt;
546546 int counter, dcd;
547547 u8 status;
548− long deltv;
548+ ktime_t delkt;
549549 int data;
550550 static int last_dcd = -1;
551551
@@ -565,7 +565,7 @@ static irqreturn_t lirc_irq_handler(int i, void *blah) · 13 unmodified lines
565565 if ((status & hardware[type].signal_pin_change)
566566 && sense != -1) {
567567 /* get current time */
568− do_gettimeofday(&tv);
568+ kt = ktime_get();
569569
570570 /* New mode, written by Trent Piepho
571571 <xyzzy@u.washington.edu>. */
@@ -594,34 +594,20 @@ static irqreturn_t lirc_irq_handler(int i, void *blah) · 22 unmodified lines
594594 dcd = (status & hardware[type].signal_pin) ? 1 : 0;
595595
596596 if (dcd == last_dcd) {
597− pr_warn("ignoring spike: %d %d %lx %lx %lx %lx\n",
598− dcd, sense,
599− tv.tv_sec, lasttv.tv_sec,
600− (unsigned long)tv.tv_usec,
601− (unsigned long)lasttv.tv_usec);
597+ pr_warn("ignoring spike: %d %d %llx %llx\n",
598+ dcd, sense, ktime_to_us(kt),
599+ ktime_to_us(lastkt));
602600 continue;
603601 }
604602
605− deltv = tv.tv_sec-lasttv.tv_sec;
606− if (tv.tv_sec < lasttv.tv_sec ||
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) {
603+ delkt = ktime_sub(kt, lastkt);
604+ if (ktime_compare(delkt, ktime_set(15, 0)) > 0) {
617605 data = PULSE_MASK; /* really long time */
618606 if (!(dcd^sense)) {
619607 /* sanity check */
620− pr_warn("AIEEEE: %d %d %lx %lx %lx %lx\n",
621− dcd, sense,
622− tv.tv_sec, lasttv.tv_sec,
623− (unsigned long)tv.tv_usec,
624− (unsigned long)lasttv.tv_usec);
608+ pr_warn("AIEEEE: %d %d %llx %llx\n",
609+ dcd, sense, ktime_to_us(kt),
610+ ktime_to_us(lastkt));
625611 /*
626612 * detecting pulse while this
627613 * MUST be a space!
@@ -629,11 +615,9 @@ static irqreturn_t lirc_irq_handler(int i, void *blah) · 1 unmodified line
629615 sense = sense ? 0 : 1;
630616 }
631617 } else
632− data = (int) (deltv*1000000 +
633− tv.tv_usec -
634− lasttv.tv_usec);
618+ data = (int) ktime_to_us(delkt);
635619 frbwrite(dcd^sense ? data : (data|PULSE_BIT));
636− lasttv = tv;
620+ lastkt = kt;
637621 last_dcd = dcd;
638622 wake_up_interruptible(&rbuf.wait_poll);
639623 }
@@ -790,7 +774,7 @@ static int set_use_inc(void *data) · 150 unmodified lines
790774 unsigned long flags;
791775
792776 /* initialize timestamp */
793− do_gettimeofday(&lasttv);
777+ lastkt = ktime_get();
794778
795779 spin_lock_irqsave(&hardware[type].lock, flags);
796780
@@ -979,7 +963,7 @@ static int lirc_serial_resume(struct platform_device *dev) · 182 unmodified lines
979963
980964 spin_lock_irqsave(&hardware[type].lock, flags);
981965 /* Enable Interrupt */
982− do_gettimeofday(&lasttv);
966+ lastkt = ktime_get();
983967 soutp(UART_IER, sinp(UART_IER)|UART_IER_MSI);
984968 off();
985969
drivers/staging/media/omap4iss/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config VIDEO_OMAP4
22 tristate "OMAP 4 Camera support"
3− depends on VIDEO_V4L2=y && VIDEO_V4L2_SUBDEV_API && I2C=y && ARCH_OMAP4
3+ depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
44 depends on HAS_DMA
55 select MFD_SYSCON
66 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
601601 subdev = media_entity_to_v4l2_subdev(entity);
602602 ret = v4l2_subdev_call(subdev, video, s_stream, 0);
603603 if (ret < 0) {
604− dev_dbg(iss->dev, "%s: module stop timeout.\n",
605− subdev->name);
604+ dev_warn(iss->dev, "%s: module stop timeout.\n",
605+ subdev->name);
606606 /* If the entity failed to stopped, assume it has
607607 * crashed. Mark it as such, the ISS will be reset when
608608 * applications will release it.
drivers/staging/media/omap4iss/iss.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include <linux/platform_device.h>
2121 #include <linux/wait.h>
2222
23−#include <media/omap4iss.h>
23+#include <linux/platform_data/media/omap4iss.h>
2424
2525 #include "iss_regs.h"
2626 #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
674674 status = iss_reg_read(csi2->iss, csi2->regs1, CSI2_CTX_IRQSTATUS(n));
675675 iss_reg_write(csi2->iss, csi2->regs1, CSI2_CTX_IRQSTATUS(n), status);
676676
677+ if (omap4iss_module_sync_is_stopping(&csi2->wait, &csi2->stopping))
678+ return;
679+
677680 /* Propagate frame number */
678681 if (status & CSI2_CTX_IRQ_FS) {
679682 struct iss_pipeline *pipe =
@@ -776,9 +779,6 @@ void omap4iss_csi2_isr(struct iss_csi2_device *csi2) · 96 unmodified lines
776779 pipe->error = true;
777780 }
778781
779− if (omap4iss_module_sync_is_stopping(&csi2->wait, &csi2->stopping))
780− return;
781−
782782 /* Successful cases */
783783 if (csi2_irqstatus & CSI2_IRQ_CONTEXT0)
784784 csi2_isr_ctx(csi2, &csi2->contexts[0]);
drivers/staging/media/omap4iss/iss_csiphy.h+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #ifndef OMAP4_ISS_CSI_PHY_H
1515 #define OMAP4_ISS_CSI_PHY_H
1616
17−#include <media/omap4iss.h>
17+#include <linux/platform_data/media/omap4iss.h>
1818
1919 struct iss_csi2_device;
2020
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
158158 /* Program UV buffer address... Hardcoded to be contiguous! */
159159 if ((informat->code == MEDIA_BUS_FMT_UYVY8_1X16) &&
160160 (outformat->code == MEDIA_BUS_FMT_YUYV8_1_5X8)) {
161− u32 c_addr = addr + (resizer->video_out.bpl_value *
162− (outformat->height - 1));
161+ u32 c_addr = addr + resizer->video_out.bpl_value
162+ * outformat->height;
163163
164164 /* Ensure Y_BAD_L[6:0] = C_BAD_L[6:0]*/
165165 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
287287 */
288288
289289 static int iss_video_queue_setup(struct vb2_queue *vq,
290− const void *parg,
291290 unsigned int *count, unsigned int *num_planes,
292291 unsigned int sizes[], void *alloc_ctxs[])
293292 {
@@ -434,7 +433,7 @@ struct iss_buffer *omap4iss_video_buffer_next(struct iss_video *video) · 140 unmodified lines
434433 list_del(&buf->list);
435434 spin_unlock_irqrestore(&video->qlock, flags);
436435
437− v4l2_get_timestamp(&buf->vb.timestamp);
436+ buf->vb.vb2_buf.timestamp = ktime_get_ns();
438437
439438 /* Do frame number propagation only if this is the output video node.
440439 * 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
4141 * videobuf2 queue operations
4242 */
4343
44−static int uvc_queue_setup(struct vb2_queue *vq, const void *parg,
44+static int uvc_queue_setup(struct vb2_queue *vq,
4545 unsigned int *nbuffers, unsigned int *nplanes,
4646 unsigned int sizes[], void *alloc_ctxs[])
4747 {
@@ -329,7 +329,7 @@ struct uvc_buffer *uvcg_queue_next_buffer(struct uvc_video_queue *queue, · 281 unmodified lines
329329
330330 buf->buf.field = V4L2_FIELD_NONE;
331331 buf->buf.sequence = queue->sequence++;
332− v4l2_get_timestamp(&buf->buf.timestamp);
332+ buf->buf.vb2_buf.timestamp = ktime_get_ns();
333333
334334 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused);
335335 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
677677
678678 Licence: GPLv2 or later
679679
680−ARM assembly source code available at http://www.linuxtv.org/downloads/firmware/Boot.S
680+ARM assembly source code available at https://linuxtv.org/downloads/firmware/Boot.S
681681
682682 --------------------------------------------------------------------------
683683
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−
21−struct 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
2121 };
2222
2323 #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
3434 };
3535
3636 #endif /* S5P_HDMI_H */
37−
include/linux/platform_data/media/si4713.hrenamed from include/media/si4713.h+1−1
@@ -1,5 +1,5 @@
11 /*
2− * include/media/si4713.h
2+ * include/linux/platform_data/media/si4713.h
33 *
44 * Board related data definitions for Si4713 i2c device driver.
55 *
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
4646 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
4747 * no #if __KERNEL tests are allowed here
4848 *
49− * See http://linuxtv.org for more info
49+ * See https://linuxtv.org for more info
5050 *
5151 * Author: Bill Dirks <bill@thedirks.org>
5252 * 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
223223 */
224224
225225 #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
44 #include <media/v4l2-common.h>
55 #include <media/v4l2-ioctl.h>
66 #include <media/v4l2-fh.h>
7−#include <media/saa7146.h>
7+#include <media/drv-intf/saa7146.h>
88 #include <media/videobuf-dma-sg.h>
99
1010 #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 @@
11 /*
2− * include/media/si476x.h -- Common definitions for si476x driver
2+ * include/media/drv-intf/si476x.h -- Common definitions for si476x driver
33 *
44 * Copyright (C) 2012 Innovative Converged Devices(ICD)
55 * 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
6363 u32 band; /* 0: FM, 1: FM-Japan, 2: AM */
6464 u32 freq; /* frequency */
6565 struct mutex mutex;
66− struct snd_tea575x_ops *ops;
66+ const struct snd_tea575x_ops *ops;
6767 void *private_data;
6868 u8 card[32];
6969 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 @@
11 /*
2− * include/media/adp1653.h
2+ * include/media/i2c/adp1653.h
33 *
44 * Copyright (C) 2008--2011 Nokia Corporation
55 *
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 @@
11 /*
2− * include/media/as3645a.h
2+ * include/media/i2c/as3645a.h
33 *
44 * Copyright (C) 2008-2011 Nokia Corporation
55 *
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 @@
11 /*
2− * include/media/lm3560.h
2+ * include/media/i2c/lm3560.h
33 *
44 * Copyright (C) 2013 Texas Instruments
55 *
include/media/i2c/lm3646.hrenamed from include/media/lm3646.h+1−1
@@ -1,5 +1,5 @@
11 /*
2− * include/media/lm3646.h
2+ * include/media/i2c/lm3646.h
33 *
44 * Copyright (C) 2014 Texas Instruments
55 *
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
138138 };
139139
140140 #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
3838 };
3939
4040 #endif
41−
include/media/i2c/smiapp.hrenamed from include/media/smiapp.h+1−1
@@ -1,5 +1,5 @@
11 /*
2− * include/media/smiapp.h
2+ * include/media/i2c/smiapp.h
33 *
44 * Generic driver for SMIA/SMIA++ compliant camera modules
55 *
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
3131 #define TVP5150_BLACK_SCREEN 1
3232
3333 #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−/*
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
1+#include <uapi/linux/lirc.h>
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
239239 memset(ev, 0, sizeof(*ev));
240240 }
241241
242+#define IR_DEFAULT_TIMEOUT MS_TO_NS(125)
242243 #define IR_MAX_DURATION 500000000 /* 500 ms */
243244 #define US_TO_NS(usec) ((usec) * 1000)
244245 #define MS_TO_US(msec) ((msec) * 1000)
include/media/rc-map.h+20−20
@@ -33,26 +33,26 @@ enum rc_type { · 32 unmodified lines
3333 RC_TYPE_XMP = 18, /* XMP protocol */
3434 };
3535
36−#define RC_BIT_NONE 0
37−#define RC_BIT_UNKNOWN (1 << RC_TYPE_UNKNOWN)
38−#define RC_BIT_OTHER (1 << RC_TYPE_OTHER)
39−#define RC_BIT_RC5 (1 << RC_TYPE_RC5)
40−#define RC_BIT_RC5X (1 << RC_TYPE_RC5X)
41−#define RC_BIT_RC5_SZ (1 << RC_TYPE_RC5_SZ)
42−#define RC_BIT_JVC (1 << RC_TYPE_JVC)
43−#define RC_BIT_SONY12 (1 << RC_TYPE_SONY12)
44−#define RC_BIT_SONY15 (1 << RC_TYPE_SONY15)
45−#define RC_BIT_SONY20 (1 << RC_TYPE_SONY20)
46−#define RC_BIT_NEC (1 << RC_TYPE_NEC)
47−#define RC_BIT_SANYO (1 << RC_TYPE_SANYO)
48−#define RC_BIT_MCE_KBD (1 << RC_TYPE_MCE_KBD)
49−#define RC_BIT_RC6_0 (1 << RC_TYPE_RC6_0)
50−#define RC_BIT_RC6_6A_20 (1 << RC_TYPE_RC6_6A_20)
51−#define RC_BIT_RC6_6A_24 (1 << RC_TYPE_RC6_6A_24)
52−#define RC_BIT_RC6_6A_32 (1 << RC_TYPE_RC6_6A_32)
53−#define RC_BIT_RC6_MCE (1 << RC_TYPE_RC6_MCE)
54−#define RC_BIT_SHARP (1 << RC_TYPE_SHARP)
55−#define RC_BIT_XMP (1 << RC_TYPE_XMP)
36+#define RC_BIT_NONE 0ULL
37+#define RC_BIT_UNKNOWN (1ULL << RC_TYPE_UNKNOWN)
38+#define RC_BIT_OTHER (1ULL << RC_TYPE_OTHER)
39+#define RC_BIT_RC5 (1ULL << RC_TYPE_RC5)
40+#define RC_BIT_RC5X (1ULL << RC_TYPE_RC5X)
41+#define RC_BIT_RC5_SZ (1ULL << RC_TYPE_RC5_SZ)
42+#define RC_BIT_JVC (1ULL << RC_TYPE_JVC)
43+#define RC_BIT_SONY12 (1ULL << RC_TYPE_SONY12)
44+#define RC_BIT_SONY15 (1ULL << RC_TYPE_SONY15)
45+#define RC_BIT_SONY20 (1ULL << RC_TYPE_SONY20)
46+#define RC_BIT_NEC (1ULL << RC_TYPE_NEC)
47+#define RC_BIT_SANYO (1ULL << RC_TYPE_SANYO)
48+#define RC_BIT_MCE_KBD (1ULL << RC_TYPE_MCE_KBD)
49+#define RC_BIT_RC6_0 (1ULL << RC_TYPE_RC6_0)
50+#define RC_BIT_RC6_6A_20 (1ULL << RC_TYPE_RC6_6A_20)
51+#define RC_BIT_RC6_6A_24 (1ULL << RC_TYPE_RC6_6A_24)
52+#define RC_BIT_RC6_6A_32 (1ULL << RC_TYPE_RC6_6A_32)
53+#define RC_BIT_RC6_MCE (1ULL << RC_TYPE_RC6_MCE)
54+#define RC_BIT_SHARP (1ULL << RC_TYPE_SHARP)
55+#define RC_BIT_XMP (1ULL << RC_TYPE_XMP)
5656
5757 #define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | \
5858 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
6565 return __v4l2_clk_register_fixed(dev_id, rate, THIS_MODULE);
6666 }
6767
68+#define V4L2_CLK_NAME_SIZE 64
69+
6870 #define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \
6971 "%d-%04x", adap, client)
7072
73+#define v4l2_clk_name_of(name, size, of_full_name) snprintf(name, size, \
74+ "of-%s", of_full_name)
75+
7176 #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
107107 * @standard: the timings according to the standard.
108108 * @pclock_delta: maximum delta in Hz between standard->pixelclock and
109109 * the measured timings.
110+ * @match_reduced_fps: if true, then fail if V4L2_DV_FL_REDUCED_FPS does not
111+ * match.
110112 *
111113 * Returns true if the two timings match, returns false otherwise.
112114 */
113115 bool v4l2_match_dv_timings(const struct v4l2_dv_timings *measured,
114116 const struct v4l2_dv_timings *standard,
115− unsigned pclock_delta);
117+ unsigned pclock_delta, bool match_reduced_fps);
116118
117119 /**
118120 * 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
183185 */
184186 struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
185187
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+ */
196+static 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+
186209 #endif
include/media/videobuf2-core.h+87−21
@@ -129,6 +129,8 @@ struct vb2_mem_ops { · 128 unmodified lines
129129 * @dbuf_mapped: flag to show whether dbuf is mapped or not
130130 * @bytesused: number of bytes occupied by data in the plane (payload)
131131 * @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.
132134 * @offset: when memory in the associated struct vb2_buffer is
133135 * VB2_MEMORY_MMAP, equals the offset from the start of
134136 * the device memory for this plane (or is a "cookie" that
@@ -150,6 +152,7 @@ struct vb2_plane { · 15 unmodified lines
150152 unsigned int dbuf_mapped;
151153 unsigned int bytesused;
152154 unsigned int length;
155+ unsigned int min_length;
153156 union {
154157 unsigned int offset;
155158 unsigned long userptr;
@@ -211,6 +214,7 @@ struct vb2_queue; · 55 unmodified lines
211214 * @num_planes: number of planes in the buffer
212215 * on an internal driver queue
213216 * @planes: private per-plane information; do not change
217+ * @timestamp: frame timestamp in ns
214218 */
215219 struct vb2_buffer {
216220 struct vb2_queue *vb2_queue;
@@ -219,6 +223,7 @@ struct vb2_buffer { · 2 unmodified lines
219223 unsigned int memory;
220224 unsigned int num_planes;
221225 struct vb2_plane planes[VB2_MAX_PLANES];
226+ u64 timestamp;
222227
223228 /* private: internal use only
224229 *
@@ -268,21 +273,26 @@ struct vb2_buffer { · 43 unmodified lines
268273 * struct vb2_ops - driver-specific callbacks
269274 *
270275 * @queue_setup: called from VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS
271− * handlers before memory allocation, or, if
272− * *num_planes != 0, after the allocation to verify a
273− * smaller number of buffers. Driver should return
274− * the required number of buffers in *num_buffers, the
275− * required number of planes per buffer in *num_planes; the
276− * size of each plane should be set in the sizes[] array
277− * and optional per-plane allocator specific context in the
278− * alloc_ctxs[] array. When called from VIDIOC_REQBUFS,
279− * fmt == NULL, the driver has to use the currently
280− * configured format and *num_buffers is the total number
281− * of buffers, that are being allocated. When called from
282− * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the
283− * target frame format (if the format isn't valid the
284− * callback must return -EINVAL). In this case *num_buffers
285− * are being allocated additionally to q->num_buffers.
276+ * handlers before memory allocation. It can be called
277+ * twice: if the original number of requested buffers
278+ * could not be allocated, then it will be called a
279+ * second time with the actually allocated number of
280+ * buffers to verify if that is OK.
281+ * The driver should return the required number of buffers
282+ * in *num_buffers, the required number of planes per
283+ * buffer in *num_planes, the size of each plane should be
284+ * set in the sizes[] array and optional per-plane
285+ * allocator specific context in the alloc_ctxs[] array.
286+ * When called from VIDIOC_REQBUFS, *num_planes == 0, the
287+ * driver has to use the currently configured format to
288+ * determine the plane sizes and *num_buffers is the total
289+ * number of buffers that are being allocated. When called
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.
286296 * @wait_prepare: release any locks taken while calling vb2 functions;
287297 * it is called before an ioctl needs to wait for a new
288298 * buffer to arrive; required to avoid a deadlock in
@@ -344,7 +354,7 @@ struct vb2_buffer { · 55 unmodified lines
344354 * pre-queued buffers before calling STREAMON.
345355 */
346356 struct vb2_ops {
347− int (*queue_setup)(struct vb2_queue *q, const void *parg,
357+ int (*queue_setup)(struct vb2_queue *q,
348358 unsigned int *num_buffers, unsigned int *num_planes,
349359 unsigned int sizes[], void *alloc_ctxs[]);
350360
@@ -362,11 +372,22 @@ struct vb2_ops { · 11 unmodified lines
362372 void (*buf_queue)(struct vb2_buffer *vb);
363373 };
364374
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+ */
365386 struct 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);
367388 int (*fill_vb2_buffer)(struct vb2_buffer *vb, const void *pb,
368389 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);
370391 };
371392
372393 /**
@@ -429,6 +450,7 @@ struct vb2_buf_ops { · 56 unmodified lines
429450 * called since poll() needs to return POLLERR in that situation.
430451 * @is_multiplanar: set if buffer type is multiplanar
431452 * @is_output: set if buffer type is output
453+ * @copy_timestamp: set if vb2-core should set timestamps
432454 * @last_buffer_dequeued: used in poll() and DQBUF to immediately return if the
433455 * last decoded buffer was already dequeued. Set for capture queues
434456 * when a buffer with the V4L2_BUF_FLAG_LAST is dequeued.
@@ -470,7 +492,6 @@ struct vb2_queue { · 35 unmodified lines
470492 wait_queue_head_t done_wq;
471493
472494 void *alloc_ctx[VB2_MAX_PLANES];
473− unsigned int plane_sizes[VB2_MAX_PLANES];
474495
475496 unsigned int streaming:1;
476497 unsigned int start_streaming_called:1;
@@ -478,6 +499,7 @@ struct vb2_queue { · 1 unmodified line
478499 unsigned int waiting_for_buffers:1;
479500 unsigned int is_multiplanar:1;
480501 unsigned int is_output:1;
502+ unsigned int copy_timestamp:1;
481503 unsigned int last_buffer_dequeued:1;
482504
483505 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
503525 void vb2_discard_done(struct vb2_queue *q);
504526 int vb2_wait_for_all_buffers(struct vb2_queue *q);
505527
506−int vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb);
528+void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb);
507529 int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
508530 unsigned int *count);
509531 int 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[]);
511534 int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb);
512535 int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb);
513536 int 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
531554 unsigned long pgoff,
532555 unsigned long flags);
533556 #endif
557+unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file,
558+ poll_table *wait);
559+size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
560+ loff_t *ppos, int nonblock);
561+size_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+ */
569+typedef 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+ */
585+int 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+ */
592+int vb2_thread_stop(struct vb2_queue *q);
534593
535594 /**
536595 * 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
635694 q->last_buffer_dequeued = false;
636695 }
637696
697+/*
698+ * The following functions are not part of the vb2 core API, but are useful
699+ * functions for videobuf2-*.
700+ */
701+bool vb2_buffer_in_use(struct vb2_queue *q, struct vb2_buffer *vb);
702+int vb2_verify_memory_type(struct vb2_queue *q,
703+ enum vb2_memory memory, unsigned int type);
638704 #endif /* _MEDIA_VIDEOBUF2_CORE_H */
include/media/videobuf2-v4l2.h+2−38
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828 * @vb2_buf: video buffer 2
2929 * @flags: buffer informational flags
3030 * @field: enum v4l2_field; field order of the image in the buffer
31− * @timestamp: frame timestamp
3231 * @timecode: frame timecode
3332 * @sequence: sequence count of this frame
3433 * Should contain enough information to be able to cover all the fields
@@ -39,7 +38,6 @@ struct vb2_v4l2_buffer { · 4 unmodified lines
3938
4039 __u32 flags;
4140 __u32 field;
42− struct timeval timestamp;
4341 struct v4l2_timecode timecode;
4442 __u32 sequence;
4543 };
@@ -65,42 +63,8 @@ int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type); · 19 unmodified lines
6563
6664 int __must_check vb2_queue_init(struct vb2_queue *q);
6765 void vb2_queue_release(struct vb2_queue *q);
68−
69−unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait);
70−size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
71− loff_t *ppos, int nonblock);
72−size_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− */
80−typedef 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− */
96−int 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− */
103−int vb2_thread_stop(struct vb2_queue *q);
66+unsigned int vb2_poll(struct vb2_queue *q, struct file *file,
67+ poll_table *wait);
10468
10569 /*
10670 * 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
184184 __field(int, minor)
185185 __field(u32, flags)
186186 __field(u32, field)
187− __field(s64, timestamp)
187+ __field(u64, timestamp)
188188 __field(u32, timecode_type)
189189 __field(u32, timecode_flags)
190190 __field(u8, timecode_frames)
@@ -205,7 +205,7 @@ DECLARE_EVENT_CLASS(vb2_v4l2_event_class, · 14 unmodified lines
205205 __entry->minor = owner ? owner->vdev->minor : -1;
206206 __entry->flags = vbuf->flags;
207207 __entry->field = vbuf->field;
208− __entry->timestamp = timeval_to_ns(&vbuf->timestamp);
208+ __entry->timestamp = vb->timestamp;
209209 __entry->timecode_type = vbuf->timecode.type;
210210 __entry->timecode_flags = vbuf->timecode.flags;
211211 __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
1818 __field(u32, index)
1919 __field(u32, type)
2020 __field(u32, bytesused)
21+ __field(u64, timestamp)
2122 ),
2223
2324 TP_fast_assign(
@@ -28,14 +29,16 @@ DECLARE_EVENT_CLASS(vb2_event_class, · 4 unmodified lines
2829 __entry->index = vb->index;
2930 __entry->type = vb->type;
3031 __entry->bytesused = vb->planes[0].bytesused;
32+ __entry->timestamp = vb->timestamp;
3133 ),
3234
3335 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,
3537 __entry->queued_count,
3638 __entry->owned_by_drv_count,
3739 __entry->index, __entry->type,
38− __entry->bytesused
40+ __entry->bytesused,
41+ __entry->timestamp
3942 )
4043 )
4144
include/uapi/drm/drm_fourcc.h+1−1
@@ -225,7 +225,7 @@ · 224 unmodified lines
225225 * - multiple of 128 pixels for the width
226226 * - multiple of 32 pixels for the height
227227 *
228− * For more information: see http://linuxtv.org/downloads/v4l-dvb-apis/re32.html
228+ * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html
229229 */
230230 #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
231231
include/uapi/linux/dvb/video.h+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626
2727 #include <linux/types.h>
2828 #ifndef __KERNEL__
29−#include <stdint.h>
3029 #include <time.h>
3130 #endif
3231
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
2828
2929 /* A.3. Video Interface Protocol Codes */
3030 #define UVC_PC_PROTOCOL_UNDEFINED 0x00
31+#define UVC_PC_PROTOCOL_15 0x01
3132
3233 /* A.5. Video Class-Specific VC Interface Descriptor Subtypes */
3334 #define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
include/uapi/linux/v4l2-controls.h+4−2
@@ -158,8 +158,10 @@ enum v4l2_colorfx { · 157 unmodified lines
158158 * We reserve 16 controls for this driver. */
159159 #define V4L2_CID_USER_S2255_BASE (V4L2_CID_USER_BASE + 0x1030)
160160
161−/* The base for the si476x driver controls. See include/media/si476x.h for the list
162− * of controls. Total of 16 controls is reserved for this driver */
161+/*
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+ */
163165 #define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040)
164166
165167 /* 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
4646 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
4747 * no #if __KERNEL tests are allowed here
4848 *
49− * See http://linuxtv.org for more info
49+ * See https://linuxtv.org for more info
5050 *
5151 * Author: Bill Dirks <bill@thedirks.org>
5252 * Justin Schoeman
@@ -1476,7 +1476,12 @@ struct v4l2_ext_control { · 1423 unmodified lines
14761476 } __attribute__ ((packed));
14771477
14781478 struct v4l2_ext_controls {
1479− __u32 ctrl_class;
1479+ union {
1480+#ifndef __KERNEL__
1481+ __u32 ctrl_class;
1482+#endif
1483+ __u32 which;
1484+ };
14801485 __u32 count;
14811486 __u32 error_idx;
14821487 __u32 reserved[2];
@@ -1484,9 +1489,14 @@ struct v4l2_ext_controls { · 1 unmodified line
14841489 };
14851490
14861491 #define V4L2_CTRL_ID_MASK (0x0fffffff)
1492+#ifndef __KERNEL__
14871493 #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
1494+#endif
1495+#define V4L2_CTRL_ID2WHICH(id) ((id) & 0x0fff0000UL)
14881496 #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
14891497 #define V4L2_CTRL_MAX_DIMS (4)
1498+#define V4L2_CTRL_WHICH_CUR_VAL 0
1499+#define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000
14901500
14911501 enum v4l2_ctrl_type {
14921502 V4L2_CTRL_TYPE_INTEGER = 1,
sound/pci/es1968.c+2−2
@@ -113,7 +113,7 @@ · 112 unmodified lines
113113 #include <sound/initval.h>
114114
115115 #ifdef CONFIG_SND_ES1968_RADIO
116−#include <media/tea575x.h>
116+#include <media/drv-intf/tea575x.h>
117117 #endif
118118
119119 #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
26052605 }
26062606 }
26072607
2608−static struct snd_tea575x_ops snd_es1968_tea_ops = {
2608+static const struct snd_tea575x_ops snd_es1968_tea_ops = {
26092609 .set_pins = snd_es1968_tea575x_set_pins,
26102610 .get_pins = snd_es1968_tea575x_get_pins,
26112611 .set_direction = snd_es1968_tea575x_set_direction,
sound/pci/fm801.c+2−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <sound/initval.h>
3131
3232 #ifdef CONFIG_SND_FM801_TEA575X_BOOL
33−#include <media/tea575x.h>
33+#include <media/drv-intf/tea575x.h>
3434 #endif
3535
3636 MODULE_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
815815 fm801_writew(chip, GPIO_CTRL, reg);
816816 }
817817
818−static struct snd_tea575x_ops snd_fm801_tea_ops = {
818+static const struct snd_tea575x_ops snd_fm801_tea_ops = {
819819 .set_pins = snd_fm801_tea575x_set_pins,
820820 .get_pins = snd_fm801_tea575x_get_pins,
821821 .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