Commit Graph

88 Commits (dcd6c92267155e70a94b3927bce681ce74b80d1f)

Author SHA1 Message Date
Linus Torvalds 32aaeffbd4 Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
  Revert "tracing: Include module.h in define_trace.h"
  irq: don't put module.h into irq.h for tracking irqgen modules.
  bluetooth: macroize two small inlines to avoid module.h
  ip_vs.h: fix implicit use of module_get/module_put from module.h
  nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
  include: replace linux/module.h with "struct module" wherever possible
  include: convert various register fcns to macros to avoid include chaining
  crypto.h: remove unused crypto_tfm_alg_modname() inline
  uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
  pm_runtime.h: explicitly requires notifier.h
  linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
  miscdevice.h: fix up implicit use of lists and types
  stop_machine.h: fix implicit use of smp.h for smp_processor_id
  of: fix implicit use of errno.h in include/linux/of.h
  of_platform.h: delete needless include <linux/module.h>
  acpi: remove module.h include from platform/aclinux.h
  miscdevice.h: delete unnecessary inclusion of module.h
  device_cgroup.h: delete needless include <linux/module.h>
  net: sch_generic remove redundant use of <linux/module.h>
  net: inet_timewait_sock doesnt need <linux/module.h>
  ...

Fix up trivial conflicts (other header files, and  removal of the ab3550 mfd driver) in
 - drivers/media/dvb/frontends/dibx000_common.c
 - drivers/media/video/{mt9m111.c,ov6650.c}
 - drivers/mfd/ab3550-core.c
 - include/linux/dmaengine.h
2011-11-06 19:44:47 -08:00
Paul Gortmaker 7a707b8920 drivers/media: Add module.h to all files using it implicitly
A pending cleanup will mean that module.h won't be implicitly
everywhere anymore.  Make sure the modular drivers in clocksource
are actually calling out for <module.h> explicitly in advance.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:51 -04:00
Mauro Carvalho Chehab a5abdb6044 [media] pvrusb2: initialize standards mask before detecting standard
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-08 08:00:54 -03:00
Mauro Carvalho Chehab 7383a47395 [media] pvrusb2: implement VIDIOC_QUERYSTD
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-08 08:00:26 -03:00
Mauro Carvalho Chehab 7a286cc188 [media] return -ENOTTY for unsupported ioctl's at legacy drivers
Those drivers are not relying at the V4L2 core to handle the ioctl's.
So, we need to manually patch them every time a change goes to the
core.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-By: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:38 -03:00
Mauro Carvalho Chehab 083774d8b1 [media] pvrusb2: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
pvrusb2 doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mike Isely 228ee5928b [media] pvrusb2: Remove dead code
This was caught via a compiler warning.  Amazingly enough this bit of
benign dreck dates all the way back to 2008.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 04:54:36 -03:00
Hans Verkuil 08af245de0 [media] V4L: remove V4L1 compatibility mode
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:07 -02:00
Mike Isely d72baad3f0 V4L/DVB: pvrusb2: Fix kernel oops at device unregistration
pvrusb2: Fix oops caused by touching deleted memory after
unregistration.  This bug was introduced when we had started using
video_device_node_name() - that function was being called potentially
after the underlying structure (referenced by that function) had been
deleted.  The fix rearranges things slightly so that the function is
called before destruction takes place.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:19:52 -03:00
Hans Verkuil ffb4877ba0 V4L/DVB: v4l2-common: simplify prio utility functions
v4l2_prio_init/open/close returned an int when in fact they would
always return 0. Make these void functions.

v4l2_prio_close and v4l2_prio_check pass an enum v4l2_priority as a
pointer for no good reason. Replace with a normal enum v4l2_priority
argument.

These changes will simplify the work of moving priority handling into
the v4l core.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:54 -03:00
Joe Perches 108bdd7ad7 V4L/DVB: pvrusb2-v4l2: Rename dev_info to pdi
There is a macro called dev_info that prints struct device specific
information.  Having variables with the same name can be confusing and
prevents conversion of the macro to a function.

Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:39 -03:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Laurent Pinchart 38c7c03603 V4L/DVB (13550): v4l: Use the new video_device_node_name function
Fix all device drivers to use the new video_device_node_name function.

