2014-06-13

[GIT PULL for v3.16-rc1] media updates for next

Subject: [GIT PULL for v3.16-rc1] media updates for next
Date: Wed, 04 Jun 2014 15:22:38 -0300
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
CC: Andrew Morton <akpm@linux-foundation.org>, Linux Media Mailing List <linux-media@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>

Hi Linus,

Please pull from:
  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media v4l_for_linus

For the media updates for the next kernel version. It contains:
    - a new frontend/tuner driver set for si2168 and sa2157;
    - Videobuf 2 core now supports DVB too;
    - A new gspca sub-driver (dtcs033);
    - saa7134 is now converted to use videobuf2;
    - add support for 4K timings;
    - several other driver fixes and improvements.

Thanks!
Mauro

PS.: This pull request is shorter than usual, partly because I have some
other patches on topic branches that I'll be sending you latter this
week.

-

The following changes since commit 4b660a7f5c8099d88d1a43d8ae138965112592c7:

  Linux 3.15-rc6 (2014-05-22 06:42:02 +0900)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media v4l_for_linus

for you to fetch changes up to a2668e10d7246e782f7708dc47c00f035da23a81:

  [media] au0828-dvb: restore its permission to 644 (2014-06-04 15:19:36 -0300)

----------------------------------------------------------------
Alessandro Miceli (2):
      [media] rtl28xxu: add [1b80:d39d] Sveon STV20
      [media] rtl28xxu: add [1b80:d3af] Sveon STV27

Alexander Shiyan (3):
      [media] media: coda: Use full device name for request_irq()
      [media] media: mx2-emmaprp: Cleanup internal structure
      [media] media: mx2-emmaprp: Add missing mutex_destroy()

