aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-05-06media: v4l2-dev/ioctl: Add V4L2_CAP_IO_MCNiklas Söderlund2-10/+72
Add a video device capability flag to indicate that its inputs and/or outputs are controlled by the Media Controller instead of the V4L2 API. When this flag is set, ioctl for enum inputs and outputs are automatically enabled and programmed to call a helper function. Suggested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: cec: silence shift wrapping warning in __cec_s_log_addrs()Dan Carpenter1-4/+4
The log_addrs->log_addr_type[i] value is a u8 which is controlled by the user and comes from the ioctl. If it's over 31 then that results in undefined behavior (shift wrapping) and that leads to a Smatch static checker warning. We already cap the value later so we can silence the warning just by re-ordering the existing checks. I think the UBSan checker will also catch this bug at runtime and generate a warning. But otherwise the bug is harmless. Fixes: 9881fe0ca187 ("[media] cec: add HDMI CEC framework (adapter)") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: sun8i: Fix an error handling path in 'deinterlace_runtime_resume()'Christophe JAILLET1-3/+3
It is spurious to call 'clk_disable_unprepare()' when 'clk_prepare_enable()' has not been called yet. Re-order the error handling path to avoid it. Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: err_exlusive_rate -> err_exclusive_rate] Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: vimc: deb: Add support for {RGB,BGR,GBR}888 bus formats on source padNícolas F. R. A. Prado1-17/+54
Add support for RGB888_*, BGR888_* and GBR888_* media bus formats on the source pad of debayer subdevices. Acked-by: Helen Koike <helen.koike@collabora.com> Co-developed-by: Vitor Massaru Iha <vitor@massaru.org> Signed-off-by: Vitor Massaru Iha <vitor@massaru.org> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: vimc: Add missing {RGB,BGR,GBR}888 media bus codesNícolas F. R. A. Prado2-3/+15
Add missing RGB888_*, BGR888_* and GBR888_* media bus codes in the vimc_pix_map_list. Since there is no GBR24 pixelformat, use the RGB24 pixelformat for MEDIA_BUS_FMT_GBR888_1X24. Acked-by: Helen Koike <helen.koike@collabora.com> Co-developed-by: Vitor Massaru Iha <vitor@massaru.org> Signed-off-by: Vitor Massaru Iha <vitor@massaru.org> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: vimc: Support multiple media bus codes for each pixelformatNícolas F. R. A. Prado4-32/+68
Change vimc_pix_map_list to allow multiple media bus codes to map to the same pixelformat, making it possible to add media bus codes for which there are no pixelformat. Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: fix sparse warning: const u32 -> u32] Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: ti-vpe: avoid gcc-9 warningArnd Bergmann1-25/+21
gcc warns about empty array declarations, which we get in this driver when compile-testing without CONFIG_OF: drivers/media/platform/ti-vpe/cal.c:2194:34: warning: array 'cal_of_match' assumed to have one element 2194 | static const struct of_device_id cal_of_match[]; Since all users of this driver do need CONFIG_OF anyway, there is no point in making the array definition conditional to save space, so just remove the #ifdef and move the array up a little. Fixes: 343e89a792a5 ("[media] media: ti-vpe: Add CAL v4l2 camera capture driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: cx231xx: Remove unneeded semicolonZou Wei1-1/+1
Fixes coccicheck warnings: drivers/media/usb/cx231xx/cx231xx-avcore.c:610:3-4: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: rcar-csi2: Fix comment of VCDT/VCDT2 registerKoji Matsuoka1-2/+2
According to latest H/W manual v1.50, the description of channel number in the VCDT/VCDT2 register is decremented by one. Therefore, this patch fixes it about comment. Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: venc,vdec: Return EBUSY on S_FMT while streamingStanimir Varbanov2-0/+16
According to the v4l spec s_fmt must return EBUSY while the particular queue is streaming. Add such check in encoder and decoder s_fmt methods. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: Mark last capture bufferStanimir Varbanov5-11/+54
According to stateful Codec API the decoder will process all remaining buffers from before the source change event in dynamic-resolution-change state and mark the last buffer with V4L2_BUF_FLAG_LAST. In Venus case the firmware doesn't mark that last buffer and some mechanism have to be created in v4l decoder driver. Fortunately the firmware interface (HFI) claims that the decoder output buffers will be returned to v4l decoder driver before it send the insufficient event. In order to do that we save last queued in the driver capture buffer in the event_notify and issue flush on output firmware buffers queue. Once the saved buffer is returned (as a result of flush command) we mark it as LAST. For all that possible we extend HFI flush command with one more argument and one more flush_done HFI driver callback. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: vdec: Init registered list unconditionallyStanimir Varbanov1-2/+3
Presently the list initialization is done only in dynamic-resolution-change state, which leads to list corruptions and use-after-free. Init list_head unconditionally in vdec_stop_capture called by vb2 stop_streaming without takeing into account current codec state. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: vdec: Mark flushed buffers with error stateStanimir Varbanov1-0/+3
Once the hfi_session_flush is issued by the vdec all queued buffers to firmware should be returned to the v4l driver. Some of those buffers are not processed at the time of flush command, those buffers has filled len zero (no data). Catch that in buffer_done callback and mark not filled capture buffers with error state so that client can discard them. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: helpers: Done buffers per queue typeStanimir Varbanov4-11/+16
Currently calling venus_helper_buffers_done() will return buffers to user for both capture and output queues in the same call. This is wrong because both queues are really separate and calling stop_streaming on one queue shouldn't return buffers for the other. Solve this by add a new queue type argument and fix the clients of the helper function. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: core: Constify codec frequency data arrayStanimir Varbanov1-1/+1
The array is not changed in the code, so make it const. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: core: Fix mutex destroy in removeStanimir Varbanov1-1/+2
The hfi_destroy function is called too early in remove method. It destroys a mutex which is used later in the .remove from pmruntime. Solve the issue by moving hfi_destroy after last usage of the mutex. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-05media: venus: core: Add missing mutex destroyStanimir Varbanov1-0/+1
This adds missing mutex_destroy in remove method of venus core driver. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-29media: cec-gpio: handle gpiod_get_value errors correctlyHans Verkuil1-7/+11
gpiod_get_value() can return negative values if an error occurs. In several places this error code was ignored. Ensure that errors codes are handled correctly throughout the CEC pin framework and CEC pin drivers. The return code of the cec_pin_ops read() callback had to be changed from 'bool' to 'int', which mean the prototype of that callback in the sun4i drm driver also had to be changed. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-29media: vimc: cap: Report a colorspaceNiklas Söderlund4-4/+7
The colorspace reported by a video nodes should not be V4L2_COLORSPACE_DEFAULT. Instead a default colorspace should be picked by the driver if V4L2_COLORSPACE_DEFAULT is given by userspace to {G,S,TRY}_FMT. The colorspace V4L2_COLORSPACE_SRGB is arbitrary chosen as the vimc default format to report as it's used for most webcams. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-29media: si2157: ensure wait_status is initializedSean Young1-1/+4
smatch reports wait_status is uninitialized, because smatch cannot assume the loop body is ever executed. Clarify the code so that wait_status is retrieved at least once. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-29media: rc: no need for decoder state if decoder not enabledSean Young1-0/+22
One struct ir_raw_event_ctrl is allocated per raw IR device; reduce the amount allocated if not all decoders are enabled. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-29media: m88ds3103: error in set_frontend is swallowed and not reportedSean Young1-0/+2
Bail out if registers can not be updated. Addresses-Coverity-ID: 1461655 ("Code maintainability issues") Reported-by: coverity-bot <keescook+coverity-bot@chromium.org> Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod") Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-26bpf: add bpf_ktime_get_boot_ns()Maciej Żenczykowski1-0/+2
On a device like a cellphone which is constantly suspending and resuming CLOCK_MONOTONIC is not particularly useful for keeping track of or reacting to external network events. Instead you want to use CLOCK_BOOTTIME. Hence add bpf_ktime_get_boot_ns() as a mirror of bpf_ktime_get_ns() based around CLOCK_BOOTTIME instead of CLOCK_MONOTONIC. Signed-off-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2020-04-23media: Kconfig: fix some dvb-usb-v2 dependenciesMauro Carvalho Chehab1-4/+4
There are some tuners used by a few pure DVB boards that use internally V4L2 function calls. Due to that, such drivers now depends on v4l2 core support, and can't be auto-selected if !VIDEO_V4L2: WARNING: unmet direct dependencies detected for DVB_RTL2832_SDR Depends on [n]: MEDIA_SUPPORT [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_CORE [=y] && I2C [=y] && I2C_MUX [=y] && VIDEO_V4L2 [=n] && MEDIA_SDR_SUPPORT [=y] && USB [=y] Selected by [y]: - DVB_USB_RTL28XXU [=y] && USB [=y] && MEDIA_SUPPORT [=y] && MEDIA_USB_SUPPORT [=y] && I2C [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_USB_V2 [=y] && I2C_MUX [=y] && MEDIA_SUBDRV_AUTOSELECT [=y] && MEDIA_SDR_SUPPORT [=y] WARNING: unmet direct dependencies detected for MEDIA_TUNER_E4000 Depends on [n]: (MEDIA_ANALOG_TV_SUPPORT [=y] || MEDIA_DIGITAL_TV_SUPPORT [=y] || MEDIA_RADIO_SUPPORT [=y] || MEDIA_SDR_SUPPORT [=y]) && MEDIA_SUPPORT [=y] && I2C [=y] && VIDEO_V4L2 [=n] Selected by [y]: - DVB_USB_RTL28XXU [=y] && USB [=y] && MEDIA_SUPPORT [=y] && MEDIA_USB_SUPPORT [=y] && I2C [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_USB_V2 [=y] && I2C_MUX [=y] && MEDIA_SUBDRV_AUTOSELECT [=y] WARNING: unmet direct dependencies detected for MEDIA_TUNER_FC2580 Depends on [n]: (MEDIA_ANALOG_TV_SUPPORT [=y] || MEDIA_DIGITAL_TV_SUPPORT [=y] || MEDIA_RADIO_SUPPORT [=y] || MEDIA_SDR_SUPPORT [=y]) && MEDIA_SUPPORT [=y] && I2C [=y] && VIDEO_V4L2 [=n] Selected by [y]: - DVB_USB_RTL28XXU [=y] && USB [=y] && MEDIA_SUPPORT [=y] && MEDIA_USB_SUPPORT [=y] && I2C [=y] && MEDIA_DIGITAL_TV_SUPPORT [=y] && DVB_USB_V2 [=y] && I2C_MUX [=y] && MEDIA_SUBDRV_AUTOSELECT [=y] Detected via randconfig builds. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-23media: platform: fix VIA_CAMERA dependenciesMauro Carvalho Chehab1-1/+1
As detected by a randconfig: WARNING: unmet direct dependencies detected for VIDEO_OV7670 Depends on [n]: MEDIA_SUPPORT [=y] && I2C [=y] && VIDEO_V4L2 [=n] Selected by [y]: - VIDEO_VIA_CAMERA [=y] && MEDIA_SUPPORT [=y] && MEDIA_PLATFORM_SUPPORT [=y] && V4L_PLATFORM_DRIVERS [=y] && FB_VIA [=y] There's a missing dependency on VIDEO_V4L2 for VIA_CAMERA. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-23media: tuners: Kconfig: add some missing VIDEO_V4L2 dependenciesMauro Carvalho Chehab1-2/+2
There are three tuners that depend on some functions inside V4L2 core: $ git grep -l -E 'v4l2_[0-9a-zA-Z_]+\(' drivers/media/tuners/ drivers/media/tuners/e4000.c drivers/media/tuners/fc2580.c drivers/media/tuners/msi001.c Make them dependent of VIDEO_V4L2, as otherwise, this would happen: on x86_64: CONFIG_VIDEO_V4L2=m CONFIG_MEDIA_TUNER_E4000=y ld: drivers/media/tuners/e4000.o: in function `e4000_remove': e4000.c:(.text+0x34): undefined reference to `v4l2_ctrl_handler_free' ld: drivers/media/tuners/e4000.o: in function `e4000_probe': e4000.c:(.text+0x16c1): undefined reference to `v4l2_ctrl_handler_init_class' ld: e4000.c:(.text+0x16eb): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1731): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1762): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x178c): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x17d6): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1804): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x182e): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1878): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x18a6): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x18d0): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x191a): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x1948): undefined reference to `v4l2_ctrl_auto_cluster' ld: e4000.c:(.text+0x1972): undefined reference to `v4l2_ctrl_new_std' ld: e4000.c:(.text+0x19a6): undefined reference to `v4l2_ctrl_handler_free' ld: e4000.c:(.text+0x1a2a): undefined reference to `v4l2_i2c_subdev_init' Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-22media: pwc-if: place USB device list on numberical orderMauro Carvalho Chehab1-13/+21
It seems easier to maintain the list if the USB_DEVICE is ordered. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-22media: pwc-if.c: Update comments about each pwc supported modelMauro Carvalho Chehab1-21/+21
The USB_DEVICE() list contain some of the product names, but some are missing, and others are different than the message printed during device detection. Update the comments in order to match what the driver prints. That makes easier to discover what model matches what physical device. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-22media: dvb-usb-v2: use DVB_USB_DEVICE() macroMauro Carvalho Chehab1-15/+10
Instead of using USB_DEVICE() macro directly, use the DVB_USB_DEVICE() one, as other dvb-usb-v2 devices. The usage of the new macro makes cleaner and easier to parse the supported device names in a way that it would be easily parseable to generate cardlists. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-22media: dvb-usb-ids.h: fix an USB PID nameMauro Carvalho Chehab1-1/+1
The USB_PID_ALINK_DTU is a Product ID, not a vendor ID. Fix that. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21Update rmk's email address in various driversRussell King1-1/+1
Globally update my email address in six files scattered through the tree. Acked-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2020-04-21media: coda: add RC enable controlsPhilipp Zabel3-2/+19
Currently the encoder enables the rate control algorithms if the bitrate control is non-zero. Implement the V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE and V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE controls to allow userspace to choose frame-level or macroblock-level rate control updates, or to explicitly disable rate control. Both controls are initially enabled to keep the current behavior. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: v4l2-ctrls: add __v4l2_ctrl_s_ctrl_compound()Hans Verkuil1-5/+5
Rather than creating new compound control helpers for each new type, create one generic function and just create defines on top. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Tested-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: v4l2-ctrls: v4l2_ctrl_g/s_ctrl*(): don't continue when WARN_ONHans Verkuil1-6/+12
If the v4l2_ctrl_g_ctrl*() or __v4l2_ctrl_s_ctrl*() functions are called for the wrong control type then they call WARN_ON since that is a driver error. But they still continue, potentially overwriting data. Change this to return an error (s_ctrl) or 0 (g_ctrl), just to be safe. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: iguanair: rc drivers no longer need to do lockingSean Young1-33/+3
Since commit 4957133fe32f ("media: lirc: improve locking"), drivers do not need to do any of their own locking. During suspend and resume, no processes are running so no locking is needed. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: cx25840: Register labeling, chip specific correctionBrad Love1-20/+20
Remove vbi_regs_offset from a group of registers that are 888 specific, include those registers names. Sources used for reference are 885 and 888 datasheets. Add labels to some undocumented registers. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: lgdt3306a: Add CNR v5 statBrad Love1-0/+14
The CNR is already calculated, so populate DVBv5 CNR stat during read_status. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: si2157: add on-demand rf strength funcBrad Love1-1/+39
Add get_rf_strength callback to get RSSI from the tuner. DVBv5 stat cache is updated. get_rf_strength is called by tuner_core for analog tuners and is also used by some bridge drivers to obtain RSSI directly from the tuner. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: cx231xx: Add i2c device analog tuner supportBrad Love2-19/+101
The boards listed below use i2c device drivers and have tuner_type equal TUNER_ABSENT. This means additional support is required to enable the analog tuning capability, a case statement is used to identify these models. Models with analog tuning enabled: - CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx (tested) - CX231XX_BOARD_HAUPPAUGE_935C (tested) - CX231XX_BOARD_HAUPPAUGE_955Q (tested) - CX231XX_BOARD_HAUPPAUGE_975 (tested) - CX231XX_BOARD_EVROMEDIA_FULL_HYBRID_FULLHD (untested) The EvroMedia model was added, since it uses the si2157 tuner and the board profile claims it has analog inputs. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: cx23885: Add i2c device analog tuner supportBrad Love1-12/+76
Hauppauge QuadHD/1265/5525 boards all use i2c device drivers and have tuner_type equal TUNER_ABSENT. This means additional support is required to enable the analog tuning capability, a case statement is used to identify these models. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: cx23885: Add analog frontend to HVR5525Brad Love3-0/+21
Enables the analog tuning frontend for Hauppauge HVR-5525. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: cx23885: Add analog frontend to 1265_K4Brad Love2-1/+12
Enables the analog tuning frontend for Hauppauge HVR-1265_K4. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: cx23885: Add analog frontend to Hauppauge QuadHDBrad Love3-5/+54
Add analog tuner frontend to 888 Hauppauge QuadHD boards Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: si2157: module debug option to wait on signal lockBrad Love1-3/+43
In some debugging cases it is useful to know how long it took signal lock to happen after tuning. This can help diagnose line issues. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: si2157: Briefly wait for tuning operation to completeBrad Love1-0/+52
To detect errors in the tuning operation, this waits up 40ms for operation completion status. This allows for error detection and prevents issuing additional commands to the tuner before it is finished. Tuning typically completes in 20-30ms. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: si2157: Add analog tuning related functionsBrad Love2-3/+230
Include set_analog_params, get_frequency, and get_bandwidth. Tested with NTSC and PAL standards via ch3/4 generator. Other standards are included, but are untested due to lack of generator. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: si2157: Better check for running tuner in initBrad Love1-8/+7
Getting the Xtal trim property to check if running is less error prone. Reset if_frequency if state is unknown. Replaces the previous "garbage check". Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: si2157: Check error status bit on cmd executeBrad Love1-5/+11
Check error status bit on command execute, if error bit is set return -EAGAIN. Ignore -EAGAIN in probe during device check. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: si2157: Enable tuner status flagsBrad Love1-0/+22
Enable flags to get status of commands sent to the tuner. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: v4l2-core: Add helpers to build the H264 P/B0/B1 reflistsBoris Brezillon3-0/+275
Building those list is a standard procedure described in section '8.2.4 Decoding process for reference picture lists construction' of the H264 specification. We already have 2 drivers needing the same logic (hantro and rkvdec) and I suspect we will soon have more. Let's provide generic helpers to create those lists. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>