Convert the calls that write the i2c clock register over to the new
em28xx_write_reg() function that allows for or'ing bits
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Introduce a new function that writes to a single register. This is
useful because the vast majority of register writes are a single
register, and this format permits or'ing register value bits together.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
AC97 devices provide several input and outputs. However, before this
patch, em28xx device weren't properly allowing the usage of ac97
possible combinations. Also, several input volumes were left untouched,
instead of making sure that the volumes were set on mute state.
This patch improves support for ac97 devices by allowing to use any
inputs, and making sure that unused inputs are set on mute state.
Yet, some work is still needed to select the AC97 output.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This makes easier to identify vendor ID, since AC97 vendors are
generally identified by 3 bytes. The remaining byte is used by the
vendor to identify its devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch properly implements audio handling on em28xx. Before this
patch, it was assumed that every device has an Empia 202 audio chip.
However, this is not true.
After this patch, specific AC97 chipset setup and configurations can be
done.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
audio mux entries were described by 0 and 1 magic numers. Use an enum
alias for each entry type.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Make use of the em28xx chip configuration register to determine whether
we have AC97 audio, I2S audio, or no audio support at all.
Thanks for Ray Lu from Empia for providing the em2860/em2880 datasheet.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Previously, AC97 registers were named as if they were part of em28xx
device, generating some confusion. Replace such names for a more general
naming convention.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add support for the ATI TV Wonder HD 600 USB Remote Control
(required a new keymap)
[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Refactor the em28xx IR support based on the em2860/em2880 and em2874
datasheets.
Tested on the HVR-950 (em2883), Pinnacle 800e (em2883), Pinnacle 80e (em2874)
using the remote controls that came with those products.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The first em28xx were based on i2c IR's. However, some newer designs
are coming with a polling-based IR. Those are done by reading a register
set at em28xx.
This patch adds core polling support for those devices. Later patches will
add support for some device-specific IR's.
This patch adds the same basic IR polling code used by bttv, cx88 and saa7134, and
shares the common getkey masks defined at ir-common.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add registration for Pinnacle 80e ATSC tuner
Register the em2874 based Pinnacle 80e device. Note that support for this
device also requires the new drx-j driver (which is not available yet)
Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Thanks to Joerg Schindler from Pinnacle for providing sample hardware.
Thanks to Rainer Miethling from Pinnacle for providing engineering support.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Properly support capture start on em2874
The transport stream enable register moved in the em2874, so make it work
properly.
Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Rework the logic so that the em28xx-alsa module does not get loaded for devices
that don't support analog audio (such as the em2874)
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Empia moved around their endpoint configuration in newer chips, so accommodate
the changes
Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix case where we could end up dereferencing a NULL pointer if dev->vdev or
dev->vbi_dev were not set properly.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Empia switched to a 16-bit addressable eeprom in newer devices. While we
could certainly write a routine to read the eeprom, there is nothing of use
in there that cannot be accessed through registers, and there is the risk that
we could corrupt the eeprom (since a 16-bit read call is interpreted as a
write call by 8-bit eeproms). So just be safe and bail out of the function.
Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Empia moved the location of the GPIO/GPO registers in newer devices. Add the
ability to specify the relocated registers (including caching of register
contents).
Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
When setting up the device, remember the chip id, so we can control behavior
in the future without having to read the register continuously.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add a EM28XX_NODECODER option to the list of available decoders. This option
becomes important for devices that do not have analog support.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add em2874 chip id
Add chip id for em2874 to list of known chips
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".
To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.
We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.
We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.
Thanks,
Kay
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix a NULL pointer dereference that would occur if the video decoder tied to
the em28xx supports the VIDIOC_INT_RESET call (for example: the cx25840 driver)
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
commit 50f3beb50a fixed em28xx-alsa
locking schema. However, a backport macro was kept.
This patch removes the macro, since it is not needed for the module
compilation against upstream.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Replaced usb_kill_usb for usb_unlink_usb
(wait until urb to fully stop require USB core to put the calling process to sleep).
Oops:
http://www.kerneloops.org/raw.php?rawid=71799&msgid=
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Newer versions of hald tries to open it to call QUERYCAP.
Due to the lack of a proper locking, it is possible to open the device
before it finishes initialization.
This patch adds a lock to avoid this risk, and to protect the list of
em28xx devices.
While here, remove the uneeded BKL lock.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Now that we have a polling task for IR, there's a race condition, since
IR can be polling while other operations are being doing. Also, we are
now sharing the same urb_buf for both read and write control urb
operations. So, we need a mutex.
Thanks to Davin Heitmueller <devin.heitmueller@gmail.com> for warning me.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Before this patch, every register setup on em28xx were dynamically
allocating a temporary buffer for control URB's to be handled.
To avoid this ping-pong, use, instead a pre-allocated buffer.
Also, be sure that read control URB's also use the buffer, instead of
relying on a stack buffer.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
em28xx_init_dev() has some error conditions that are not properly
de-allocating dev var, nor freeing the device number for a future usage.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The attached patch makes the em28xx auxillary audio input work.
Tested with the HVR-950.
em28xx: make auxillary audio input work
The tuner audio input was working but the aux input wasn't. Tested with
the HVR-950.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>
In dvb_init(),
case EM2880_BOARD_TERRATEC_HYBRID_XS:
case EM2880_BOARD_KWORLD_DVB_310U:
can be put in the same case than EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900
since they do the same thing.
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The v4l core creates four different video devices (video, vbi, radio, vtx)
and each has its own range of minor numbers. However, modern devices keep
increasing the number of devices that they need so a maximum of 64 video
devices will not be enough in the future. In addition this scheme makes
it very hard to add new device types.
This patch disconnects the kernel number allocation (e.g. video0, video1,
etc.) from the actual minor number (just pick the first free minor).
This allows for much more flexibility in the future. However, it does
require the use of udev. For those who cannot use udev a new CONFIG option
was created that changes the allocation scheme back to the old behavior.
Thanks to Greg KH for suggesting this approach during the 2008 LPC.
In addition, several bugs were fixed in the ivtv and cx18 drivers: these
drivers try to allocate specific kernel numbers but that scheme contained
a bug which caused what should have been e.g. video17 to appear as e.g.
video2.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fixed and Added some validations
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Added vendor/product id for EM2820_BOARD_PROLINK_PLAYTV_USB2
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Fix sparse warnings. None are serious, but cutting down on these helps find
future serious sparse warnings/errors.
Redid the av7710.c patch based on a suggestion by Oliver Endriss.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>