This set of patches introduces calls to the following set of functions:
usb_endpoint_dir_in(epd)
usb_endpoint_dir_out(epd)
usb_endpoint_is_bulk_in(epd)
usb_endpoint_is_bulk_out(epd)
usb_endpoint_is_int_in(epd)
usb_endpoint_is_int_out(epd)
usb_endpoint_is_isoc_in(epd)
usb_endpoint_is_isoc_out(epd)
usb_endpoint_num(epd)
usb_endpoint_type(epd)
usb_endpoint_xfer_bulk(epd)
usb_endpoint_xfer_control(epd)
usb_endpoint_xfer_int(epd)
usb_endpoint_xfer_isoc(epd)
In some cases, introducing one of these functions is not possible, and it
just replaces an explicit integer value by one of the following constants:
USB_ENDPOINT_XFER_BULK
USB_ENDPOINT_XFER_CONTROL
USB_ENDPOINT_XFER_INT
USB_ENDPOINT_XFER_ISOC
An extract of the semantic patch that makes these changes is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r1@ struct usb_endpoint_descriptor *epd; @@
- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ usb_endpoint_xfer_control(epd)
@r5@ struct usb_endpoint_descriptor *epd; @@
- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
- \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The current code was trying to query the AC97 registers for the vendor
information even if it was clearly not a AC97 audio device (resulting in errors
in the dmesg output). This was due to a bug in the way we did the check.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add additional output formats, which will be useful for the Pinnacle PCTV
Ultimate 880e integration with the saa7136.
Thanks to Ray Lu from Empia for providing the em2860/em2880 datasheet.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Noticed when doing the audio support for the Pinnacle PCTV HD Ultimate 808e
that the modes were incorrect (the 808e uses I2S in 5 sample mode)
Thanks for Ray Lu from Empia for providing the em2860/em2880 datasheet.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Like the em2874, the em2870 does not have any analog support, so don't bother
loading the em28xx-alsa module.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The Pinnacle 80e cannot be supported since Micronas yanked their driver
support for the drx-j chipset at the last minute. Remove the device profile
since it cannot work without the drx driver and it being there is only likely
to confuse people into thinking the device is supported but not working.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The DVC 100 profile is redundant since we already have an existing identical
profile named "Pinnacle Dazzle DVC 90/DVC 100"
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Correct problem introduced during the board refactoring where the XCLK
frequency would get zero'd out. The sequence of events was as follows:
em28xx_pre_card_setup() called em28xx_set_model()
em28xx_set_model() would memcpy to dev->board configuration
em28xx_pre_card_setup() would set the dev->board.xclk if not set
em28xx_pre_card_setup() would set the XCLK register based on dev->board.xclk
...
em28xx_card_setup() would call em28xx_set_model()
em28xx_set_model() would memcpy to dev->board configuration (clearing out
value of dev->board.xclk set in em28xx_pre_card_setup)
...
em28xx_audio_analog_set() sets the XCLK register based on dev->board.xclk
(which now contains zero)
The change sets the default XCLK and I2C Clock fields in the board definition
inside of em28xx_set_model() so that subsequent calls do not cause the
values to be overwritten.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Now, just two routines are enough for analog: the first one configs the analog
part and register V4L2 devices, and the second one release analog devices.
After this patch, it will be easier to transform em28xx-video into an em28xx
extension, loaded only on analog devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
em28xx-video were holding several code that are not specific to V4L2
interface.
This patch moves the core code for em28xx-core, and usb probing code
into em28xx-cards.
This opens the possibility of breaking em28xx into a core module and a
V4L2 module, loaded only on devices that have analog interfaces.
Some cleanup may be done at em28xx-cards to optimize the config code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The em28xx driver can be coupled to an anciliary AC97 chip. This patch
allows read/write AC97 registers directly.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch uses the same code for enumberating video formats that are
present on cx88, bttv and saa7134 drivers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The changeset 78aa52a159cf introduced a bug on em28xx: buffer setup should be
awaking xc3028. Instead, since we didn't specify the tuner mode, the device
were going to sleep, due to the lack of tuner mode when asking tuner to handle
VIDIOC_S_FREQUENCY:
xc2028 0-0061: Device is Xceive 3028 version 1.0, firmware version 2.7
xc2028 0-0061: divisor= 00 00 14 d0 (freq=83.250)
xc2028 0-0061: Putting xc2028/3028 into poweroff mode.
xc2028 0-0061: Printing sleep stack trace:
Pid: 10936, comm: mplayer Tainted: P M 2.6.27.8 #1
Call Trace:
[<ffffffffa0b759ea>] xc2028_sleep+0x89/0x1ab [tuner_xc2028]
[<ffffffffa0b48fb9>] tuner_s_frequency+0xf5/0x165 [tuner]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Don't operate under the assumption that every device that uses the em2820
default USB ID is a Prolink PlayTV USB. We have an eeprom hash, so use that,
since otherwise we cannot support other devices with the 2820 default USB ID
(such as the ADS Tech Instant TV USB USBAV-704)
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add the em2870 to the list of known em28xx chip ids.
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Changes/fixes on em28xx dev->lock:
- em28xx_init_dev() were unlocking without a previous lock;
- some read ioctls need to lock after the removal of KBL, since a write
may be happening at the same time an ioctl is reading;
- keep the device locked during all device initialization;
- lock/unlock while reading/writing registers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
vidioc_try_fmt_vid_cap() just checks if a given resolution is supported.
It doesn't touch on struct em28xx device descriptor. so, there's no need
to lock.
While there, use unlikely() for those values that aren't likely to
occur.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
em28xx devices generally get hot when xc3028 tuner is powered on. This
patch solves this by turning power off when the device is not used, at the
expense of having a higher load time, when calling a TV application.
Since firmware load happens on 1 or 2 seconds on most devices, this is not a pain.
Also, it helps to save the planet by saving some power :)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Change log format to look more like URB transactions. In fact, setup and
IN/OUT transactions are merged. This helps to debug the driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Several chips may be turned off when the device is not used, like audio,
video and dvb demods. This patch adds a gpio callback at the core
structs to allow turning off such devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
A previous changeset moved gpio from em28xx struct into em28xx_board.
However, the driver were not updated to properly honor those gpio's.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Before this patch, several devices without tuner were kept the value 0
for tuner_type. However, this means TUNER_TEMIC_PAL. Replace those
entries for the proper TUNER_ABSENT value.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Instead of a large, ugly switch specifying the gpio tables for each
device, let's move it into the boards struct. This also helps to see
what boards have already the gpio's for DVB.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Replaces all occurrences of em28xx_write_regs_req() and em28xx_write_reg()
used to setup register names by em28xx_write_reg().
Also, documents the register names that are known.
This patch were generated by this small perl script:
my %reg_map = (
# Register table - the same as defined on parse_em28xx.pl script
);
while (<>) {
if (m/(.*)em28xx_write_regs_req\(dev\,\s*0x00\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
my $reg = $2;
my $val = $3;
$val =~ tr/A-f/a-f/;
$reg = $reg_map{$reg} if defined($reg_map{$reg});
printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
} elsif (m/(.*)em28xx_write_regs\(dev\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
my $reg = $2;
my $val = $3;
$val =~ tr/A-f/a-f/;
$reg = $reg_map{$reg} if defined($reg_map{$reg});
printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
} else {
print $_;
}
}
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Now, the first message states board names. Also, removed printing the alternate
settings by default. I2C messages are now clearer.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Since saa7115 has saa711x chip auto-detection, there's no need on differenciating
it at cards table. Just use the generic name for all boards that use a philips
saa711x decoder.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Several fields are duplicated on both structs. Let's just copy em28xx_board instead.
A later cleanup could just copy the fields that are changed, in order to keep em28xx_board
const.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>