Anton Leontiev (1):
      [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling

Antti Palosaari (12):
      [media] si2157: Silicon Labs Si2157 silicon tuner driver
      [media] si2168: Silicon Labs Si2168 DVB-T/T2/C demod driver
      [media] em28xx: add [2013:025f] PCTV tripleStick (292e)
      [media] si2168: add support for DVB-T2
      [media] si2157: extend frequency range for DVB-C
      [media] si2168: add support for DVB-C (annex A version)
      [media] si2157: add copyright and license
      [media] si2168: add copyright and license
      [media] MAINTAINERS: add si2168 driver
      [media] MAINTAINERS: add si2157 driver
      [media] si2168: relax demod lock checks a little
      [media] em28xx: PCTV tripleStick (292e) LNA support

Archit Taneja (5):
      [media] v4l: ti-vpe: register video device only when firmware is loaded
      [media] v4l: ti-vpe: Allow DMABUF buffer type support
      [media] v4l: ti-vpe: Fix some params in VPE data descriptors
      [media] v4l: ti-vpe: Add selection API in VPE driver
      [media] v4l: ti-vpe: Rename csc memory resource name

Arun Kumar K (4):
      [media] s5p-mfc: Update scratch buffer size for MPEG4
      [media] s5p-mfc: Move INIT_BUFFER_OPTIONS from v7 to v6
      [media] s5p-mfc: Rename IS_MFCV7 macro
      [media] v4l: Add source change event

Bartlomiej Zolnierkiewicz (1):
      [media] v4l: ti-vpe: fix devm_ioremap_resource() return value checking

Brian Healy (1):
      [media] rtl28xxu: add 1b80:d395 Peak DVB-T USB

Changbing Xiong (1):
      [media] au0828: Cancel stream-restart operation if frontend is disconnected

Daeseok Youn (1):
      [media] s2255drv: fix memory leak s2255_probe()

Dan Carpenter (2):
      [media] av7110: fix confusing indenting
      [media] Staging: dt3155v4l: set error code on failure

Daniel Glöckner (1):
      [media] bttv: Add support for PCI-8604PW

Ezequiel Garcia (1):
      [media] media: stk1160: Avoid stack-allocated buffer for control URBs

Frank Schaefer (24):
      [media] em28xx: fix indenting in em28xx_usb_probe()
      [media] em28xx: remove some unused fields from struct em28xx
      [media] em28xx: remove function em28xx_compression_disable() and its call
      [media] em28xx: move norm_maxw() and norm_maxh() from em28xx.h to em28xx-video.c
      [media] em28xx: remove the i2c_set_adapdata() call in em28xx_i2c_register()
      [media] em28xx: move sub-module data structs to a common place in the main struct
      [media] em28xx-video: simplify usage of the pointer to struct v4l2_ctrl_handler in em28xx_v4l2_init()
      [media] em28xx: start moving em28xx-v4l specific data to its own struct
      [media] em28xx: move struct v4l2_ctrl_handler ctrl_handler from struct em28xx to struct v4l2
      [media] em28xx: move struct v4l2_clk *clk from struct em28xx to struct v4l2
      [media] em28xx: move video_device structs from struct em28xx to struct v4l2
      [media] em28xx: move videobuf2 related data from struct em28xx to struct v4l2
      [media] em28xx: move v4l2 frame resolutions and scale data from struct em28xx to struct v4l2
      [media] em28xx: move vinmode and vinctrl data from struct em28xx to struct v4l2
      [media] em28xx: move TV norm from struct em28xx to struct v4l2
      [media] em28xx: move struct em28xx_fmt *format from struct em28xx to struct v4l2
      [media] em28xx: move progressive/interlaced fields from struct em28xx to struct v4l2
      [media] em28xx: move sensor parameter fields from struct em28xx to struct v4l2
      [media] em28xx: move capture state tracking fields from struct em28xx to struct v4l2
      [media] em28xx: move v4l2 user counting fields from struct em28xx to struct v4l2
      [media] em28xx: move tuner frequency field from struct em28xx to struct v4l2
      [media] em28xx: remove field tda9887_conf from struct em28xx
      [media] em28xx: remove field tuner_addr from struct em28xx
      [media] em28xx: move fields wq_trigger and streaming_started from struct em28xx to struct em28xx_audio

Guennadi Liakhovetski (2):
      [media] V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space
      [media] V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode

Hans Verkuil (40):
      [media] v4l2-subdev.h: fix sparse error with v4l2_subdev_notify
      [media] videobuf2-core: fix sparse errors
      [media] v4l2-common.h: remove __user annotation in struct v4l2_edid
      [media] v4l2-ioctl.c: fix sparse __user-related warnings
      [media] v4l2-dv-timings.h: add CEA-861-F 4K timings
      [media] v4l2-dv-timings.c: add the new 4K timings to the list
      [media] vb2: fix handling of data_offset and v4l2_plane.reserved[]
      [media] vb2: if bytesused is 0, then fill with output buffer length
      [media] vb2: use correct prefix
      [media] vb2: move __qbuf_mmap before __qbuf_userptr
      [media] vb2: set timestamp when using write()
      [media] vb2: reject output buffers with V4L2_FIELD_ALTERNATE
      [media] vb2: simplify a confusing condition
      [media] vb2: add vb2_fileio_is_active and check it more often
      [media] vb2: allow read/write as long as the format is single planar
      [media] vb2: start messages with a lower-case for consistency
      [media] DocBook media: update bytesused field description
      [media] v4l2-pci-skeleton.c: fix alternate field handling
      [media] vb2: add thread support
      [media] vb2: Add videobuf2-dvb support
      [media] vb2: stop_streaming should return void
      [media] bfin_capture: drop unnecessary vb2_is_streaming check
      [media] vb2: fix compiler warning
      [media] saa7134: fix regression with tvtime
      [media] saa7134: coding style cleanups
      [media] saa7134: drop abuse of low-level videobuf functions
      [media] saa7134: swap ts_init_encoder and ts_reset_encoder
      [media] saa7134: store VBI hlen/vlen globally
      [media] saa7134: remove fmt from saa7134_buf
      [media] saa7134: rename empress_tsq to empress_vbq
      [media] v4l2-subdev.h: add g_tvnorms video op
      [media] tw9910: add g_tvnorms video op
      [media] soc_camera: disable STD ioctls if no tvnorms are set
      [media] v4l2-pci-skeleton: fix typo
      [media] v4l2-ioctl: drop spurious newline in string
      [media] saa7134: rename vbi/cap to vbi_vbq/cap_vbq
      [media] saa7134: move saa7134_pgtable to saa7134_dmaqueue
      [media] saa7134: convert to vb2
      [media] saa7134: add saa7134_userptr module option to enable USERPTR
      [media] DocBook media: fix typo

Himangi Saraogi (1):
      [media] timblogiw: Introduce the use of the managed version of kzalloc

Ismael Luceno (3):
      [media] gspca_gl860: Clean up idxdata structs
      [media] solo6x10: Reduce OSD writes to the minimum necessary
      [media] solo6x10: Kconfig: Add supported card list to the SOLO6X10 knob

Jacek Anaszewski (8):
      [media] s5p-jpeg: Add fmt_ver_flag field to the s5p_jpeg_variant structure
      [media] s5p-jpeg: Perform fourcc downgrade only for Exynos4x12 SoCs
      [media] s5p-jpeg: Add m2m_ops field to the s5p_jpeg_variant structure
      [media] s5p-jpeg: g_selection callback should always succeed
      [media] s5p-jpeg: Fix sysmmu page fault
      [media] s5p-jpeg: Prevent JPEG 4:2:0 > YUV 4:2:0 decompression
      [media] s5p-jpeg: Fix build break when CONFIG_OF is undefined
      [media] s5p-jpeg: Fix NV12 format entry related to S5C2120 SoC

Jinqiang Zeng (1):
      [media] fix the code style errors in sn9c102

John Sheu (1):
      [media] s5p-mfc: fix encoder crash after VIDIOC_STREAMOFF

Kamil Debski (3):
      [media] v4l: s5p-mfc: Fix default pixel format selection for decoder
      [media] v4l: s5p-mfc: Limit enum_fmt to output formats of current version
      [media] v4l: Fix documentation of V4L2_PIX_FMT_H264_MVC and VP8 pixel formats

Kiran AVND (4):
      [media] s5p-mfc: Update scratch buffer size for VP8 encoder
      [media] s5p-mfc: Add variants to access mfc registers
      [media] s5p-mfc: Core support to add v8 decoder
      [media] s5p-mfc: Core support for v8 encoder

Kirill Tkhai (1):
      [media] s2255: Do not free fw_data until timer handler has actually stopped using it

Lad, Prabhakar (53):
      [media] media: davinci: vpbe: use v4l2_fh for priority handling
      [media] media: davinci: vpfe: use v4l2_fh for priority handling
      [media] staging: media: davinci: vpfe: use v4l2_fh for priority handling
      [media] staging: media: davinci: vpfe: release buffers in case start_streaming call back fails
      [media] media: davinci: vpbe: release buffers in case start_streaming call back fails
      [media] media: davinci: vpif_display: initialize vb2 queue and DMA context during probe
      [media] media: davinci: vpif_display: drop buf_init() callback
      [media] media: davinci: vpif_display: use vb2_ops_wait_prepare/finish helper functions
      [media] media: davinci: vpif_display: release buffers in case start_streaming() call back fails
      [media] media: davinci: vpif_display: drop buf_cleanup() callback
      [media] media: davinci: vpif_display: improve vpif_buffer_prepare() callback
      [media] media: davinci: vpif_display: improve vpif_buffer_queue_setup() function
      [media] media: davinci: vpif_display: improve start/stop_streaming callbacks
      [media] media: davinci: vpif_display: use vb2_fop_mmap/poll
      [media] media: davinci: vpif_display: use v4l2_fh_open and vb2_fop_release
      [media] media: davinci: vpif_display: use vb2_ioctl_* helpers
      [media] media: davinci: vpif_display: drop unused member fbuffers
      [media] media: davinci: vpif_display: drop reserving memory for device
      [media] media: davinci: vpif_display: drop unnecessary field memory
      [media] media: davinci: vpif_display: drop numbuffers field from common_obj
      [media] media: davinic: vpif_display: drop started member from struct common_obj
      [media] media: davinci: vpif_display: initialize the video device in single place
      [media] media: davinci: vpif_display: drop unneeded module params
      [media] media: davinci: vpif_display: drop cropcap
      [media] media: davinci: vpif_display: group v4l2_ioctl_ops
      [media] media: davinci: vpif_display: use SIMPLE_DEV_PM_OPS
      [media] media: davinci: vpif_display: return -ENODATA for *dv_timings calls
      [media] media: davinci: vpif_display: return -ENODATA for *std calls
      [media] media: davinci; vpif_display: fix checkpatch error
      [media] media: davinci: vpif_display: fix v4l-compliance issues
      [media] media: davinci: vpif_capture: initalize vb2 queue and DMA context during probe
      [media] media: davinci: vpif_capture: drop buf_init() callback
      [media] media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper functions
      [media] media: davinci: vpif_capture: release buffers in case start_streaming() call back fails
      [media] media: davinci: vpif_capture: drop buf_cleanup() callback
      [media] media: davinci: vpif_capture: improve vpif_buffer_prepare() callback
      [media] media: davinci: vpif_capture: improve vpif_buffer_queue_setup() function
      [media] media: davinci: vpif_capture: improve start/stop_streaming callbacks
      [media] media: davinci: vpif_capture: use vb2_fop_mmap/poll
      [media] media: davinci: vpif_capture: use v4l2_fh_open and vb2_fop_release
      [media] media: davinci: vpif_capture: use vb2_ioctl_* helpers
      [media] media: davinci: vpif_capture: drop reserving memory for device
      [media] media: davinci: vpif_capture: drop unnecessary field memory
      [media] media: davinic: vpif_capture: drop started member from struct common_obj
      [media] media: davinci: vpif_capture: initialize the video device in single place
      [media] media: davinci: vpif_capture: drop unneeded module params
      [media] media: davinci: vpif_capture: drop cropcap
      [media] media: davinci: vpif_capture: group v4l2_ioctl_ops
      [media] media: davinci: vpif_capture: use SIMPLE_DEV_PM_OPS
      [media] media: davinci: vpif_capture: return -ENODATA for *dv_timings calls
      [media] media: davinci: vpif_capture: return -ENODATA for *std calls
      [media] media: davinci: vpif_capture: drop check __KERNEL__
      [media] media: davinci: vpif: add Copyright message

Lars-Peter Clausen (1):
      [media] adv7604: Add missing include to linux/types.h

Laurent Pinchart (37):
      [media] v4l: Add UYVY10_2X10 and VYUY10_2X10 media bus pixel codes
      [media] v4l: Add UYVY10_1X20 and VYUY10_1X20 media bus pixel codes
      [media] v4l: Add 12-bit YUV 4:2:0 media bus pixel codes
      [media] v4l: Add 12-bit YUV 4:2:2 media bus pixel codes
      [media] omap4iss: Don't check for DEBUG when printing IRQ debugging messages
      [media] omap4iss: Add missing white space
      [media] omap4iss: Use a common macro for all sleep-based poll loops
      [media] omap4iss: Relax usleep ranges
      [media] v4l: vb2: Avoid double WARN_ON when stopping streaming
      [media] mt9p031: Really disable Black Level Calibration in test pattern mode
      [media] mt9p031: Fix BLC configuration restore when disabling test pattern
      [media] Documentation: media: Remove double 'struct'
      [media] tvp5150: Replace container_of() with to_tvp5150()
      [media] v4l: subdev: Move [gs]_std operation to video ops
      [media] v4l: Add pad-level DV timings subdev operations
      [media] ad9389b: Add pad-level DV timings operations
      [media] adv7511: Add pad-level DV timings operations
      [media] adv7842: Add pad-level DV timings operations
      [media] s5p-tv: hdmi: Add pad-level DV timings operations
      [media] s5p-tv: hdmiphy: Add pad-level DV timings operations
      [media] ths8200: Add pad-level DV timings operations
      [media] tvp7002: Add pad-level DV timings operations
      [media] media: bfin_capture: Switch to pad-level DV operations
      [media] media: davinci: vpif: Switch to pad-level DV operations
      [media] media: staging: davinci: vpfe: Switch to pad-level DV operations
      [media] s5p-tv: mixer: Switch to pad-level DV operations
      [media] ad9389b: Remove deprecated video-level DV timings operations
      [media] adv7511: Remove deprecated video-level DV timings operations
      [media] adv7842: Remove deprecated video-level DV timings operations
      [media] s5p-tv: hdmi: Remove deprecated video-level DV timings operations
      [media] s5p-tv: hdmiphy: Remove deprecated video-level DV timings operation
      [media] ths8200: Remove deprecated video-level DV timings operations
      [media] tvp7002: Remove deprecated video-level DV timings operations
      [media] v4l: Improve readability by not wrapping ioctl number #define's
      [media] v4l: Add support for DV timings ioctls on subdev nodes
      [media] v4l: Validate fields in the core code for subdev EDID ioctls
      [media] m5mols: Replace missing header

Luis R. Rodriguez (2):
      [media] technisat-usb2: rename led enums to be specific to driver
      [media] bt8xx: make driver routines fit into its own namespcae

Ma Haijun (1):
      [media] videobuf-dma-contig: fix incorrect argument to vm_iomap_memory() call

Manuel Schönlaub (1):
      [media] az6027: Added the PID for a new revision of the Elgato EyeTV Sat DVB-S Tuner

Martin Bugge (2):
      [media] adv7842: update RGB quantization range on HDMI/DVI-D mode irq
      [media] adv7842: Disable access to EDID DDC lines before chip power up

Masanari Iida (1):
      [media] media: parport: Fix format string mismatch in bw-qcam.c

Matt DeVillier (1):
      [media] fix mceusb endpoint type identification/handling

Mauro Carvalho Chehab (14):
      Documentation: Update cardlists
      saa7134-alsa: include vmalloc.h
      Merge tag 'v3.15-rc6' into patchwork
      [media] em28xx: make em28xx_free_v4l2 static()
      Revert "[media] media: davinci: vpif_capture: drop unneeded module params"
      [media] dib0700: fix RC support on Hauppauge Nova-TD
      [media] au0828: Improve debug messages for urb_completion
      [media] au0828: reset streaming when a new frequency is set
      [media] xc5000: get rid of positive error codes
      [media] xc5000: Don't wrap msleep()
      [media] xc5000: fix CamelCase
      [media] xc5000: Don't use whitespace before tabs
      [media] xc5000: delay tuner sleep to 5 seconds
      [media] au0828-dvb: restore its permission to 644

Mike Sampson (1):
      [media] sn9c102_hv7131r: fix style warnings flagged by checkpatch.pl

Mikhail Domrachev (1):
      [media] saa7134: add vidioc_querystd

Nicolas Dufresne (3):
      [media] s5p-fimc: Iterate for each memory plane
      [media] s5p-fimc: Changed RGB32 to BGR32
      [media] s5p-fimc: Reuse calculated sizes

Olivier Langlois (1):
      [media] uvcvideo: Fix clock param realtime setting

Pali Rohár (1):
      [media] radio-bcm2048: fix wrong overflow check

Paul Bolle (1):
      [media] omap4iss: Remove VIDEO_OMAP4_DEBUG Kconfig option

Pawel Osciak (6):
      [media] s5p-mfc: Copy timestamps only when a frame is produced
      [media] s5p-mfc: Fixes for decode REQBUFS
      [media] s5p-mfc: Extract open/close MFC instance commands
      [media] s5p-mfc: Don't allocate codec buffers on STREAMON
      [media] s5p-mfc: Don't try to resubmit VP8 bitstream buffer for decode
      [media] s5p-mfc: Add support for resolution change event

Peter Senna Tschudin (1):
      [media] USB: as102_usb_drv.c: Remove useless return variables

Philipp Zabel (1):
      [media] vb2: fix num_buffers calculation if req->count > VIDEO_MAX_FRAMES

Ricardo Ribalda (1):
      [media] videobuf2-dma-sg: Fix NULL pointer dereference BUG

Robert Butora (2):
      [media] media/usb/gspca: Add support for Scopium astro webcam (0547:7303)
      [media] media:gspca:dtcs033 Clean sparse check warnings on endianess

Sakari Ailus (22):
      [media] smiapp: Remove unused quirk register functionality
      [media] smiapp: Rename SMIA_REG to SMIAPP_REG for consistency
      [media] smiapp: Fix determining the need for 8-bit read access
      [media] smiapp: Add a macro for constructing 8-bit quirk registers
      [media] smiapp: Use I2C adapter ID and address in the sub-device name
      [media] smiapp: Make PLL flags separate from regular quirk flags
      [media] smiapp: Make PLL flags unsigned long
      [media] smiapp: Make PLL (quirk) flags a function
      [media] smiapp: Add register diversion quirk
      [media] smiapp: Define macros for obtaining properties of register definitions
      [media] smiapp: Use %u for printing u32 value
      [media] v4l: Check pad arguments for [gs]_frame_interval
      [media] media: Use a better owner for the media device
      [media] v4l: Only get module if it's different than the driver for v4l2_dev
      [media] v4l: V4L2_MBUS_FRAME_DESC_FL_BLOB is about 1D DMA
      [media] v4l: Remove documentation for nonexistend input field in v4l2_buffer
      [media] smiapp: Print the index of the format descriptor
      [media] smiapp: Call limits quirk immediately after retrieving the limits
      [media] smiapp: Scaling goodness is signed
      [media] smiapp: Use better regulator name for the Device tree
      [media] smiapp: Check for GPIO validity using gpio_is_valid()
      [media] smiapp: Return correct return value in smiapp_registered()

Sylwester Nawrocki (4):
      [media] exynos4-is: Fix compilation for !CONFIG_COMMON_CLK
      [media] exynos4-is: Free FIMC-IS CPU memory only when allocated
      [media] ARM: S5PV210: Remove camera support from mach-goni.c
      [media] exynos4-is: Remove support for non-dt platforms

Takashi Iwai (1):
      [media] ivtv: Fix Oops when no firmware is loaded

Tuomas Tynkkynen (1):
      [media] staging: lirc: Fix sparse warnings

Victor Lambret (1):
      [media] videobuf2-core: remove duplicated code

Vitaly Osipov (2):
      [media] staging: media: omap24xx: fix up checkpatch error message
      [media] staging: media: omap24xx: use pr_info() instead of KERN_INFO

ileana@telecom-paristech.fr (1):
      [media] staging: omap24xx: fix coding style

 Documentation/DocBook/media/v4l/io.xml             |   15 +-
 .../DocBook/media/v4l/media-ioc-enum-links.xml     |    8 +-
 Documentation/DocBook/media/v4l/pixfmt.xml         |    4 +-
 Documentation/DocBook/media/v4l/subdev-formats.xml |  760 ++++++++++++
 Documentation/DocBook/media/v4l/vidioc-dqevent.xml |   33 +
 .../DocBook/media/v4l/vidioc-dv-timings-cap.xml    |   27 +-
 .../DocBook/media/v4l/vidioc-enum-dv-timings.xml   |   30 +-
 .../DocBook/media/v4l/vidioc-subscribe-event.xml   |   20 +
 .../devicetree/bindings/media/s5p-mfc.txt          |    3 +-
 Documentation/video4linux/CARDLIST.bttv            |    1 +
 Documentation/video4linux/CARDLIST.em28xx          |    1 +
 Documentation/video4linux/fimc.txt                 |   30 -
 Documentation/video4linux/v4l2-pci-skeleton.c      |   42 +-
 MAINTAINERS                                        |   21 +-
 arch/arm/mach-s5pv210/mach-goni.c                  |   51 -
 drivers/media/dvb-core/dvb-usb-ids.h               |    3 +
 drivers/media/dvb-frontends/Kconfig                |    7 +
 drivers/media/dvb-frontends/Makefile               |    1 +
 drivers/media/dvb-frontends/si2168.c               |  760 ++++++++++++
 drivers/media/dvb-frontends/si2168.h               |   39 +
 drivers/media/dvb-frontends/si2168_priv.h          |   46 +
 drivers/media/i2c/ad9389b.c                        |   64 +-
 drivers/media/i2c/adv7180.c                        |    2 +-
 drivers/media/i2c/adv7183.c                        |    4 +-
 drivers/media/i2c/adv7511.c                        |   66 +-
 drivers/media/i2c/adv7604.c                        |    4 -
 drivers/media/i2c/adv7842.c                        |   28 +-
 drivers/media/i2c/bt819.c                          |    2 +-
 drivers/media/i2c/cx25840/cx25840-core.c           |    4 +-
 drivers/media/i2c/ks0127.c                         |    6 +-
 drivers/media/i2c/m5mols/m5mols_capture.c          |    2 +-
 drivers/media/i2c/ml86v7667.c                      |    2 +-
 drivers/media/i2c/msp3400-driver.c                 |    2 +-
 drivers/media/i2c/mt9p031.c                        |   53 +-
 drivers/media/i2c/saa6752hs.c                      |    2 +-
 drivers/media/i2c/saa7110.c                        |    2 +-
 drivers/media/i2c/saa7115.c                        |    2 +-
 drivers/media/i2c/saa717x.c                        |    2 +-
 drivers/media/i2c/saa7191.c                        |    2 +-
 drivers/media/i2c/smiapp-pll.h                     |    2 +-
 drivers/media/i2c/smiapp/smiapp-core.c             |   57 +-
 drivers/media/i2c/smiapp/smiapp-quirk.c            |   55 +-
 drivers/media/i2c/smiapp/smiapp-quirk.h            |   24 +-
 drivers/media/i2c/smiapp/smiapp-reg-defs.h         |    8 +-
 drivers/media/i2c/smiapp/smiapp-regs.c             |   89 +-
 drivers/media/i2c/smiapp/smiapp-regs.h             |   19 +-
 drivers/media/i2c/soc_camera/tw9910.c              |   11 +-
 drivers/media/i2c/sony-btf-mpx.c                   |   10 +-
 drivers/media/i2c/ths8200.c                        |   10 +
 drivers/media/i2c/tvaudio.c                        |    6 +-
 drivers/media/i2c/tvp514x.c                        |    2 +-
 drivers/media/i2c/tvp5150.c                        |    6 +-
 drivers/media/i2c/tvp7002.c                        |    5 +-
 drivers/media/i2c/tw2804.c                         |    2 +-
 drivers/media/i2c/tw9903.c                         |    2 +-
 drivers/media/i2c/tw9906.c                         |    2 +-
 drivers/media/i2c/vp27smpx.c                       |    6 +-
 drivers/media/i2c/vpx3220.c                        |    2 +-
 drivers/media/media-device.c                       |    7 +-
 drivers/media/media-devnode.c                      |    5 +-
 drivers/media/parport/bw-qcam.c                    |    2 +-
 drivers/media/pci/bt8xx/bttv-cards.c               |  110 ++
 drivers/media/pci/bt8xx/bttv-driver.c              |    2 +-
 drivers/media/pci/bt8xx/bttv.h                     |    1 +
 drivers/media/pci/bt8xx/dst.c                      |   20 +-
 drivers/media/pci/cx18/cx18-av-core.c              |    2 +-
 drivers/media/pci/cx18/cx18-fileops.c              |    2 +-
 drivers/media/pci/cx18/cx18-gpio.c                 |    6 +-
 drivers/media/pci/cx18/cx18-ioctl.c                |    2 +-
 drivers/media/pci/cx23885/cx23885-video.c          |    4 +-
 drivers/media/pci/cx88/cx88-core.c                 |    2 +-
 drivers/media/pci/ivtv/ivtv-alsa-pcm.c             |    6 +
 drivers/media/pci/ivtv/ivtv-fileops.c              |    2 +-
 drivers/media/pci/ivtv/ivtv-ioctl.c                |    2 +-
 drivers/media/pci/saa7134/Kconfig                  |    4 +-
 drivers/media/pci/saa7134/saa7134-alsa.c           |  107 +-
 drivers/media/pci/saa7134/saa7134-core.c           |  130 ++-
 drivers/media/pci/saa7134/saa7134-dvb.c            |   50 +-
 drivers/media/pci/saa7134/saa7134-empress.c        |  187 ++-
 drivers/media/pci/saa7134/saa7134-i2c.c            |    7 -
 drivers/media/pci/saa7134/saa7134-reg.h            |   12 +-
 drivers/media/pci/saa7134/saa7134-ts.c             |  191 ++--
 drivers/media/pci/saa7134/saa7134-tvaudio.c        |    7 -
 drivers/media/pci/saa7134/saa7134-vbi.c            |  175 ++-
 drivers/media/pci/saa7134/saa7134-video.c          |  697 +++++------
 drivers/media/pci/saa7134/saa7134.h                |  108 +-
 drivers/media/pci/saa7146/mxb.c                    |   14 +-
 drivers/media/pci/sta2x11/sta2x11_vip.c            |    7 +-
 drivers/media/pci/ttpci/av7110_av.c                |    6 +-
 drivers/media/pci/zoran/zoran_device.c             |    2 +-
 drivers/media/pci/zoran/zoran_driver.c             |    2 +-
 drivers/media/platform/blackfin/bfin_capture.c     |   14 +-
 drivers/media/platform/coda.c                      |    6 +-
 drivers/media/platform/davinci/vpbe_display.c      |   55 +-
 drivers/media/platform/davinci/vpfe_capture.c      |   15 +-
 drivers/media/platform/davinci/vpif_capture.c      | 1119 +++++-------------
 drivers/media/platform/davinci/vpif_capture.h      |   28 -
 drivers/media/platform/davinci/vpif_display.c      | 1206 ++++++--------------
 drivers/media/platform/davinci/vpif_display.h      |   44 +-
 drivers/media/platform/exynos-gsc/gsc-m2m.c        |    4 +-
 drivers/media/platform/exynos4-is/Kconfig          |    3 +-
 drivers/media/platform/exynos4-is/common.c         |    2 +-
 drivers/media/platform/exynos4-is/fimc-capture.c   |    6 +-
 drivers/media/platform/exynos4-is/fimc-core.c      |    6 +-
 drivers/media/platform/exynos4-is/fimc-core.h      |    2 +-
 drivers/media/platform/exynos4-is/fimc-is.c        |    3 +
 drivers/media/platform/exynos4-is/fimc-isp-video.c |    7 +-
 drivers/media/platform/exynos4-is/fimc-isp.h       |    2 +-
 drivers/media/platform/exynos4-is/fimc-lite-reg.c  |    2 +-
 drivers/media/platform/exynos4-is/fimc-lite.c      |    8 +-
 drivers/media/platform/exynos4-is/fimc-lite.h      |    2 +-
 drivers/media/platform/exynos4-is/fimc-m2m.c       |    9 +-
 drivers/media/platform/exynos4-is/fimc-reg.c       |    2 +-
 drivers/media/platform/exynos4-is/media-dev.c      |  329 +-----
 drivers/media/platform/exynos4-is/media-dev.h      |    2 +-
 drivers/media/platform/exynos4-is/mipi-csis.c      |   43 +-
 drivers/media/platform/fsl-viu.c                   |    2 +-
 drivers/media/platform/marvell-ccic/mcam-core.c    |    7 +-
 drivers/media/platform/mem2mem_testdev.c           |    5 +-
 drivers/media/platform/mx2_emmaprp.c               |   37 +-
 drivers/media/platform/s3c-camif/camif-capture.c   |    4 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c        |  122 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.h        |    6 +-
 drivers/media/platform/s5p-mfc/regs-mfc-v6.h       |    4 +-
 drivers/media/platform/s5p-mfc/regs-mfc-v7.h       |    5 +-
 drivers/media/platform/s5p-mfc/regs-mfc-v8.h       |  124 ++
 drivers/media/platform/s5p-mfc/s5p_mfc.c           |   79 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h    |   15 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c      |   62 +
 drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.h      |    3 +
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c       |  290 ++---
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c       |   96 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_opr.c       |    6 +
 drivers/media/platform/s5p-mfc/s5p_mfc_opr.h       |  254 +++++
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c    |  842 +++++++++-----
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.h    |    7 +-
 drivers/media/platform/s5p-tv/hdmi_drv.c           |   14 +-
 drivers/media/platform/s5p-tv/hdmiphy_drv.c        |    9 +-
 drivers/media/platform/s5p-tv/mixer_video.c        |   11 +-
 drivers/media/platform/soc_camera/atmel-isi.c      |    6 +-
 drivers/media/platform/soc_camera/mx2_camera.c     |    4 +-
 drivers/media/platform/soc_camera/mx3_camera.c     |    4 +-
 drivers/media/platform/soc_camera/rcar_vin.c       |    4 +-
 .../platform/soc_camera/sh_mobile_ceu_camera.c     |    4 +-
 drivers/media/platform/soc_camera/soc_camera.c     |   12 +-
 drivers/media/platform/ti-vpe/csc.c                |    6 +-
 drivers/media/platform/ti-vpe/sc.c                 |    4 +-
 drivers/media/platform/ti-vpe/vpdma.c              |   68 +-
 drivers/media/platform/ti-vpe/vpdma.h              |   17 +-
 drivers/media/platform/ti-vpe/vpe.c                |  227 +++-
 drivers/media/platform/timblogiw.c                 |   10 +-
 drivers/media/platform/vino.c                      |    6 +-
 drivers/media/platform/vivi.c                      |    3 +-
 drivers/media/platform/vsp1/vsp1_video.c           |    4 +-
 drivers/media/rc/mceusb.c                          |   65 +-
 drivers/media/tuners/Kconfig                       |    7 +
 drivers/media/tuners/Makefile                      |    1 +
 drivers/media/tuners/si2157.c                      |  260 +++++
 drivers/media/tuners/si2157.h                      |   34 +
 drivers/media/tuners/si2157_priv.h                 |   37 +
 drivers/media/tuners/xc5000.c                      |  302 ++---
 drivers/media/usb/au0828/au0828-dvb.c              |   57 +-
 drivers/media/usb/au0828/au0828-video.c            |    4 +-
 drivers/media/usb/au0828/au0828.h                  |    2 +
 drivers/media/usb/cx231xx/cx231xx-417.c            |    2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c          |    6 +-
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c            |    6 +
 drivers/media/usb/dvb-usb/az6027.c                 |    7 +-
 drivers/media/usb/dvb-usb/dib0700.h                |    2 +-
 drivers/media/usb/dvb-usb/dib0700_core.c           |   43 +-
 drivers/media/usb/dvb-usb/dib0700_devices.c        |    2 +-
 drivers/media/usb/dvb-usb/technisat-usb2.c         |   28 +-
 drivers/media/usb/em28xx/Kconfig                   |    2 +
 drivers/media/usb/em28xx/em28xx-audio.c            |   39 +-
 drivers/media/usb/em28xx/em28xx-camera.c           |   51 +-
 drivers/media/usb/em28xx/em28xx-cards.c            |   47 +-
 drivers/media/usb/em28xx/em28xx-dvb.c              |   89 ++
 drivers/media/usb/em28xx/em28xx-i2c.c              |    1 -
 drivers/media/usb/em28xx/em28xx-v4l.h              |    2 +-
 drivers/media/usb/em28xx/em28xx-vbi.c              |   10 +-
 drivers/media/usb/em28xx/em28xx-video.c            |  622 +++++-----
 drivers/media/usb/em28xx/em28xx.h                  |  153 ++-
 drivers/media/usb/gspca/Kconfig                    |   10 +
 drivers/media/usb/gspca/Makefile                   |    2 +
 drivers/media/usb/gspca/dtcs033.c                  |  441 +++++++
 drivers/media/usb/gspca/gl860/gl860-mi2020.c       |  464 ++++----
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c            |    2 +-
 drivers/media/usb/pwc/pwc-if.c                     |    7 +-
 drivers/media/usb/s2255/s2255drv.c                 |   11 +-
 drivers/media/usb/stk1160/stk1160-core.c           |   10 +-
 drivers/media/usb/stk1160/stk1160-v4l.c            |    8 +-
 drivers/media/usb/stk1160/stk1160.h                |    1 -
 drivers/media/usb/tm6000/tm6000-cards.c            |    2 +-
 drivers/media/usb/tm6000/tm6000-video.c            |    2 +-
 drivers/media/usb/usbtv/usbtv-video.c              |    9 +-
 drivers/media/usb/usbvision/usbvision-video.c      |    2 +-
 drivers/media/usb/uvc/uvc_video.c                  |   36 +-
 drivers/media/v4l2-core/Kconfig                    |    4 +
 drivers/media/v4l2-core/Makefile                   |    1 +
 drivers/media/v4l2-core/tuner-core.c               |    6 +-
 drivers/media/v4l2-core/v4l2-device.c              |   18 +-
 drivers/media/v4l2-core/v4l2-dv-timings.c          |   11 +
 drivers/media/v4l2-core/v4l2-event.c               |   36 +
 drivers/media/v4l2-core/v4l2-ioctl.c               |   12 +-
 drivers/media/v4l2-core/v4l2-subdev.c              |   67 +-
 drivers/media/v4l2-core/videobuf-dma-contig.c      |    2 +-
 drivers/media/v4l2-core/videobuf2-core.c           |  706 ++++++++----
 drivers/media/v4l2-core/videobuf2-dma-sg.c         |    2 +-
 drivers/media/v4l2-core/videobuf2-dvb.c            |  336 ++++++
 drivers/staging/media/as102/as102_usb_drv.c        |    7 +-
 drivers/staging/media/bcm2048/radio-bcm2048.c      |    2 +-
 .../staging/media/davinci_vpfe/vpfe_mc_capture.h   |    2 -
 drivers/staging/media/davinci_vpfe/vpfe_video.c    |   27 +-
 drivers/staging/media/davinci_vpfe/vpfe_video.h    |    2 -
 drivers/staging/media/dt3155v4l/dt3155v4l.c        |    7 +-
 drivers/staging/media/go7007/go7007-v4l2.c         |    5 +-
 drivers/staging/media/go7007/s2250-board.c         |    2 +-
 drivers/staging/media/go7007/saa7134-go7007.c      |    4 +
 drivers/staging/media/lirc/lirc_bt829.c            |    6 +-
 drivers/staging/media/lirc/lirc_parallel.c         |   26 +-
 drivers/staging/media/lirc/lirc_serial.c           |   11 +-
 drivers/staging/media/lirc/lirc_sir.c              |   33 +-
 drivers/staging/media/lirc/lirc_zilog.c            |   23 +-
 drivers/staging/media/msi3101/sdr-msi3101.c        |   24 +-
 drivers/staging/media/omap24xx/tcm825x.c           |   12 +-
 drivers/staging/media/omap24xx/tcm825x.h           |    4 +-
 drivers/staging/media/omap4iss/Kconfig             |    6 -
 drivers/staging/media/omap4iss/iss.c               |   52 +-
 drivers/staging/media/omap4iss/iss.h               |   14 +
 drivers/staging/media/omap4iss/iss_csi2.c          |   39 +-
 drivers/staging/media/omap4iss/iss_video.h         |    2 +-
 drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c   |    7 +-
 drivers/staging/media/sn9c102/sn9c102.h            |   30 +-
 drivers/staging/media/sn9c102/sn9c102_core.c       |  342 +++---
 drivers/staging/media/sn9c102/sn9c102_devtable.h   |   22 +-
 drivers/staging/media/sn9c102/sn9c102_hv7131d.c    |   22 +-
 drivers/staging/media/sn9c102/sn9c102_hv7131r.c    |   23 +-
 drivers/staging/media/sn9c102/sn9c102_mi0343.c     |   30 +-
 drivers/staging/media/sn9c102/sn9c102_mi0360.c     |   30 +-
 drivers/staging/media/sn9c102/sn9c102_ov7630.c     |   22 +-
 drivers/staging/media/sn9c102/sn9c102_ov7660.c     |   22 +-
 drivers/staging/media/sn9c102/sn9c102_pas106b.c    |   22 +-
 drivers/staging/media/sn9c102/sn9c102_pas202bcb.c  |   22 +-
 drivers/staging/media/sn9c102/sn9c102_sensor.h     |   34 +-
 drivers/staging/media/sn9c102/sn9c102_tas5110c1b.c |   18 +-
 drivers/staging/media/sn9c102/sn9c102_tas5110d.c   |   14 +-
 drivers/staging/media/sn9c102/sn9c102_tas5130d1b.c |   18 +-
 drivers/staging/media/solo6x10/Kconfig             |   12 +-
 drivers/staging/media/solo6x10/solo6x10-enc.c      |   31 +-
 drivers/staging/media/solo6x10/solo6x10-offsets.h  |    2 +
 drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c |    3 +-
 drivers/staging/media/solo6x10/solo6x10-v4l2.c     |    3 +-
 include/linux/platform_data/mipi-csis.h            |   28 -
 include/media/adv7604.h                            |    2 +
 include/media/davinci/vpbe_display.h               |    6 +-
 include/media/davinci/vpfe_capture.h               |    6 +-
 include/media/{s5p_fimc.h => exynos-fimc.h}        |   21 -
 include/media/media-device.h                       |    4 +-
 include/media/media-devnode.h                      |    3 +-
 include/media/v4l2-device.h                        |    8 +
 include/media/v4l2-event.h                         |    4 +
 include/media/v4l2-subdev.h                        |   33 +-
 include/media/videobuf2-core.h                     |   51 +-
 include/media/videobuf2-dvb.h                      |   58 +
 include/uapi/linux/v4l2-common.h                   |    2 +-
 include/uapi/linux/v4l2-dv-timings.h               |   70 ++
 include/uapi/linux/v4l2-mediabus.h                 |   14 +-
 include/uapi/linux/v4l2-subdev.h                   |   40 +-
 include/uapi/linux/videodev2.h                     |   19 +-
 269 files changed, 9309 insertions(+), 5840 deletions(-)
 create mode 100644 drivers/media/dvb-frontends/si2168.c
 create mode 100644 drivers/media/dvb-frontends/si2168.h
 create mode 100644 drivers/media/dvb-frontends/si2168_priv.h
 create mode 100644 drivers/media/platform/s5p-mfc/regs-mfc-v8.h
 create mode 100644 drivers/media/tuners/si2157.c
 create mode 100644 drivers/media/tuners/si2157.h
 create mode 100644 drivers/media/tuners/si2157_priv.h
 create mode 100644 drivers/media/usb/gspca/dtcs033.c
 create mode 100644 drivers/media/v4l2-core/videobuf2-dvb.c
 delete mode 100644 include/linux/platform_data/mipi-csis.h
 rename include/media/{s5p_fimc.h => exynos-fimc.h} (87%)
 create mode 100644 include/media/videobuf2-dvb.h

2014-05-05

Report on the San Jose V4L/DVB mini-summit

Subject: [ANN] Report on the San Jose V4L/DVB mini-summit
Date: Mon, 05 May 2014 12:10:46 +0200
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Linux Media Mailing List <linux-media@vger.kernel.org>

Note: please reply with corrections if I made a mistake or missed something. In
particular the DVB sections might contain inaccuracies since I am not a DVB expert.

================================================================================

Report of the V4L/DVB mini-summit in San Jose, May 3rd 2014

Attendees:

Mauro Carvalho Chehab
Kamil Debski
Tomasz Figa
Devin Heitmueller
Shuah Khan
Mike Krufky
Laurent Pinchart
Steve Toth
Hans Verkuil

Sakari Ailus was not present but was reading and commenting on the etherpad notes.


1) V4L2 Ambiguities

