Along the time, several debug messages were added at cx88-cards.
While those are still useful to track some troubles with
tuners, they're too verbose:
[ 5768.281801] cx88[0]: Calling XC2028/3028 callback
[ 5768.287388] cx88[0]: Calling XC2028/3028 callback
[ 5768.292575] cx88[0]: Calling XC2028/3028 callback
[ 5768.299408] cx88[0]: Calling XC2028/3028 callback
[ 5768.306244] cx88[0]: Calling XC2028/3028 callback
...
and, most of the time, useless.
So, disable them, except if core_debug modprobe parameter
is used.
* /home/v4l/v4l/patchwork: (76 commits)
[media] s5c73m3: fix indentation of the help section in Kconfig
[media] cx25821-alsa: get rid of a __must_check warning
[media] cx25821-video: declare cx25821_vidioc_s_std as static
[media] cx25821-video: remove maxw from cx25821_vidioc_try_fmt_vid_cap
[media] r820t: Remove a warning for an unused value
[media] dib0090: Fix a warning at dib0090_set_EFUSE
[media] dib8000: fix a warning
[media] dib8000: Fix sub-channel range
[media] dib8000: store dtv_property_cache in a temp var
[media] dib8000: warning fix: declare internal functions as static
[media] r820t: quiet gcc warning on n_ring
[media] r820t: memory leak in release()
[media] r820t: precendence bug in r820t_xtal_check()
[media] videodev2.h: Remove the unused old V4L1 buffer types
[media] anysee: Grammar s/report the/report to/
[media] anysee: Initialize ret = 0 in anysee_frontend_attach()
[media] media: videobuf2: fix the length check for mmap
[media] em28xx: save isoc endpoint number for DVB only if endpoint has alt settings with xMaxPacketSize != 0
[media] videobuf-dma-contig: remove support for cached mem
[media] mem2mem_testdev: set timestamp_type and add debug param
...
[media] s5c73m3: fix indentation of the help section in Kconfig
The 'help' section of the Kconfig entry for this driver is missing
an extra alignment. That seems to violate what's stated at:
Documentation/kbuild/kconfig-language.txt
Even if it works, the better is to add 2 extra spaces there, as
this is the common practice and helps human reading of the file.
[media] cx25821-alsa: get rid of a __must_check warning
The hole reason for __must_check is to not ignore an error.
However, a "ret" value is used at cx25821 just to avoid the
Kernel compilation to compain about it.
That, however, produces another warning (with W=1):
drivers/media/pci/cx25821/cx25821-alsa.c: In function 'cx25821_audio_fini':
drivers/media/pci/cx25821/cx25821-alsa.c:727:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
With the current implementation of driver_for_each_device() and
cx25821_alsa_exit_callback(), there's actually just one
very unlikely condition where it will currently produce
an error: if driver_find() returns NULL.
Ok, there's not much that can be done, as it is on a driver's
function that returns void, but it can at least print some message
if the error happens.
[media] cx25821-video: declare cx25821_vidioc_s_std as static
Fixes the following warning:
drivers/media/pci/cx25821/cx25821-video.c: At top level:
drivers/media/pci/cx25821/cx25821-video.c:766:5: warning: no previous prototype for 'cx25821_vidioc_s_std' [-Wmissing-prototypes]
[media] cx25821-video: remove maxw from cx25821_vidioc_try_fmt_vid_cap
After cx25821-video cleanup, this var is not used anymore:
drivers/media/pci/cx25821/cx25821-video.c: In function 'cx25821_vidioc_try_fmt_vid_cap':
drivers/media/pci/cx25821/cx25821-video.c:591:15: warning: variable 'maxw' set but not used [-Wunused-but-set-variable]
as the code now checks the max width as the default case for the
range check.
[media] r820t: Remove a warning for an unused value
Currently, the driver complains about the pre_detect var:
drivers/media/tuners/r820t.c: In function 'r820t_sysfreq_sel':
drivers/media/tuners/r820t.c:722:31: warning: variable 'pre_dect' set but not used [-Wunused-but-set-variable]
While rtl8232 code comments it, perhaps some other driver may use.
So, the better is to keep the code there, allowing to enable it
via r820t config data.
[media] dib0090: Fix a warning at dib0090_set_EFUSE
The check if the values for c, h and n are within the range is
always true, as, if one of this values is out of range, the
previous "if" clauses will default to a value within the
range.
That fixes the following warning:
drivers/media/dvb-frontends/dib0090.c: In function 'dib0090_set_EFUSE':
drivers/media/dvb-frontends/dib0090.c:1545:5: warning: comparison is always true due to limited range of data type [-Wtype-limits]
drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_wait_lock':
drivers/media/dvb-frontends/dib8000.c:3972:1: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/media/dvb-frontends/dib8000.c:2419:6: note: 'value' was declared here
isdbt_sb_subchannel is unsigned with 8 bits. So, it will
never be -1. Instead, any value bigger than 13 is invalid.
As is, the current code generates the following warnings:
drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_set_isdbt_common_channel':
drivers/media/dvb-frontends/dib8000.c:2358:3: warning: comparison is always true due to limited range of data type [-Wtype-limits]
drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_tune':
drivers/media/dvb-frontends/dib8000.c:3107:8: warning: comparison is always false due to limited range of data type [-Wtype-limits]
drivers/media/dvb-frontends/dib8000.c:3153:9: warning: comparison is always false due to limited range of data type [-Wtype-limits]
drivers/media/dvb-frontends/dib8000.c:3160:5: warning: comparison is always false
It should also be noticed that ARIB STD-B31, item
"3.15.6.8 Number of segments" at TMCC table defines the
value 15 for unused segment, and 14 as reserved.
So, better to change the check to consider any value
bigger than 13 to mean that sub-channels should be
disabled, fixing the warning and doing the right thing
even if an invalid value is filled by userspace.
[media] dib8000: store dtv_property_cache in a temp var
dtv_property_cache is used on several places on very long lines.
On all places it is used, a long list of struct reference is done.
Instead of doing it, at the routines where it is used more than once,
replace it by one temporary var. That may help the compiler to
use a better code. It also makes easier to review the code, as the
lines becomes closer to 80 columns, making them a way clearer
to read.
[media] dib8000: warning fix: declare internal functions as static
drivers/media/dvb-frontends/dib8000.c:2412:5: warning: no previous prototype for 'dib8000_wait_lock' [-Wmissing-prototypes]
drivers/media/dvb-frontends/dib8000.c:2688:5: warning: no previous prototype for 'dib8000_get_symbol_duration' [-Wmissing-prototypes]
drivers/media/tuners/r820t.c: In function 'r820t_imr':
drivers/media/tuners/r820t.c:1871:8: warning: 'n_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
Mauro: This is a FALSE POSITIVE: the loop will always return a value
for n_ring, as the last test will fill it with 15, if the loop fails.
* topic/r820t: (31 commits)
[media] r820t: Don't divide the IF by two
[media] r820t: disable auto gain/VGA setting
[media] rtl2832: Fix IF calculus
[media] r820t: put it into automatic gain mode
[media] r820t: Fix hp_cor filter mask
[media] r820t: fix PLL calculus
[media] r820t: Don't put it in standby if not initialized yet
[media] r820t: avoid rewrite all regs when not needed
[media] r820t: Allow disabling IMR callibration
[media] r820t: add a commented code for GPIO
[media] r820t: add IMR calibrate code
[media] r820t: proper initialize the PLL register
[media] r820t: use usleep_range()
[media] r820t: fix prefix of the r820t_read() function
[media] r820t: split the function that read cached regs
[media] r820t: better report signal strength
[media] r820t: add support for diplexer
[media] r820t: Show the read data in the bit-reversed order
[media] r820t: use the second table for 7MHz
[media] r820t: Invert bits for read ops
...
[media] anysee: Initialize ret = 0 in anysee_frontend_attach()
drivers/media/usb/dvb-usb-v2/anysee.c: In function ‘anysee_frontend_attach’:
drivers/media/usb/dvb-usb-v2/anysee.c:641: warning: ‘ret’ may be used uninitialized in this function
And gcc is right (see the ANYSEE_HW_507T case), so initialize ret to zero
to fix this.
[media] media: videobuf2: fix the length check for mmap
Memory maps typically require that the buffer size to be page
aligned. Currently, two memops drivers do such alignment
internally, but videobuf-vmalloc doesn't.
Also, the buffer overflow check doesn't take it into account.
So, instead of doing it at each memops driver, enforce it at
VB2 core.
Frank Schaefer [Mon, 8 Apr 2013 16:06:59 +0000 (13:06 -0300)]
[media] em28xx: save isoc endpoint number for DVB only if endpoint has alt settings with xMaxPacketSize != 0
X-Patchwork-Delegate: mchehab@redhat.com
In addition to commit 72cc9ba3 "em28xx: ignore isoc DVB USB endpoints with
wMaxPacketSize = 0 bytes for all alt settings" we should not save the endpoint
number of the isoc DVB endpoint before it has been validated.
While the current code works fine, dev->dvb_ep_isoc != 0 could be interpreted
as indicator that the device provides DVB support.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Wed, 17 Apr 2013 06:04:10 +0000 (03:04 -0300)]
[media] mem2mem_testdev: set timestamp_type and add debug param
While testing v4l2-ctl I noticed that this m2m driver didn't set timestamp_type
and that it spammed the kernel log with debug messages. Set timestamp_type
correctly and add debug module option to enable debug messages.
Since the introduction of the timestamp_type field, it is necessary that
the driver chooses which type it will use. This patch adds support for
the timestamp_type.
[media] m2m-deinterlace: Add copy time stamp handling
Since the introduction of the timestamp_type field, it is necessary that
the driver chooses which type it will use. This patch adds support for
the timestamp_type.
Since the introduction of the timestamp_type field, it is necessary that
the driver chooses which type it will use. This patch adds support for
the timestamp_type.
Since the introduction of the timestamp_type field, it is necessary that
the driver chooses which type it will use. This patch adds support for
the timestamp_type.
Since the introduction of the timestamp_type field, it is necessary that
the driver chooses which type it will use. This patch adds support for
the timestamp_type.
Since the introduction of the timestamp_type field, it is necessary that
the driver chooses which type it will use. This patch adds support for
the timestamp_type.
[media] exynos4-is: Copy timestamps from M2M OUTPUT to CAPTURE buffer queue
Add copying of buffer timestamps and set the timestamp_type to
V4L2_BUF_FLAG_TIMESTAMP_COPY to avoid warnings about UNDEFINED
timestamp type like:
WARNING: at drivers/media/v4l2-core/videobuf2-core.c:2042 vb2_queue_init+0xe0/0x18c()
Modules linked in:
[<c0016ef0>] (unwind_backtrace+0x0/0x13c) from [<c0029b3c>] (warn_slowpath_common+0x54/0x64)
[<c0029b3c>] (warn_slowpath_common+0x54/0x64) from [<c0029b68>] (warn_slowpath_null+0x1c/0x24)
[<c0029b68>] (warn_slowpath_null+0x1c/0x24) from [<c03b7018>] (vb2_queue_init+0xe0/0x18c)
[<c03b7018>] (vb2_queue_init+0xe0/0x18c) from [<c03b4e08>] (v4l2_m2m_ctx_init+0xa0/0xc4)
[<c03b4e08>] (v4l2_m2m_ctx_init+0xa0/0xc4) from [<c03ca6c4>] (fimc_m2m_open+0x130/0x1f8)
[<c03ca6c4>] (fimc_m2m_open+0x130/0x1f8) from [<c03a5dd4>] (v4l2_open+0xac/0xe8)
[<c03a5dd4>] (v4l2_open+0xac/0xe8) from [<c0113920>] (chrdev_open+0x9c/0x158)
[<c0113920>] (chrdev_open+0x9c/0x158) from [<c010e488>] (do_dentry_open+0x1f8/0x280)
[<c010e488>] (do_dentry_open+0x1f8/0x280) from [<c010e600>] (finish_open+0x34/0x50)
[<c010e600>] (finish_open+0x34/0x50) from [<c011cc58>] (do_last+0x5bc/0xc00)
[<c011cc58>] (do_last+0x5bc/0xc00) from [<c011d34c>] (path_openat+0xb0/0x484)
[<c011d34c>] (path_openat+0xb0/0x484) from [<c011d824>] (do_filp_open+0x30/0x84)
[<c011d824>] (do_filp_open+0x30/0x84) from [<c010e0f8>] (do_sys_open+0xe8/0x170)
[<c010e0f8>] (do_sys_open+0xe8/0x170) from [<c000f040>] (ret_fast_syscall+0x0/0x30)
[media] exynos4-is: Fix TRY format propagation at MIPI-CSIS subdev
Ensure TRY format is propagated from the sink to source pad.
The format at both pads is always same so the TRY format buffer
for pad 0 is used to hold format for both pads.
While at it remove redundant fmt->pad checking.
[media] exynos4-is: Fix driver name reported in vidioc_querycap
Originally struct v4l2_capability driver and card name was filled
with name of the platform device. After switching to the device tree
the device names have changed and now are 4 different driver names
reported, depending on the video device opened. So instead of e.g.
"exynos4-fimc" there is now one of: 11800000.fimc, 11810000.fimc, 11820000.fimc, 11830000.fimc.
Fix this by using dev->driver_name, rather than platform device name.
A common vidioc_querycap function is created for both M2M and capture
video node.
This fixes any breakage at user space should any application/library
rely on the driver's name.
[media] exynos4-is: Remove redundant module_put() for MIPI-CSIS module
Currently there is unbalanced module_put() on the s5p-csis module
which prevents it from being unloaded. The subdev's owner module
has reference count decremented in v4l2_device_unregister_subdev()
so just remove this erroneous call.
[media] exynos4-is: Set fimc-lite subdev owner module
The FIMC-LITE.n subdevs have currently sd->owner field not set,
the exynos-fimc-lite module can be removed at any time, regardless
it is in use by other modules. When this module is unloaded the
kernel can crash easily by accessing video or media device nodes.
[media] exynos4-is: Unregister fimc-is subdevs from the media device properly
Add missing v4l2_device_unregister_subdev() call for the FIMC-IS subdevs
(currently there is only the FIMC-IS-ISP subdev) so corresponding resources
are properly freed upon the media device driver module removal.
[media] exynos4-is: Don't overwrite subdevdata in the fimc-is sensor driver
It's an I2C client driver and it must not overwrite the struct v4l2_subdev
dev_priv field, which is used by the v4l2 core to store a pointer to
struct i2c_client.
[media] exynos4-is: Fix regulator/gpio resource releasing on the driver removal
Remove regulator_bulk_free() calls as devm_regulator_bulk_get() function
is used to get the regulators so those will be freed automatically while
the driver is removed.
Missing gpio free is fixed by requesting a gpio with the devm_* API.
All that is done now in the I2C client driver remove() callback is the
media entity cleanup call.
Remove unneeded MODULE_DEVICE_TABLE(of,...) instances from files that
are linked into same module. This fixes following error when building
as a module:
LD [M] drivers/media/platform/exynos4-is/s5p-fimc.o
drivers/media/platform/exynos4-is/fimc-is-sensor.o: In function `.LANCHOR1':
fimc-is-sensor.c:(.rodata+0x48): multiple definition of `__mod_of_device_table'
drivers/media/platform/exynos4-is/fimc-is.o:fimc-is.c:(.rodata+0x174): first defined here
drivers/media/platform/exynos4-is/fimc-is-i2c.o:(.rodata+0x5c): multiple definition of `__mod_of_device_table'
drivers/media/platform/exynos4-is/fimc-is.o:fimc-is.c:(.rodata+0x174): first defined here
make[4]: *** [drivers/media/platform/exynos4-is/exynos-fimc-is.o] Error 1
Also remove exporting fimc_is_(un)register_i2c_driver functions, it
is not needed since these functions should be called only from our
module.
* /home/v4l/v4l/patchwork:
[media] media/rc/imon.c: kill urb when send_packet() is interrupted
[media] media/rc/imon.c: do not try to register 2nd intf if 1st intf failed
[media] imon: Use large delays earlier
[media] media: info leak in media_device_enum_entities()
[media] dib7090p: improve the support of the dib7090 and dib7790
[media] dib7090p: remove the support for the dib7090E
[media] dib8096: enhancement
[media] dib0090: enhancement
[media] dib7000p: enhancement
[media] dib8000: enhancement
[media] em28xx: add a missing le16_to_cpu conversion
[media] solo6x10: Fix pixelformat accepted/reported by the encoder
[media] go7007: dubious one-bit signed bitfields
[media] cx88: Fix unsafe locking in suspend-resume
[media] solo6x10: Update the encoder mode on VIDIOC_S_FMT
[media] lg2160: dubious one-bit signed bitfield
Kevin Baradon [Mon, 22 Apr 2013 19:09:44 +0000 (16:09 -0300)]
[media] imon: Use large delays earlier
send_packet() is used during initialization, before send_packet_delay
is set. So, move ictx->send_packet_delay to happen earlier.
[mchehab@redhat.com: fold two patches into one to make git history clearer] Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Olivier Grenie [Mon, 31 Dec 2012 12:51:17 +0000 (09:51 -0300)]
[media] dib7090p: improve the support of the dib7090 and dib7790
The intend of this patch is to improve the support of the dib7090 and
dib7790. The AGC1 min value is set to 32768 by default. The actual AGC1 min
and the external attenuation are controled depending on the received RF
level.
Olivier Grenie [Mon, 31 Dec 2012 12:47:10 +0000 (09:47 -0300)]
[media] dib7090p: remove the support for the dib7090E
The intend of this patch is to remove the support for the dib7090E. The
DiB7090E-package has never left prototype state and never made it to
mass-prod-state.
Olivier Grenie [Mon, 31 Dec 2012 13:17:44 +0000 (10:17 -0300)]
[media] dib8096: enhancement
The intend of this patch is to improve the support of the dib8096. The PLL
parameters are not automatically computed. The limit to set/unset external
diode for attenuation has been updated. The TFE8096P board is using the
new I2C API.
Olivier Grenie [Mon, 31 Dec 2012 13:38:44 +0000 (10:38 -0300)]
[media] dib0090: enhancement
The intend of this patch is to improve the support of the dib0090 tuner.
The ramp tables have been updated. Also some minor enhancements has been
added (EFUSE and reset).
Olivier Grenie [Mon, 31 Dec 2012 12:23:26 +0000 (09:23 -0300)]
[media] dib7000p: enhancement
The intend of this patch is to improve the support of the dib7000p. It is
now possible to set the minimum value for the AGC1. Also, the driver takes
into account the frequency offset introduced in the tuned frequency.
Dan Carpenter [Wed, 17 Apr 2013 06:20:30 +0000 (03:20 -0300)]
[media] go7007: dubious one-bit signed bitfields
Because they're signed, "is_video" and "is_audio" can be 0 and -1
instead of 0 and 1 as intended. It doesn't cause a bug, but it makes
Sparse complain:
drivers/staging/media/go7007/go7007-priv.h:94:31: error: dubious one-bit signed bitfield
drivers/staging/media/go7007/go7007-priv.h:95:31: error: dubious one-bit signed bitfield
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx88: Fix unsafe locking in suspend-resume
Legacy PCI suspend-resume handlers are called with interrupts enabled.
But cx8800_suspend/cx8800_resume and
cx8802_suspend_common/cx8802_resume_common use spin_lock/spin_unlock
functions to acquire dev->slock, while the same lock is acquired in the
corresponding irq-handlers: cx8800_irq and cx8802_irq.
That means a deadlock is possible if an interrupt happens while suspend
or resume owns the lock. The patch replaces spin_lock/spin_unlock with
spin_lock_irqsave/spin_unlock_irqrestore.
Found by Linux Driver Verification project (linuxtesting.org).
This commit adds a driver that exposes all the radio related
functionality of the Si476x series of chips via the V4L2 subsystem.
[mchehab@redhat.com: change it to depends on MFD_SI476X_CORE instead of
selecting it; vidioc_s_register now uses const struct] Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] DT: export of_get_next_parent() for use by modules: fix modular V4L2
Currently modular V4L2 build with enabled OF is broken dur to the
of_get_next_parent() function being unavailable to modules. Export it to
fix the build.
Merge branch 'topic/r820t' of /home/v4l/v4l/patchwork
* 'topic/r820t' of /home/v4l/v4l/patchwork: (31 commits)
[media] r820t: Don't divide the IF by two
[media] r820t: disable auto gain/VGA setting
[media] rtl2832: Fix IF calculus
[media] r820t: put it into automatic gain mode
[media] r820t: Fix hp_cor filter mask
[media] r820t: fix PLL calculus
[media] r820t: Don't put it in standby if not initialized yet
[media] r820t: avoid rewrite all regs when not needed
[media] r820t: Allow disabling IMR callibration
[media] r820t: add a commented code for GPIO
[media] r820t: add IMR calibrate code
[media] r820t: proper initialize the PLL register
[media] r820t: use usleep_range()
[media] r820t: fix prefix of the r820t_read() function
[media] r820t: split the function that read cached regs
[media] r820t: better report signal strength
[media] r820t: add support for diplexer
[media] r820t: Show the read data in the bit-reversed order
[media] r820t: use the second table for 7MHz
[media] r820t: Invert bits for read ops
...
There are a few errors at the PLL calculus, causing the device
to use wrong values.
While here, change the calculus to use 32 bits, as there's no
need for 64 bits there.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Antti Palosaari <crope@iki.fi>
The rtl-sdr library disabled IMR callibration. While I'm not sure
yet why, it could be a good idea to add a modprobe parameter here,
to allow to also disable it. There are two rationale behind it:
- It helps to compare USB dumps between rtl-sdr and the Kernel module;
- If rtl-sdr disabled it, perhaps there's a good reason (e. g. it
might not be actually working, or it might be causing some trouble).
For both cases, it seems useful to add a modprobe parameter to allow
testing the device with both configurations.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Antti Palosaari <crope@iki.fi>
Add the code to set the GPIO for this tuner. This code is
currently unused, so it is kept there only for completeness.
With this patch there are just two things that got left from
the original driver:
- At standby, there's another mode, not used by rtl2832u.
Not sure if it might be needed in the future, but I suspect
it is not used at all;
- There is a "fast tune" mode. As nor DVB or V4L API supports
it, it seems an overkill to implement it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Antti Palosaari <crope@iki.fi>
This code seems to calibrate I/Q phase and gain during the
device initialization.
This is done only once, and it doesn't seem to be needed to
happen after resuming.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Antti Palosaari <crope@iki.fi>
The rtl-sdr library, from where this driver was initially
based, doesn't use half PLL clock, but this is used on
the Realtek Kernel driver. So, also do the same here.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Antti Palosaari <crope@iki.fi>