This also strips kernel log messages from the "/dev/" prefix, has the device
node location is a userspace policy decision unknown to the kernel.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 00:17:55 -02:00
Mike Isely 4a89baa2e1 V4L/DVB (13222): pvrusb2: Make more info available to udev
pvrusb2: Associate V4L device node in sysfs with the underlying USB
device.  This opens the door to device information tracking in udev

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:58 -02:00
Mike Isely 48c5b0dfd7 V4L/DVB (11747): pvrusb2: Bump up version advertised through v4l interface
Kick up the pvrusb2 version number advertised through the v4l
interface.  This value really has almost no meaning because I don't
make a serious attempt to version the driver in this manner (otherwise
this one line becomes a nasty hotspot of changes and merge
conflicts).  The value that is here is really a historical thing.
However Hans Verkuil thought it might be a good idea to bump up the
number anyway right now since the driver's mechanism for communicating
with the v4l core has pretty much completely changed.  Sending out a

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:00 -03:00
Roel Kluin 223ffe5f82 V4L/DVB: cleanup redundant tests on unsigned
Remove redundant tests on unsigned.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:58 -03:00
Mike Isely defeb0b94b V4L/DVB (11205): pvrusb2: Remove ancient IVTV specific ioctl functions
Remove ancient IVTV_IOC_G_CODEC and IVTV_IOC_S_CODEC ioctl functions
from the pvrusb2 driver.  These are very very old, were non-standard,
and were only present to keep MythTV happy (their implementation did
nothing except to report success).  That was long ago; no recent
versions of MythTV should require this anymore.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:39 -03:00
Mauro Carvalho Chehab be9ed5117d V4L/DVB (10298): remove err macro from few usb devices
Patch removes err() macros from few usb devices.
It places pr_err in pvrusb2-v4l2.c, dev_err in dabusb and in usbvision
drivers. Beside placing dev_err, patch defines new s2255_dev_err macro
with S2255_DRIVER_NAME in s2255 module.

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Acked-by: Thierry Merle <thierry.merle@free.fr>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:26 -03:00
Mike Isely d166b02ea6 V4L/DVB (10236): pvrusb2: Stop advertising VBI capability - it isn't there
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:21 -03:00
Hans Verkuil aecde8b53b V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID.
Since the i2c driver ID will be removed in the near future we have to
modify the v4l2 debugging API to use the driver name instead of driver ID.

Note that this API is not used in applications other than v4l2-dbg.cpp
as it is for debugging and testing only.

Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged
with a warning that it is deprecated and will be removed in 2.6.30.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02 17:11:52 -02:00
Hans Verkuil 069b747931 V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl.
Since internal to v4l2 the ioctl prototype is the same regardless of it
being called through .ioctl or .unlocked_ioctl, we need to convert it all
to the long return type of unlocked_ioctl.

Thanks to Jean-Francois Moine for posting an initial patch for this and
thus bringing it to our attention.

Cc: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02 17:11:34 -02:00
Hans Verkuil bec43661b1 V4L/DVB (10135): v4l2: introduce v4l2_file_operations.
Introduce a struct v4l2_file_operations for v4l2 drivers.

Remove the unnecessary inode argument.

Move compat32 handling (and llseek) into the v4l2-dev core: this is now
handled in the v4l2 core and no longer in the drivers themselves.

Note that this changeset reverts an earlier patch that changed the return
type of__video_ioctl2 from int to long. This change will be reinstated
later in a much improved version.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-02 17:11:12 -02:00
Hans Verkuil f473bf76c7 V4L/DVB (9503): v4l: remove inode argument from video_usercopy
The inode argument was never used. Removing it from video_usercopy
brings the function pointer type of video_usercopy in line with similar
v4l2 functions, thus simplifying several drivers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:26 -02:00
Mauro Carvalho Chehab b1f88407f3 V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl()
The inode parameter at v4l_compat_translate_ioctl() were just passed over several
places just to keep compatible with fops.ioctl. However, it weren't used anywere.

This patch gets hid of this unused parameter.