1.1) VIDIOC_ENUM_FMT & Multi-planar

Currently there is no way to know if a format is a multi-planar format.

This is an issue when using a single-planar application with a multi-planar driver:
the libv4l plugin will convert from the single planar API to the multi-planar API, but
that only works for single planar formats, multi-planar formats should be skipped.

It is not possible to deduce whether a fourcc format is multi or single planar.

Proposed solution:

Add an MPLANE flag reported during format enumeration (similar to the compressed flag).

Actions:
   
- Post an RFC (Hans).

1.2) Rename mem2mem_testdev to vim2m

Actions:

- Do this, but add a module alias with the old name to ensure backward compatibility. (Hans)

1.3) Drop 2.6.31 support in media_build

We need to support at least the distro LTS kernels. This means keeping 2.6.32 support until
the end of the year (projected EOL as LTS by mid 2014)

Actions:
   
- Drop 2.6.31 next time it breaks (Hans)

1.4) Extending struct v4l2_pix_format

The v4l2_pix_format struct has no more free space. We need to extend it today to add flags
(for pre-multiplied alpha) and data_offset for single planar. However the structure is used
in v4l2_framebuffer, whose size would then change, breaking the ioctl ABI.

The risk of breakage when embedding v4l2_pix_format inside v4l2_framebuffer is unknown but
not expected to be too high. The Xorg V4L plugin shouldn't break at first sight.

