Commit graph

391 commits

Author SHA1 Message Date
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