Commit Graph

466 Commits (36a52c009a39049893c9a3a4091f8f8f48585f47)

Author SHA1 Message Date
Mike Isely 2710814754 V4L/DVB (13224): pvrusb2: Improve diagnostic info on driver initialization failure
It used to be that the only real detectable reason for the driver to
fail during initialization would be that if the hardware is simply
jammed.  However with the advent of the sub-device mechanism in V4L it
is possible now to detect if a sub-device module fails to load
successfully.  The pvrusb2 driver does in fact react to this by also
(correctly) failing, however the original diagnostic message "hardware
is jammed" was still being reported.  This misleads the user because
in fact it might not actually be a hardware failure.  This change adds
logic to tell the difference and then report a more appropriate
message to the kernel log.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:40:59 -02:00
Mike Isely 1b33185f5d V4L/DVB (13223): pvrusb2: Soften encoder warning message
pvrusb2: Encoder failures are mostly recoverable by the driver.  While
it would sure be nice not to have the failure happen in the first
place, this has been going on for years and I doubt that a real
solution will ever present itself.  I think that part's firmware is
just slightly flakey and we have to deal with it.  The driver does
deal with it just fine, but the warning message going into the kernel
log is probably a little more alarming than it should be.  So try to
soften up the warning somewhat.

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 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
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:55 +01:00
Hans Verkuil 53dacb1570 V4L/DVB (12540): v4l: simplify v4l2_i2c_new_subdev and friends
Rewrite v4l2_i2c_new_subdev as a simplified version of v4l2_i2c_new_subdev_cfg
and remove v4l2_i2c_new_probed_subdev and v4l2_i2c_new_probed_subdev_addr.

This simplifies this API substantially.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:19:24 -03:00
Michael Krufky a18eaf02c8 V4L/DVB (12874): pvrusb2: disable tda18271 slave tuner output / loop thru in standby mode
Enable the standby mode optimization to disable the tda18271
slave tuner output / loop thru options when in low power mode

Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:13:57 -03:00
Hans Verkuil f19b56a8eb V4L/DVB (12426): pvrusb2: fix compile warning
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:18:49 -03:00
Jean Delvare e81516c58e V4L/DVB (12343): Stop defining I2C adapter IDs nobody uses
There is no point in defining I2C adapter IDs when no code is using
them. As this field might go away in the future, stop using it when
we don't need to.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:18:13 -03:00
Mike Isely 90135c9686 V4L/DVB (12122): pvrusb2: De-obfuscate code which handles routing schemes
This change does not change any outward behavior; it merely chops down
some large if-conditions with embedded assignments into something a
little more maintainable for others (I of course never had a problem
with this...).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23 03:15:17 -03:00
Mike Isely 81e804c9c2 V4L/DVB (12121): pvrusb2: Improve handling of routing schemes
The pvrusb2 driver has a concept of "routing scheme" which defines
which physical inputs should be connected based on application's
choice of logical input.  The correct "routing scheme" depends on the
specific device since different devices might wire up their muxes

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23 03:15:13 -03:00
Mike Isely 6f441ed78e V4L/DVB (12120): pvrusb2: Change initial default frequency setting
Change default frequency to be US Broadcast channel 3 - with the
transition to d igital the previous value has now become useless.
This change is PURELY to help with my testing (I need to set some kind
of default so it might as well be some thing usable).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23 03:15:09 -03:00
Mike Isely a6862da2f3 V4L/DVB (12119): pvrusb2: Re-fix hardware scaling on video standard change
The cx25840 module's VBI initialization logic uses the current video
standard as part of its internal algorithm.  This therefore means that
we probably need to make sure that the correct video standard has been
set before initializing VBI.  (Normally we would not care about VBI,
but as described in an earlier changeset, VBI must be initialized
correctly on the cx25840 in order for the chip's hardware scaler to
operate correctly.)