Mauro mentioned that the fmt field is the very last in v4l2_framebuffer, so we could keep
the ABI by hardcoding the size in the ioctl number without embedding v4l2_pix_format in
v4l2_framebuffer. However the risk of bugs sneaking in in the kernel could be high as the
size would need to be hardcoded in video_usercopy as well.

Mauro proposed first deprecating v4l2_framebuffer in favour of dmabuf. We don't really know
how widely the related ioctls are used.

Actions:
   
- Embed the structure (anyone who needs to extend v4l2_pix_format)
- Mark the framebuffer API as deprecated (Hans)
- Would be nice: Convert the Xorg V4L driver to DMABUF

Extending struct v4l2_pix_format:

- Use the priv field as a magic value to indicate that extensions are available.
- Alias the priv field using a union to name it 'version'.

Actions:
   
- Post an RFC (Hans)

1.5) Height vs Field

When calling S/TRY_FMT with incompatible height and field values, which one of the
two should be changed by the driver? Proposal: field should change.

Actions:
   
- Post an RFC (Hans)

1.6) Crop, Compose, Scale

All 8 combinations of crop, compose and scaling were described.

Do we want to increase the format automatically when requesting a compose rectangle
that is partially outside of the S_FMT buffer, or constrain the compose rectangle to
that of the S_FMT buffer? If the format is locked (vb2_is_busy() returns true), then
the compose rectangle has to be constrained. But should this also happen if the format
is not locked?

