Remove unused em28xx_board.vchannels and em28xx.video_channels.
Also, .is_em2800 = 0 is not needed, as all data is zeroed by kernel loader.
The table also included a notice that svideo weren't test on Hauppauge
USB2. Remove this notice, since this input also works properly.
Also, it does some whitespace cleanups.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The previous patches removed XCLK and I2C magic. Now, we finally know
what those registers do. Also, only a very few cards need different
setups for those.
Instead of keeping the setups for those values inside the per-device
hack magic switch, move the uncommon values to the board-specific
struct, and have a common setup for all other boards.
So, almost 100 lines of hacking magic were removed.
A co-lateral effect of this patch is that it also fixes a bug at em28xx-core, where xclk
were set, without taking any care about not overriding a previous xclk setup.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cleanup the calls to set the GPIOs and GPOs for various devices,
replacing the register number with the #define from em28xx-reg.h and
converting over to using em28xx_write_reg()
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Convert over to setting the XCLK register usage with the new em28xx_write_reg()
function.
Thanks to Ray Lu from Empia for providing the em2860/2880 datasheet.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
On some em28xx devices, there's an unused interface. This is printed on
the logs as an error. We can just ignore that interface.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
If removing and reiserting the driver on some devices, tuner type will
be unset at the second time. This patch fixes this issue.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch cleans up the entries of xc2028/3028, since those devices
don't need or use a tda9887.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Pixelview uses a Sigmatel stac codec. It has an external line out pin,
connected to AC97_MASTER_VOL. It also provides I2S output, but using a
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Some devices use more than one AC97 outputs. This patch allows such
devices to properly work.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Some boards use different AC97 setups for output. This patch adds the
capability of specifying the output to be used. Currently, only one
output is selected, but the better is to allow user to select it via a
mixer, on alsa driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>