It's kind of messy to force the video standard to be set before
initializing VBI (mainly because we can't know what the app really
wants that early in the initialization process).  So this patch does
the next best thing: VBI is re-initialized after any point where the
video standard has been set.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23 03:15:05 -03:00
Mike Isely e17d787c51 V4L/DVB (12118): pvrusb2: Fix hardware scaling when used with cx25840
The cx25840 module requires that its VBI initialization entry point be
called in order for hardware-scaled video capture to work properly -
even if we don't care about VBI.  Making this behavior even more
subtle is that if the capture resolution is set to 720x480 - which is
the default that the pvrusb2 driver sets up - then the cx25840
bypasses the hardware scaler.  Therefore this problem does not
manifest itself until some other resolution, e.g. 640x480, is tried.
MythTV typically defaults to 640x480 or 480x480, which means that
things break whenever the driver is used with MythTV.

This all has been known for a while (since at least Nov 2006), but
recent changes in the pvrusb2 driver (specifically in regards to
sub-device support) caused this to break again.  VBI initialization
must happen *after* the chip's firmware is loaded, not before.  With
this fix, 24xxx devices work correctly again.

A related fix that is part of this changeset is that now we
re-initialize VBI any time after we issue a reset to the cx25840
driver.  Issuing a chip reset erases the state that the VBI setup
previously did.  Until the HVR-1950 came along this subtlety went
unnoticed, because the pvrusb2 driver previously never issued such a
reset.  But with the HVR-1950 we have to do that reset in order to
correctly transition from digital back to analog mode - and since the
HVR-1950 always starts in digital mode (required for the DVB side to
initialize correctly) then this device has never had a chance to work
correctly in analog mode!  Analog capture on the HVR-1950 has been
broken this *ENTIRE* time.  I had missed it until now because I've
usually been testing at the default 720x480 resolution which does not
require scaling...  What fun.  By re-initializing VBI after a cx25840
chip reset, correct behavior is restored.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23 03:15:01 -03:00
Steven Toth 08b83583dc V4L/DVB (11856): pvrusb2: Ensure we specify I/F's for all bandwidths
pvrusb2: Ensure we specify I/F's for all bandwidths

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:13 -03:00
Jean Delvare 7e11118592 V4L/DVB (11850): pvrusb2: Instantiate ir_video I2C device by default
Now that the ir-kbd-i2c driver has been converted to a new-style i2c
driver, we can instantiate the ir_video I2C device by default. The
pvr2_disable_ir_video is kept to disable the IR receiver, either
because the user doesn't use it, or for debugging purpose.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:12 -03:00
Steven Toth 507a34f450 V4L/DVB (11701): pvrusb2: Ensure the PVRUSB2 disabled the i2c gate on the tda10048.
... else DVB-T tuning will not work.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:01 -03:00
Mike Isely 008b6c5f76 V4L/DVB (11750): pvrusb2: Allocate a routing ID for future support of Terratec Grabster AV400
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:00 -03:00
Jean Delvare fa7ce76428 V4L/DVB (11748): pvrusb2: Don't use the internal i2c client list
The i2c core used to maintain a list of client for each adapter. This
is a duplication of what the driver core already does, so this list
will be removed as part of a future cleanup. Anyone using this list
must stop doing so.