In the "crop, no compose, scale" case, do we adjust the format and keep the crop
rectangle fixed when the set crop rectangle + scaler limitations require it, or do we
adjust the crop rectangle and keep the format fixed? Effectively the same question as
in the case above.

The problem is complicated, documentation should do more than just listing the cases
with text only. Graphics and/or tables should be used to make the behavior clearer
for applications.

To simplify drivers the addition of V4L2 core helper functions are certainly needed
to coordinate the crop/compose/scale dependencies.

To detect scaler presence, mandate drivers to implement ENUM_FRAMESIZES with
stepwise/continuous framesize ranges *and* forbid drivers for devices without a scaler
to report stepwise/continuous framesizes.

Actions:
   
- Check what happens when we allow or disallow partly out of bounds compose rectangles
  (as opposed to increasing the format automatically). (Hans)
- Add ENUM_FRAMESIZES support to those drivers that can scale (Hans)

Separate issue: changing the input, output, STD, DV_TIMINGS or discrete webcam framesize
will typically reset the crop/compose/fmt.

However, when setting the same input, output, std, etc. this does not happen. E.g.
S_STD(G_STD()) will normally be a nop.

We should look into creating a reset ioctl that can be used to explicitly reset the
pipeline.

In addition (a bit unrelated to the topic) we should look into an ioctl that can be
used to have some control over power usage. E.g., if the last user of the /dev/radioX
device goes away, should the power be turn off or not, or perhaps only after X seconds.

