Dan Carpenter [Thu, 18 Apr 2013 18:20:40 +0000 (15:20 -0300)]
[media] r820t: precendence bug in r820t_xtal_check()
The test as written is always false. It looks like the intent was to
test that the bit was not set.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Sat, 20 Apr 2013 15:07:16 +0000 (12:07 -0300)]
[media] videodev2.h: Remove the unused old V4L1 buffer types
Those aren't used anywhere for a long time. Drop it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Thu, 25 Apr 2013 13:28:18 +0000 (10:28 -0300)]
Merge branch 'topic/cx25821' into patchwork
* topic/cx25821: (31 commits)
[media] cx25821: remove cx25821-audio-upstream.c from the Makefile
[media] cx25821: replace custom ioctls with write()
[media] cx25821: drop cx25821-video-upstream-ch2.c/h
[media] cx25821: add output format ioctls
[media] cx25821: prepare querycap for output support
[media] cx25821: group all fmt functions together
[media] cx25821: setup output nodes correctly
[media] cx25821: remove references to subdevices that aren't there
[media] cx25821: remove custom ioctls that duplicate v4l2 ioctls
[media] cx25821: g/s/try/enum_fmt related fixes and cleanups
[media] cx25821: switch to v4l2_fh, add event and prio handling
[media] cx25821: replace resource management functions with fh ownership
[media] cx25821: move vidq from cx25821_fh to cx25821_channel
[media] cx25821: remove 'type' field from cx25821_fh
[media] cx25821: use core locking
[media] cx25821: remove unnecessary debug messages
[media] cx25821: remove TRUE/FALSE/STATUS_(UN)SUCCESSFUL defines
[media] cx25821: convert to the control framework
[media] cx25821: embed video_device, clean up some kernel log spam
[media] cx25821: remove bogus dependencies
...
Mauro Carvalho Chehab [Thu, 25 Apr 2013 13:26:43 +0000 (10:26 -0300)]
Merge branch 'topic/si476x' into patchwork
* topic/si476x:
Revert "[media] mfd: Add chip properties handling code for SI476X MFD"
Revert "[media] mfd: Add the main bulk of core driver for SI476x code"
Revert "[media] mfd: Add commands abstraction layer for SI476X MFD"
[media] v4l2: Add a V4L2 driver for SI476X MFD
Mauro Carvalho Chehab [Thu, 25 Apr 2013 13:26:21 +0000 (10:26 -0300)]
Merge branch 'topic/r820t' into patchwork
* 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
...
Geert Uytterhoeven [Wed, 24 Apr 2013 10:36:46 +0000 (07:36 -0300)]
[media] anysee: Grammar s/report the/report to/
[mchehab@redhat.com: Fix a merge conflict]
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Geert Uytterhoeven [Wed, 24 Apr 2013 10:36:45 +0000 (07:36 -0300)]
[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.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Fri, 19 Apr 2013 10:18:01 +0000 (07:18 -0300)]
[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.
Reported-by: Prabhakar lad <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>
Mauro Carvalho Chehab [Wed, 17 Apr 2013 11:22:15 +0000 (08:22 -0300)]
[media] videobuf-dma-contig: remove support for cached mem
videobuf_queue_dma_contig_init_cached() is not used anywhere.
Drop support for it, cleaning up the code a little bit.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.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.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kamil Debski [Thu, 25 Apr 2013 10:21:24 +0000 (07:21 -0300)]
[media] mx2-emmaprp: 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.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kamil Debski [Wed, 24 Apr 2013 13:58:47 +0000 (10:58 -0300)]
[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.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kamil Debski [Wed, 24 Apr 2013 13:50:55 +0000 (10:50 -0300)]
[media] exynos-gsc: 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.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kamil Debski [Wed, 24 Apr 2013 13:38:24 +0000 (10:38 -0300)]
[media] coda: 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.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kamil Debski [Wed, 24 Apr 2013 13:31:05 +0000 (10:31 -0300)]
[media] s5p-mfc: Optimize copy time stamp handling
For the sake of simplicity and readability memcpy was replaced with
assignment.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kamil Debski [Wed, 24 Apr 2013 13:08:02 +0000 (10:08 -0300)]
[media] s5p-jpeg: 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.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kamil Debski [Wed, 24 Apr 2013 12:34:03 +0000 (09:34 -0300)]
[media] s5p-g2d: 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.
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Wed, 24 Apr 2013 16:07:49 +0000 (13:07 -0300)]
[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)
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Tue, 23 Apr 2013 15:40:24 +0000 (12:40 -0300)]
[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.
Reported-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Tue, 23 Apr 2013 14:36:04 +0000 (11:36 -0300)]
[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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Wei Yongjun [Thu, 18 Apr 2013 02:18:19 +0000 (23:18 -0300)]
[media] s5p-mfc: fix error return code in s5p_mfc_probe()
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 17:26:19 +0000 (14:26 -0300)]
[media] exynos4-is: Fix runtime PM handling on fimc-is probe error path
Ensure there is no unbalanced pm_runtime_put().
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 17:18:22 +0000 (14:18 -0300)]
[media] exynos4-is: Change function call order in fimc_is_module_exit()
Due to hardware dependencies (clocks/power domain) the I2C bus
controller needs to be unregistered before fimc-is.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 17:10:02 +0000 (14:10 -0300)]
[media] exynos4-is: Remove debugfs entries properly
Ensure both debugfs: fimc_is directory and the fw_log file
are properly removed in the driver cleanup sequence.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 16:49:23 +0000 (13:49 -0300)]
[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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 16:40:42 +0000 (13:40 -0300)]
[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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 12:05:54 +0000 (09:05 -0300)]
[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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyugmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 12:00:45 +0000 (09:00 -0300)]
[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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 11:55:23 +0000 (08:55 -0300)]
[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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 11:49:54 +0000 (08:49 -0300)]
[media] exynos4-is: Fix initialization of subdev 'flags' field
Ensure the value of struct v4l2_subdev::flags field as set
in v4l2_subdev_init() is preserved when initializing it in
the subdev drivers.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Tue, 16 Apr 2013 16:15:25 +0000 (13:15 -0300)]
[media] exynos4-is: Remove redundant MODULE_DEVICE_TABLE entries
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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Thu, 18 Apr 2013 17:34:05 +0000 (14:34 -0300)]
[media] s5c73m3: Add missing subdev .unregistered callback
This is needed to free any resources requested in
the .registered subdev op.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sylwester Nawrocki [Wed, 17 Apr 2013 18:03:34 +0000 (15:03 -0300)]
[media] s5c73m3: Fix remove() callback to free requested resources
Make sure v4l2_device_unregister_subdev() is called for both:
oif and sensor subdev and both media entities are freed on
driver removal.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sachin Kamat [Tue, 16 Apr 2013 06:02:20 +0000 (03:02 -0300)]
[media] exynos4-is: Convert index variable to signed
index variable is used to check the validity of the data by
testing for negative values. Hence make it signed.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sachin Kamat [Tue, 16 Apr 2013 06:02:19 +0000 (03:02 -0300)]
[media] exynos4-is: Fix potential null pointer dereferencing
If fimc->drv_data is NULL, then fimc->drv_data->num_entities would
cause NULL pointer dereferencing. Hence remove it from print statement.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kevin Baradon [Mon, 22 Apr 2013 19:09:46 +0000 (16:09 -0300)]
[media] media/rc/imon.c: kill urb when send_packet() is interrupted
This avoids:
Apr 12 23:52:16 homeserver kernel: imon:send_packet: task interrupted
Apr 12 23:52:16 homeserver kernel: ------------[ cut here ]------------
Apr 12 23:52:16 homeserver kernel: WARNING: at drivers/usb/core/urb.c:327 usb_submit_urb+0x353/0x370()
Apr 12 23:52:16 homeserver kernel: Hardware name: Unknow
Apr 12 23:52:16 homeserver kernel: URB
f64b6f00 submitted while active
Apr 12 23:52:16 homeserver kernel: Modules linked in:
Apr 12 23:52:16 homeserver kernel: Pid: 3154, comm: LCDd Not tainted 3.8.6-htpc-00005-g9e6fc5e #26
Apr 12 23:52:16 homeserver kernel: Call Trace:
Apr 12 23:52:16 homeserver kernel: [<
c012d778>] ? warn_slowpath_common+0x78/0xb0
Apr 12 23:52:16 homeserver kernel: [<
c04136c3>] ? usb_submit_urb+0x353/0x370
Apr 12 23:52:16 homeserver kernel: [<
c04136c3>] ? usb_submit_urb+0x353/0x370
Apr 12 23:52:16 homeserver kernel: [<
c0447010>] ? imon_ir_change_protocol+0x150/0x150
Apr 12 23:52:16 homeserver kernel: [<
c012d843>] ? warn_slowpath_fmt+0x33/0x40
Apr 12 23:52:16 homeserver kernel: [<
c04136c3>] ? usb_submit_urb+0x353/0x370
Apr 12 23:52:16 homeserver kernel: [<
c0446c67>] ? send_packet+0x97/0x270
Apr 12 23:52:16 homeserver kernel: [<
c0446cfe>] ? send_packet+0x12e/0x270
Apr 12 23:52:16 homeserver kernel: [<
c05c5743>] ? do_nanosleep+0xa3/0xd0
Apr 12 23:52:16 homeserver kernel: [<
c044760e>] ? vfd_write+0xae/0x250
Apr 12 23:52:16 homeserver kernel: [<
c0447560>] ? lcd_write+0x180/0x180
Apr 12 23:52:16 homeserver kernel: [<
c01b2b19>] ? vfs_write+0x89/0x140
Apr 12 23:52:16 homeserver kernel: [<
c01b2dda>] ? sys_write+0x4a/0x90
Apr 12 23:52:16 homeserver kernel: [<
c05c7c45>] ? sysenter_do_call+0x12/0x26
Apr 12 23:52:16 homeserver kernel: ---[ end trace
a0b6f0fcfd2f9a1d ]---
Apr 12 23:52:16 homeserver kernel: imon:send_packet: error submitting urb(-16)
Apr 12 23:52:16 homeserver kernel: imon:vfd_write: send packet #3 failed
Apr 12 23:52:16 homeserver kernel: imon:send_packet: error submitting urb(-16)
Apr 12 23:52:16 homeserver kernel: imon:vfd_write: send packet #0 failed
Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kevin Baradon [Mon, 22 Apr 2013 19:09:45 +0000 (16:09 -0300)]
[media] media/rc/imon.c: do not try to register 2nd intf if 1st intf failed
This bug could be triggered if 1st interface configuration fails:
Apr 8 18:20:30 homeserver kernel: usb 5-1: new low-speed USB device number 2 using ohci_hcd
Apr 8 18:20:30 homeserver kernel: input: iMON Panel, Knob and Mouse(15c2:0036) as /devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/input/input2
Apr 8 18:20:30 homeserver kernel: Registered IR keymap rc-imon-pad
Apr 8 18:20:30 homeserver kernel: input: iMON Remote (15c2:0036) as /devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/rc/rc0/input3
Apr 8 18:20:30 homeserver kernel: rc0: iMON Remote (15c2:0036) as /devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/rc/rc0
Apr 8 18:20:30 homeserver kernel: imon:send_packet: packet tx failed (-32)
Apr 8 18:20:30 homeserver kernel: imon 5-1:1.0: remote input dev register failed
Apr 8 18:20:30 homeserver kernel: imon 5-1:1.0: imon_init_intf0: rc device setup failed
Apr 8 18:20:30 homeserver kernel: imon 5-1:1.0: unable to initialize intf0, err 0
Apr 8 18:20:30 homeserver kernel: imon:imon_probe: failed to initialize context!
Apr 8 18:20:30 homeserver kernel: imon 5-1:1.0: unable to register, err -19
Apr 8 18:20:30 homeserver kernel: BUG: unable to handle kernel NULL pointer dereference at
00000014
Apr 8 18:20:30 homeserver kernel: IP: [<
c05c4e4c>] mutex_lock+0xc/0x30
Apr 8 18:20:30 homeserver kernel: *pde =
00000000
Apr 8 18:20:30 homeserver kernel: Oops: 0002 [#1] PREEMPT SMP
Apr 8 18:20:30 homeserver kernel: Modules linked in:
Apr 8 18:20:30 homeserver kernel: Pid: 367, comm: khubd Not tainted 3.8.3-htpc-00002-g79b1403 #23 Unknow Unknow/RS780-SB700
Apr 8 18:20:30 homeserver kernel: EIP: 0060:[<
c05c4e4c>] EFLAGS:
00010296 CPU: 1
Apr 8 18:20:30 homeserver kernel: EIP is at mutex_lock+0xc/0x30
Apr 8 18:20:30 homeserver kernel: EAX:
00000014 EBX:
00000014 ECX:
00000000 EDX:
f590e480
Apr 8 18:20:30 homeserver kernel: ESI:
f5deac00 EDI:
f590e480 EBP:
f5f3ee00 ESP:
f6577c28
Apr 8 18:20:30 homeserver kernel: DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Apr 8 18:20:30 homeserver kernel: CR0:
8005003b CR2:
00000014 CR3:
0081b000 CR4:
000007d0
Apr 8 18:20:30 homeserver kernel: DR0:
00000000 DR1:
00000000 DR2:
00000000 DR3:
00000000
Apr 8 18:20:30 homeserver kernel: DR6:
ffff0ff0 DR7:
00000400
Apr 8 18:20:30 homeserver kernel: Process khubd (pid: 367, ti=
f6576000 task=
f649ea00 task.ti=
f6576000)
Apr 8 18:20:30 homeserver kernel: Stack:
Apr 8 18:20:30 homeserver kernel:
00000000 f5deac00 c0448de4 f59714c0 f5deac64 c03b8ad2 f6577c90 00000004
Apr 8 18:20:30 homeserver kernel:
f649ea00 c0205142 f6779820 a1ff7f08 f5deac00 00000001 f5f3ee1c 00000014
Apr 8 18:20:30 homeserver kernel:
00000004 00000202 15c20036 c07a03e8 fffee0ca f6795c00 f5f3ee1c f5deac00
Apr 8 18:20:30 homeserver kernel: Call Trace:
Apr 8 18:20:30 homeserver kernel: [<
c0448de4>] ? imon_probe+0x494/0xde0
Apr 8 18:20:30 homeserver kernel: [<
c03b8ad2>] ? rpm_resume+0xb2/0x4f0
Apr 8 18:20:30 homeserver kernel: [<
c0205142>] ? sysfs_addrm_finish+0x12/0x90
Apr 8 18:20:30 homeserver kernel: [<
c04170e9>] ? usb_probe_interface+0x169/0x240
Apr 8 18:20:30 homeserver kernel: [<
c03b0ca0>] ? __driver_attach+0x80/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03b0ca0>] ? __driver_attach+0x80/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03b0a94>] ? driver_probe_device+0x54/0x1e0
Apr 8 18:20:30 homeserver kernel: [<
c0416abe>] ? usb_device_match+0x4e/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03af314>] ? bus_for_each_drv+0x34/0x70
Apr 8 18:20:30 homeserver kernel: [<
c03b0a0b>] ? device_attach+0x7b/0x90
Apr 8 18:20:30 homeserver kernel: [<
c03b0ca0>] ? __driver_attach+0x80/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03b00ff>] ? bus_probe_device+0x5f/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03aeab7>] ? device_add+0x567/0x610
Apr 8 18:20:30 homeserver kernel: [<
c041a7bc>] ? usb_create_ep_devs+0x7c/0xd0
Apr 8 18:20:30 homeserver kernel: [<
c0413837>] ? create_intf_ep_devs+0x47/0x70
Apr 8 18:20:30 homeserver kernel: [<
c04156c4>] ? usb_set_configuration+0x454/0x750
Apr 8 18:20:30 homeserver kernel: [<
c03b0ca0>] ? __driver_attach+0x80/0x80
Apr 8 18:20:30 homeserver kernel: [<
c041de8a>] ? generic_probe+0x2a/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03b0ca0>] ? __driver_attach+0x80/0x80
Apr 8 18:20:30 homeserver kernel: [<
c0205aff>] ? sysfs_create_link+0xf/0x20
Apr 8 18:20:30 homeserver kernel: [<
c04171db>] ? usb_probe_device+0x1b/0x40
Apr 8 18:20:30 homeserver kernel: [<
c03b0a94>] ? driver_probe_device+0x54/0x1e0
Apr 8 18:20:30 homeserver kernel: [<
c03af314>] ? bus_for_each_drv+0x34/0x70
Apr 8 18:20:30 homeserver kernel: [<
c03b0a0b>] ? device_attach+0x7b/0x90
Apr 8 18:20:30 homeserver kernel: [<
c03b0ca0>] ? __driver_attach+0x80/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03b00ff>] ? bus_probe_device+0x5f/0x80
Apr 8 18:20:30 homeserver kernel: [<
c03aeab7>] ? device_add+0x567/0x610
Apr 8 18:20:30 homeserver kernel: [<
c040e6df>] ? usb_new_device+0x12f/0x1e0
Apr 8 18:20:30 homeserver kernel: [<
c040f4d8>] ? hub_thread+0x458/0x1230
Apr 8 18:20:30 homeserver kernel: [<
c015554f>] ? dequeue_task_fair+0x9f/0xc0
Apr 8 18:20:30 homeserver kernel: [<
c0131312>] ? release_task+0x1d2/0x330
Apr 8 18:20:30 homeserver kernel: [<
c01477b0>] ? abort_exclusive_wait+0x90/0x90
Apr 8 18:20:30 homeserver kernel: [<
c040f080>] ? usb_remote_wakeup+0x40/0x40
Apr 8 18:20:30 homeserver kernel: [<
c0146ed2>] ? kthread+0x92/0xa0
Apr 8 18:20:30 homeserver kernel: [<
c05c7877>] ? ret_from_kernel_thread+0x1b/0x28
Apr 8 18:20:30 homeserver kernel: [<
c0146e40>] ? kthread_freezable_should_stop+0x50/0x50
Apr 8 18:20:30 homeserver kernel: Code: 89 04 24 89 f0 e8 05 ff ff ff 8b 5c 24 24 8b 74 24 28 8b 7c 24 2c 8b 6c 24 30 83 c4 34 c3 00 83 ec 08 89 1c 24 89 74 24 04 89 c3 <f0> ff 08 79 05 e8 ca 03 00 00 64 a1 70 d6 80 c0 8b 74 24 04 89
Apr 8 18:20:30 homeserver kernel: EIP: [<
c05c4e4c>] mutex_lock+0xc/0x30 SS:ESP 0068:
f6577c28
Apr 8 18:20:30 homeserver kernel: CR2:
0000000000000014
Apr 8 18:20:30 homeserver kernel: ---[ end trace
df134132c967205c ]---
Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>
Dan Carpenter [Sun, 21 Apr 2013 10:10:03 +0000 (07:10 -0300)]
[media] media: info leak in media_device_enum_entities()
The last part of the "u_ent.name" buffer isn't cleared so it still has
uninitialized stack memory.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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.
Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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.
Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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.
Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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).
Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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.
Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patrick Boettcher [Mon, 22 Apr 2013 15:45:52 +0000 (12:45 -0300)]
[media] dib8000: enhancement
The intend of this patch is to improve the support of the dib8000.
Signed-off-by: Olivier Grenie <olivier.grenie@parrot.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@parrot.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Frank Schaefer [Fri, 19 Apr 2013 20:09:46 +0000 (17:09 -0300)]
[media] em28xx: add a missing le16_to_cpu conversion
commit
61ff5d69 "em28xx: improve em2710/em2820 distinction" missed the
le16_to_cpu conversion of the USB vendor ID.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Ismael Luceno [Thu, 18 Apr 2013 13:56:35 +0000 (10:56 -0300)]
[media] solo6x10: Fix pixelformat accepted/reported by the encoder
The 6010 produces MPEG-4 part 2, while 6110 produces H.264.
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>
Alexey Khoroshilov [Sat, 13 Apr 2013 21:52:04 +0000 (18:52 -0300)]
[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).
[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Ismael Luceno [Fri, 12 Apr 2013 21:28:33 +0000 (18:28 -0300)]
[media] solo6x10: Update the encoder mode on VIDIOC_S_FMT
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dan Carpenter [Wed, 17 Apr 2013 11:18:30 +0000 (08:18 -0300)]
[media] lg2160: dubious one-bit signed bitfield
Sparse complains that these are "dubious one-bit signed bitfields" and
the comment says it was intended to be 1 and 0 instead of -1 and 0.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Thu, 18 Apr 2013 23:53:23 +0000 (20:53 -0300)]
Revert "[media] mfd: Add chip properties handling code for SI476X MFD"
This reverts commit
a118e9c122969a924061b48b6cc6bb73ccc8de4c.
Requested-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Thu, 18 Apr 2013 23:52:33 +0000 (20:52 -0300)]
Revert "[media] mfd: Add the main bulk of core driver for SI476x code"
This reverts commit
b40fe4f67de2c826868f408e03f2ef9fe39d85b9.
Conflicts:
drivers/mfd/si476x-i2c.c
Requested-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Thu, 18 Apr 2013 23:51:00 +0000 (20:51 -0300)]
Revert "[media] mfd: Add commands abstraction layer for SI476X MFD"
This reverts commit
626b67c1ad90b450e0afbd1c277fd81ad64c5539.
Requested-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andrey Smirnov [Thu, 18 Apr 2013 23:46:08 +0000 (20:46 -0300)]
[media] v4l2: Add a V4L2 driver for SI476X MFD
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>
Guennadi Liakhovetski [Tue, 2 Apr 2013 15:28:11 +0000 (12:28 -0300)]
[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.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Wed, 17 Apr 2013 09:07:01 +0000 (06:07 -0300)]
Revert "[media] mfd: Add header files and Kbuild plumbing for SI476x MFD core"
As requested by Samuel Ortiz <sameo@linux.intel.com>, revert
this patch.
This reverts commit
3f8ec5df11aa2ad7402cfb3368532a96b63426a4.
Conflicts:
drivers/mfd/Kconfig
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Wed, 17 Apr 2013 09:05:18 +0000 (06:05 -0300)]
Revert "[media] v4l2: Add a V4L2 driver for SI476X MFD"
As requested by Andrey Smirnov <andrew.smirnov@gmail.com>, revert
this patch.
This reverts commit
30bac9110455402fa8888740c6819dd3daa2666f.
Conflicts:
drivers/media/radio/Kconfig
drivers/media/radio/radio-si476x.c
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 17:27:04 +0000 (14:27 -0300)]
[media] r820t: Don't divide the IF by two
The original Win driver doesn't do; rtl-sdr also disabled that
piece of the code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 19:20:53 +0000 (16:20 -0300)]
[media] r820t: disable auto gain/VGA setting
On field tests, the auto gain routine is not working, nor it is
used by the original driver. Let's comment it for now.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Mon, 15 Apr 2013 22:44:39 +0000 (19:44 -0300)]
[media] rtl2832: Fix IF calculus
Spectrum is inverted. So, we need to invert it when calculating the
value for the IF register
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 18:55:27 +0000 (15:55 -0300)]
[media] r820t: put it into automatic gain mode
Currently, it is putting it on manual mode.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 18:47:53 +0000 (15:47 -0300)]
[media] r820t: Fix hp_cor filter mask
The bit mask was inverted here.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 18:04:54 +0000 (15:04 -0300)]
[media] r820t: fix PLL calculus
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>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 16:25:10 +0000 (13:25 -0300)]
[media] r820t: Don't put it in standby if not initialized yet
r820t_standby() can be called before r820t_init().
If that happens, just do nothing.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 16:22:21 +0000 (13:22 -0300)]
[media] r820t: avoid rewrite all regs when not needed
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Thu, 11 Apr 2013 13:59:12 +0000 (10:59 -0300)]
[media] r820t: Allow disabling IMR callibration
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>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 21:35:17 +0000 (18:35 -0300)]
[media] r820t: add a commented code for GPIO
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>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 18:55:48 +0000 (15:55 -0300)]
[media] r820t: add IMR calibrate code
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>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 18:54:46 +0000 (15:54 -0300)]
[media] r820t: proper initialize the PLL register
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>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 18:48:02 +0000 (15:48 -0300)]
[media] r820t: use usleep_range()
Instead of using msleep(), use sleep_range(), as it provides
a closer sleep time.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 13:53:35 +0000 (10:53 -0300)]
[media] r820t: fix prefix of the r820t_read() function
Just cosmetic changes: all other functions are prefixed
by r820t. Do the same for r820t_read().
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 13:50:50 +0000 (10:50 -0300)]
[media] r820t: split the function that read cached regs
As we'll need to retrieve cached registers, make this
function explicit.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 12:04:03 +0000 (09:04 -0300)]
[media] r820t: better report signal strength
If signal is zero, shows it as a zero, not as 0xff.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 11:51:45 +0000 (08:51 -0300)]
[media] r820t: add support for diplexer
This is part of the original driver, and adding it doesn't hurt,
so add it, to better sync the code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 10:43:10 +0000 (07:43 -0300)]
[media] r820t: Show the read data in the bit-reversed order
As the driver's logic uses the bit-reversed order for read,
use it as well when displaying the debug messages.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 10:33:23 +0000 (07:33 -0300)]
[media] r820t: use the second table for 7MHz
The Realtek Kernel driver uses the second DVB-T 7MHz table instead
of the first one. Use it as well.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 10:08:17 +0000 (07:08 -0300)]
[media] r820t: Invert bits for read ops
On read, the bit order is inverted.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 01:16:52 +0000 (22:16 -0300)]
[media] rtl2832: properly set en_bbin for r820t
DVBT_EN_BBIN should be set on both places where IF is set. So,
move it to a function and call it where needed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Wed, 10 Apr 2013 00:29:40 +0000 (21:29 -0300)]
[media] r820t: use the right IF for the selected TV standard
IF is set at r820t_set_tv_standard(). So, we can't calculate
LO frequency before calling it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Tue, 9 Apr 2013 21:19:50 +0000 (18:19 -0300)]
[media] rtl2832: add code to bind r820t on it
There are some init stuff to be done for each new tuner at the
demod code. Add the code there for r820t.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Tue, 9 Apr 2013 21:46:10 +0000 (18:46 -0300)]
[media] r820t: Fix IF scale
Scale used at get_if_freq and LO freq calculus is Hz.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Sun, 7 Apr 2013 22:47:49 +0000 (19:47 -0300)]
[media] rtl820t: Add a debug msg when PLL gets locked
[ 2255.342797] r820t 3-001a: generic_set_freq: PLL locked on frequency
725476191 Hz, gain=45
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Sun, 7 Apr 2013 22:32:55 +0000 (19:32 -0300)]
[media] r820t: proper lock and set the I2C gate
As this tuner can be used by analog and digital parts of the
driver, be sure that all ops that access the hardware will
be be properly locked.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Sun, 7 Apr 2013 21:57:15 +0000 (18:57 -0300)]
[media] rtl28xxu: use r820t to obtain the signal strength
Now that we can get the strength from r820t, use it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Sun, 7 Apr 2013 21:33:13 +0000 (18:33 -0300)]
[media] r820t: Set gain mode to auto
This tuner works with 2 modes: automatic gain mode and manual
gain mode. Put it into automatic mode, as we currently don't
have any API for manual gain adjustment.
The logic to allow setting the manual mode is there, as it is
just a few extra code. This way, if/when we latter add support
for setting the gain mode, the code is already there.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Sun, 7 Apr 2013 21:12:56 +0000 (18:12 -0300)]
[media] r820t: Give a better estimation of the signal strength
Instead of a binary signal strength measure, use the tuner gain
to obtain a better estimation of the signal strength.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Sat, 6 Apr 2013 12:40:11 +0000 (09:40 -0300)]
[media] rtl28xxu: add support for Rafael Micro r820t
This tuner is used on some rtl2882 dongles. Add it to the driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Fri, 5 Apr 2013 17:35:18 +0000 (14:35 -0300)]
[media] r820t: Add a tuner driver for Rafael Micro R820T silicon tuner
This driver was written from scratch, based on an existing driver
that it is part of rtl-sdr git tree, released under GPLv2:
https://groups.google.com/forum/#!topic/ultra-cheap-sdr/Y3rBEOFtHug
https://github.com/n1gp/gr-baz
http://cgit.osmocom.org/rtl-sdr/plain/src/tuner_r820t.c
(there are also other variants of it out there)
>From what I understood from the threads, the original driver was converted
to userspace from a Realtek tree. I couldn't find the original tree.
However, the original driver look awkward on my eyes. So, I decided to
write a new version from it from the scratch, while trying to reproduce
everything found there.
TODO:
- After locking, the original driver seems to have some routines to
improve reception. This was not implemented here yet.
- RF Gain set/get is not implemented.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Mauro Carvalho Chehab [Tue, 16 Apr 2013 22:56:05 +0000 (19:56 -0300)]
[media] sta2x11_vip: Fix compilation if I2C is not set
From Fengguang Wu <fengguang.wu@intel.com>:
> drivers/media/pci/sta2x11/sta2x11_vip.c: In function 'sta2x11_vip_init_one':
> drivers/media/pci/sta2x11/sta2x11_vip.c:1314:2: error: implicit declaration of function 'i2c_get_adapter' [-Werror=implicit-function-declaration]
> drivers/media/pci/sta2x11/sta2x11_vip.c:1314:15: warning: assignment makes pointer from integer without a cast [enabled by default]
> drivers/media/pci/sta2x11/sta2x11_vip.c:1330:2: error: implicit declaration of function 'i2c_put_adapter' [-Werror=implicit-function-declaration]
And also:
> warning: (STA2X11_VIP) selects VIDEO_ADV7180 which has unmet direct dependencies (MEDIA_SUPPORT && VIDEO_V4L2 && I2C)
> drivers/media/i2c/adv7180.c: In function '__adv7180_status':
> drivers/media/i2c/adv7180.c:194:2: error: implicit declaration of function 'i2c_smbus_read_byte_data' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c: In function 'adv7180_s_routing':
> drivers/media/i2c/adv7180.c:251:2: error: implicit declaration of function 'i2c_smbus_write_byte_data' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c: In function 'adv7180_probe':
> drivers/media/i2c/adv7180.c:551:2: error: implicit declaration of function 'i2c_check_functionality' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c:554:2: error: implicit declaration of function 'i2c_adapter_id' [-Werror=implicit-function-declaration]
> drivers/media/i2c/adv7180.c: At top level:
> drivers/media/i2c/adv7180.c:663:1: warning: data definition has no type or storage class [enabled by default]
> drivers/media/i2c/adv7180.c:663:1: warning: type defaults to 'int' in declaration of 'module_i2c_driver' [-Wimplicit-int]
> drivers/media/i2c/adv7180.c:663:1: warning: parameter names (without types) in function declaration [enabled by default]
> drivers/media/i2c/adv7180.c:649:26: warning: 'adv7180_driver' defined but not used [-Wunused-variable]
This is due to the lack of I2C support:
...
> CONFIG_I2C is not set
...
So, Make sure that sta2x11_vip depends on I2C.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Tue, 16 Apr 2013 22:43:06 +0000 (19:43 -0300)]
[media] it913x: rename its tuner driver to tuner_it913x
There are three drivers with *it913x name on it, and they all
belong to the same device:
a tuner, at it913x.c;
a frontend: it913x-fe.c;
a bridge: it913x.c, renamed to dvb_usb_it913x by the
building system.
This is confusing. Even more confusing are the two .c files with
the same name under different directories, with different contents
and different functions. So, prepend the tuner one.
This also breaks the out-of-tree compilation system.
Reported-by: Frederic Fays <frederic.fays@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
William Steidtmann [Mon, 15 Apr 2013 20:17:11 +0000 (17:17 -0300)]
[media] mceusb: add some missing cmd sizes
Fix mceusb_cmdsize() which returns incorrect datasize=0 for
sub-commands MCE_RSP_GETPORTSTATUS, MCE_RSP_GETWAKESOURCE,
MCE_RSP_EQDEVDETAILS, MCE_RSP_EQEMVER, and MCE_RSP_EQIRNUMPORTS.
While here, change mceusb_cmdsize() name to reflect that it returns
data size not cmd size.
Signed-off-by: William Steidtmann <billstei@hbci.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
David Howells [Tue, 16 Apr 2013 17:26:54 +0000 (14:26 -0300)]
[media] zoran: Don't print proc_dir_entry data in debug [RFC]
Don't print proc_dir_entry data in debug as we're soon to have no direct
access to the contents of the PDE. Print what was put in there instead.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Randy Dunlap [Tue, 16 Apr 2013 14:33:22 +0000 (11:33 -0300)]
[media] staging/media: fix go7007 dependencies and build
VIDEO_GO7007 uses usb interfaces so it should depend on USB.
It also selects CYPRESS_FIRMWARE, which depends on USB.
Fixes build errors and a kconfig warning:
go7007-loader.c:(.text+0xcc7d0): undefined reference to `usb_get_dev'
go7007-loader.c:(.init.text+0x49f0): undefined reference to `usb_register_driver'
go7007-loader.c:(.exit.text+0x17ce): undefined reference to `usb_deregister'
warning: (DVB_USB_AZ6007 && VIDEO_GO7007) selects CYPRESS_FIRMWARE which has unmet direct dependencies (MEDIA_SUPPORT && USB)
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Michal Marek [Tue, 16 Apr 2013 11:06:30 +0000 (08:06 -0300)]
[media] em28xx: Put remaining .vidioc_g_chip_info instance under ADV_DEBUG
Commit cd634f1 ("[media] v4l2: put VIDIOC_DBG_G_CHIP_NAME under
ADV_DEBUG") missed the initializer of radio_ioctl_ops:
drivers/media/usb/em28xx/em28xx-video.c:1830:2: error: unknown field 'vidioc_g_chip_info' specified in initializer
drivers/media/usb/em28xx/em28xx-video.c:1830:26: error: 'vidioc_g_chip_info' undeclared here (not in a function)
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 14 Apr 2013 15:47:57 +0000 (12:47 -0300)]
[media] cx25821: remove cx25821-audio-upstream.c from the Makefile
The audio output is currently not used as this should be rewritten as an
alsa driver. For the time being remove this source from the Makefile.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 14 Apr 2013 15:02:19 +0000 (12:02 -0300)]
[media] cx25821: replace custom ioctls with write()
Ideally this should be implemented with vb2, but it'll do for now.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 14 Apr 2013 15:10:32 +0000 (12:10 -0300)]
[media] cx25821: drop cx25821-video-upstream-ch2.c/h
cx25821-video-upstream_ch2.c/h is practically identical to cx25821-video-upstream.c/h
so add support for ch2 into cx25821-video-upstream.c instead.
After this we can replace the custom ioctls with a proper write() interface.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 14 Apr 2013 14:40:26 +0000 (11:40 -0300)]
[media] cx25821: add output format ioctls
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>