For pvrusb2, I propose the following change, which should lead to an
equally informative output. The only difference is that i2c clients
which are not a v4l2 subdev won't show up, but I guess this case is
not supposed to happen anyway.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:00 -03: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
Mike Isely 96e56c1ac4 V4L/DVB (11746): pvrusb2: Set ir_video autoloading to default disabled
This sets the disable_autoload_ir_video module option to being set,
which disables any attempt by the driver to autoload IR support.  This
changes preserves previous behavior, for now.  This change can be set
back concurrent with other changes that finally update i2c-kbd-i2c to
use the new i2c binding model.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:00 -03:00
Mike Isely cd85b7afe1 V4L/DVB (11745): pvrusb2: Update to work with upcoming ir_video changes in v4l-dvb core
The ir-kbd-i2c module is about to be updated to match the new style
i2c binding model.  These pvrusb2 changes maintain compatibility with
that change.  Note that this does not actually break anything even
without the expected ir-kbd-i2c changes yet because previously the
pvrusb2 didn't autoload ir-kbd-i2c anyway.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:59 -03:00
Mike Isely 27eab3840b V4L/DVB (11744): pvrusb2: Select, track, and report IR scheme in use with the device
This change defines all possible "IR schemes" related to the pvrusb2
driver, on a per-device basis.  That information is then set according
to the hardware in use.  The idea here is to make possible a more
intelligent future decision on which, if any, IR receiver driver might
be loaded during initialization.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:59 -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
Greg Kroah-Hartman ca19d84295 V4L/DVB (11739): remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:58 -03:00
Steven Toth c7470206de V4L/DVB (11699): pvrusb2: Ensure we specify the I/F at attach time
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:53 -03:00
David Vrabel 3444b26afa USB: add reset endpoint operations
Wireless USB endpoint state has a sequence number and a current
window and not just a single toggle bit.  So allow HCDs to provide a
endpoint_reset method and call this or clear the software toggles as
required (after a clear halt, set configuration etc.).

usb_settoggle() and friends are then HCD internal and are moved into
core/hcd.h and all device drivers call usb_reset_endpoint() instead.