Actions:

- Look in a reset and power control ioctl (Hans)


2) Extend the control framework with Compound Types.

Drop units from the compound types proposal for now, will be added back later as no
agreement has been reached on unit numerical vs. string IDs (and neither is that required
for the first version).

Laurent: Whether a control should be hidden from users isn't really something the kernel
should decide. A new HIDDEN flag might not be a good  solution. A NEXT_COMPOUND flag could
be used instead of NEXT_HIDDEN to solve the enumeration problem (hiding compound controls
from older applications) for compound controls only, but is it even really needed?

Do we need more than two dimensions? Hans: Can be done, but 99% of the cases will be 1 or 2
dimensions, so that's what we should optimize for. Adding support for more than 2 dimensions
would require passing an arbitrary number of sizes (one per dimension) to the query control
API. That would require adding a pointer to struct v4l2_query_ext_ctrl. Hans: possible to do,
but a PITA. Laurent has hardware that needs 3 dimensions.

Proposed implementation: Simplify 1D and 2D, allows >2D.
   
    __u32 dimensions;
    union {
        struct {
            __u32 cols;
            __u32 rows;
        };
        __u32 *sizes;
    };

Just using a pointer might not be too difficult though. Hans would like to play with it, if
it turns out to be not too complex to implement for applications we might just use that.

