Dan Carpenter [Fri, 20 Jul 2012 10:11:57 +0000 (07:11 -0300)]
[media] dib8000: move dereference after check for NULL
My static checker complains that we dereference "state" inside the call
to fft_to_mode() before checking for NULL. The comments say that it is
possible for "state" to be NULL so I have moved the dereference after
the check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Ezequiel García [Wed, 18 Jul 2012 16:41:11 +0000 (13:41 -0300)]
[media] cx25821: Remove bad strcpy to read-only char*
The strcpy was being used to set the name of the board.
This was both wrong and redundant,
since the destination char* was read-only and
the name is set statically at compile time.
The type of the name field is changed to const char*
to prevent future errors.
Daniel Drake [Sun, 15 Jul 2012 20:23:05 +0000 (17:23 -0300)]
[media] via-camera: pass correct format settings to sensor
The code attempts to maintain a "user format" and a "sensor format",
but in this case it looks like a typo is passing the user format down
to the sensor.
This was preventing display of video at anything other than 640x480.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The current formulation of the bw_params loop uses the counter j as an
index for the first dimension of the bw_params array which is later
incremented by the variable i. It is evaluated correctly only, because j
is initialized to 0 at the beginning of the loop. I think that
explicitly using the index 0 better reflects the intent of the
expression.
Hans Verkuil [Thu, 12 Jul 2012 15:06:24 +0000 (12:06 -0300)]
[media] Use a named union in struct v4l2_ioctl_info
Hi Mauro,
struct v4l2_ioctl_info uses an anonymous union, which is initialized
in the v4l2_ioctls table.
Unfortunately gcc < 4.6 uses a non-standard syntax for that, so trying to
compile v4l2-ioctl.c with an older gcc will fail.
It is possible to work around this by testing the gcc version, but in this
case it is easier to make the union named since it is used in only a few
places.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] staging/media/solo6x10: use module_pci_driver macro
the driver duplicates the module_pci_driver code,
how?
module_pci_driver is used for those drivers whose
init and exit paths does only register and unregister
to pci API and nothing else.
Du, Changbin [Sat, 7 Jul 2012 06:53:28 +0000 (03:53 -0300)]
[media] rc: ati_remote.c: code style fixing
changes:
1. wrap some lines that are longer than 80 characters.
2. remove local function prototype declarations which do not
need.
3. replace TAB character with a space character in function
comments.
Signed-off-by: Du, Changbin <changbin.du@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Douglas Bagnall [Sat, 7 Jul 2012 02:27:57 +0000 (23:27 -0300)]
[media] Avoid sysfs oops when an rc_dev's raw device is absent
For some reason, when the lirc daemon learns that a usb remote control
has been unplugged, it wants to read the sysfs attributes of the
disappearing device. This is useful for uncovering transient
inconsistencies, but less so for keeping the system running when such
inconsistencies exist.
Under some circumstances (like every time I unplug my dvb stick from
my laptop), lirc catches an rc_dev whose raw event handler has been
removed (presumably by ir_raw_event_unregister), and proceeds to
interrogate the raw protocols supported by the NULL pointer.
This patch avoids the NULL dereference, and ignores the issue of how
this state of affairs came about in the first place.
Version 2 incorporates changes recommended by Mauro Carvalho Chehab
(-ENODEV instead of -EINVAL, and a signed-off-by).
Signed-off-by: Douglas Bagnall <douglas@paradise.net.nz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Wed, 25 Jul 2012 14:48:53 +0000 (11:48 -0300)]
[media] vivi: fix a few format-related compliance issues
This patch will always set the field to INTERLACED (this fixes a bug were a driver should
never return FIELD_ANY), and will default to YUYV pixelformat if an unknown pixelformat
was specified.
This way S/TRY_FMT will always return a valid format struct.
Add missing usb_free_urb on failure path after usb_alloc_urb.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@km exists@
local idexpression e;
expression e1,e2,e3;
type T,T1;
identifier f;
@@
* e = usb_alloc_urb(...)
... when any
when != e = e1
when != e1 = (T)e
when != e1(...,(T)e,...)
when != &e->f
if(...) { ... when != e2(...,(T1)e,...)
when != e3 = e
when forall
(
return <+...e...+>;
|
* return ...;
) }
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Documentation: Add newline at end-of-file to files lacking one
This patch simply adds a newline character at end-of-file to those
files in Documentation/ that currently lack one.
This is done for a few different reasons:
A) It's rather annoying when you do "cat some_file.txt" that your
prompt/cursor ends up at the end of the last line of output rather
than on a new line.
B) Some tools that process files line-by-line may get confused by the
lack of a newline on the last line.
C) The "\ No newline at end of file" line in diffs annoys me for some
reason.
So, let's just add the missing newline once and for all.
Hans Verkuil [Thu, 19 Jul 2012 19:45:49 +0000 (16:45 -0300)]
[media] vivi: remove pointless video_nr++
Remove the pointless video_nr++. It doesn't do anything useful and it has
the unexpected side-effect of changing the video_nr module option, so
cat /sys/module/vivi/parameters/video_nr gives a different value back
then what was specified with modprobe.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Wed, 11 Jul 2012 14:47:38 +0000 (11:47 -0300)]
[media] radio-si470x: Lower firmware version requirements
Testing with a firmware version 12 usb radio stick has shown version 12
to work fine too.
Reported-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.
The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.
The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.
The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.
[media] V4L: Add capability flags for memory-to-memory devices
This patch adds new V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE
capability flags that are intended to be used for memory-to-memory (M2M)
devices, instead of ORed V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT.
V4L2_CAP_VIDEO_M2M flag is added at the drivers, CAPTURE and OUTPUT
capability flags are left untouched and will be removed in future,
after a transition period required for existing applications to be
adapted to check only for V4L2_CAP_VIDEO_M2M.
The V4L2_CID_ISO_SENSITIVITY control menu values should be
standard ISO values multiplied by 1000. Multiply all menu
items by 1000 so ISO is properly reported as 50...3200 range.
[media] s5p-fimc: Remove V4L2_FL_LOCK_ALL_FOPS flag
This patch adds locking for open(), close(), poll() and mmap()
file operations in the driver as a follow up to the changes
done in commit 5126f2590bee412e3053de851cb07f531
"v4l2-dev: add flag to have the core lock all file operations".
[media] tw9910: Don't access the device in the g_mbus_fmt operation
The g_mbus_fmt operation only needs to return the current mbus frame
format and doesn't need to configure the hardware to do so. Fix it to
avoid requiring the chip to be powered on when calling the operation.
[media] ov772x: Don't access the device in the g_mbus_fmt operation
The g_mbus_fmt operation only needs to return the current mbus frame
format and doesn't need to configure the hardware to do so. Fix it to
avoid requiring the chip to be powered on when calling the operation.
[media] ov2640: Don't access the device in the g_mbus_fmt operation
The g_mbus_fmt operation only needs to return the current mbus frame
format and doesn't need to configure the hardware to do so. Fix it to
avoid requiring the chip to be powered on when calling the operation.
[media] soc-camera: Pass the physical device to the power operation
There will be no soc_camera_device instance with a soc-camera device is
used with a non soc-camera host, so we won't be able to pass the
soc_camera_device fake platform device to board code. Pass the physical
device instead.
The argument is currently not used by any board file so this is safe.
[media] soc-camera: Don't fail at module init time if no device is present
The soc-camera module exports functions that are needed by soc-camera
client drivers even when not running in soc-camera mode. Replace the
platform_driver_probe() with a platform_driver_register() call to avoid
module load failures if no soc-camera device is present.
Manjunath Hadli [Fri, 29 Jun 2012 06:24:29 +0000 (03:24 -0300)]
[media] davinci: vpif: Enable selection of the ADV7343 and THS7303
The auto selection of pertinent helper chips (VIDEO_HELPER_CHIPS_AUTO)
should select the ADV7343 and THS7303 driver, which is used by VPIF
display driver.
[media] davinci: vpif: Add suspend/resume callbacks to vpif driver
add clock enable and disable in probe and remove functions.
Probe will succeed only if the device clock is provided instead of
assuming that the clock is always enabled. VPIF clock has to be
dealt with during suspend and resume. Implement power management
callbacks to VPIF driver to disable/enable clock on suspend/resume
respectively.
Manjunath Hadli [Fri, 29 Jun 2012 06:20:12 +0000 (03:20 -0300)]
[media] davinci: vpif: add support for clipping on output data
add hardware clipping support for VPIF output data. This
is needed as it is possible that the external encoder
might get confused between the FF or 00 which are a part
of the data and that of the SAV or EAV codes.
[media] davinci: vpif: make generic changes to re-use the vpif drivers on da850/omap-l138 soc
change the dm646x specific strings in the driver to make
them generic across platforms. In this case change all the
strings which have a dm646x connotation to vpif which is a
platform independent ip.
[media] davinci: vpif: add check for genuine interrupts in the isr
As the same interrupt is shared between capture and display devices,
sometimes we get isr calls where the interrupt might not genuinely belong
to capture or display. Hence, add a condition in the isr to check for
interrupt ownership and channel number to make sure we do not
service wrong interrupts.
Lad, Prabhakar [Fri, 22 Jun 2012 09:19:28 +0000 (06:19 -0300)]
[media] videobuf-dma-contig: restore buffer mapping for uncached bufers
from commit a8f3c203e19b702fa5e8e83a9b6fb3c5a6d1cce4
restore the mapping scheme for uncached buffers,
which was changed in a common scheme for cached and uncached.
This apparently was wrong, and was probably intended only for cached buffers.
the fix fixes the crash observed while mapping uncached buffers.
Hans de Goede [Sat, 23 Jun 2012 07:39:58 +0000 (04:39 -0300)]
[media] shark2: New driver for the Griffin radioSHARK v2 USB radio receiver
This driver consists of 2 parts, a generic tea5777 driver and a driver
for the Griffin radioSHARK v2 USB radio receiver, which is the only driver
using the generic tea5777 for now.
This first version only implements FM support, once the the new
VIDIOC_ENUM_FREQ_BANDS API is upstream I'll also add AM support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sat, 7 Jul 2012 19:11:11 +0000 (16:11 -0300)]
[media] v4l2-ioctl: Don't assume file->private_data always points to a v4l2_fh
Commit efbceecd4522a41b8442c6b4f68b4508d57d1ccf, adds a number of helper
functions for ctrl related ioctls to v4l2-ioctl.c, these helpers assume that
if file->private_data != NULL, it points to a v4l2_fh, which is only the case
for drivers which actually use v4l2_fh.
This breaks for example bttv which use the "filedata" pointer for its own uses,
and now all the ctrl ioctls try to use whatever its filedata points to as
v4l2_fh and think it has a ctrl_handler, leading to:
This patch adds the missing test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags) tests
to the ctrl ioctl helpers v4l2_fh paths, fixing the issues with for example
the bttv driver.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sat, 7 Jul 2012 15:11:57 +0000 (12:11 -0300)]
[media] gspca: Don't use video_device_node_name in v4l2_device release handler
When the v4l2_device release handler gets called the kobject under
vdev->dev has already been released, so we cannot use kobject_name on
it (which video_device_node_name does).
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>