If the device endpoint state has been reset (with a clear halt) but
the host endpoint state has not then subsequent data transfers will
not complete. The device will only work again after it is reset or
disconnected.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-17 10:50:27 -07:00
Jean Delvare 6c4b755780 V4L/DVB (11437): pvrusb2: Drop client_register/unregister stubs
The client_register and client_unregister methods are optional so
there is no point in defining stub ones. Especially when these methods
are likely to be removed soon.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:44:51 -03:00
Hans Verkuil 5325b4272a V4L/DVB (11380): v4l2-subdev: change s_routing prototype
It is no longer needed to use a struct pointer as argument, since v4l2_subdev
doesn't require that ioctl-like approach anymore. Instead just pass the input,
output and config (new!) arguments directly.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:44:27 -03:00
Hans Verkuil e6574f2fbe V4L/DVB (11373): v4l2-common: add explicit v4l2_device pointer as first arg to new_(probed)_subdev
The functions v4l2_i2c_new_subdev and v4l2_i2c_new_probed_subdev relied on
i2c_get_adapdata to return the v4l2_device. However, this is not always
possible on embedded platforms. So modify the API to pass the v4l2_device
pointer explicitly.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:44:24 -03:00
Hans Verkuil f41737ece4 V4L/DVB (11370): v4l2-subdev: move s_std from tuner to core.
s_std didn't belong in the tuner ops. Stricly speaking it should be part of
the video ops, but it is used by audio and tuner devices as well, so it is
more efficient to make it part of the core ops.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:44:22 -03:00
Hans Verkuil cc26b076cf V4L/DVB (11369): v4l2-subdev: add load_fw and use that instead of abusing core->init.
The init callback was used in several places to load firmware. Make a separate
load_fw callback for that. This makes the code a lot more understandable.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:44:21 -03:00
Janne Grunau 70ad638354 V4L/DVB (11355): pvrusb2: use usb_interface.dev for v4l2_device_register
Signed-off-by: Janne Grunau <j@jannau.net>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:44:13 -03:00
Mike Isely fcd62cf7f6 V4L/DVB (11334): pvrusb2: Fix uninitialized tuner_setup field(s)
Any time a struct (especially one not defined by this driver) is
allocated, we MUST zero its underlying storage.  This makes our usage
of the struct predictable and robust against future changes where
fields might be added that we don't know about.  Failing to do this
with tuner_setup left the config field uninitialized which then caused
trouble with the tuner type used for HVR-1950 devices.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:43:52 -03:00
Mike Isely 7bf56f94a1 V4L/DVB (11333): pvrusb2: Report def_val items in sysfs symbolically, consistent with cur_val
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:43:52 -03:00
Mike Isely 5b72d71525 V4L/DVB (11332): pvrusb2: Fix incorrect reporting of default value for non-integer controls
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06 21:43:51 -03:00
Mike Isely dc070bccde V4L/DVB (11208): pvrusb2: Use v4l2_device_disconnect()
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:40 -03:00
Mike Isely 2a6b627f8b V4L/DVB (11207): pvrusb2: Add composite and s-video input support for OnAir devices
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:40 -03:00
Mike Isely bb65242aa3 V4L/DVB (11206): pvrusb2: Add sub-device for demod
Forgot to include the tda9887 component when moving to v4l2-subdev.  I
got fooled because its name is "tuner", the same as the tuner module.
Silly me.

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
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
Mike Isely 5a3bab8eb0 V4L/DVB (11204): pvrusb2: Remove old i2c layer; we use v4l2-subdev now
This change removes the old i2c module controlling layer from the
pvrusb2 driver.  This is code that first had appeared in the driver
back in December 2005.  It's history.  Now we use v4l2-subdev.  Please
note also that with this change, the driver will no longer be usable
in kernels older that 2.6.22.

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
Mike Isely 2eb563b7e7 V4L/DVB (11203): pvrusb2: Implement better reporting on attached sub-devices
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
Mike Isely fd28aeafd6 V4L/DVB (11202): pvrusb2: Fix slightly mis-leading header in debug interface output
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
Mike Isely 7dfdf1ee14 V4L/DVB (11201): pvrusb2: Fix space-after-comma idiocy
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
Mike Isely 69ea3c1cbc V4L/DVB (11200): pvrusb2: Make a bunch of dvb config structures const (trivial)
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
Mike Isely dd5f322f35 V4L/DVB (11199): pvrusb2: Convert all device definitions to use new sub-device declarations
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
Mike Isely 23334a22ea V4L/DVB (11198): pvrusb2: Define default I2C address for CS53L32A sub-device
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
Mike Isely 851981a1ee V4L/DVB (11197): pvrusb2: Fix incorrectly named sub-device ID
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely 1dfe6c7794 V4L/DVB (11196): pvrusb2: Define default I2C addresses for msp3400 and saa7115 sub-devices
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely 5c6cb4e251 V4L/DVB (11195): pvrusb2: Issue required core init broadcast to all sub-devices
The v4l2-subdev infrastructure requires that an initialization call
must be issued to all attached sub-devices before normal operation can
start.  This change satisfies that requirement.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely 27764726a8 V4L/DVB (11194): pvrusb2: Implement mechanism to force a full sub-device update
When a pvrusb2 driver instance first initializes, we need to be sure
to send out a complete state update for everything to all attached
modules.  The old i2c layer did this by keeping a separate mask of
"stale" bits for each attached module - and setting that mask to all
stale when that module attaches.  But the new sub-device adaptation
I've implemented here no longer has per-module stale bits.  So instead
there's now a global "force dirty" bit that is set upon instance
initialization, before the sub-devices are attached.  After the first
update, this bit is cleared, allowing for normal update-on-dirty
behavior.  In this manner, we ensure that all sub-devices have been
properly synchronized at initialization.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely 5e430ca5d2 V4L/DVB (11193): pvrusb2: Correct some trace print inaccuracies
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely e260508d64 V4L/DVB (11192): pvrusb2: Implement trace print for stream on / off action
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely 0b46701499 V4L/DVB (11191): pvrusb2: Define default I2C address for cx25840 sub-device
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely 75212a0273 V4L/DVB (11190): pvrusb2: Broadcast tuner type change to sub-devices
The tuner sub-device isn't going to work very well unless we tell it
the correct tuner type to use...

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:38 -03:00
Mike Isely b481880bff V4L/DVB (11189): pvrusb2: Deal with space-after-comma coding style idiocy
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely e68a619a1b V4L/DVB (11188): pvrusb2: Sub-device update must happen BEFORE state dirty bits are cleared
The sub-device update mechanism relies on various "dirty" bits in the
driver in order to know what pieces of state need to be propagated out
to the various sub-devices.  But that won't work if the dirty bits are
cleared before the update gets a chance to run.  This change ensures
that the update takes place before the dirty bits are cleared.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely 0db8556805 V4L/DVB (11187): pvrusb2: Allow sub-devices to insert correctly
A sub-device won't successfully attach to our I2C adapter if its class
isn't set to zero.  Right the class is still set to
I2C_CLASS_TV_ANALOG in order to allow the old mechanism to still
work.  This change temporarily sets the class to zero during the
interval when the sub-device attaches.  This code will get removed
when the old i2c layer is finally removed from the driver.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely 5f757ddd5f V4L/DVB (11186): pvrusb2: Fix bugs involved in listing of sub-devices
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely 3ab8d29515 V4L/DVB (11185): pvrusb2: Fix uninitialized counter
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely ae111f76f7 V4L/DVB (11184): pvrusb2: Define default i2c address for wm8775 sub-device
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely bd14d4f8f4 V4L/DVB (11183): pvrusb2: Implement more sub-device loading trace and improve error handling
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely 634ba268b9 V4L/DVB (11182): pvrusb2: Tie in cx25840 sub-device support
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:37 -03:00
Mike Isely 1e481cca49 V4L/DVB (11181): pvrusb2: Fix silly 80 column issue
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:36 -03:00
Mike Isely 76891d6557 V4L/DVB (11180): pvrusb2: Tie in msp3400 sub-device support
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:36 -03:00
Mike Isely 4ecbc28d3d V4L/DVB (11179): pvrusb2: make sub-device specific update function names uniform
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:36 -03:00
Mike Isely 01c59df818 V4L/DVB (11178): pvrusb2: Make audio sample rate update into a sub-device broadcast
The pvrusb2 driver had previously been using i2c module specific calls
to set the sample rate (a long long time ago this was needed).  These
days it is safe to use a broadcast so let's just broadcast this when
communicating audio sample rate to sub-devices.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:35 -03:00
Mike Isely 6f9565120f V4L/DVB (11177): pvrusb2: Tie in saa7115 sub-device handling
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:35 -03:00
Mike Isely 5f6dae802c V4L/DVB (11176): pvrusb2: Tie in wm8775 sub-device handling
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:35 -03:00
Mike Isely edb9dcb885 V4L/DVB (11175): pvrusb2: Implement sub-device specific update framework
Lay down a foundation whereby it becomes possible to send customized
updates to specific sub-devices.  (This becomes useful for routing
configuration, which is a very sub-device specific operation.)

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:35 -03:00
Mike Isely 858f910e86 V4L/DVB (11174): pvrusb2: Implement reporting of connected sub-devices
The pvrusb2 driver has a function that reports internal state.  It can
be accessed from either the debug interface or as the result of a v4l
log status request.  This change adds information listing sub-devices
to the report.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:35 -03:00
Mike Isely 20ae26c84e V4L/DVB (11173): pvrusb2: Fix backwards function header comments
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:35 -03:00
Mike Isely 1ab5e74fa3 V4L/DVB (11172): pvrusb2: Cause overall initialization to fail if sub-driver(s) fail
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:35 -03:00
Mike Isely af78e16b5d V4L/DVB (11171): pvrusb2: Tie in sub-device decoder start/stop
Implement code to send appropriate streaming start/stop commands to
attached sub-devices

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely 6907205bcb V4L/DVB (11170): pvrusb2: Clean-up / placeholders inserted for additional development
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely 00e5f73607 V4L/DVB (11169): pvrusb2: Note who our video decoder sub-device is, and set it up
Other code may need to treat the video decoder sub-device in a special
manner, so this change implements code to recognize when such a
sub-device is connected to the driver, does any special processing for
it, and notes who the device is for future reference.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely e3e76cbb4d V4L/DVB (11168): pvrusb2: Define value for a null sub-device ID
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely 2641df3621 V4L/DVB (11167): pvrusb2: Tie in various v4l2 operations into the sub-device mechanism
This is another step in the v42l-subdev assimilation.  This implements
various call-outs to sub-devices based on state changes within the
pvrusb2 driver.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely 40f07111be V4L/DVB (11166): pvrusb2: Implement status fetching from sub-devices
Implement status fetching operations in terms of calling out to
sub-device(s).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely d8f5b9ba82 V4L/DVB (11165): pvrusb2: Tie in debug register access to sub-devices
Implement tie-in for v4l2 debug register access such that the
appropriate attached sub-device is handled.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely ed3261a859 V4L/DVB (11164): pvrusb2: Tie-in sub-device log requests
Trigger a broadcast to attached sub-devices when a logging request is made.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:34 -03:00
Mike Isely 5ceaad14ea V4L/DVB (11163): pvrusb2: Lay foundation for triggering sub-device updates
These changes set up the spot where we'll check for and set general
updates to any attached sub-devices.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely 446dfdc6cc V4L/DVB (11162): pvrusb2: Tie up loose ends with v4l2-subdev setup
Tie up loose ends with v4l2-subdev setup.  Set attached module's group
ID to match our internal ID, emit a few useful messages when
sub-devices are dealt with, implement better error legs, and fix an
error in the old i2c layer (caused by changes related to the
v4l2-subdev work here).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely 15b474423f V4L/DVB (11161): pvrusb2: Set i2c autoprobing to be off by default
In order to keep a sub-device from promiscuously attaching to the
pvrusb2 driver, the i2c adapter's class must be cleared.  This change
clears that class by default.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely 6063a4422c V4L/DVB (11160): pvrusb2: whitespace tweaks
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely a932f50746 V4L/DVB (11159): pvrusb2: Providing means to stop tracking an old i2c module
This implements a temporary mechanism to "untrack" an i2c module from
the old i2c layer.  The v4l2-subdev related code in the driver will
use this to remove a sub-device from the old i2c layer.  In the end,
once the old i2c layer is removed, this will also eventually go away.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely e9c64a78db V4L/DVB (11158): pvrusb2: New device attribute mechanism to specify sub-devices
Set up new mechanism for declaring and loading appropriate sub-devices
when driver initializes.  This is another part of the v4l2-subdev
adoption.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely acd92d40cc V4L/DVB (11157): pvrusb2: whitespace trivial tweaks
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely a51f5000b7 V4L/DVB (11156): pvrusb2: Changes to further isolate old i2c layer
This introduces some additional isolation in the pvrusb2 from the old
i2c layer, a step along the way to separate the driver from that layer
and to make it easier to introduce the common v4l2-subdev framework as
the eventual replacement.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely b72b7bf5cb V4L/DVB (11155): pvrusb2: Set up v4l2_device instance
Define a v4l2_device instance in the pvrusb2 driver and initialize /
tear it down appropriately.  This is a step in the v4l2-subdev
adoption effort.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:33 -03:00
Mike Isely 59af336795 V4L/DVB (11154): pvrusb2: Split i2c module handling from i2c adapter
This is the first step in the effort to move the pvrusb2 driver over
to using the v4l2-subdev framework.  This commit involves mainly
splitting apart pvrusb2-i2c-core - part of it is the driver's I2C
adapter driver and the rest is the old i2c module handling logic.  The
i2c module handling junk is moved out to pvrusb2-i2c-track and various
header references are correspondingly updated.  Yes, this patch has a
huge pile of checkpatch complaints, but I'm NOT going to fix any of
it.  Why?  First, I'm moving a large chunk of existing code and I'm
not going to spend time adjusting it to match someone's idea of coding
style.  Second, in the end I expect all that moved code to go away by
the time the rework is done so wasting time on it now to adhere to the
standard is in the end a large waste of time.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:32 -03:00
Mauro Carvalho Chehab 1398ae1fe6 V4L/DVB (11127): Kconfig: replace all occurrences of CUSTOMIZE to CUSTOMISE
There are several Kconfig items using CUSTOMIZE. Yet, most use the English
writing CUSTOMISE. This generates lots of trouble, because people sometimes type
the Kbuild item different.