Laurent: What about supporting querying multiple controls in one ioctl call? The ext get/set
API allows it, it might be nice for consistency. Hans didn't see a need for it since you
typically enumerate controls only once.

Actions Hans:

- Drop unit string
- Drop HIDDEN flag, replace NEXT_HIDDEN by NEXT_COMPOUND
- Investigate multi-dimensional data structs


3) Patch Merging Process

Some proposals:
   
- Merge to "devel" branch rather than master branch during critical development
  periods (merge windows, etc)
   
- Encourage earlier pull request submission to that review can happen before
  the last opportunity, allowing time to make changes if needed according to
  feedback from review
   
- Add 'ATTN' inside pull request subject line tp indicate that Mauro's (or some
  other maintainer's) attention is required. Should be limited to api changes,
  dependencies.
   
- Push for the creation of a DT submaintainer for v4l, to review & aid in the
  process of getting DT changes merged - possible proposal for upcoming LKS.
   
- Patches that modify DT bindings should include the term, "DT" or "Devicetree"
  in the patch subject.

Changes merged in the fixes branch are only applied to master when the next kernel
version is released and merged in master. This causes potential conflicts in the
master branch. Merged -rc back in master automatically won't be done, but when
needed developers can contact Mauro to request merging of specific fixes back in
master on a case-by-case basis.

Submaintainers need to send regular pull requests (around once per week) instead
of waiting for the end of the merge window.


4) Linux media power management

One driver, the attach point, loads extensions. The main driver has to make sure that
all functions are suspended and resumed properly.

After resume, multiple extensions might access the tuner at the same time, causing
many problems: i2c gates, i2c bus speed setup, etc.

What to do if a platform v4l/dvb device depends on a completely separate other device
(e.g. i2c bus)? There is currently no way of describing dependencies across subsystems.

early_resume() could be used to setup buses etc. before the rest of the resume
process will continue.

High-level PM code for the DVB case is probably needed.

The proposal was to add token support to drivers/base to coordinate who has a 'token'
(i.e. resource ownership). However, concerns were raised that putting this in drivers/base
would making upstreaming more difficult and it was not clear whether making this a
generic mechanism was actually the right thing to do. Too early to tell, let's make
it work for two or more hybrid devices first to get more experience.

i2c_mux_adapter can be used to implement i2c gates, thus simplifying driver code.

There is one special case where a i2c device has a mux that selects between two i2c
buses (one slow, one fast), and which bus is used is selected by the driver.

It's not clear whether i2c_mux_adapter can be used to model that as well.

Actions (Shuah):

- Make it work first for two or more hybrid devices, and go from there.


5) Configuration stores

Use cases:

    - The Renesas VSP1 supports configuring the device automatically from a "command"
      buffer that describes a complete configuration, instead of writing to registers individually.
    - Switch between hardware shadow registers (register banks available in camera sensors)
    - MFC hardware codec (Exynos SoC) has configuration options that can be changed on
      a per frame basis (e.g. forcing a particular QP for a frame, forcing a particular frame type).
    - Android libcamera 3 (under development, not used yet) mandates per-frame configurations
      (and per-frame status)

Sakari: To be the most useful for the user space in the context of cameras in embedded systems,
we should provide complete functionality, including sensor and ISP configuration. Syncing the
two is a problem on its own. As the hardware doesn't support this there's room for errors
if timing goes wrong.

How do we solve this problem without impacting drivers and applications?

Possible implementation: use the control framework with configuration stores. We will need to
define the exact semantics of many small details (e.g. how does this interact with control events?).

The main questions are:

- Is the proposed implementation (using the control framework for configuration stores)
  acceptable?

  The consensus was that leveraging the control framework makes a lot of sense since it already
  provides 90% of what is needed to support this. Doing it outside of the control framework
  would duplicate what is already there.

- Most of the per-frame configuration settings are controls, but not all. E.g. some are ioctls
  like S_INPUT. Should controls be made for these and should applications actually have to use those
  controls to set the input in a config store, or should a more transaction-like concept be used:

    start configuration store
    ioctl calls to set config store
    apply changes to config store

  Sakari: how about configuration passed using private IOCTLs? Much of this may be something that
  could change on per-frame basis.

  No real conclusion was reached, but Hans will look into experimenting with a transaction-based
  approach.

- How should the number of configuration stores be determined? By the kernel or should userspace
  be able to set it?

  Maximum number of configuration stores could be equal to the maximum number of buffers. This is
  32, which easily maps to a bitmap. Stores should be allocated explicitly, either in one go
  (similar to REQBUFS) or on demand (similar to CREATE_BUFS). Use cases are not clear at the moment.

  Sakari: the maximum number of buffers isn't part of the user space API and hopefully won't be. At
  the very least it mustn't be kept as low as 32.

  Allowing userspace to set this someone seemed to be the preferred approach.

- (Somewhat unrelated) Adding crop/compose selection controls to allow for atomic setting
  of crop and compose rectangles and to allow for multi-selection (multiple crop and compose
  rectangles). Currently the selection API does not allow for this, and attempts to extend
  the API made it very messy and where never accepted. The compound type additions to the
  control framework would make this quite easy to do.

  After some discussion selection controls are grumpily accepted.

For testing/reference hardware Laurent proposed the vsp1 driver where these features
are needed.

If you have multiple video nodes feeding video to a hardware block (e.g. a composer), then
the format for each video can be different depending on the configuration store. This
means that those formats and the config store have to be validated together: either by
adding support for that in vb2 or requiring that all buffers provide the same config store ID.

The media controller API will need to be extended to support configuration stores
for links. This would be an opportunity to support setting up multiple links in one go.
The configuration store creation/deletion API could also be implemented at the MC level
instead of in a specific V4L2 node.


6) DVB Demux Improvements

- must add mmapped stream & dmabuf support, currently DVB only supports read() - bad!
- propose to wrap packets within a structure containing timestamps before mmap
  delivery - read() remains the same, this will aid in seeking encrypted streams
- currently the kernel demux only allows us to filter one section per pid per
  file descriptor - we would like to remove this limit
- in the case of a hardware demux, we would like to be able to service multiple
  frontends in a single demux - currently this is not possible.
- we'd like to extend it such that the same file descriptor can handle more
  than one section / pid filter
- use videobuf2 post-demux for delivery?
- ultimately, we should use the media controller to aid in pipeline connections

The consensus was that all these proposed additions were useful. For the mmap and
dmabuf support vb2 should be used internally, this might need some work to make
vb2 less v4l2 specific.


7) of-graph helpers

