David Cohen [Wed, 8 Dec 2010 12:13:59 +0000 (09:13 -0300)]
[media] ov9640: fix OmniVision OV9640 sensor driver's priv data retrieving
OmniVision OV9640 driver wasn't requesting properly its private data
on I2C remove and video_probe functions. It was retrieving the V4L2
subdev struct address instead of priv struct's one. This patch fixes
such problem.
drivers/media/video/ivtv/ivtv-i2c.c:170: warning: cast from pointer to integer of different size
drivers/media/video/ivtv/ivtv-i2c.c:171: warning: cast from pointer to integer of different size
$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
They seem bogus, but, as the original code also has problems with
LE/BE, just change its implementation to be clear.
Andy Walls [Wed, 29 Dec 2010 01:49:50 +0000 (22:49 -0300)]
[media] lirc_zilog: Remove use of deprecated struct i2c_adapter.id field
Remove use of deprecated struct i2c_adapter.id field. In the process,
perform different detection of the HD PVR's Z8 IR microcontroller versus
the other Hauppauge cards with the Z8 IR microcontroller.
Also added a comment about probe() function behavior that needs to be
fixed.
Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Wed, 29 Dec 2010 01:46:13 +0000 (22:46 -0300)]
[media] hdpvr: Add I2C and ir-kdb-i2c registration of the Zilog Z8 IR chip
Adds I2C registration of the Zilog Z8F0811 IR microcontroller for either
lirc_zilog or ir-kbd-i2c to use. This is a required step in removing
lirc_zilog's use of the deprecated struct i2c_adapter.id field.
Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This driver duplicates the same functionality found at ir-kbd-i2c.
There were a few missing key parsers that were added by the previous
patches. The only thing left on lirc_i2c driver is the IR parsing
for Asus TV-Box and Creative/VisionTek BreakOut-Box.
Those devices use pcf8574 chip for IR.
They are old video adapters with TV tuners. Their code were never
merged upstream, and they are not chipped anymore. So, it is very
unlikely that someone would have interests on porting them to the
Linux Kernel.
Due to that, let's remove lirc_i2c, as all the remaining functionality
are already mapped via ir-kbd-i2c.
Currently, lirc-i2c has a decoding logic for Leadtek Remote
Control. Move it to cx88, as we intend to remove lirc-i2c.
For now, initialize LIRC remote keytable with RC_MAP_EMPTY, as
we don't know its keymap yet. It would be nice to later check
if is there any file on LIRC userspace with that keytable.
When comparing lirc-i2c and ir-kbd-i2c/bttv-input logic, a difference
was noticed. As lirc-i2c will be removed soon, store the difference on
a comment inside ir-kbd-i2c, in order to preserve the knowledge we
have about that remote controller.
Hans Verkuil [Wed, 29 Dec 2010 17:38:44 +0000 (14:38 -0300)]
[media] timblogiw: fix compile warning
Fix 64-bit compile warning:
drivers/media/video/timblogiw.c: In function ‘timblogiw_dma_filter_fn’:
drivers/media/video/timblogiw.c:151: warning: cast from pointer to integer of different size
drivers/media/video/timblogiw.c: In function ‘timblogiw_open’:
drivers/media/video/timblogiw.c:670: warning: cast to pointer from integer of different size
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Cc: Richard Rojförs <richard.rojfors@pelagicore.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Wed, 29 Dec 2010 17:29:55 +0000 (14:29 -0300)]
[media] v4l: fix handling of v4l2_input.capabilities
The v4l core sets the v4l2_input.capabilities field based on the supplied
v4l2_ioctl_ops. However, several drivers do a memset or memcpy of the v4l2_input
struct, thus overwriting that field incorrectly.
Either remove the memset (which is already done by the v4l core), or add the
proper capabilities field in case of a memcpy.
The same is also true for v4l2_output, but that only affected the ivtv driver.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Wed, 29 Dec 2010 17:25:52 +0000 (14:25 -0300)]
[media] v4l2-ctrls: use const char * const * for the menu arrays
This prevents checkpatch warnings generated when defining
'static const char *foo[]' arrays. It makes sense to use
const char * const * anyway since the pointers in the array
are indeed const.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Mon, 27 Dec 2010 15:22:46 +0000 (12:22 -0300)]
[media] saa6588: rename rds.h to saa6588.h
The naming of the media/rds.h header suggested that it was a generic
RDS header, when in fact it is just a saa6588 module API that is
internal to the kernel.
Rename the header and the struct and defines in it to make this clear.
Also removed the header include in radio-si470x.h (not used anymore)
and from ioctl-number.txt (it's internal to the kernel and never called
from userspace).
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Alexey Chernov [Mon, 6 Dec 2010 20:09:53 +0000 (17:09 -0300)]
[media] support of GoTView PCI-E X5 3D Hybrid in cx23885
Some comments:
1. Everything initialize properly except radio.
2. All analog inputs (TV, composite, S-Video) are tested by myself in several
TV norms (SECAM-D, PAL, NTSC), everything work fine.
So the patch adds general support/detection of the card with working analog
part, DVB part is not supported for now.
Ang Way Chuang [Fri, 24 Dec 2010 05:40:46 +0000 (02:40 -0300)]
[media] cx88-dvb.c: DVB net latency using Hauppauge HVR4000
A Hauppauge HVR 4000 is used on a School On Internet Asia (SOI Asia)
project in order to carry IP traffic over ULE. However, there is an
issue with high latency jitter.
My boss, Husni, identified the problem and provided a patch for it.
The default buffer size of 32 TS frames on cx88 causes the high latency,
so our deployment changes that to 6 TS frames. This patch made the
buffer size tunable, while keeping the default buffer size of 32 TS
frames unchanged.
Dan Carpenter [Thu, 23 Dec 2010 19:38:53 +0000 (16:38 -0300)]
[media] cx231xxx: fix typo in saddr_len check
The original code compared "saddr_len" with zero twice in a nonsensical
way. I asked the list, and Andy Walls and Sri Deevi say that the second
check should be if "saddr_len == 1".
[media] fsl_viu: add VIDIOC_QUERYSTD and VIDIOC_G_STD support
VIDIOC_QUERYSTD and VIDIOC_G_STD ioctls are currently not
supported in the FSL VIU driver. The decoder subdevice
driver saa7115 extended by previous patch supports QUERYSTD
for saa711x, so we add the appropriate ioctls to the VIU
driver to be able to determine the video input's standard.
[media] saa7115: allow input standard autodetection for more chips
Autodetect input's standard using field frequency detection
feature (FIDT in status byte at 0x1F) of the chips saa7111/
saa7111a/saa7113/saa7114/saa7118.
Dmitri Belimov [Wed, 22 Dec 2010 08:57:46 +0000 (05:57 -0300)]
[media] tm6000: rework and fix IR
Hi
This patch didn't kill Stefan's remotes and just for upload my good part of code.
1. Add some code for show IR activity
2. Add filter for IR remotes
3. Split remotes to different types.
4. Fix stop interrupt pipe when isoc pipe started.
When we decide general way of IR I'll add support our remotes.
For our customers I'll made custom temporary patch without this part.
[media] dabusb: Move it to staging to be deprecated
dabusb driver were conceived as an experimental driver for a test
device. The driver never supported any shipped product, and, while
there were some updates on it in 2003, for an ancient product,
those changes were never submitted upstream.
Also, there's no DocBook for its API, nor any upstream discussion.
So, better to remove it, on .39. If later needed, we may rescue it
from git logs. For now, let's move it to staging.
Acked-by: Deti Fliegl <deti@fliegl.de> Cc: Deti Fliegl <deti@fliegl.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/af9013.c: In function ‘af9013_update_signal_strength.clone.0’:
drivers/media/dvb/frontends/af9013.c:967:6: warning: ‘ret’ may be used uninitialized in this function
Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
A few typos at the driver are causing the following warnings:
drivers/media/dvb/frontends/stv090x.c: In function ‘stv090x_start_search’:
drivers/media/dvb/frontends/stv090x.c:1486:27: warning: comparison between ‘enum stv090x_search’ and ‘enum stv090x_delsys’
drivers/media/dvb/frontends/stv090x.c:1487:24: warning: comparison between ‘enum stv090x_search’ and ‘enum stv090x_delsys’
drivers/media/dvb/frontends/stv090x.c: In function ‘stv090x_optimize_track’:
drivers/media/dvb/frontends/stv090x.c:2943:2: warning: case value ‘4’ not in enumerated type ‘enum stv090x_delsys’
The first two are due to the lack of using the delsys types
STV090x_DVBS1/STV090x_DSS
instead of
STV090x_SEARCH_DVBS1/STV090x_SEARCH_DSS
The second one is due to the usage of STV090x_UNKNOWN (enum stv090x_modulation)
instead of STV090x_ERROR (enum stv090x_delsys).
Cc: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] gspca: Fix a warning for using len before filling it
The check for status errors is now before the check for len. That's
ok. However, the error printk's for the status error prints the URB
length. This generates this error:
drivers/media/video/gspca/gspca.c: In function ‘fill_frame’:
drivers/media/video/gspca/gspca.c:305:9: warning: ‘len’ may be used uninitialized in this function
The fix is as simple as moving the len init to happen before the checks.
[media] dib7000m/dib7000p: Add support for TRANSMISSION_MODE_4K
Fixes several warnings:
drivers/media/dvb/frontends/dib7000m.c: In function ‘dib7000m_set_channel’:
drivers/media/dvb/frontends/dib7000m.c:808:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c:869:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c: In function ‘dib7000m_tune’:
drivers/media/dvb/frontends/dib7000m.c:1023:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c:1033:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c:1043:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c: In function ‘dib7000p_set_channel’:
drivers/media/dvb/frontends/dib7000p.c:720:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c:773:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c: In function ‘dib7000p_tune’:
drivers/media/dvb/frontends/dib7000p.c:997:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c:1007:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c:1017:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
The drivers were prepared to support 4K carriers, but as the define were added
later, they were using a "magic" value of 255.
Cc: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/radio/radio-wl1273.c: In function ‘wl1273_fm_upload_firmware_patch’:
drivers/media/radio/radio-wl1273.c:675:2: warning: ‘n’ may be used uninitialized in this function
drivers/media/radio/radio-wl1273.c:675:2: warning: ‘i’ may be used uninitialized in this function
Those vars are never initialized, and the debug message makes no sense, as it
will show just two random values.
Cc: Matti J. Aaltonen <matti.j.aaltonen@nokia.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] dmxdev: Fix a compilation warning due to a bad type
drivers/media/dvb/dvb-core/dmxdev.c: In function ‘dvb_dmxdev_start_feed’:
drivers/media/dvb/dvb-core/dmxdev.c:583:13: warning: comparison between ‘enum dmx_ts_pes’ and ‘enum <anonymous>’
[media] feature_removal_schedule.txt: mark VIDIOC_*_OLD ioctls to die
There are some old broken definitions of ioctl's, where the
read/write arguments were marked wrong. The last one were added
on 2.6.6 kernel. Remove them, in order to cleanup some
copy_from_user/copy_to_user logic done inside V4L core.
drivers/staging/lirc/lirc_bt829.c:141: undefined reference to `lirc_register_driver'
drivers/built-in.o:(.rodata+0x20f68): undefined reference to `lirc_dev_fop_read'
drivers/built-in.o:(.rodata+0x20f7c): undefined reference to `lirc_dev_fop_poll'
drivers/built-in.o:(.rodata+0x20f8c): undefined reference to `lirc_dev_fop_open'
drivers/built-in.o:(.rodata+0x20f94): undefined reference to `lirc_dev_fop_close'
drivers/built-in.o:(.rodata+0x21030): undefined reference to `lirc_dev_fop_open'
drivers/built-in.o:(.rodata+0x21038): undefined reference to `lirc_dev_fop_close'
This happens when .config is like:
CONFIG_LIRC=m
CONFIG_IR_LIRC_CODEC=m
CONFIG_LIRC_STAGING=y
CONFIG_LIRC_BT829=y
This example file uses the old V4L1 API. It also doesn't use libv4l.
So, it is completely obsolete. A good example already exists at
v4l-utils (v4l2grab.c):
http://git.linuxtv.org/v4l-utils.git
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Mon, 20 Dec 2010 00:59:56 +0000 (21:59 -0300)]
[media] ivtv: Return EFAULT when copy_from_user() fails in ivtv_write_vbi_from_user()
If write() on a VBI device node fails due to a bad buffer pointer from
userspace, we should notify the application properly with EFAULT, per the
V4L2 API spec.
Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 18 Dec 2010 13:48:17 +0000 (10:48 -0300)]
[media] ivtv: ivtv_write_vbi() should use copy_from_user() for user data buffers
ivtv_write_vbi() is used for both VBI data that came from the
driver internally and VBI data that came from the user. However,
it did not use copy_from_user() for reading the VBI data from the
user buffers.
This change adds a new version of the function,
ivtv_write_vbi_from_user(), that uses copy_from_user() to read the VBI
data provided via user buffers.
This should resolve a sparse build warning reported by Dave Gilbert.
Reported-by: Dr. David Alan Gilbert <linux at treblig.org> Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 11 Dec 2010 23:38:20 +0000 (20:38 -0300)]
[media] cx18: Only allocate a struct cx18_dvb for the DVB TS stream
The cx18_stream struct contained a struct cx18_dvb for
every stream object, most of which were for analog capture.
Now we only allocate the cx18_dvb object for the DTV TS stream.
Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 11 Dec 2010 15:31:45 +0000 (12:31 -0300)]
[media] ivtv, cx18: Make ioremap failure messages more useful for users
The error messages these drivers emitted for ioremap() failures
were misleading and not helpful for users. Reworded those messages
to help the user take action to resolve vmalloc address space
exhaustion.
Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] gspca - main: Check the isoc packet status before its length
When an error is set for an isochronous packet, the length of the packet
may be null. In this case, the error was not detected and the image
was not discarded as it should be.
Theodore Kilgore [Fri, 24 Dec 2010 20:06:04 +0000 (17:06 -0300)]
[media] gspca - sq905c: Adds the Lego Bionicle
This patch adds the Vendor:Product number of the Lego Bionicle camera to
the existing gspca/sq905c.c and also a line for the camera in gspca.txt.
The camera works "out of the box" with these small changes. So this is
just in time for Christmas. Think of the children.
Jesper Juhl [Sat, 18 Dec 2010 22:05:02 +0000 (19:05 -0300)]
[media] saa7164: Remove pointless conditional and save a few bytes in saa7164_downloadfirmware()
Hi,
release_firmware() just does nothing if passed a NULL pointer. So there's
no reason to test before the call in
saa7164-fw.c::saa7164_downloadfirmware().
Removing the pointless conditional also saves a few bytes.
before:
text data bss dec hex filename
7943 112 2144 10199 27d7 drivers/media/video/saa7164/saa7164-fw.o
after:
text data bss dec hex filename
7931 112 2136 10179 27c3 drivers/media/video/saa7164/saa7164-fw.o
[media] media: fsl-viu: fix support for streaming with mmap method
Streaming using mmap didn't work in the VIU driver. We need to
start/stop DMA in streamon/streamoff and free the buffers on
release. Add appropriate driver extension now.
'n' may be bigger than MAX_INT*sizeof(int), if so checking of truncated
(int)(n/sizeof(int)) for LIRCBUF_SIZE overflow and then using nontruncated 'count'
doesn't make sense. Also n may be up to sizeof(int)-1 bytes bigger than expected,
so check value of (n % sizeof(int)) too.