Cc: Laurent Pinchart <laurent.pinchart@skynet.be>
Cc: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21 14:31:45 -02:00
Hans Verkuil c6330fb86f V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d
The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
independent of the minor number. So instead of using the minor field
of the video_device struct one has to use the num field: this always
contains the kernel number of the device node.

I forgot about this when I did the v4l2 core change, so this patch
converts all drivers that use it in one go. Luckily the change is
trivial.

Cc: michael@mihu.de
Cc: mchehab@infradead.org
Cc: corbet@lwn.net
Cc: luca.risolia@studio.unibo.it
Cc: isely@pobox.com
Cc: pe1rxq@amsat.org
Cc: royale@zerezo.com
Cc: mkrufky@linuxtv.org
Cc: stoth@linuxtv.org
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-21 14:31:37 -02:00
Mike Isely 432907f750 V4L/DVB (8900): pvrusb2: Implement cropping pass through
This builds upon the previous pvrusb2 change to more formally
implement full cropping support.  This enables access from the
driver's V4L interface, and enables access to full capabilities from
sysfs as well.  Note that this is only effective when in analog mode.
It also will only work when the underlying digitizer's driver (saa7115
or cx25840 depending on the hardware) also implements the appropriate
functions.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:57 -02:00
Mike Isely 26dd1c57a0 V4L/DVB (8898): pvrusb2: Be able to programmatically retrieve a control's default value
The pvrusb2 control mechanism up until now has used a constant int to
hold a control's default value.  This change makes it possible to
retrieve the control's default through some other means, e.g. as a
result of a query from lower level software.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:57 -02:00
Mike Isely 157afbc0de V4L/DVB (8894): pvrusb2: Remove BKL
The earlier change from Hans Verkuil that pushed the BKL from
video_open() down into the drivers should be unneeded for the pvrusb2
driver.  This driver's implementation for open already protects its
internal structures through other means, thus the BKL is not required.
This change reverses Hans' previous change, for the pvrusb2 driver.

It probably would have been a good idea for Hans to previously have
asked for my ack before committing his change.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:57 -02:00
Hans Verkuil d56dc61265 V4L/DVB (8613): v4l: move BKL down to the driver level.
The BKL is now moved from the video_open function in v4l2-dev.c to the
various drivers. It seems about a third of the drivers already has a
lock of some sort protecting the open(), another third uses
video_exclusive_open (yuck!) and the last third required adding the
BKL in their open function.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12 09:36:47 -02:00
Hans Verkuil 0ea6bc8d43 V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_device
The type and type2 fields were unused and so could be removed.
Instead add a vfl_type field that contains the type of the video
device.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27 11:07:10 -03:00
Hans Verkuil 9c39d7eafa V4L/DVB (8483): Remove obsolete owner field from video_device struct.
According to an old comment this should have been removed in 2.6.15.
Better late than never...

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-26 12:55:07 -03:00
Hans Verkuil 35ea11ff84 V4L/DVB (8430): videodev: move some functions from v4l2-dev.h to v4l2-common.h or v4l2-ioctl.h
The functions in a header should not belong to another module. The prio functions
belong to v4l2-common.c, so move them to v4l2-common.h.

The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header
and move those functions to it.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23 19:00:17 -03:00
Mike Isely 64723b3018 V4L/DVB (7936): pvrusb2: Remove svn Id keyword from all sources
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20 07:06:52 -03:00
Harvey Harrison a6a3a17b7f media: fix integer as NULL pointer warnings
drivers/media/video/v4l2-common.c:719:16: warning: Using plain integer as NULL pointer
drivers/media/video/au0828/au0828-dvb.c:122:19: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1101:22: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1102:23: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-audio.c:78:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c:84:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1264:9: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-context.c:197:28: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:126:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:133:32: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:145:31: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:177:55: warning: Using plain integer as NULL pointer
drivers/media/video/videobuf-core.c💯9: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-28 17:31:13 -07:00
Mike Isely e57b1c8006 V4L/DVB (7723): pvrusb2: Clean up input selection list generation in V4L interface
Change how list of possible pvrusb2 inputs is generated to include
only those interfaces that make sense for the interface instance.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:49 -03:00
Mike Isely 1cb03b76d0 V4L/DVB (7719): pvrusb2: Implement input selection enforcement
In the pvrusb2 driver, different interfaces (e.g. V4L, DVB) have

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:09:49 -03:00
Mike Isely 794b16072e V4L/DVB (7321): pvrusb2: Rework context handling and initialization
This change significantly rearranges pvr2_context level initialization
and operation:

1. A new kernel thread is set up for management of the context.

2. Destruction of the pvr2_context instance is moved into the kernel
   thread.  No other context is able to remove the instance; doing
   this simplifies lock handling.

3. The callback into pvrusb2-main, which is used to trigger
   initialization of each interface, is now issued from this kernel
   thread.  Previously it had been indirectly issued out of the work
   queue thread in pvr2_hdw, which led to deadlock issues if the
   interface needed to change a control setting (which in turn
   requires dispatch of another work queue entry).

4. Callbacks into the interfaces (via the pvr2_channel structure) are
   now issued strictly from this thread.  The net result of this is
   that such callback functions can now also safely operate driver
   controls without deadlocking the work queue.  (At the moment this
   is not actually a problem, but I'm anticipating issues with this in
   the future).

5. There is no longer any need for anyone to enter / exit the
   pvr2_context structure.  Implementation of the kernel thread here
   allows this all to be internal now, simplifying other logic.

6. A very very longstanding issue involving a mutex deadlock between
   the pvrusb2 driver and v4l should now be solved.  The deadlock
   involved the pvr2_context mutex and a globals-protecting mutex in
   v4l.  During initialization the driver would take the pvr2_context
   mutex first then the v4l2 interface would register with v4l and
   implicitly take the v4l mutex.  Later when v4l would call back into
   the driver, the two mutexes could possibly be taken in the opposite
   order, a situation that can lead to deadlock.  In practice this
   really wasn't an issue unless a v4l app tried to start VERY early
   after the driver appeared.  However it still needed to be solved,
   and with the use of the kernel thread relieving need for
   pvr2_context mutex, the problem should be finally solved.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:07:48 -03:00
Mike Isely beb0ecd7f0 V4L/DVB (7300): pvrusb2: v4l2 implementation fixes for input selection
Now that the pvrusb2 driver can dynamically choose which inputs to
make available depending on the hardware, the enumeration of input
choices is no longer a contiguous range of integers.  Unfortunately
this causes a problem in the v4l2 implementation since the input
enumeration requires continuity in the API.  This change implements a
mapping in order to preserve the v4l2 interface requirement.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:07:47 -03:00
Mike Isely 895c3e8bfe V4L/DVB (7298): pvrusb2: Account for dtv choice (a bit) in v4l2 implementation
The v4l2 implementation in pvru2b2 must produce a sane answer when
asked, when the input choice is set to dtv.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24 14:07:46 -03:00
Mike Isely 78a47101ac V4L/DVB (6695): pvrusb2: Implement functions to pass descriptive hardware info
Implement additional pvrusb2 device info table entries for a device
identifier and a device description.  Export this information via the
driver's internal API.  Make this information available via the sysfs
driver interface.  Also propagate this information into the v4l2
capability structure.  An app can now retrieve and report a
descriptive string about the particular type of hardware device it is
operating.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:02 -02:00
Mike Isely 681c739944 V4L/DVB (6691): pvrusb2: Rework pipeline state control
This is a new implementation for video pipeline control within the
pvrusb2 driver.  Actual start/stop of the pipeline is moved to the
driver's kernel thread.  Pipeline stages are controlled autonomously
based on surrounding pipeline or application control state.  Kernel
thread management is also cleaned up and moved into the internal
control structure of the driver, solving a set up / tear down race
along the way.  Better failure recovery is implemented with this new
control strategy.  Also with this change comes better control of the
cx23416 encoder, building on additional information learned about the
peculiarities of controlling this part (this information was the
original trigger for this rework).  With this change, overall encoder
stability should be considerably improved.  Yes, this is a large
change for this driver, but due to the nature of the feature being
worked on, the changes are fairly pervasive and would be difficult to
break into smaller pieces with any semblence of step-wise stability.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:01 -02:00
Mauro Carvalho Chehab 22c4a4e98e V4L/DVB (6320): v4l core: remove the unused .hardware V4L1 field
struct video_device used to define a .hardware field. While
initialized on severl drivers, this field is never used inside V4L.
However, drivers using it need to include the old V4L1 header.