- of-graph; generalized v4l2 DT bindings (valid for v4l2/drm)
- Currently both A -> B and B -> A are supplied: not everyone likes that
  (slight duplication of information)
- What is correct to do for new devices? Ongoing discussion.

Russell King's framework: component fw (similar to v4l2-async), currently in mainline.
The current implementation is complex to use, but patches exist to clean that up, all
good stuff.

However, it has no partial binding support (no callbacks when each module appears).
This is used in several drivers today (soc-camera, davinci, exynos4-is).

Need a solution for this if we want to use Russell's work.

Yet another implementation: [RFC PATCH 0/4] drivers/base: Generic framework for
tracking internal interfaces

Actions:

- Figure out if the drivers that implement partial binding support really need it?
- If so, then a solution needs to be found if we want to use Russell's framework.
- Check out the 'tracking internal interfaces' patch series.


8) vivi rewrite demo

Very well received. Hans wanted to know if the rewritten vivi driver could just replace
the current one, or if incremental patches were needed. There were no objections to just
replacing it.

One comment was made that instead of having a TV channel every 10 MHz one of the frequency
tables should be used instead as being more realistic. Hans will look into this.

==================================================================================

All in all it was a very productive mini-summit. I would like to thank all attendees
and the Linux Foundation for providing a room for us to use.

Regards,

    Hans Verkuil

2014-04-15

Naked hardware #15: PCTV tripleStick (292e)

PCTV tripleStick (292e) teardown

PCTV tripleStick (292e)

tripleStick is the latest DVB-T/T2/C stick from PCTV Systems, successor of the old good PCTV nanoStick T2 (290e). It has a little bit better features compared to old nanoStick T2 as nanoStick T2 didn't support officially DVB-C at all, only DVB-T and DVB-T2. Case is just similar and it is hard to distinguish visually between nanoStick T2 and tripleStick. Only differences seems to be colored logo on upper-side and model number (290e vs. 292e) on backside.

That device appeared to market beginning of this year, during January 2014 or so. It replaced rather quickly old nanoStick T2. If you now order nanoStick T2 you will likely get tripleStick as a replacement. nanoStick T2 has been very popular stick among the Linux users as it have been basically the only one DVB-T2 capable stick which works out of the box (I made its driver for Kernel 3.0). My initial plan was not write driver for tripleStick, but I changed my mind after large amount of feedback from users who has ordered old well supported nanoStick T2, but got non-working tripleStick instead. So, I decided to give a try for reverse-engineering that Silicon Labs DTV chipset open.

PCTV Systems has assigned USB ID 2013:025f for that device. Windows driver knows also USB ID 2013:025b for 291e. According to Windows driver tripleStick, 292e, seems to be just renamed 291e for the reason or the other. Stick PCB also has model number 291e printed.

PCTV 292e (291e)

Initial Linux support will go the Kernel 3.16 if nothing unexpected happens.


Key components:
Empia EM28178
Silicon Labs Si2168
Silicon Labs Si2157

Hardware internals

That device is build to two PCBs, which are attached together like a sandwitch. It is somehow popular construction only for PCTV Systems and Hauppauge devices. Earlier, Pinnacle also used that kind of sandwich construction, maybe its backgrounds are from there, dunno (PCTV Systems was Pinnacle).

USB bridge / main PCB


Main PCB

That is top side of main PCB. Biggest chip clearly visible is EM28178.

PCB printings:
291e Main
2030000-02 LF
pctv systems

Empia  EM28178

Empia EM28178
EM28178 is USB-bridge, maybe the latest version from Empia EM28xx family. Clock source is crystal (it should be 12 MHz) which is located on same PCB, but bottom side, between the "sandwich".

Regulator?

regulator?
There is another 10 pin chip too, located right side of EM28178. Unfortunately that chip printings are too unclear and I cannot guess what it is. It cannot be LNA as RF parts are located on another PCB. Maybe some regulator? 

Serial eeprom

eeprom I2C bus wires
I2C serial eeprom is located on main PCB, but it is bottom side - between the PCBs. I2C bus wires from EM28178 to eeprom are clearly visible. It is those two long wires going from chip to right on picture and ending right side of "PCTV" text. I2C bus itself goes through PCB directly to eeprom located just other side of PCB. Copper pads are debug pins, attach your sniffer there :) It is not possible sniff demodulator and tuner from that point because only eeprom is connected to this bus. EM28178 has 2 I2C bus. First bus is for eeprom and all the rest are on second bus. However, attaching sniffer to second I2C bus is even more easier as that bus is routed to another PCB via those soldered pin headers.

serial eeprom

Demodulator and tuner / tuner PCB


Tuner PCB
That PCB is practically dedicated for RF parts "tuner". Demodulator, RF tuner and LNA are all here.


PCB printings:
291e Tuner
20300001-02 LF
pctv systems


Silicon Labs Si2157 & Silicon Labs Si2168


Silicon Labs Si2157 & Silicon Labs Si2168
Chip "215730" seen on picture is Silicon Labs Si2157 RF tuner. Metal box, just upper-side of chip, is crystal which offers 24 MHz reference clock. I2C bus is coming through the Si2168 demodulator, chip on the right side. Si2157 is very modern RF tuner which runs firmware and has has a DSP for digital filtering (and more?). Both of those are very uncommon choices for current silicon RF tuners. I can remember only Xceive tuners having firmware before that. DSP is even more uncommon...

Biggest chip, Si2168, is DVB-T/T2/C demodulator from Silicon Labs. It is the most popular DVB-T2 capable demodulator used for PC TV receivers currently. Demodulator supports also T2-Lite profile (DVB-T2 extension) which is aimed mainly for mobile transmissions, mobile TV and radio.

There is no own crystal for Si2168 (or it is hiding another side of PCB), which means clock is feed via Si2157, saving few components. Demodulator offers gated I2C bus for Si2157 RF tuner, as norm is nowadays. TS interface pins are located mostly left side of the chip. Surprisingly it looks like TS is connected using parallel connection...

Metal box right side of  Si2168 is remote controller receiver (IR RX). Weird looking IR component, though. It is connected to EM28178 which decodes IR key codes.

Low-noise amplifier


602
That chip must be LNA as it is clearly middle of the RF signal path, between antenna connector and RF tuner. Specifications unknown, labeled as 602. LNAs are usually controlled over GPIO line. Wired to EM28178 GPIO?


Linux driver

There was existing driver for EM28178 USB-bridge, but no driver for Si2168 nor Si2157. Fortunately both Si2168 and Si2157 provided very high level firmware API for device control. That makes protocol reverse-engineering pretty easy.

Current driver supports only minimal set of features in order to receive DVB-T/T2/C. There is no signal statistics implemented at all. Power management is also broken, it leaves device full active when device is closed, as it should set tuner and demod sleep. Broken PM is actually Windows driver bug - it is hard reverse-engineer it bug free when sniffs from Windows are already broken. All-in-all, it eats ("only") 210mA from USB when idle and Windows does not behave any better.

Driver can be found from that development tree:
http://git.linuxtv.org/cgit.cgi/anttip/media_tree.git/log/?h=pctv_292e


Si2168 needs firmware, which I named as dvb-demod-si2168-01.fw. Firmware size is only 2720 bytes, meaning it cannot be whole firmware, but a kind of the partial patch.
Firmware can be extracted from the bundled driver CD version 6.4.8.984.

file:
/TVC 6.4.8/Driver/PCTV Empia/emOEM.sys

extract:
dd if=emOEM.sys ibs=1 skip=1089416 count=2720 of=dvb-demod-si2168-01.fw

verify checksum:
md5sum dvb-demod-si2168-01.fw
87c317e0b75ad49c2f2cbf35572a8093  dvb-demod-si2168-01.fw

Reverse-engineering scripts I used to parse I2C demod and tuner I2C traffic are available here. There is also few already parsed sniffs to look example and compare things. These are surely very helpful if you are adding new features or support for new chip revisions / versions.

USB interface

IDLE current drain without a driver: 68 mA



Pictures