Let's standardise every occurrence using the same syntax.

The changes were generated by this small shell script:

for i in `find linux -type f`; do sed s,CUSTOMIZE,CUSTOMISE,g $i >/tmp/a && mv /tmp/a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:31 -03:00
Janne Grunau e86da6f07e V4L/DVB (11125): fix mispelled Hauppauge in HD PVR and PVR USB2 driver comments
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:31 -03:00
Mauro Carvalho Chehab 0aab2e6044 V4L/DVB (10897): Fix Kbuild MEDIA_TUNER_CUSTOMIZE dependencies
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:14 -03:00
Mauro Carvalho Chehab 45f5c1993f V4L/DVB (10838): get rid of the other occurrences of DVB_FE_CUSTOMIZE typo
There are still more places where DVB_FE_CUSTOMIZE is used, instead of
DVB_FE_CUSTOMISE.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:08 -03:00
Mauro Carvalho Chehab af2ffb2cfd V4L/DVB (10836): Kconfig: replace DVB_FE_CUSTOMIZE to DVB_FE_CUSTOMISE
The name of the option is DVB_FE_CUSTOMISE. However, on a few places, a wrong
name were used, due to a typo (DVB_FE_CUSTOMIZE).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:43:08 -03:00
Mike Isely 87e3495c31 V4L/DVB (10303): pvrusb2: Use usb_make_path() to determine device bus location
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:26 -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 94b5ff9cf3 V4L/DVB (10259): pvrusb2: Code module name directly in printk
The name of the pvrusb2 module is not likely to ever change, and there
are plenty of other places where the name is directly coded, so there
is little utility in using a macro to infer the module name here.  In
addition, using that macro complicates other uses of the driver
involving older kernels where this macro works differently.  Yes I
know for many places we don't have to worry about that.  But my
alternative is that I have to build special logic in the pvrusb2
standalone driver to special-case what is otherwise costmetic and that
is just plain nuts for something as trivial as this, especially since
this change does not at all have any compile time or run time impact
on the driver.  I'm just removing a nicety that didn't have a lot of
value here to begin with.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:23 -03:00
Mike Isely 2cc3b6bff4 V4L/DVB (10258): pvrusb2: Issue VIDIOC_INT_INIT to v4l2 modules when they first attach
It appears that various v4l-dvb drivers are changing to require
explicit initialization before use.  This change to the pvrusb2 driver
implements an automatic issuance of VIDIOC_INT_INIT when a module is
bound to the driver, thus conforming to the new behavior.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:23 -03:00
Mike Isely be4f4aecf8 V4L/DVB (10239): pvrusb2: Fix misleading comment caused by earlier commit
Previous v4l-dvb changeset id 4cc8ed11e2e0 changed the pvrusb2-hdw
internal API regarding i2c chip debug register access.  However that
change failed to also update the corresponding function comment
describing the API.  As driver maintained I never saw a request for an
ack on that change; there probably should have been one especially
since the manner in which this API operates was changed - its
interface is now entangled with a v4l specific struct and I would have
preferred to keep this API clear of moving-target v4l-isms such as
this one if at all possible which is why I had done it the way I did
before.  But whatever.  This commit at least fixes the comment issue.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:22 -03:00