V4L/DVB: using vmalloc requires include linux/vmalloc.h
After merging the scsi-post-merge tree, today's linux-next build (powerpc
allyesconfig) failed like this:
drivers/media/dvb/ngene/ngene-core.c: In function 'ngene_release_buffers':
drivers/media/dvb/ngene/ngene-core.c:1443: error: implicit declaration of function 'vfree'
drivers/media/dvb/ngene/ngene-core.c: In function 'ngene_get_buffers':
drivers/media/dvb/ngene/ngene-core.c:1454: error: implicit declaration of function 'vmalloc'
drivers/media/dvb/ngene/ngene-core.c:1454: warning: assignment makes pointer from integer without a cast
drivers/media/dvb/ngene/ngene-core.c:1461: warning: assignment makes pointer from integer without a cast
drivers/media/dvb/ngene/ngene-core.c:1467: warning: assignment makes pointer from integer without a cast
drivers/media/dvb/ngene/ngene-core.c: In function 'ngene_probe':
drivers/media/dvb/ngene/ngene-core.c:1836: warning: assignment makes pointer from integer without a cast
Oliver Endriss [Tue, 2 Feb 2010 01:01:31 +0000 (22:01 -0300)]
V4L/DVB: ngene: Adapt to current frontend drivers
Adapt to current stv090x + stv6110 drivers.
[mchehab@redhat.com: removed compilation hack added by me on a prev patch] Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Márton Németh [Sat, 23 Jan 2010 13:44:34 +0000 (14:44 +0100)]
V4L/DVB: hdpvr-video: cleanup signedness
The fifth parameter of usb_bulk_msg() is a pointer to signed
(see <linux/usb.h>) so also call this function with pointer to signed.
This will remove the following sparse warning (see "make C=1"):
* warning: incorrect type in argument 5 (different signedness)
expected int *actual_length
got unsigned int *<noident>
Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jiri Slaby [Fri, 22 Jan 2010 15:10:55 +0000 (12:10 -0300)]
V4L/DVB: media: dvb/af9015, add hashes support
So as a final patch, add support for hash and one hash entry
for MSI digi vox mini II:
iManufacturer 1 Afatech
iProduct 2 DVB-T 2
iSerial 3 010101010600001
It is now handled with proper IR and key map tables.
Add af9015_setup structure to hold (right now only remote) setup
of distinct receivers.
Add af9015_setup_match for matching ids against tables.
This is for easier matching different kind of ids against tables
to obtain setups. Currently module parameters and usb vendor ids
are switched into and matched against tables. Hashes will follow.
This will be useful for matching of IR tables later.
We read the eeprom anyway for dumping. Switch the dumping to
print_hex_dump_bytes and compute hash above that by
hash = 0;
for (u32 VAL) in (eeprom):
hash *= GOLDEN_RATIO_PRIME_32
hash += VAL; // while preserving endinaness
The computation is moved earlier to the flow, namely from
af9015_af9013_frontend_attach to af9015_read_config, so that
we can access the sum in af9015_read_config already.
Márton Németh [Fri, 29 Jan 2010 20:30:53 +0000 (17:30 -0300)]
V4L/DVB: hdpvr-core: make module parameters local
The default_video_input and default_audio_input module parameters are
only used inside the hdpvr-core.c file so make them static.
This will remove the following sparse warnings (see "make C=1"):
* warning: symbol 'default_video_input' was not declared. Should it be static?
* warning: symbol 'default_audio_input' was not declared. Should it be static?
Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Manu Abraham <manu@linuxtv.org> Acked-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/stv090x.c: In function 'stv090x_blind_search':
drivers/media/dvb/frontends/stv090x.c:1967: warning: 'coarse_fail' may be used uninitialized in this function
Cc: Manu Abraham <manu@linuxtv.org> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Manu Abraham <manu@linuxtv.org> Acked-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx18/cx18-alsa-pcm.c: In function 'cx18_alsa_announce_pcm_data':
drivers/media/video/cx18/cx18-alsa-pcm.c:82: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
Cc: Andy Walls <awalls@radix.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Márton Németh [Fri, 29 Jan 2010 20:42:17 +0000 (17:42 -0300)]
V4L/DVB: smsir: make local variables static
Make the file local parameters static.
This will remove the following sparse warnings (see "make C=1"):
* warning: symbol 'ir_pos' was not declared. Should it be static?
* warning: symbol 'ir_word' was not declared. Should it be static?
* warning: symbol 'ir_toggle' was not declared. Should it be static?
Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 30 Jan 2010 19:20:27 +0000 (16:20 -0300)]
V4L/DVB: cx18: Add missing serialization locks to cx18-dvb
Operations that manipulates the state of the encoder or global instance flags
and variables should be serialized. This adds some serialization locks that
have been missing from cx18-dvb. Since the DVB part of the CX23418 doesn't
affect the encoder, no one would likely have ever noticed a race in changing
card instance variables.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 30 Jan 2010 18:50:51 +0000 (15:50 -0300)]
V4L/DVB: cx18: Fix memory leak in cx18-alsa starting of PCM captures
The cx18_open_id is normally dynamically allocated and stored in the
filp->private_data for v4l2 file operations. The cx18-alsa routines should
not dynamically allocate a cx18_open_id because they never store it anywhere
and never free it. This change fixes that and plugs a memory leak.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sat, 30 Jan 2010 18:28:22 +0000 (15:28 -0300)]
V4L/DVB: cx18: Add missing serialization locking to cx18-alsa
File operations that manipulate the state of the encoder, or video or audio
subdevices or some of the stream flags need to be serialized. Add the
serilization locks to cx18-alsa in a manner consistent with the locking for
the v4l2 file operations.
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jean Delvare [Tue, 26 Jan 2010 19:46:58 +0000 (16:46 -0300)]
V4L/DVB: dvb/bt8xx: Clean-up init and exit functions
The init and exit functions are needlessly complex. Remove the bloat:
* Drop irrelevant/outdated comments.
* Remove useless bt878_pci_driver_registered global variable.
Arnaud Patard [Mon, 25 Jan 2010 15:02:31 +0000 (12:02 -0300)]
V4L/DVB: Fix VIDIOC_QBUF compat ioctl32
When using VIDIOC_QBUF with memory type set to V4L2_MEMORY_MMAP, the
v4l2_buffer buffer gets unmodified on drivers like uvc (well, only
bytesused field is modified). Then some apps like gstreamer are reusing
the same buffer later to call munmap (eg passing the buffer "length"
field as 2nd parameter of munmap).
It's working fine on full 32bits but on 32bits systems with 64bit
kernel, the get_v4l2_buffer32() doesn't copy length/m.offset values and
then copy garbage to userspace in put_v4l2_buffer32().
This has for consequence things like that in the libv4l2 logs:
Márton Németh [Sat, 23 Jan 2010 06:58:20 +0000 (03:58 -0300)]
V4L/DVB: zoran: match parameter signedness of g_input_status
The second parameter of g_input_status operation in <media/v4l2-subdev.h>
is unsigned so also call it with unsigned paramter.
This will remove the following sparse warning (see "make C=1"):
* incorrect type in argument 2 (different signedness)
expected unsigned int [usertype] *status
got int *<noident>
Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Stefan Richter [Wed, 18 Nov 2009 19:03:31 +0000 (16:03 -0300)]
V4L/DVB: firedtv: reduce memset()s
Before each FCP transdaction, the entire 512 bytes of the FCP frame were
cleared, then values filled in.
Clear only the bytes between filled-in bytes and end of the
- request frame, or
- response frame if data from a larger response will be needed, or
- whole frame if data from a variable length response will be taken.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Stefan Richter [Wed, 18 Nov 2009 19:03:03 +0000 (16:03 -0300)]
V4L/DVB: firedtv: remove check for interrupting signal
FCP transactions as well as CMP transactions were serialized with
mutex_lock_interruptible. It is extremely unlikly though that a signal
will arrive while a concurrent process holds the mutex. And even if one
does, the duration of a transaction is reasonably short (1.2 seconds if
all retries time out, usually much shorter).
Hence simplify the code to plain mutex_lock.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Stefan Richter [Wed, 18 Nov 2009 19:02:01 +0000 (16:02 -0300)]
V4L/DVB: firedtv: do not DMA-map stack addresses
This is a portability fix and reduces stack usage.
The DMA mapping API cannot map on-stack addresses, as explained in
Documentation/DMA-mapping.txt. Convert the two cases of on-stack packet
payload buffers in firedtv (payload of write requests in avc_write and
of lock requests in cmp_lock) to slab-allocated memory.
We use the 512 bytes sized FCP frame buffer in struct firedtv for this
purpose. Previously it held only incoming FCP responses, now it holds
pending FCP requests and is then overwriten by an FCP response from the
tuner subunit. Ditto for CMP lock requests and responses. Accesses to
the payload buffer are serialized by fdtv->avc_mutex.
As a welcome side effect, stack usage of the AV/C transaction functions
is reduced by 512 bytes.
Alas, avc_register_remote_control() is a special case: It previously
did not wait for a response. To fit better in with the other FCP
transactions, let it wait for an interim response.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
WARNING: drivers/media/video/cx18/cx18-alsa.o(.text+0x4de): Section
mismatch in reference from the function cx18_alsa_load() to the function
.init.text:snd_cx18_init()
The function cx18_alsa_load() references
the function __init snd_cx18_init().
This is often because cx18_alsa_load lacks a __init
annotation or the annotation of snd_cx18_init is wrong.
WARNING: drivers/media/video/cx18/built-in.o(.text+0x1c022): Section
mismatch in reference from the function cx18_alsa_load() to the function
.init.text:snd_cx18_init()
The function cx18_alsa_load() references
the function __init snd_cx18_init().
This is often because cx18_alsa_load lacks a __init
annotation or the annotation of snd_cx18_init is wrong.
WARNING: drivers/media/video/built-in.o(.text+0x28cc56): Section
mismatch in reference from the function cx18_alsa_load() to the function
.init.text:snd_cx18_init()
The function cx18_alsa_load() references
the function __init snd_cx18_init().
This is often because cx18_alsa_load lacks a __init
annotation or the annotation of snd_cx18_init is wrong.
WARNING: drivers/media/built-in.o(.text+0x2d2432): Section mismatch in
reference from the function cx18_alsa_load() to the function
.init.text:snd_cx18_init()
The function cx18_alsa_load() references
the function __init snd_cx18_init().
This is often because cx18_alsa_load lacks a __init
annotation or the annotation of snd_cx18_init is wrong.
Antonio Ospite [Sun, 17 Jan 2010 06:42:14 +0000 (03:42 -0300)]
V4L/DVB: gspca - ov534: Fix end of frame handling
Fix a regression, introduced in the driver split, which made
the ov534 driver unusable.
Plus, the debug message should reflect that we discard also packets
beyond the expected frame size.
Hans de Goede [Wed, 13 Jan 2010 10:12:28 +0000 (07:12 -0300)]
V4L/DVB: gspca - zc3xx: Change the resolutions of some sensors
The sensors adcm2700, mc501cb and ov7620 cannot have the full height
permitted by the zc3xx bridges. This change removes 8 pixels at the
bottom of the images.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Márton Németh [Sat, 16 Jan 2010 16:41:43 +0000 (13:41 -0300)]
V4L/DVB: stv0900: make more local functions static
Some functions are only used locally so mark them static.
This will remove the following sparse warnings (see "make C=1"):
* symbol 'extract_mask_pos' was not declared. Should it be static?
* symbol 'stv0900_initialize' was not declared. Should it be static?
* symbol 'stv0900_get_mclk_freq' was not declared. Should it be static?
* symbol 'stv0900_set_mclk' was not declared. Should it be static?
* symbol 'stv0900_get_err_count' was not declared. Should it be static?
Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Márton Németh [Sat, 16 Jan 2010 16:35:36 +0000 (13:35 -0300)]
V4L/DVB: stv0900: make local functions static
The functions stv0900_sw_algo() and stv0900_set_dvbs1_track_car_loop() are only used
locally so mark them static.
This will remove the following sparse warnings (see "make C=1"):
* symbol 'stv0900_sw_algo' was not declared. Should it be static?
* symbol 'stv0900_set_dvbs1_track_car_loop' was not declared. Should it be static?
Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Márton Németh [Sat, 16 Jan 2010 16:21:59 +0000 (13:21 -0300)]
V4L/DVB: cx231xx: cleanup dvb_attach() return value handling
Remove the following sparse error (see "make C=1"):
* error: incompatible types for operation (<)
left side has type struct dvb_frontend *
right side has type int
Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB: vpfe-capture: converting dm644x ccdc driver to a platform driver
1) clocks are configured using generic clock names
2) converting the driver to a platform driver
3) cleanup - consolidate all static variables inside a structure, ccdc_cfg
The ccdc driver now uses generic names for clocks - master and slave. On individual platforms
these clocks will inherit from the platform specific clock. This will allow re-use of
the driver for the same IP across different SoCs.
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Reviewed-by: Vaibhav Hiremath <hvaibhav@ti.com> Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB: vpfe-capture - converting dm355 ccdc driver to a platform driver
1) clocks are configured using generic clock names;
2) converts the driver to a platform driver;
3) cleanup - consolidate all static variables inside a structure, ccdc_cfg;
The ccdc now uses a generic name for clocks. "master" and "slave". On individual platforms
these clocks will inherit from the platform specific clock. This will allow re-use of
the driver for the same IP across different SoCs.
Updated based on Kevin's comments on clock configuration and error code (v3, v4).
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Reviewed-by: Vaibhav Hiremath <hvaibhav@ti.com> Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Pete Eberlein [Wed, 13 Jan 2010 22:15:48 +0000 (19:15 -0300)]
V4L/DVB: s2250: Fix write_reg i2c address
The kernel i2c model uses right-aligned 7-bit i2c addresses, but the
2250 firmware uses an 8-bit address in the usb vendor request. A
previous patch by Jean Delvare shifted the i2c addresses 1 bit to the
right, and this patch fixes the write_reg function to shift it back
before sending the vendor request.
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signed-off-by: Pete Eberlein <pete@sensoray.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Move the cx18_alsa_announce_pcm_data() function further up in the file, since
apparently "make checkpatch" has never heard of a forward declaration. Note
that despite the hg diff showing everything else as having been deleted/added,
in reality it was only that one function that got moved (and the forward
declaration was removed from the top of the file).
Fix codingstyle issues, and make the minimum version for cx18-alsa required
to be 2.6.17, so that we don't need all the #ifdefs related to the changes
to ALSA structures.