This seems to cause compilation troubles with some random configs.
Better just to remove it from all drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:24 -02:00
Mike Isely 31a1854706 V4L/DVB (5507): Pvrusb2: Gather USB bus address info and report it
The V4L2 API requires a unique bus_info string returned as part of the
v4l2_capability structure.  These changes gather up the USB address
information, from the underlying device, into a string and report that
out through v4l2 and via sysfs (for completeness).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:30 -03:00
Al Viro 89952d133d [PATCH] misc NULL noise
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-14 15:27:49 -07:00
Hans Verkuil f3d092b84a V4L/DVB (5304): Improve chip matching in v4l2_register
The chip matching in struct v4l2_register for VIDIOC_DBG_G/S_REGISTER 
was rather primitive. It could not be extended to other busses besides 
i2c and it lacked a way to.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-03-01 13:09:44 -02:00
Mike Isely 201f5c9caf V4L/DVB (5175): Pvrusb2: VIDIOC_DBG_[S|G]_REGISTER fixups
Support 64 bit register IDs internally.  Only allow root access to
this API (for both set and get).  Note that actual 64 bit access only
becomes possible once the definition for v4l2_register is updated, but
this change clears the way for it from the viewpoint of the pvrusb2
driver.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:13 -02:00
Michael Krufky 8d3643637e V4L/DVB (5169): Pvrusb2: Use macro names for FX2 commands
This is a maintainability cleanup; use nice names for all the FX2
commands instead of raw bytes.  This way we can easily find where we
issue FX commands.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:11 -02:00
Trent Piepho 52ebc763d8 V4L/DVB (5146): Make VIDIOC_INT_[SG]_REGISTER ioctls no longer internal only
The direct register access ioctls were defined as kernel internal only,
but they are very useful for debugging hardware from userspace and are
used as such.  Officially export them.

VIDIOC_INT_[SG]_REGISTER is renamed to VIDIOC_DBG_[SG]_REGISTER 
Definition of ioctl and struct v4l2_register is moved from v4l2-common.h 
to videodev2.h.

Types used in struct v4l2_register are changed to the userspace 
exportable versions (u32 -> __u32, etc). 

Use of VIDIOC_DBG_S_REGISTER requires CAP_SYS_ADMIN permission, so move 
the check into the video_ioctl2() dispatcher so it doesn't need to be 
duplicated in each driver's call-back function. CAP_SYS_ADMIN check is 
added to pvrusb2 (which doesn't use video_ioctl2).

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:55 -02:00
Mauro Carvalho Chehab 5cc1dd8c3d V4L/DVB (5117): Fix: VIDIOC_G_TUNER were returning an endless number of tuners
pvrusb2 have only one tuner inside. However, as it were not handling
index, a call to v4l-info were returning as if it were an infinite
number of tuners:
$ v4l-info|grep VIDIOC_G_TUNER |head -5
    VIDIOC_G_TUNER(0)
    VIDIOC_G_TUNER(1)
    VIDIOC_G_TUNER(2)
    VIDIOC_G_TUNER(3)
    VIDIOC_G_TUNER(4)

Acked-by: Mike Isely <isely@isely.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:48 -02:00
Pantelis Koukousoulas fd69496461 V4L/DVB (5095): Pvrusb2: Allow VIDIOC_S_FMT with -1 for resolution values
With the previous patch, mplayer started but was polling the video
device forever without any video actually coming out. Further analysis
showed that it does a VIDIOC_S_FMT with width and height set to -1 (!!!).
The code handling this only cares that both are lower than the minimum
range allowed so it ends up setting the size to 19x17 (!!) This pretty
much breaks the encoder here. Even if this breakage is yet another (TM)
result of my setup, setting the size to 19x17 by default would surprise
most users IMHO.
So, special case for -1 and interpret this to be a request for the
default size, please. Users can then set their favorite size both
through mplayer and through sysfs.
With this patch, mplayer finally works in pvr:// mode (not that we
really gain anything over operating it through sysfs with lirc,
sometime I might actually get off my lazy a** and contribute this
setup too)

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:42 -02:00